Skip to content
mermaid-graph-writer logo

Mermaid Graph Writer

mermaid-graph-writer

Writes precise, well-structured Mermaid diagrams for any visualization need. Use when creating flowcharts, sequence diagrams, state machines, ER models, timelines, mindmaps, Gantt charts, or

SKILL.md

Full skill instructions

Mermaid Graph Writer

Writes precise, well-structured Mermaid diagrams. Selects the optimal diagram type for the content, uses correct syntax, and produces diagrams that are readable by both humans (rendered) and agents (text DSL).


When to Use

✅ Use for:

  • Creating any Mermaid diagram from a description or data
  • Choosing the right diagram type for a visualization need
  • Refactoring prose decision trees into Mermaid flowcharts
  • Modeling system architectures, protocols, state machines, data models
  • Encoding temporal knowledge as timeline diagrams

❌ NOT for:

  • Rendering/​exporting Mermaid to PNG/​SVG/​PDF (use mermaid-graph-renderer)
  • ASCII art or Unicode box-drawing (use diagramming-expert)
  • GUI-based design tools (Figma, etc.)

Diagram Type Selection

flowchart TD
  A{What are you modeling?} -->|Branching logic| B[flowchart]
  A -->|Request/​response over time| C[sequenceDiagram]
  A -->|States and transitions| D[stateDiagram-v2]
  A -->|Entities and relationships| E[erDiagram]
  A -->|Chronological evolution| F[timeline]
  A -->|Concept hierarchy| G[mindmap]
  A -->|Time-sequenced tasks| H[gantt]
  A -->|Proportions| I[pie]
  A -->|2-axis comparison| J[quadrantChart]
  A -->|Branch/​merge history| K[gitGraph]
  A -->|Type hierarchy / OO| L[classDiagram]
  A -->|User experience steps| M[journey]
  A -->|Quantity flows| N[sankey-beta]
  A -->|Numeric data| O[xychart-beta]
  A -->|System components| P[block-beta]
  A -->|Infrastructure| Q[architecture-beta]
  A -->|Task board| R[kanban]
  A -->|Requirements traceability| S[requirementDiagram]
  A -->|System context / containers| T[C4Context]
  A -->|Protocol packets / headers| U[packet-beta]
  A -->|Multi-axis comparison| V[radar]
  A -->|Hierarchical proportions| W[treemap]
  A -->|Code-style sequences| X[zenuml]

Quick Reference

ContentTypeDirection
Decision tree / processflowchart TDTop-down for decisions, LR for processes
API protocol / agent commssequenceDiagramAlways vertical (implicit)
Lifecycle / status machinestateDiagram-v2Automatic layout
Database / data modelerDiagramAutomatic layout
"What changed when"timelineHorizontal chronological
Taxonomy / brainstormmindmapRadial from root
Project scheduleganttHorizontal timeline
Category proportionspieCircular
Effort vs. impactquadrantChart2D scatter
Git branching strategygitGraphHorizontal
Class/​interface hierarchyclassDiagramAutomatic
User flow with satisfactionjourneyHorizontal sections
Flow quantities between categoriessankey-betaLeft-to-right flow
Bar/​line chartsxychart-betaStandard axes
System block layoutblock-betaGrid-based
Cloud/​infra topologyarchitecture-betaGrouped services
Task status columnskanbanColumn-based
Requirements traceabilityrequirementDiagramAutomatic layout
System context / containersC4Context / C4ContainerLayered (5 sub-types)
Protocol packets / headerspacket-betaHorizontal bit layout
Multi-axis scoringradarRadial axes
Hierarchical proportionstreemapNested rectangles
Code-style sequenceszenumlVertical (plugin)

Flowchart Deep Dive (Most Common)

Direction

  • TD / TB — top-down (best for decision trees)
  • LR — left-right (best for processes, pipelines)
  • BT — bottom-up (rare, for dependency graphs)
  • RL — right-left (rare)

Node Shapes

