Expert guidance for creating syntactically correct Mermaid diagrams. Use when creating flowcharts, sequence diagrams, class diagrams, state diagrams, Gantt charts, ER diagrams, or data lineage visualizations.
View on GitHubmajesticlabs-dev/majestic-marketplace
majestic-engineer
plugins/majestic-engineer/skills/mermaid-builder/SKILL.md
January 24, 2026
Select agents to install to:
npx add-skill https://github.com/majesticlabs-dev/majestic-marketplace/blob/main/plugins/majestic-engineer/skills/mermaid-builder/SKILL.md -a claude-code --skill mermaid-builderInstallation paths:
.claude/skills/mermaid-builder/# Mermaid Builder
## Core Philosophy
- **Correctness**: Follow Mermaid syntax rules strictly
- **Clarity**: Diagrams communicate complex ideas simply
- **Simplicity**: Avoid overloading with unnecessary detail
- **Modularity**: Break complex diagrams into subgraphs
## Critical: Label Quoting Rule
**RULE: Wrap labels in double quotes if they contain spaces, special characters, or punctuation.**
```mermaid
%% CORRECT - labels with spaces quoted
flowchart LR
A["User Login"] --> B["Process Request"]
C["Pay $100?"] --> D["Confirm (Yes/No)"]
%% WRONG - will fail to render
flowchart LR
A[User Login] --> B[Process Request]
```
**Must quote:** Spaces, special chars (`$%&`), punctuation (`:,;`), operators (`()[]`)
**Optional:** Simple alphanumeric (`Login`, `Process`, `Node1`)
**When in doubt, use quotes. It never hurts.**
## Quick Reference
### Flowchart Shapes
| Syntax | Shape |
|--------|-------|
| `["Text"]` | Rectangle |
| `("Text")` | Rounded |
| `{"Text"}` | Diamond (decision) |
| `[("Text")]` | Cylinder (database) |
| `(("Text"))` | Circle |
### Arrow Types
| Syntax | Type |
|--------|------|
| `-->` | Solid arrow |
| `---` | Solid line |
| `-.->` | Dotted arrow |
| `==>` | Thick arrow |
| `-->|Label|` | Arrow with label |
### Diagram Types
| Type | Declaration | Use Case |
|------|-------------|----------|
| Flowchart | `flowchart TD` | Processes, workflows, decisions |
| Sequence | `sequenceDiagram` | Component interactions, API flows |
| Class | `classDiagram` | OOP structure, models |
| State | `stateDiagram-v2` | State transitions |
| Gantt | `gantt` | Timelines, scheduling |
| ER | `erDiagram` | Database schema |
| Pie | `pie` | Proportional data |
**Directions:** `TB`/`TD` (top-down), `BT` (bottom-up), `LR` (left-right), `RL` (right-left)
See [resources/diagram-examples.md](resources/diagram-examples.md) for complete examples of each diagram type.
## Minimal Examples
### Flowchart
```mermaid
flowchart TD
Start["Start"] --> Ch