Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Generate and render Mermaid diagrams for architecture docs, READMEs, PRs, terminals, chats, and CI as themed SVG, PNG, or ASCII/Unicode art. Use this skill whenever the user provides Mermaid code or .mmd files; asks for a flowchart, sequence/state/class diagram, ERD, XY chart, or architecture/workflow/data-model visualization; or wants to beautify, theme, batch-convert, or make a diagram terminal-friendly. Runs locally without a browser or DOM, with 15 built-in themes and custom colors.
.claude/skills/imxv-pretty-mermaid/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-10 | ✗→✓ | ▲ Improved | 52% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 4% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 16% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 146% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 7% | 0% |
Create or render Mermaid diagrams with the bundled Node.js CLI. Use SVG for scalable documentation, PNG for sharing or raster-only consumers, and ASCII or Unicode for terminals and plain text.
Treat the directory containing this file as <skill-root>. Run bundled scripts from that directory, or invoke them with absolute paths. Keep user source and rendered output in the user's requested location; do not copy the renderer into their project.
.mmd file, preserving user terminology and relationships.Do not overwrite an existing source or output file unless the user asked for replacement.
| Need | Diagram type | Starter | | --- | --- | --- | | Process, decision tree, architecture | Flowchart | flowchart LR | | API calls, messages, interactions | Sequence | sequenceDiagram | | Lifecycle or finite-state machine | State | stateDiagram-v2 | | Classes, modules, relationships | Class | classDiagram | | Database entities and cardinality | ER | erDiagram | | Bars, lines, trends, comparisons | XY chart | xychart-beta |
Read references/DIAGRAM_TYPES.md when authoring non-trivial Mermaid syntax.
| Output | Best for | Notes | | --- | --- | --- | | SVG | READMEs, docs, slides, websites | Scalable, themed, supports transparency | | PNG | Chats, previews, raster-only tools | Set --format png; no external converter required | | Unicode | Modern terminals and readable text previews | Default ASCII renderer output | | Plain ASCII | Logs and restricted terminals | Add --use-ascii | | ANSI-colored text | Interactive terminals | Set --color-mode |
Run these from <skill-root>.
bashnode scripts/themes.mjs
bashnode scripts/render.mjs \ --input diagram.mmd \ --output diagram.svg \ --theme tokyo-night
bashnode scripts/render.mjs \ --input diagram.mmd \ --output diagram.txt \ --format ascii \ --color-mode none
Add --use-ascii when Unicode box-drawing characters are not acceptable.
bashnode scripts/render.mjs \ --input diagram.mmd \ --output diagram.png \ --format png \ --width 1200 \ --theme tokyo-night
bashnode scripts/batch.mjs \ --input-dir ./diagrams \ --output-dir ./rendered \ --format svg \ --theme github-dark \ --workers 4
Use batch rendering for three or more diagrams or when consistent options must be applied to a directory.
tokyo-nightgithub-dark, github-lightzinc-lightdraculanord, nord-lightRead references/THEMES.md or open docs/THEME_GALLERY.md when visual theme choice matters. A named theme can be refined with explicit color flags.
| Option | Purpose | | --- | --- | | --theme <name> | Apply one of the 15 built-in themes | | --bg, --fg | Set required base colors | | --line, --accent, --muted | Refine connectors, highlights, and secondary text | | --surface, --border | Refine node fill and stroke | | --font <name> | Set the SVG font family |
| Option | Purpose | | --- | --- | | --transparent | Remove the SVG background | | --padding <n> | Set canvas padding | | --node-spacing <n> | Set horizontal node spacing | | --layer-spacing <n> | Set vertical layer spacing | | --component-spacing <n> | Separate disconnected components | | --interactive | Enable XY chart hover tooltips |
| Option | Purpose | | --- | --- | | --width <n> | Set output width from 100 to 10000 pixels while preserving aspect ratio | | --transparent | Preserve a transparent background |
| Option | Purpose | | --- | --- | | --use-ascii | Replace Unicode box drawing with plain ASCII | | --padding-x, --padding-y | Tune diagram spacing | | --box-border-padding | Tune padding inside node boxes | | --color-mode <mode> | none, auto, ansi16, ansi256, truecolor, or html |
Run node scripts/render.mjs --help or node scripts/batch.mjs --help for the authoritative CLI list.
LR for wide flows and TB for narrow documents.assets/example_diagrams/ and consult the diagram reference.After rendering:
<svg; confirm PNG output opens as a valid image; confirm text output contains visible diagram content.Run both npm test and npm run validate when changing this skill, its scripts, templates, or references.
npm install in <skill-root>; the CLI also attempts a first-run install.node scripts/themes.mjs and use an exact listed name.references/DIAGRAM_TYPES.md, reduce to the failing statement, then restore the diagram incrementally.--node-spacing, --layer-spacing, or --component-spacing.--color-mode none.| Resource | Read or use when | | --- | --- | | references/DIAGRAM_TYPES.md | Authoring or debugging Mermaid syntax | | references/THEMES.md | Comparing themes or defining custom colors | | references/api_reference.md | Extending scripts or calling beautiful-mermaid directly | | docs/THEME_GALLERY.md | Choosing a theme visually | | assets/example_diagrams/ | Starting from a supported diagram template | | scripts/render.mjs | Rendering one diagram | | scripts/batch.mjs | Rendering a directory in parallel | | scripts/themes.mjs | Listing installed themes |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 11,855 | 28,844 | +143% | 1 | 1 | 0% | 467 | 2,210 | +373% | 0 | 0 | — |
case-02 | fail→fail | 8,305 | 8,091 | -3% | 1 | 1 | 0% | 318 | 2,167 | +581% | 0 | 0 | — |
case-03 | fail→fail | 11,363 | 11,749 | +3% | 1 | 1 | 0% | 435 | 2,205 | +407% | 0 | 0 | — |
case-04 | pass→pass | 6,335 | 6,751 | +7% | 1 | 1 | 0% | 934 | 2,902 | +211% | 0 | 0 | — |
case-05 | pass→pass | 11,321 | 11,139 | -2% | 1 | 1 | 0% | 1,779 | 3,427 | +93% | 0 | 0 | — |
case-06 | pass→pass | 10,020 | 5,608 | -44% | 1 | 1 | 0% | 551 | 2,446 | +344% | 0 | 0 | — |
case-07 | fail→fail | 20,829 | 7,365 | -65% | 1 | 1 | 0% | 2,187 | 2,750 | +26% | 0 | 0 | — |
case-08 | pass→pass | 3,879 | 6,682 | +72% | 1 | 1 | 0% | 445 | 2,487 | +459% | 0 | 0 | — |
case-09 | pass→pass | 5,451 | 4,026 | -26% | 1 | 1 | 0% | 762 | 2,455 | +222% | 0 | 0 | — |
case-10 | fail→pass | 19,848 | 8,561 | -57% | 1 | 1 | 0% | 2,114 | 3,210 | +52% | 0 | 0 | — |
case-11 | fail→pass | 15,989 | 12,456 | -22% | 1 | 1 | 0% | 2,475 | 2,583 | +4% | 0 | 0 | — |
case-12 | fail→pass | 33,214 | 8,888 | -73% | 1 | 1 | 0% | 2,859 | 3,320 | +16% | 0 | 0 | — |
case-13 | pass→pass | 15,735 | 135,553 | +761% | 1 | 1 | 0% | 2,096 | 2,383 | +14% | 0 | 0 | — |
case-14 | fail→fail | 13,379 | 4,215 | -68% | 1 | 1 | 0% | 2,041 | 2,331 | +14% | 0 | 0 | — |
case-15 | pass→pass | 10,525 | 3,069 | -71% | 1 | 1 | 0% | 1,558 | 2,153 | +38% | 0 | 0 | — |
case-16 | fail→pass | 80,070 | 22,467 | -72% | 1 | 1 | 0% | 924 | 2,274 | +146% | 0 | 0 | — |
case-17 | pass→pass | 21,196 | 4,572 | -78% | 1 | 1 | 0% | 1,313 | 2,225 | +69% | 0 | 0 | — |
case-18 | fail→pass | 21,503 | 9,925 | -54% | 1 | 1 | 0% | 2,447 | 2,622 | +7% | 0 | 0 | — |
case-19 | fail→pass | 33,689 | 13,451 | -60% | 1 | 1 | 0% | 1,884 | 2,553 | +36% | 0 | 0 | — |
case-20 | pass→pass | 4,560 | 4,384 | -4% | 1 | 1 | 0% | 474 | 2,103 | +344% | 0 | 0 | — |
case-21 | fail→pass | 41,340 | 3,356 | -92% | 1 | 1 | 0% | 1,679 | 2,248 | +34% | 0 | 0 | — |
case-22 | pass→pass | 10,347 | 4,480 | -57% | 1 | 1 | 0% | 1,188 | 2,211 | +86% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 19 counted toward the lift figure. The other 3 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +32 percentage points is the difference between those two pass rates over the 19 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.