Creates and renders Mermaid and D2 diagrams for architecture, sequence, ER, state, flow, git graphs, timelines, and charts with themed styling and SVG/raster export.
Ships in supermodel-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Diagram source is the maintainable artifact; exports are generated outputs. Model one coherent idea per diagram at a consistent abstraction level, with nodes derived from real code, config, or events — never invented for visual balance.
Both languages export themed SVG, and every raster format comes from that SVG. Pick by the diagram and the job:
| Reach for | When |
|---|---|
| Mermaid | The source lives in Markdown (GitHub, Obsidian, Artifacts, docs), the content matches one of the 32 diagram types, or readers will edit it in place |
| D2 | Dense nested architecture, ERDs from real schemas, orthogonal routing (ELK), multi-board layers and steps, or precise control over layout and shapes |
| Either | The user names one; never substitute silently |
Both languages, every diagram:
classDef block themes.md gives.+N more node.HTTPS 443, POST /payments), not verbs; keep decision-label vocabulary consistent within a diagram.diagram.ts check, plus d2 fmt for D2. Exit status is authoritative.scripts/diagram.ts checks and renders both languages in the theme. Mermaid renders through pele; D2 through the d2 CLI, with any flags after -- passed to it.
DIAGRAM=~/.agents/skills/diagramming/scripts/diagram.ts
deno run --allow-read --allow-run=d2 "$DIAGRAM" check flow.mmd notes.md arch.d2
deno run --allow-read --allow-run=d2 --allow-write=. "$DIAGRAM" render arch.d2 -o arch.svg -- --layout elk
deno run --allow-read --allow-run=d2 "$DIAGRAM" render flow.mmd --mode light | rsvg-convert -z 2 -o flow.png
check reads .mmd, .d2, and the mermaid fences in .md files. render infers the language from .mmd, .mermaid, or .d2, and needs --lang mermaid|d2 for stdin.
--mode | Output | Use for |
|---|---|---|
auto (default) | Frappe, with a prefers-color-scheme: light block for Dawn | SVG viewed in a browser: docs sites, committed SVGs, Artifacts |
light (Dawn), dark (Frappe) | Literal colors only | Anything rasterized, and destinations that ignore CSS |
The theme's semantic classes override the colors written in the source in every mode.
rsvg-convert turns any SVG from either language into PNG, PDF, or PS; pipe through ImageMagick for other formats. It reads D2's embedded fonts and the theme's CSS, where resvg falls back to a serif font on D2 output. Rasterizers ignore media queries, so always pass --mode light or --mode dark before piping.
rsvg-convert -z 2 diagram.svg -o diagram.png
rsvg-convert -f pdf diagram.svg -o diagram.pdf
rsvg-convert diagram.svg | magick - diagram.webp
d2-cli.md (opens in a new tab)d2-language.md (opens in a new tab)d2-patterns.md (opens in a new tab)mermaid.md (opens in a new tab)scripts/d2.ts (opens in a new tab)scripts/d2_test.ts (opens in a new tab)scripts/diagnostic.ts (opens in a new tab)scripts/diagram.ts (opens in a new tab)scripts/mermaid.ts (opens in a new tab)scripts/mermaid_test.ts (opens in a new tab)scripts/style.ts (opens in a new tab)scripts/theme.ts (opens in a new tab)themes.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
22 skills in this plugin
/agent-configCoding agent harness config - Claude Code hooks and settings, Codex config.toml layers, sandbox and approvals, permission profiles, MCP, plugins./analytics-engineeringAnalytics engineering - dbt projects, maintainable SQL as CTE pipelines, event patterns (funnels, sessions, retention, window functions, MATCH_RECOGNIZE)./ascii-animationsASCII and Unicode terminal animations - spinners, logo reveals, particles. Frame loops, character grids, per-character state, performance./supermodel-skills:diagrammingfrom supermodel-skills
npx claudepluginhub gwenwindflower/dotfiles --plugin supermodel-skillsOther plugins' skills for the same job