From documentation
This skill should be used when the user asks to "create a diagram", "draw a flowchart", "make a mermaid diagram", "fix mermaid", "diagram not rendering", "sequence diagram", "state diagram", "flowchart", "ER diagram", "mermaid syntax", "mermaid chart", or needs guidance on creating Mermaid diagrams that render correctly in Obsidian, GitHub, and other markdown environments — including node quoting, shape syntax, subgraph labels, arrow types, and avoiding common pitfalls.
How this skill is triggered — by the user, by Claude, or both
Slash command
/documentation:mermaid-best-practicesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Rules for creating Mermaid diagrams that render correctly across Obsidian, GitHub, and standard markdown renderers.
Rules for creating Mermaid diagrams that render correctly across Obsidian, GitHub, and standard markdown renderers.
Core principle: Always quote node text. Use stable diagram types. Test before committing.
Always wrap node text in double quotes when it contains:
%% WRONG
flowchart TD
A[Market Analysis] --> B[Pick a Niche]
%% CORRECT
flowchart TD
A["Market Analysis"] --> B["Pick a Niche"]
Safe default: Quote everything. There is zero downside.
Parentheses () conflict with node shape syntax and cause parse failures.
%% WRONG — parser confuses shape delimiters with text
A(["Step 1 (important)"])
%% CORRECT — use dashes or remove parens
A(["Step 1 — important"])
| Syntax | Shape | Example |
|---|---|---|
A["text"] | Rectangle | A["Analysis"] |
A("text") | Rounded | A("Decision") |
A{"text"} | Diamond (decision) | A{"Condition?"} |
A(["text"]) | Stadium | A(["Start"]) |
A[["text"]] | Subroutine | A[["Subprocess"]] |
A[("text")] | Cylinder (DB) | A[("Database")] |
A(("text")) | Circle | A(("Endpoint")) |
Subgraph labels with spaces or special characters must use the ID["Title"] form:
%% WRONG
subgraph Data Preparation
A --> B
end
%% CORRECT
subgraph PREP["Data Preparation"]
A --> B
end
| Syntax | Meaning |
|---|---|
--> | Arrow |
--- | Line (no arrowhead) |
-.-> | Dashed arrow |
==> | Thick arrow |
--"label"--> | Arrow with label |
%% Labels on arrows — quote if non-ASCII or spaces
A -->|"Yes"| B
A -->|"No"| C
| Type | Use Case |
|---|---|
flowchart TD/LR | Processes, funnels, workflows |
sequenceDiagram | Interactions, API flows |
stateDiagram-v2 | State machines |
gantt | Timelines, project plans |
graph TD/LR | Simple graphs |
classDiagram | UML class diagrams |
erDiagram | Entity-relationship |
| Type | Issues |
|---|---|
quadrantChart | May fail in older renderers |
mindmap | Limited support |
timeline | Unstable rendering |
pie | Label encoding issues with non-ASCII |
Tip: For SWOT analysis, use flowchart with subgraph instead of quadrantChart.
flowchart TD
A["Traffic"] --> B["Landing Page"]
B --> C{"Converts?"}
C -->|"Yes"| D["Lead"]
C -->|"No"| E["Retargeting"]
D --> F["Qualification"]
F --> G["Deal"]
style A fill:#E3F2FD
style G fill:#C8E6C9
flowchart LR
subgraph INPUT["Input"]
A["Request"]
end
subgraph PROCESS["Processing"]
B["Step 1"]
C["Step 2"]
D["Step 3"]
end
subgraph OUTPUT["Output"]
E["Result"]
end
A --> B --> C --> D --> E
style INPUT fill:#FFF3E0
style PROCESS fill:#E8F5E9
style OUTPUT fill:#E3F2FD
stateDiagram-v2
[*] --> Draft: Create
Draft --> Review: Submit
Review --> Published: Approve
Review --> Draft: Reject
Published --> [*]
note right of Review: Content review
sequenceDiagram
participant U as User
participant S as System
participant D as Database
U->>S: Request
S->>D: Query
D-->>S: Data
S-->>U: Response
ID["Title"] formCause: Markdown syntax (lists, headers) leaked into the mermaid code block. Fix: Ensure all content inside the block is valid Mermaid syntax only.
subgraph ... end pairingCause: Outdated renderer or missing Mermaid plugin. Fix: Update Obsidian / ensure GitHub has Mermaid support enabled.
npx claudepluginhub j2h4u/oh-my-claude-plugins --plugin documentationCreates, edits, and verifies skills using a test-driven development approach with pressure scenarios and subagents.