mermaid
Skill2 starsChanged 8 months agoMITView on GitHub
Guide for creating mermaid diagrams. This skill should be used when users want to create a mermaid diagram (or update an existing diagram).
44 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- lulufoo/lulu-boardtheir own version, first seen Nov 8, 2026
- chrislacey89/skillstheir own version, first seen Nov 4, 2026
- puncsky/system-design-and-architecturetheir own version, first seen Nov 2, 2026
- lulufoo/lulu-drawertheir own version, first seen Nov 1, 2026
- Voronenko/ai-filestheir own version, first seen Nov 1, 2026
- bex-co/bextheir own version, first seen Oct 28, 2026
Used with
Projects with it also use plantuml, ship and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
xenodiumSkillplantuml
This skill should be used when the user invokes "/plantuml" to create a diagram from the current context using PlantUML and output the resulting image path.
Also in 3 projects that use this
AWSSkillship
Finalize dev work on an issue branch — update docs, push, and open a PR.
Also in 4 projects that use this
SentrySkillcommit
Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.
Also in 4 projects that use this
Other versions44 projects use a version of this.
Word for word · 1
- julweber/ai_agent_skills★ 2100% same
Edited · 2
- nilecui/SkillsBase★ 2799% same
- grantkee/claude-extensions★ 299% same
Wrote their own version · 41
- puncsky/system-design-and-architecture★ 3.6ksame name
- alibaba/loongcollector★ 2.2ksame name
- chujianyun/skills★ 751same name
- bex-co/bex★ 576same name
- WH-2099/mermaid-skill★ 268same name
- xenodium/emacs-skills★ 142same name
- mgifford/accessibility-skills★ 48same name
- greedychipmunk/agent-skills★ 24same name
- ulises-jeremias/agent-toolkit★ 19same name
- soujava/agent-skills★ 10same name
31 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository51 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ai-agent-skills-assistantSkill
- ansibleSkill
- artificial-analysisSkill
- cavemanSkill
- claude-cliSkill
- code-doctorSkill
- code-summarizerSkill
- codex-cliSkill
- concourse-ciSkill
- dev-brainstormingSkill
- docker-cliSkill
- file-organizerSkill
- frontend-web-developerSkill
- github-actions-cicdSkill
- github-cliSkill
- gitlab-ci-cdSkill
- grill-meSkill
- gtd-assistantSkill
- herdr-cliSkill
- hf-cliSkill
- karpathy-guidelinesSkill
- kestraSkill
- list-large-filesSkill
- list-most-intensive-processesSkill
- llama-cppSkill
- llm-wikiSkill
- morning-ritualSkill
- obsidian-masterSkill
- obsidian-open-loops-collectorSkill
- opencode-agent-creatorSkill
- opencode-cliSkill
- pi-cliSkill
- pi-subagents-masterSkill
- planka-development-flowSkill
- plnk-cliSkill
- ponytailSkill
- product-prd-brainstormingSkill
- python-api-developerSkill
- ralph-prd-converterSkill
- ralph-prd-generatorSkill
- release-managementSkill
- rest-testsuite-skillSkill
- skill-loaderSkill
- design-taste-frontendSkill
- terraformSkill
- tmux-coderSkill
- tmux-specialistSkill
- trello-cliSkill
- tts-conversationSkill
- uvSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. 0 are common, 21 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 40 edited versions we read keep these.
21
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Follow these steps for every diagram creation/modification:
- Distinctive: line 23
Create syntactically correct Mermaid diagram code
- Distinctive: line 24
Use appropriate diagram type syntax
- Very specific: line 29
Write code to .mmd file
- Distinctive: line 31
Use kebab-case for filenames
- Distinctive: line 35
Check for syntax errors and warnings
- Distinctive: line 36
If validation fails, proceed to step 5
- Distinctive: line 53
Only render when user explicitly requests a preview/image
- Distinctive: line 94
When analyzing code to create diagrams:
- Distinctive: line 124
Use meaningful node IDs
- Distinctive: line 125
Add clear, concise labels
- Distinctive: line 127
Use classDefs for visual consistency
- Distinctive: line 130
Keep diagrams focused (split large diagrams into smaller ones)
- Distinctive: line 131
Use top-to-bottom or left-to-right orientation consistently
- Distinctive: line 132
Add comments in code for complex sections
- Distinctive: line 135
NEVER skip validation step
- Distinctive: line 136
Always fix errors before presenting to user
- Distinctive: line 137
Test rendered output when in doubt
- Very specific: line 141
If mmdc validation fails:
- Distinctive: line 142
Read error message carefully
- Distinctive: line 170
Default output format: SVG
- Distinctive: line 171
Always validate before presenting
- Distinctive: line 173
Only load example files when needed for specific diagram type
“Common” is measured: kept by at least 6 in 10 of the 40 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Mermaid Diagram Skill
This skill helps you create, validate, and render Mermaid diagrams from natural language descriptions, code analysis, or by editing existing diagrams.
Core Workflow
Follow these steps for every diagram creation/modification:
1. Understand the Request
- Identify the diagram type needed (flowchart, sequence, class, etc.)
- Extract key elements: entities, relationships, flow, hierarchy
- Determine if creating new, editing existing, or generating from code
2. Generate Mermaid Code
- Create syntactically correct Mermaid diagram code
- Use appropriate diagram type syntax
- Apply consistent naming and styling
- Refer to
examples/directory for type-specific syntax (load on-demand)
3. Save to File
- Write code to
.mmdfile - Generate meaningful filename based on diagram purpose (e.g.,
user-authentication-flow.mmd,database-schema.mmd) - Use kebab-case for filenames
4. Validate with CLI
- ALWAYS validate using:
mmdc -i <filename>.mmd - Check for syntax errors and warnings
- If validation fails, proceed to step 5
5. Auto-Correct Errors
- Analyze error messages from
mmdc - Common issues:
- Invalid syntax or keywords
- Missing quotes around labels with spaces
- Incorrect arrow syntax
- Malformed node definitions
- Automatically fix the code
- Re-save and re-validate
- Repeat until validation succeeds
6. Render on Request
- Default format: SVG
- Command:
mmdc -i <filename>.mmd -o <filename>.svg - Alternative formats: PNG (
-o <filename>.png), PDF (-o <filename>.pdf) - Only render when user explicitly requests a preview/image
Supported Diagram Types
Load examples from examples/ directory as needed:
Basic Diagrams:
- Flowchart (
examples/flowchart.md) - Sequence Diagram (
examples/sequence.md) - Class Diagram (
examples/class.md) - State Diagram (
examples/state.md) - Entity Relationship (
examples/er.md)
Planning & Management:
- Gantt Chart (
examples/gantt.md) - User Journey (
examples/journey.md) - Timeline (
examples/timeline.md) - Kanban (
examples/kanban.md)
Data Visualization:
- Pie Chart (
examples/pie.md) - XY Chart (
examples/xy-chart.md) - Quadrant Chart (
examples/quadrant.md) - Sankey (
examples/sankey.md) - Radar (
examples/radar.md) - Treemap (
examples/treemap.md)
Technical Diagrams:
- Git Graph (
examples/git.md) - C4 Diagram (
examples/c4.md) - Requirement Diagram (
examples/requirement.md) - Architecture (
examples/architecture.md) - Block Diagram (
examples/block.md) - Packet (
examples/packet.md)
Organizational:
- Mindmap (
examples/mindmap.md) - ZenUML (
examples/zenuml.md)
Code Analysis → Diagram
When analyzing code to create diagrams:
Class Diagrams:
- Extract classes, methods, properties, inheritance, interfaces
- Show relationships: inheritance, composition, aggregation
Sequence Diagrams:
- Track function calls, async operations, API interactions
- Show actors, lifelines, activation boxes
Flowcharts:
- Map control flow, conditionals, loops
- Show function entry/exit points
State Diagrams:
- Identify states from enums, state machines, status fields
- Map transitions and events
Templates
Common patterns available in templates/common-patterns.md (load on-demand):
- Standard flowchart structures
- API sequence patterns
- Database ER patterns
- Microservice architecture layouts
- State machine templates
Best Practices
Styling:
- Use meaningful node IDs
- Add clear, concise labels
- Apply subgraphs for grouping related elements
- Use classDefs for visual consistency
Readability:
- Keep diagrams focused (split large diagrams into smaller ones)
- Use top-to-bottom or left-to-right orientation consistently
- Add comments in code for complex sections
Validation:
- NEVER skip validation step
- Always fix errors before presenting to user
- Test rendered output when in doubt
Error Handling
If mmdc validation fails:
- Read error message carefully
- Identify line number and issue
- Apply fix (common fixes in examples)
- Re-validate
- Inform user only if repeated attempts fail
Output Format
Present to user:
Created: <filename>.mmd
<Show the mermaid code in a code block>
✓ Validated successfully with mermaid-cliIf rendered:
Created: <filename>.mmd
Rendered: <filename>.svg
[Show file paths]Notes
- Assume
mmdc(mermaid-cli) is installed and available - Default output format: SVG
- Always validate before presenting
- Fix errors autonomously
- Only load example files when needed for specific diagram type
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

