/diagrams:diagram-routerfrom diagrams
Routes diagram requests to the best format (SVG, Mermaid, Excalidraw, D2) and infers diagram type from user intent. Activates when user asks to visualize something without specifying a format.
Ships in diagrams. 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.
None: SKILL.md is the whole skill.
Select the best output format and diagram type for the user's request, then delegate to the format-specific skill.
If the user explicitly requests a format, use it:
If they specified a format, skip to Step 3.
Default: SVG. Always. SVG produces the highest visual quality, handles every diagram type, and renders everywhere (browsers, GitHub, docs, presentations). Only route away from SVG when the user explicitly names another format.
| Context Signal | Format | Why |
|---|---|---|
| No specific signal | SVG | Best quality, most flexible, browser-native |
| "For the README" / "in markdown" / "GitHub" | SVG | GitHub renders SVG natively. Quality matters. |
| "Quick" / "simple" / "basic" | SVG | Still SVG -- it handles simple diagrams well too |
| User explicitly says "mermaid" | Mermaid | They asked for it |
| User explicitly says "excalidraw" / "whiteboard" / "sketch" / "hand-drawn" | Excalidraw | Hand-drawn aesthetic, saves .excalidraw file |
| User explicitly says "d2" | D2 | They asked for it |
The rule is simple: SVG unless the user says otherwise. The user can always convert later ("convert that to mermaid", "make that an excalidraw", etc.).
If the user described what they want to visualize but did not name a diagram type, infer it:
| What They Described | Diagram Type |
|---|---|
| System components, layers, platform | Layered architecture |
| Service communication, API calls, request flow | Sequence diagram |
| Steps in a process, pipeline, workflow | Flowchart |
| Who handles each step, team responsibilities | Swimlane |
| Object lifecycle, status transitions | State machine |
| Database tables and relationships | ER diagram |
| Module/package dependencies | Dependency graph |
| Option A vs option B, before/after | Comparison (side-by-side) |
| Project phases, milestones, releases | Timeline / Gantt |
| Security boundaries, attack surface | Threat model / DFD |
| Topics and subtopics, brainstorm | Mind map |
| Central service with consumers | Hub and spoke |
| Set overlaps, shared characteristics | Venn diagram |
| Decision logic, branching conditions | Decision tree |
| Volume distribution, traffic flow | Sankey diagram |
| Team structure, hierarchy | Org chart / tree |
| Cloud infrastructure, network topology | Network diagram |
| How software maps to infrastructure | Deployment diagram |
If ambiguous, briefly confirm with the user: "This sounds like a [type] -- does that match what you have in mind?"
Load the selected format skill and follow its workflow:
svg skill and its references (svg-design-system.md, layout-patterns.md)mermaid skillexcalidraw skilld2 skillAlways consult the design-system skill for color, composition, and quality rules regardless of format.
Users frequently want to convert between formats or extract styles. Common patterns:
Format conversion:
Style extraction from images:
Cross-format iteration:
When converting, preserve:
Accept that some fidelity is lost when converting to simpler formats (SVG to Mermaid loses custom positioning and gradients). Mention this to the user.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
diagram-routing, visualization, svg, mermaid, excalidraw, d2
npx claudepluginhub zate/cc-plugins --plugin diagrams6 skills in this plugin
/d2Generate diagrams using D2 (Terrastruct) -- a modern, clean diagram scripting language with excellent auto-layout. Use when the diagram-router selects D2, or when the user wants clean architecture diagrams, nested containers, or prefers D2's aesthetic. Requires the d2 CLI binary./design-systemShared design principles for all diagram formats -- color theory, composition, typography, accessibility, and quality standards. Referenced by format-specific skills (svg, mermaid, excalidraw, d2). Use when generating any visual diagram to ensure professional quality./excalidrawGenerate diagrams with a hand-drawn whiteboard aesthetic by writing .excalidraw files directly. Use when the user wants informal sketches, whiteboard-style visuals, or diagrams they can open and edit in Excalidraw. Saves a local .excalidraw file -- viewing/rendering is handled separately./mermaidGenerate diagrams using Mermaid syntax -- the most LLM-friendly text-based diagram format. Use when the diagram-router selects Mermaid, or when diagrams will live in GitHub/GitLab markdown, documentation, or when quick generation with broad diagram type coverage is needed. Renders natively on major platforms./svgGenerate professional-quality diagrams as raw SVG. Use when the diagram-router selects SVG, or when the user needs pixel-precise control, custom visuals, threat models, comparisons, Venn diagrams, or any diagram type that other formats cannot handle well. SVG is the most expressive format -- unlimited visual possibilities, browser-native rendering.Other plugins' skills for the same job