awesome-skills

Mermaid Syntax Skill — Development skill for Claude Code

Development community

A Claude Code skill for generating error-free Mermaid diagrams - prevents common syntax errors with special characters, reserved words, and escaping rules.

How to install Mermaid Syntax Skill

This entry records only its repository, not the path inside it, so there is no exact command to give. Open awesome-skills/mermaid-syntax-skill and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Mermaid Syntax Skill does

A Claude Code skill for generating error-free Mermaid diagrams - prevents common syntax errors with special characters, reserved words, and escaping rules.

Alternatives in Development

  • n8n Validation Expert — Fix n8n validation errors with error catalog 3.6k ★
  • Pi Reserved Keybindings — Extensions cannot override these shortcuts — they are silently skipped by registerShortcut() 526 ★
  • Deep Dive Claude Code — 《深入理解 Claude Code 源码》— 系统剖析 Anthropic Claude Code CLI 的架构设计、工程实践与编程哲学 25 chapters, 101 Mermaid diagrams, 467 c 181 ★

README

Mermaid Syntax Skill

A Claude Code skill for generating error-free Mermaid diagrams. Prevents common syntax errors with special characters, reserved words, and escaping rules. **Supports Mermaid v11 features.**

Installation

# Clone to your Claude Code skills directory
git clone https://github.com/awesome-skills/mermaid-syntax-skill.git ~/.claude/skills/mermaid-syntax

Features

  • Critical Error Prevention - Handles 90% of common Mermaid syntax errors
  • Mermaid v11 Support - Hand-drawn look, bidirectional arrows, new diagram types
  • Complete Syntax Reference - Flowchart, Sequence, Class, State, ER, Gantt, Git Graph, and more
  • Working Examples - Ready-to-use diagram patterns
  • Validation Script - Check diagrams for common errors before committing

Common Errors This Skill Prevents

Error Type Problem Solution
Special Characters A[Text (with) parens] breaks Use quotes: A["Text (with) parens"]
Reserved Word "end" A --> end breaks diagram Use A --> End or A --> ["end"]
Node ID with o/x oNode creates circle edge Use descriptive names: orderNode
Semicolon in Sequence A->>B: key;value breaks Use entity: A->>B: key#59;value
Single % comment % comment breaks Use %% comment
Subgraph with
subgraph Title
breaks
Use subgraph "Title
"
stroke-dasharray comma stroke-dasharray: 5,5 breaks Escape: stroke-dasharray: 5\,5

Skill Structure

mermaid-syntax/
├── SKILL.md              # Core syntax rules (auto-loaded when triggered)
├── references/
│   ├── flowchart-complete.md    # All 30+ node shapes, edges, subgraphs
│   ├── sequence-complete.md     # Messages, activations, control flow
│   ├── class-state-complete.md  # Class/State/ER diagram syntax
│   └── other-diagrams.md        # Gantt, Pie, Git Graph, Mindmap, Timeline
├── examples/
│   ├── flowchart-examples.md    # 8 flowchart patte