mermaid-diagrams · davila7 — Claude Code skill: text-based software diagrams
A skill that teaches your agent Mermaid syntax: class, sequence, ERD, C4 and flowchart diagrams. Useful when you need to document architecture or a database schema.
npx claude-code-templates@latest --skill creative-design/mermaid-diagramsWhat mermaid-diagrams does
The skill gives the agent a guide to Mermaid syntax and helps pick the right diagram type for the job. It covers class diagrams for domain modeling, sequence diagrams for API and auth flows, flowcharts for algorithms and user journeys, ERDs for database schemas, and C4 diagrams at context, container and component levels. State diagrams, git graphs, Gantt charts and pie charts are in there too.
The structure is simple: the first line declares the diagram type, the rest is the definition. Comments start with %%. Unknown words break a diagram, while wrong parameters fail silently — so validate syntax in Mermaid Live Editor before committing it. Reference files ship alongside: references/class-diagrams.md, references/sequence-diagrams.md, references/flowcharts.md, references/erd-diagrams.md, references/c4-diagrams.md and references/advanced-features.md.
Theming and layout go through frontmatter. Themes are default, forest, dark, neutral and base; layout is dagre or elk; look is classic or handDrawn. Storing .mmd files next to the code pays off, since GitHub and GitLab render Mermaid in Markdown. For PNG or SVG export there is Mermaid CLI: npm install -g @mermaid-js/mermaid-cli, then mmdc -i input.mmd -o output.png.
What it helps with
- map a database schema as an ERD before a migration
- show an API request flow as a sequence diagram
- break a system down into C4 container levels
- draw a flowchart for a user journey
- document a branching strategy as a git graph
Example prompts for the agent
- draw a sequence diagram for the login flow through the API
- create an ERD for the USER, ORDER and LINE_ITEM tables
- show the service architecture as a C4 container diagram
How to install mermaid-diagrams
1claude-code-templates
npx claude-code-templates@latest --skill creative-design/mermaid-diagrams2Skills CLI (Vercel)
npx skills add davila7/claude-code-templates --skill mermaid-diagrams -a claude-code3Manually: put the files in place
~/.claude/skills/mermaid-diagrams/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/mermaid-diagrams/
Manually: put the files in place
.agents/skills/mermaid-diagrams/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/mermaid-diagrams/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install davila7/claude-code-templates mermaid-diagrams2Manually: put the files in place
.github/skills/mermaid-diagrams/SKILL.mdPlatform CLI
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/creative-design/mermaid-diagramsManually: put the files in place
.devin/skills/mermaid-diagrams/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about mermaid-diagrams
How do I install mermaid-diagrams in Claude?
Use the templates CLI: npx claude-code-templates@latest --skill creative-design/mermaid-diagrams. Or run npx skills add davila7/claude-code-templates --skill mermaid-diagrams -a claude-code. The skill file lands at ~/.claude/skills/mermaid-diagrams/SKILL.md.
What does mermaid-diagrams do?
It hands the agent a Mermaid syntax guide and helps choose the right diagram type: class, sequence, flowchart, ERD, C4, state, git graph, Gantt or pie chart.
Where do these diagrams render?
GitHub and GitLab render Mermaid inside Markdown, VS Code needs the Markdown Mermaid extension, and Notion, Obsidian and Confluence support it too. Mermaid CLI handles PNG or SVG export.
Similar skills
Everything for Writing and docs →mermaid-diagrams by other authors comes first.