- Home
- Skills
- Sammcj
- Agentic Coding
- Mermaid Diagrams
mermaid-diagrams_skill
- Python
110
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill sammcj/agentic-coding --skill mermaid-diagrams- SKILL.md1.0 KB
Overview
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.
How this skill works
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.
When to use it
- Creating new Mermaid flowcharts, sequence diagrams, or class diagrams for documentation
- Updating existing Mermaid diagrams to meet style and rendering constraints
- Automatically validating diagrams before committing or publishing documentation
- Converting informal sketches into Mermaid code that renders reliably
- Standardizing diagram styling across multiple repos or teams
Best practices
- Do not use round brackets () inside any node or label text; use alternate phrasing or hyphens
- Use <br> for intentional line breaks inside labels instead of literal newlines
- Avoid unordered lists inside node labels; use single-line or <br> separated items
- Apply the provided classDef color theme to nodes for consistent visual language
- Keep labels short and focused; break long labels with <br> for clarity
- Validate diagrams in the target renderer to confirm classDef styles apply
Example use cases
- Turn a hand-drawn service interaction into a Mermaid sequence diagram with standardized colors
- Refactor a complex flowchart to remove parentheses, replace newlines with <br>, and improve readability
- Lint Mermaid files in a CI pipeline to prevent rendering errors before documentation release
- Create a consistent set of component diagrams that reuse the provided classDef styles
- Update contributor-submitted diagrams to match project visual and syntax conventions
FAQ
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.