/diagrams:mermaidfrom diagrams
Generates clean, maintainable Mermaid diagrams (flowchart, sequence, class, state, ER, gantt, pie, mindmap) for software architecture, API flows, data models, and more. Stores as .mmd files for version control.
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.
Generate clean, maintainable Mermaid diagram code that renders professional software architecture diagrams, flowcharts, sequence diagrams, and more. Diagrams should be version-controllable, easy to update, and clearly communicate system design.
flowchart TD, sequenceDiagram, classDiagram).%% for comments to explain complex sections.A, B, C) for nodes..mmd files alongside code for version control.| Use Case | Diagram Type | Direction |
|---|---|---|
| System architecture, component relationships | flowchart | TD (top-down) or LR (left-right) |
| API interactions, message flows | sequenceDiagram | Automatic (time-based) |
| Domain models, OOP design | classDiagram | Automatic |
| Database schemas | erDiagram | Automatic |
| State machines, lifecycle | stateDiagram | Automatic |
| Project timelines | gantt | Automatic |
Choose one:
%% Flowchart directions:
flowchart TD %% Top-down (most common)
flowchart LR %% Left-right (good for processes)
flowchart BT %% Bottom-top
flowchart RL %% Right-left
%% Other diagrams auto-direction:
sequenceDiagram %% Time-based (left to right)
classDiagram %% Automatic hierarchy
erDiagram %% Automatic relationships
✅ DO — Introduce nodes with descriptive identifiers:
flowchart TD
WEBPORTAL[Web Portal]
WEBEXPAPI[Web Portal Experience API]
MOBILEAPP[Mobile App]
MOBEXPAPI[Mobile App Experience API]
MICROSERVICES[Microservices]
DB[Database]
%% Now define connections
WEBPORTAL-->WEBEXPAPI
MOBILEAPP-->MOBEXPAPI
❌ DON'T — Mix definition with connections:
flowchart TD
WEBPORTAL[Web Portal]-->WEBEXPAPI[Web Portal Experience API]
MOBILEAPP[Mobile App]-->MOBEXPAPI[Mobile App Experience API]
✅ DO:
flowchart TD
AUTHSERVICE[Auth Service]-->DATABASE[(Database)]
USERSERVICE[User Service]-->DATABASE[(Database)]
❌ DON'T:
flowchart TD
A[Auth Service]-->B[(Database)]
C[User Service]-->B[(Database)]
%% Basic connection
A --> B
%% With label (use pipes)
A -->|label text| B
%% Different arrow styles
A --> B %% Solid arrow
A -.-> B %% Dotted line
A ==> B %% Thick arrow
A -.- B %% Dotted without arrow
%% With text label
A -->|POST /login| B
A -->|200 OK| B
flowchart TD
A[Hard text] %% Rectangle (default)
B(Round edge) %% Rounded rectangle
C([Stadium]) %% Stadium shape
D{Decision} %% Diamond (for decisions)
E[(Database)] %% Cylinder (database)
F[/Input or Output/] %% Parallelogram
Start([Start]) %% Circle (start/end)
flowchart TD
subgraph CLIENTS["Client Layer"]
WEBPORTAL[Web Portal]
MOBILEAPP[Mobile App]
end
subgraph BACKEND["Backend Layer"]
subgraph API["API Gateway"]
WEBEXPAPI[Web API]
MOBEXPAPI[Mobile API]
end
MICROSERVICES[Microservices]
DB[(Database)]
end
WEBPORTAL-->WEBEXPAPI
MOBILEAPP-->MOBEXPAPI
WEBEXPAPI-->MICROSERVICES
MOBEXPAPI-->MICROSERVICES
MICROSERVICES-->DB
flowchart TD
%% Mobile App authentication flow
MOBILEAPP[Mobile App]-->AUTHAPI[Auth API]
%% Auth API validates against Identity Provider
AUTHAPI-->IDENTITYPROVIDER[Identity Provider]
%% On success, return JWT token
IDENTITYPROVIDER-->|JWT token| MOBILEAPP
✅ DO — Define shared node on its own line:
flowchart TD
WEBPORTAL[Web Portal]-->MICROSERVICES[Microservices]
MOBILEAPP[Mobile App]-->MICROSERVICES[Microservices]
MICROSERVICES[Microservices]-->DB[(Database)]
❌ DON'T — Repeat shared node:
flowchart TD
WEBPORTAL[Web Portal]-->MICROSERVICES[Microservices]-->DB[(Database)]
MOBILEAPP[Mobile App]-->MICROSERVICES[Microservices]
flowchart TD
%% Define all nodes first
CLIENT[Client Application]
APIGATEWAY[API Gateway]
AUTHSERVICE[Auth Service]
USERSERVICE[User Service]
DATABASE[(User Database)]
CACHE[(Redis Cache)]
%% Define connections with labels
CLIENT -->|HTTPS Request| APIGATEWAY
APIGATEWAY -->|Validate JWT| AUTHSERVICE
APIGATEWAY -->|Get User| USERSERVICE
%% Service dependencies
USERSERVICE -->|Read| DATABASE
USERSERVICE -->|Check| CACHE
%% Horizontal alignment for clarity
APIGATEWAY -->|Route| USERSERVICE
USERSERVICE -->DATABASE
sequenceDiagram
%% Define participants
participant User
participant Client as Client App
participant API as API Gateway
participant Auth as Auth Service
participant DB as Database
%% Message flow
User->>Client: Enter credentials
Client->>API: POST /login
API->>Auth: Validate credentials
Auth->>DB: Query user
DB-->>Auth: Return user data
%% Alt/else blocks for conditions
alt Valid credentials
Auth-->>API: 200 OK + JWT
API-->>Client: 200 OK + token
Client-->>User: Show dashboard
else Invalid credentials
Auth-->>API: 401 Unauthorized
API-->>Client: 401 Error
Client-->>User: Show error
end
classDiagram
%% Define classes with attributes/methods
class User {
+string id
+string email
+string name
+register()
+login()
}
class Title {
+string name
+int releaseYear
+play()
}
class Genre {
+string name
+getTopTitles()
}
class Review {
+string content
+datetime createdAt
+submit()
}
%% Define relationships
User --> Review : creates
Title *-- Season : has
Title *-- Review : has
Title -- Genre : belongs to
%% Relationship types
%% *-- : Composition (strong ownership)
%% --> : Association (weak relationship)
%% -- : Aggregation
%% <|-- : Inheritance
erDiagram
%% Define entities with keys
USER ||--o{ ORDER : places
ORDER ||--|{ LINE_ITEM : contains
PRODUCT ||--o{ LINE_ITEM : includes
USER {
int id PK
string email UK
string name
datetime created_at
}
ORDER {
int id PK
int user_id FK
decimal total
datetime created_at
}
LINE_ITEM {
int id PK
int order_id FK
int product_id FK
int quantity
decimal price
}
PRODUCT {
int id PK
string name
decimal price
int stock
}
%% Cardinality
%% ||--o{ : One-to-many (optional)
%% ||--|{ : One-to-many (mandatory)
%% }o--o{ : Many-to-many
stateDiagram-v2
%% Define states
[*] --> Idle
Idle --> Loading: Start
Loading --> Processing: Data ready
Processing --> Complete: Success
Processing --> Error: Failure
Error --> Idle: Retry
Complete --> [*]
%% Nested states
state Authentication {
[*] --> Unauthenticated
Unauthenticated --> Authenticating: Login
Authenticating --> Authenticated: Success
Authenticating --> Unauthenticated: Fail
}
%% Notes
note right of Processing
Validate input
Update database
end note
---
config:
theme: base
themeVariables:
primaryColor: "#ff6b6b"
secondaryColor: "#4ecdc4"
tertiaryColor: "#ffe66d"
look: classic
---
flowchart TD
A[Node A] --> B[Node B]
default — Standard blue/greyforest — Green tonesdark — Dark modeneutral — Grey tonesbase — Customizableflowchart TD
classDef success fill:#4ecdc4,stroke:#333,stroke-width:2px
classDef error fill:#ff6b6b,stroke:#333,stroke-width:2px
A[Success] --> B[Error]
class A success
class B error
Before finalizing, verify:
%%) explain complex sections| ❌ Wrong | ✅ Right |
|---|---|
A --> B with unclear A, B | AUTHSERVICE[Auth Service] --> DATABASE[(Database)] |
| No comments | %% Auth flow validates JWT token |
| One giant diagram | Split into architecture.mmd, api-flow.mmd, data-model.mmd |
| Missing node definitions | Define all nodes first, then connections |
Using # in comments | Use %% not # for comments |
Always diagram when:
Reserve for:
Now create your Mermaid diagram following these instructions. Start by choosing the right diagram type, define all nodes with descriptive identifiers, then add connections with clear labels. Use comments and subgraphs to improve readability.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
4 skills in this plugin
/ascii-artdiagrams:ascii-artDraw ASCII-art / text diagrams for software documentation using extended ASCII box-drawing characters (IBM CP437 codes > 128 — single-line ┌─┐│└┘├┤┬┴┼, double-line ╔═╗║╚╝, shading ░▒▓█), never +, -, |, or /. Enforces ≤80-char width and strict row/column alignment, renders in monospaced fonts. Use when the user wants an ascii diagram, a text/box diagram, a terminal diagram, or a plain-text visualization./diagramsRouter for the diagrams plugin — pick the right diagram format and dispatch to its skill. Routes to ascii-art (text/box-drawing diagrams), mermaid (flowcharts, sequence, class, state, ER, gantt), or wardley (Wardley maps in markdown). Use when the user says "draw a diagram", "diagram this", "make a chart", "visualize this as a diagram", "ascii diagram", "mermaid diagram", or "wardley map"./wardleydiagrams:wardleyProduce a Wardley map in the WTG2 DSL (wardleyToGo) as a .wtg2 file that renders to SVG via wtg2svg — anchors (user needs), components positioned by value chain (visibility) and evolution (roman numerals I–IV), dependencies, movement, inertia, build/buy/outsource, signals, gameplays, and groups. Use when the user asks for a Wardley map, strategic map, or value-chain map.npx claudepluginhub florianbuetow/claude-code --plugin diagramsOther plugins' skills for the same job