Creating and refining Mermaid diagrams with live reload. Use when users want flowcharts, sequence diagrams, class diagrams, ER diagrams, state diagrams, or any other Mermaid visualization. Provides best practices for syntax, styling, and the iterative workflow using mermaid_preview and mermaid_save tools.
/plugin marketplace add veelenga/claude-mermaid/plugin install claude-mermaid@claude-mermaidThis skill is limited to using the following tools:
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 colorswidth, height, 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 previewgraph 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
User: "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]
User: "Save it"
You: "Saving to ./docs/auth-flow.svg" [Use mermaid_save]