zinc-light
Theme preview, source.mmd
Mermaid to themed SVG, PNG or terminal text, with no browser in the loop.
A small Node skill over the beautiful-mermaid renderer: six diagram types, fifteen themes, three output formats and a batch runner. I read the skill, ran its smoke test and doc validator, and rendered every example in every format. Runs locally without a browser or DOM, with 15 built-in themes and custom colors.
Anyone putting diagrams in READMEs, PRs, chats or terminals.
A .mmd source plus an SVG, PNG or text render in the place you asked.
A seven-step loop, from SKILL.md.
Source first. Save new source as a .mmd file, preserving user terminology and relationships.
Render. Render with a named theme or explicit colors.
Inspect. Inspect the result. Fix syntax, clipping, crowded layout, or unclear labels and render again.
Don’t clobber. Do not overwrite an existing source or output file unless the user asked for replacement.
Be honest about limits. Report any renderer limitation instead of silently dropping unsupported syntax.
Each type’s How it works lists the best practices from DIAGRAM_TYPES.md, checked at build time.
Swatches are the colors in the renderer’s code. Where THEMES.md’s quick table disagrees, it says so.
The repo’s 15 theme previews and the six examples rendered on this box. Click to enlarge.
Theme preview, source.mmd
Theme preview, source.mmd
Theme preview, source.mmd
Theme preview, source.mmd
Theme preview, source.mmd
Theme preview, source.mmd
Theme preview, source.mmd
Theme preview, source.mmd
Theme preview, source.mmd
Theme preview, source.mmd
Theme preview, source.mmd
Theme preview, source.mmd
Theme preview, source.mmd
Theme preview, source.mmd
Theme preview, source.mmd
Example diagram, box render
Example diagram, box render
Example diagram, box render
Example diagram, box render
Example diagram, box render
Example diagram, box render
Run on a copy of the repo in /tmp with nice and timeout.
All runs at commit e234ab7, Node 20.
| Run | Result | Note |
|---|---|---|
| npm test | pass | 6 diagrams × 3 formats, 15 themes. |
| npm run validate | pass | 14 Markdown files. |
| 18 example renders | 18/18 exit 0 | SVG, PNG and Unicode for each type. |
| batch, 4 workers | 6/6 | |
| First run without node_modules | crash | ERR_MODULE_NOT_FOUND for @resvg/resvg-js; no auto-install. |
| git status of the original | clean | All runs were on copies. |
render.mjs statically imports png.mjs, which imports @resvg/resvg-js. Without node_modules, Node fails at load time, before loadBeautifulMermaid() can run npm install. SKILL.md says “the CLI also attempts a first-run install”.
SKILL.md forbids overwriting; render.mjs overwrites silently. The rule depends on the agent.
A --> with no target produced an SVG and exit 0, so “confirm the command exits successfully” is not enough.
The routed theme reference is in Chinese, and its quick table lists the accent as the foreground for several themes (e.g. tokyo-night-light #34548a vs fg #343b58 in code).
resvg rasterizes the SVG, so PNG works in CI and sandboxes.
validate-docs checks the Markdown, the SKILL.md length and that every theme has a preview.
Route by need, then by output. Two small tables pick the type and the format.
Make the agent look at the render. Inspection is a step, not an afterthought.
Ship starters. One working example per type.
Keep the loader lazy. If you promise auto-install, import heavy dependencies after the check.
Each quote on this page is compared with its source file at build time; the build fails on any mismatch.