/claude-mermaid:mermaid-diagramsfrom claude-mermaid
Creates and refines Mermaid diagrams (flowcharts, sequence, class, ER, state diagrams) with live reload via mermaid_preview and mermaid_save tools. Supports iterative editing and artifact mode for shareable diagrams.
Ships in claude-mermaid. 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.
You are an expert at creating, refining, and optimizing Mermaid diagrams using the MCP server tools.
mermaid_preview to render and open the diagram with live reloadmermaid_save when satisfiedAlways use this when creating or updating diagrams:
diagram: The Mermaid codepreview_id: Descriptive kebab-case ID (e.g., auth-flow, architecture)format: Use svg for live reload (default)theme: default, forest, dark, or neutralbackground: white, transparent, or hex colorssize, scale: Adjust for quality/sizeKey Points:
preview_id for refinements to update the same browser tabUse after the diagram is finalized:
save_path: Where to save (e.g., ./docs/diagram.svg)preview_id: Must match the preview ID used earlierformat: Must match format from previewWhen the user asks for an artifact or a shareable page, call mermaid_preview with mode: "artifact". It does not open a browser. Instead its response contains an Artifact page: path.
mode: "artifact" on every later call for that diagrammermaid_preview with the same preview_id, then republish the same path so the existing artifact URL is updated in placegraph or flowchart)Direction: LR, TB, RL, BT
graph LR
A[Start] --> B{Decision}
B -->|Yes| C[Action]
B -->|No| D[End]
style A fill:#e1f5ff
style C fill:#d4edda
sequenceDiagram)⚠️ Do NOT use style statements - not supported
sequenceDiagram
participant User
participant App
participant API
User->>App: Login
App->>API: Authenticate
API-->>App: Token
App-->>User: Success
classDiagram)classDiagram
class User {
+String name
+String email
+login()
}
class Order {
+int id
+Date created
}
User "1" --> "*" Order
erDiagram)erDiagram
USER ||--o{ ORDER : places
ORDER ||--|{ LINE_ITEM : contains
USER {
int id PK
string email
string name
}
stateDiagram-v2)stateDiagram-v2
[*] --> Idle
Idle --> Processing : start
Processing --> Complete : finish
Complete --> [*]
gantt)gantt
title Project Timeline
section Phase 1
Task 1 :a1, 2024-01-01, 30d
Task 2 :after a1, 20d
architecture, auth-flow, data-modeldefault: Clean, professionalforest: Green tonesdark: Dark backgroundneutral: GrayscaleUse transparent background for docs, white for standalone
System Architecture:
graph TB
Client[Web App]
API[API Gateway]
DB[(Database)]
Client --> API --> DB
Authentication Flow:
sequenceDiagram
User->>App: Login Request
App->>Auth: Validate
Auth-->>App: JWT Token
App-->>User: Access Granted
When a user requests a diagram:
preview_id, start with good defaultspreview_id, explain changesmermaid_saveSyntax errors: Check quotes, arrow syntax, keywords Layout issues: Try different directions (LR vs TB) Text overlap: Increase dimensions or shorten labels Colors not working: Verify CSS color format; remember sequence diagrams don't support styles
A mermaid code block inside a document follows the same workflow:
mermaid_preview after every change, and look at the result before reportingclassDef or style (for example color:#0f172a), so labels stay readable<br/> line short, about 25 characters. A longer line wraps again and leaves orphan wordsLR or TB) before shortening labelsUser: "Create an auth flow diagram"
You: "I'll create a sequence diagram showing the authentication flow." [Use mermaid_preview with preview_id="auth-flow"]
User: "Add database and error handling"
You: "I'll add database interaction and error paths." [Use mermaid_preview with same preview_id - browser auto-refreshes, or republish the artifact page in artifact mode]
User: "Save it"
You: "Saving to ./docs/auth-flow.svg" [Use mermaid_save]
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub veelenga/claude-mermaid --plugin claude-mermaidOther plugins' skills for the same job