From sdd-engineering
Create Mermaid diagrams in markdown. Use when the user wants to visualize workflows, architectures, API flows, data models, state machines, or system designs. Covers flowcharts, sequence diagrams, class diagrams, ER diagrams, state diagrams, and more.
How this skill is triggered — by the user, by Claude, or both
Slash command
/sdd-engineering:mermaid-diagramThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate Mermaid diagrams embedded in markdown that **communicate clearly** — showing relationships, flows, and structure that words alone can't express.
Generate Mermaid diagrams embedded in markdown that communicate clearly — showing relationships, flows, and structure that words alone can't express.
See examples.md for ready-to-use templates for each diagram type.
mmdc| You want to show... | Use | Mermaid keyword |
|---|---|---|
| Steps, decisions, branches | Flowchart | flowchart TD |
| API calls between services over time | Sequence Diagram | sequenceDiagram |
| Object relationships, inheritance | Class Diagram | classDiagram |
| Database tables and relationships | ER Diagram | erDiagram |
| Transitions between states | State Diagram | stateDiagram-v2 |
| Project timeline, task dependencies | Gantt Chart | gantt |
| Proportions, distribution | Pie Chart | pie |
| Hierarchical idea breakdown | Mindmap | mindmap |
| Git branching strategy | Git Graph | gitGraph |
| User experience steps | User Journey | journey |
| Chronological events | Timeline | timeline |
The most common diagram type. Use for workflows, decision trees, and process flows.
| Code | Direction |
|---|---|
TD / TB | Top → Down |
LR | Left → Right |
BT | Bottom → Top |
RL | Right → Left |
| Syntax | Shape | Use for |
|---|---|---|
[text] | Rectangle | Process, action |
(text) | Rounded | Start/end |
{text} | Diamond | Decision |
((text)) | Circle | Event, trigger |
[(text)] | Cylinder | Database, storage |
[[text]] | Subroutine | External process |
| Syntax | Style |
|---|---|
--> | Solid arrow |
-.-> | Dashed arrow |
==> | Bold arrow |
--text--> | Arrow with label |
~~~ | Invisible link (layout) |
Group related nodes into labeled containers:
subgraph Title
direction LR
A --> B
end
Use for API flows, service interactions, and request/response patterns. Ideal for documenting HTTP routes, middleware chains, and client-server communication.
| Element | Syntax |
|---|---|
| Solid arrow (request) | ->> |
| Dashed arrow (response) | -->> |
| Solid line (sync) | -> |
| Dashed line (async) | --> |
| Cross (destroy) | -x |
| Note | Note right of A: text |
| Activation | activate A / deactivate A |
| Alt/else | alt condition / else / end |
| Loop | loop label / end |
| Opt (optional) | opt condition / end |
Use for data models, ORM/ODM schemas, and object relationships.
| Syntax | Meaning |
|---|---|
<|-- | Inheritance |
*-- | Composition (strong ownership) |
o-- | Aggregation (weak ownership) |
--> | Association |
<|.. | Interface implementation |
..> | Dependency |
class ClassName {
+String publicField
-Number privateField
#Date protectedField
+methodName() ReturnType
-privateMethod() void
}
Use for database schema relationships and data modeling.
| Syntax | Meaning |
|---|---|
||--|| | One-to-one |
||--o{ | One-to-many |
}o--o{ | Many-to-many |
||--o| | One-to-zero-or-one |
ENTITY {
string fieldName PK "Primary Key"
string otherField FK "Foreign Key"
number numericField
date dateField
}
Use for component lifecycle, auth flows, or any finite state machine.
| Element | Syntax |
|---|---|
| Start | [*] --> State1 |
| End | State1 --> [*] |
| Transition | State1 --> State2 : event |
| Composite state | state StateName { ... } |
| Fork/Join | state fork_state <<fork>> |
| Choice | state choice_state <<choice>> |
| Note | note right of State : text |
Use for project planning, sprint timelines, implementation plans.
gantt
dateFormat YYYY-MM-DD
title Project Timeline
section Phase 1
Task A :a1, 2024-01-01, 5d
Task B :after a1, 3d
section Phase 2
Task C :2024-01-10, 7d
Duration formats: 1d (days), 1w (weeks), 1h (hours)
Dependencies: after taskId for sequential tasks
style nodeId fill:#f9f,stroke:#333,stroke-width:2px
classDef className fill:#bbf,stroke:#333
class nodeId className
%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#ff6b6b'}}}%%
Available themes: default, dark, forest, neutral, base (customizable)
mermaid code blocks~~~) as a first resort — fix the layout with direction/grouping firstGitHub, GitLab, Notion, and most markdown renderers support mermaid blocks natively:
```mermaid
flowchart LR
A --> B
```
If mmdc (Mermaid CLI) is available:
# PNG output
mmdc -i diagram.md -o diagram.png
# SVG output
mmdc -i diagram.md -o diagram.svg -t dark
# With custom width
mmdc -i diagram.md -o diagram.png -w 1200
Before sharing any diagram:
npx claudepluginhub syukpublic/dev-digest-ai-marketplace --plugin sdd-engineeringCreates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.