Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Creates clear, valid, version-controllable diagrams as code using Mermaid — flowcharts, sequence diagrams, ER diagrams, class diagrams, state machines, Gantt charts, C4/architecture diagrams, and more. Use this skill when the user asks to "draw a diagram", "make a flowchart", "create a sequence diagram", "diagram this architecture", "visualize this process/data model/API flow", "show the ER diagram", "render Mermaid", "diagram as code", or wants a chart embeddable in Markdown, GitHub, Notion, or
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-06 | ✗→✓ | ▲ Improved | 133% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 44% | 0% |
| case-05 | ✓→✗ | ▼ Worse | 101% | 0% |
| case-20 | ✓→✗ | ▼ Worse | 24% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 91% | 0% |
Mermaid is a text-based diagramming language that renders to SVG. Because diagrams are plain text, they live in version control, diff cleanly in PRs, and render natively on GitHub, GitLab, Notion, Obsidian, VS Code, and most Markdown tools.
This skill helps you (1) pick the correct diagram type for the user's intent, (2) write valid, idiomatic Mermaid, (3) style it for clarity, and (4) verify it renders before delivering.
Keywords: mermaid, diagram, flowchart, sequence diagram, ER diagram, entity relationship, class diagram, state diagram, gantt, C4, architecture, diagram as code, graphviz alternative, markdown diagram.
references/diagram-types.md for the selection guide.references/diagram-types.md.references/syntax-cheatsheet.md. Start with the header keyword (e.g. flowchart TD), then nodes/relationships, then styling last.scripts/validate_mermaid.py <file.mmd> for static checks, or use the Mermaid CLI (mmdc) if available to do a real render. See scripts/validate_mermaid.py.mermaid code block so it renders in Markdown. Offer a PNG/SVG export command if the user needs an image.| User intent / phrase | Diagram type | Header keyword | |---|---|---| | "steps", "process", "decision", "if/else", "workflow" | Flowchart | flowchart TD | | "API call", "request/response", "who talks to whom over time" | Sequence | sequenceDiagram | | "database", "tables", "schema", "relationships", "foreign keys" | Entity Relationship | erDiagram | | "classes", "objects", "OOP", "inheritance", "methods/attributes" | Class | classDiagram | | "states", "lifecycle", "status transitions", "state machine" | State | stateDiagram-v2 | | "timeline", "schedule", "project plan", "milestones" | Gantt | gantt | | "system architecture", "services", "containers", "boundaries" | C4 / Architecture | C4Context / architecture-beta | | "user journey", "experience steps with sentiment" | Journey | journey | | "git branches", "commits", "merges" | Git graph | gitGraph |
Full guidance, including when NOT to use a given type, is in references/diagram-types.md.
Input: "Diagram our login flow: user submits credentials, we check them, on success issue a token, on failure show an error and let them retry."
`markdown
flowchart TD A(User submits credentials]) --> B{Valid?} B -- Yes --> CIssue JWT token] C --> D(Redirect to dashboard]) B -- No --> EShow error message] E --> F{Retries left?} F -- Yes --> A F -- No --> G(Lock account])
More examples for every diagram type are in examples/gallery.md.
TD/TB (top-down) for processes and hierarchies; LR (left-right) for pipelines and wide flows that read like a timeline.([rounded]) for start/end, [rectangle] for actions, {diamond} for decisions, [(database)] for stores, [[subroutine]] for sub-processes.subgraph to show boundaries (services, teams, layers). Give subgraphs titles.A["Save (draft)"]. Use #quot; / HTML entities or <br/> for line breaks.classDef + class or style at the end. Avoid hardcoding colors that fight light/dark themes; prefer a small palette and semantic classes.end as a node id breaks flowcharts — capitalize it (End) or quote it.(), :, #, <, >, {} ) inside labels — wrap the label in "...".->>) don't work in flowcharts; flowchart arrows (-->) don't work in sequence diagrams.flowchart/sequenceDiagram/etc. on line 1 means nothing renders.A -- text --> B; sequence uses A->>B: text.stateDiagram vs stateDiagram-v2 — always prefer -v2; it has better layout and features.gantt/journey — these are whitespace-sensitive; keep sections and tasks aligned.mermaid fence.npx -p @mermaid-js/mermaid-cli mmdc -i diagram.mmd -o diagram.svg (or -o diagram.png).%%{init: ...}%% directive documented in references/syntax-cheatsheet.md.references/diagram-types.md — full type-selection guide with strengths, limits, and "use when / avoid when".references/syntax-cheatsheet.md — dense, copy-paste syntax for every major diagram type, plus styling and config directives.examples/gallery.md — a complete, renderable example for each diagram type with the prompt that produced it.scripts/validate_mermaid.py — stdlib Python static validator; checks headers, balanced brackets, reserved-word ids, and common syntax mistakes, and shells out to mmdc for a real render if installed.Other measured skills in the registry, with their headline benchmark lift.