mcpField
M
mermaid

mermaid

github.com/markdown-viewerDevelopment3.4k539 installsUpdated 3w ago
Repository

About mermaid

A syntax guide for creating Mermaid diagrams in documents. It is aimed at diagram authors and covers diagram types, common constraints, and troubleshooting.

Key features

  1. 01Covers multiple Mermaid diagram types
  2. 02Explains node and connection syntax
  3. 03Lists common syntax conflicts
  4. 04Offers diagram troubleshooting guidance

Use cases

  1. 01Create flowcharts or sequence diagrams
  2. 02Organize nodes in subgraphs
  3. 03Fix diagrams that fail to render

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/markdown-viewer/skills --skill mermaid

After installing, type/mermaidin Claude Code to confirm it loaded.

Bundled filesreferences/syntax.md

Details

From the project README

Mermaid Diagram Visualizer

Quick Start: Identify diagram type (flowchart/sequence/state/class/ER/gantt/mindmap) → Define nodes with shapes → Connect with arrows → Wrap in ```mermaid fence. Default: top-to-bottom (TD), use flowchart over graph, Unicode supported.


Critical Syntax Rules

Rule 1: List Syntax Conflicts
❌ [1. Item]     → "Unsupported markdown: list"
✅ [1.Item]      → Remove space after period
✅ [① Item]      → Use circled numbers ①②③④⑤⑥⑦⑧⑨⑩
✅ [(1) Item]    → Use parentheses
Rule 2: Subgraph Naming
❌ subgraph AI Agent Core    → Space without quotes
✅ subgraph agent["AI Agent Core"]  → ID with display name
✅ subgraph agent            → Simple ID only
Rule 3: Node References in Subgraphs
❌ Title --> AI Agent Core   → Reference display name
✅ Title --> agent           → Reference subgraph ID
Rule 4: Special Characters in Node Text
✅ ["Text with spaces"]       → Quotes for spaces
✅ Use #quot; instead of "    → Avoid quotation marks
✅ Use #lpar;#rpar; for ()    → Avoid parentheses
Rule 5: Use flowchart over graph
❌ graph TD      → Outdated
✅ flowchart TD  → Supports subgraph directions, more features

Common Pitfalls

IssueSolution
Diagram won't renderCheck unmatched brackets, quotes
List syntax error[1.Item] not [1. Item]
Subgraph reference failsUse ID not display name
Too crowdedSplit into multiple diagrams
Crossing connectionsUse different layout direction or invisible edges ~~~

Output Format

```mermaid
[diagram code]
```

Related Files

For diagram-specific syntax and advanced features, refer to references below:

  • syntax.md — Detailed syntax for all 14+ diagram types: flowchart shapes, sequence actors, class relationships, state transitions, ER cardinality, Gantt tasks, and more

Comments

Markdown supported