[text]       Rectangle (default action)
(text)       Rounded rectangle (soft step)
{text}       Diamond (decision/​condition)
([text])     Stadium/​pill (start/​end)
[[text]]     Subroutine (subprocess)
[(text)]     Cylinder (database/​storage)
((text))     Circle (event/​trigger)
>text]       Flag (async/​signal)
{{text}}     Hexagon (preparation)
[/​text/]     Parallelogram (input/​output)
[\text\]     Reverse parallelogram
[/​text\]     Trapezoid
[\text/]     Reverse trapezoid

Edge Styles

-->          Solid arrow (main flow)
---          Solid line (association)
-.->         Dotted arrow (optional/​async)
==>          Thick arrow (emphasis/​critical path)
--text-->    Labeled edge
~~~          Invisible link (layout control only)

Subgraphs

flowchart TD
  subgraph Backend
    A[API] --> B[DB]
  end
  subgraph Frontend
    C[UI] --> D[State]
  end
  C -->|fetch| A

Sequence Diagram Essentials

Messages

->>    Solid arrow (sync request)
-->>   Dotted arrow (async response)
-)     Open arrow (async fire-and-forget)
-x     Cross (failed/​rejected)

Blocks

activate / deactivate    Lifeline activation
alt / else / end         Conditional branching
loop / end               Repetition
par / and / end          Parallel execution
critical / end           Critical section
break / end              Break-out flow
rect rgb(...)  / end     Background highlight

Numbering

Add autonumber after the first line to auto-number all messages.


State Diagram Essentials

[*] --> State1           Start transition
State1 --> State2        Named transition
State1 --> State2: event Labeled transition
State2 --> [*]           End transition

state State1 {          Nested states
  [*] --> SubA
  SubA --> SubB
}

state fork <<fork>>      Fork pseudostate
state join <<join>>      Join pseudostate
state choice <<choice>>  Choice pseudostate

ER Diagram Essentials

Cardinality

