Creates syntactically correct mermaid diagrams (flowchart, sequenceDiagram, classDiagram, stateDiagram, erDiagram, gantt, mindmap) following official specifications. Prevents common errors like special characters in labels, subgraph syntax, note misuse, and reserved words. Use when creating or editing mermaid diagrams in documentation or design files.
From claude-toolkitnpx claudepluginhub johwer/marketplace --plugin claude-toolkitThis skill is limited to using the following tools:
class-reference.mdcommon-errors.mdflowchart-reference.mdsequence-reference.mdSearches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Creates syntactically correct mermaid diagrams following official specifications and preventing common errors.
This skill helps you create error-free mermaid diagrams by:
When to use:
flowchart TD
Start[Start Process]
Process[Process Data]
Decision{Is Valid?}
End[End]
Start --> Process
Process --> Decision
Decision -->|Yes| End
Decision -->|No| Process
sequenceDiagram
participant A as Alice
participant B as Bob
A->>B: Hello Bob
B->>A: Hi Alice
Note right of B: Bob thinks
classDiagram
class Animal {
+String name
+int age
+makeSound()
}
class Dog {
+bark()
}
Animal <|-- Dog
Problem characters: :, (), [], {}, @, ;, ,
Solutions:
Option A: Use double quotes
flowchart LR
A["Function: process()"]
B["Array [1, 2, 3]"]
Option B: Use HTML entities
: → :( → () → )[ → [] → ]; → ;WRONG:
flowchart LR
A[Function: process()] ❌ Colon breaks syntax
"end" (lowercase):
flowchart TD
Start --> End ✅ Capitalized OK
Start --> end ❌ Breaks diagram
Start --> END ✅ All caps OK
"o" and "x" at edge start:
flowchart LR
A --- oB ❌ Creates circle edge
A --- xB ❌ Creates cross edge
A --- oC ✅ Add space: o B
CORRECT:
flowchart TD
subgraph ID["Subgraph Title"]
A[Node A]
B[Node B]
end
WRONG:
flowchart TD
subgraph "Subgraph Title" ❌ Missing ID
A[Node A]
end
sequenceDiagram ONLY:
sequenceDiagram
A->>B: Message
Note right of B: This is valid ✅
flowchart/graph: NO note keyword
flowchart TD
Note[Use regular node instead] ✅
Define before linking:
classDiagram
class Animal {
+name
}
class Dog
Animal <|-- Dog ✅ Both defined
Method syntax:
classDiagram
class MyClass {
+method(param) ReturnType ✅
+field: Type ✅
}
Declaration:
flowchart TD (Top-Down)flowchart LR (Left-Right)graph TD (alias)Node shapes:
A[Rectangle]B(Rounded)C{Dservice-cond}E[[Subroutine]]Edges:
A --> B (arrow)A --- B (line)A -.-> B (dotted arrow)A ==> B (thick arrow)A -->|label| B (labeled edge)Subgraph:
flowchart TD
subgraph SG1["Group 1"]
A[Node A]
B[Node B]
end
subgraph SG2["Group 2"]
C[Node C]
end
A --> C
Participants:
sequenceDiagram
participant A as Alice
participant B as Bob
Messages:
A->>B: Solid arrowA-->>B: Dotted arrowA-)B: AsyncNotes:
Note right of A: TextNote left of B: TextNote over A,B: TextBlocks:
alt, opt, par, loop, rectClass definition:
classDiagram
class ClassName {
+publicField: Type
-privateField: Type
+method(param) ReturnType
}
Relationships:
A <|-- B (inheritance)A *-- B (composition)A o-- B (aggregation)A --> B (association)A ..> B (dependency)A ..|> B (realization)Edge labels:
classDiagram
A --> B : label
A ..> C : another label
stateDiagram-v2
[*] --> State1
State1 --> State2
State2 --> [*]
state State1 {
[*] --> Nested1
Nested1 --> [*]
}
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE-ITEM : contains
CUSTOMER {
string name
int id
}
gantt
title Project Schedule
dateFormat YYYY-MM-DD
section Phase 1
Task 1 :a1, 2025-01-01, 30d
Task 2 :after a1, 20d
mindmap
root((Central Idea))
Topic1
Subtopic1
Subtopic2
Topic2
Cause: Special characters in labels
Solution: Use double quotes or HTML entities
flowchart LR
A["Method: process()"] ✅
Cause: Missing ID in subgraph declaration
Solution:
flowchart TD
subgraph ID["Title"] ✅
A[Node]
end
Cause: Reserved word "end" in lowercase
Solution: Capitalize: End, END
Cause: Using Note keyword in flowchart
Solution: Use regular node or switch to sequenceDiagram
Cause: "o" or "x" at edge start
Solution:
flowchart LR
A --- B ✅
A --- oC ❌ (creates circle edge)
A --- " oC" ✅ (add space)
For detailed specifications on specific diagram types, see:
Before finalizing a mermaid diagram:
subgraph ID["Title"]graph TB
subgraph Server["MCP Server"]
Main[SwiftMCPServer]
LSP[LSPState]
end
subgraph Tools["Tools"]
T1[Tool 1]
T2[Tool 2]
end
Main --> LSP
Main --> Tools
style Server fill:#e3f2fd
sequenceDiagram
participant C as Client
participant L as LSP
C->>L: initialize
L->>C: response
C->>L: initialized
Note over L: Ready for requests
C->>L: textDocument/references
L->>C: result
erDiagram
ProjectMemory ||--o{ FileInfo : contains
ProjectMemory ||--o{ Note : contains
FileInfo {
string path
date lastModified
}
Escape special chars: Use " or &#XX;
Subgraph: subgraph ID["Title"]
Note: sequenceDiagram only
Reserved: Avoid lowercase "end"
classDiagram: Define before link
For complete syntax details, refer to supporting reference files.