home / skills / sammcj / agentic-coding / mermaid-diagrams
This skill helps you create and update mermaid diagrams following best practices, including color themes, labeling, and formatting guidelines.
npx playbooks add skill sammcj/agentic-coding --skill mermaid-diagramsReview the files below or copy the command above to add this skill to your agents.
---
name: mermaid-diagrams
description: Use the mermaid-diagrams skill whenever you are creating or updating mermaid diagrams. Provides guidance on mermaid best practices.
---
# Mermaid Diagramming Guidelines
- You MUST NOT use round brackets ( ) within item labels or descriptions
- Use `<br>` instead of `\n` for line breaks
- Mermaid does not support unordered lists within item labels
- Apply this colour theme unless specified otherwise:
```
classDef inputOutput fill:#F5F5F5,stroke:#9E9E9E,color:#616161
classDef llm fill:#E8EAF6,stroke:#7986CB,color:#3F51B5
classDef components fill:#F3E5F5,stroke:#BA68C8,color:#8E24AA
classDef process fill:#E0F2F1,stroke:#4DB6AC,color:#00897B
classDef stop fill:#FFEBEE,stroke:#E57373,color:#D32F2F
classDef data fill:#E3F2FD,stroke:#64B5F6,color:#1976D2
classDef decision fill:#FFF3E0,stroke:#FFB74D,color:#F57C00
classDef storage fill:#F1F8E9,stroke:#9CCC65,color:#689F38
classDef api fill:#FFF9C4,stroke:#FDD835,color:#F9A825
classDef error fill:#FFCDD2,stroke:#EF5350,color:#C62828
```
This skill helps you create and update Mermaid diagrams with consistent syntax, accessibility, and visual styling. It enforces formatting rules and supplies a standard color theme so diagrams render predictably across projects. Use it to avoid common Mermaid pitfalls and keep diagrams readable and reusable.
The skill inspects Mermaid code for prohibited patterns and formatting issues, such as round parentheses in labels and incorrect line breaks. It suggests or applies fixes like replacing newlines with <br> and ensuring labels do not contain unordered lists. It also enforces a predefined set of classDef color styles to keep visuals consistent.
Why must I avoid round parentheses in labels?
Mermaid can misinterpret parentheses inside labels and cause parsing errors; using alternate punctuation prevents unexpected behavior.
How do I represent multiple lines inside a node?
Insert <br> where you want a line break; do not include literal newlines in the label.