||--||    Exactly one to exactly one
||--o{    One to zero-or-many
}o--o{    Zero-or-many to zero-or-many
||--|{    One to one-or-many

Attributes

erDiagram
  USER {
    int id PK
    string name
    string email UK
  }
  ORDER {
    int id PK
    int user_id FK
    date created_at
  }
  USER ||--o{ ORDER : places

Writing Principles

1. Descriptive Labels, Not Codes

  • ✅ A[Check if tests pass]
  • ❌ A[Step 2.3]

2. Consistent Direction

Pick one direction for the whole diagram. Don't mix TD and LR within the same flowchart.

3. Max 15 Nodes per Diagram

Beyond 15 nodes, split into multiple diagrams or use subgraphs. A crowded diagram is worse than no diagram.

4. Use Subgraphs for Grouping

When a diagram has natural clusters (frontend/​backend, phases, teams), use subgraphs to group them visually.

5. Label All Decision Edges

Every edge leaving a diamond ({decision}) node must have a label:

  • ✅ A{Ready?} -->|Yes| B and A -->|No| C
  • ❌ A{Ready?} --> B and A --> C (which is yes? which is no?)

6. Use Appropriate Edge Styles

  • Solid arrows for main flow
  • Dotted arrows for optional/​async paths
  • Thick arrows for critical paths or emphasis
  • Invisible links (~~~) only for layout tweaking

Anti-Patterns

Wrong Diagram Type

Novice: Using a flowchart for everything — even protocols, state machines, and data models. Expert: Match diagram type to content structure. Sequence diagrams for protocols. State diagrams for lifecycle. ER for data models. Each type exists because flowcharts can't express that structure well.

Overcrowded Diagram

Novice: One diagram with 30 nodes and crossing edges. Expert: Split into overview diagram + detail diagrams. Use subgraphs. Max ~15 nodes per diagram.

Unlabeled Decision Edges

Novice: {Decision} --> A and {Decision} --> B — which condition leads where? Expert: Always label edges from decision diamonds: -->|Yes| and -->|No| (or -->|Success| and -->|Failure|, etc.)

Prose That Should Be a Diagram

Novice: "First check if X. If X then do A, otherwise do B. Then if A succeeds, do C, otherwise retry A." Expert: That's a flowchart. Write it as one. The formal graph is more precise AND more readable.


References

  • references/​diagram-types.md — Consult for comprehensive syntax, features, and examples for all 23 Mermaid diagram types: timeline, mindmap, quadrant, sankey, XY chart, block, architecture, kanban, pie, gitgraph, class, journey, requirementDiagram, C4 (5 sub-types), packet-beta, radar, treemap, and zenuml
  • scripts/​validate_mermaid.py — Validates Mermaid syntax in any file: checks diagram type declarations, matching fences, structural correctness

More skills from curiositech

recovery-education-writer logo
curiositech/some_claude_skills

recovery-education-writer

Write neuroscientific, peer-oriented drug education content that roots experiences in body/brain mechanisms. Use when creating educational articles, explaining neurological phenomena, demystifying

242 0
View
crisis-response-protocol logo
curiositech/some_claude_skills

crisis-response-protocol

Handle mental health crisis situations in AI coaching safely. Use when implementing crisis detection, safety protocols, emergency escalation, or suicide prevention features. Activates for crisis

242 0
View
websocket-streaming logo
curiositech/some_claude_skills

websocket-streaming

Implements real-time bidirectional communication between DAG execution engines and visualization dashboards via WebSocket. Covers connection management, typed event protocols, reconnection

242 0
View
document-generation-pdf logo
curiositech/some_claude_skills

document-generation-pdf

Generate, fill, and assemble PDF documents at scale. Handles legal forms, contracts, invoices, certificates. Supports form filling (pdf-lib), template rendering (Puppeteer, LaTeX), digital

242 0
View
drone-cv-expert logo
curiositech/some_claude_skills

drone-cv-expert

Expert in drone systems, computer vision, and autonomous navigation. Specializes in flight control, SLAM, object detection, sensor fusion, and path planning. Activate on "drone", "UAV", "SLAM",

242 0
View
cost-accrual-tracker logo
curiositech/some_claude_skills

cost-accrual-tracker

Track real-time API cost accrual during LLM execution. Activate on 'cost tracking', 'token usage', 'API costs', 'budget monitoring', 'usage metrics'. NOT for cost estimation, pricing tiers,

242 0
View
openapi-spec-writer logo
curiositech/some_claude_skills

openapi-spec-writer

Expert in writing OpenAPI 3.0/3.1 specifications for REST APIs. Specializes in schema design, documentation best practices, API-first development, and tooling integration. Generates comprehensive

242 0
View
recovery-app-onboarding logo
curiositech/some_claude_skills

recovery-app-onboarding

Expert guidance for designing and implementing onboarding flows in recovery, wellness, and mental health applications. This skill should be used when building onboarding experiences, first-time

242 0
View
skill-coach logo
curiositech/some_claude_skills

skill-coach

Guides creation of high-quality Agent Skills with domain expertise, anti-pattern detection, and progressive disclosure best practices. Use when creating skills, reviewing existing skills, or when users mention improving skill quality, encoding expertise, or avoiding common AI tooling mistakes. Ac...

242 0
View
windows-3-1-web-designer logo
curiositech/some_claude_skills

windows-3-1-web-designer

Modern web applications with authentic Windows 3.1 aesthetic. Solid navy title bars, Program Manager navigation, beveled borders, single window controls. Extrapolates Win31 to AI chatbots (Cue

242 0
View
logging-observability logo
curiositech/some_claude_skills

logging-observability

Structured logging, distributed tracing, and metrics for production applications. [What: OpenTelemetry setup, log level strategy, correlation IDs, SLI/SLO alerting thresholds, Grafana dashboard

242 0
View
form-validation-architect logo
curiositech/some_claude_skills

form-validation-architect

End-to-end form handling with react-hook-form, Zod schemas, validation patterns, error messaging, field arrays, and multi-step wizards. Use for complex forms, validation architecture, autosave,

242 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View