skills/mermaid-diagram-guide/SKILL.md
Reference guide for Mermaid diagram syntax covering all major diagram types used in software engineering. Use when creating or writing mermaid diagrams, asking "how do I write a mermaid X diagram", "what is the syntax for mermaid", "create a sequence/flowchart/class/ER/gantt/state/C4/architecture diagram in mermaid", or "help me with mermaid". Do NOT use for rendering diagrams or non-mermaid diagram tools.
npx skillsauth add armandli/get-skilled mermaid-diagram-guideInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
To validate a diagram, write its content (without markdown fences) to a .mmd file. A PostToolUse
hook will automatically run mmdc -i <file> -o <tmp>.svg and feed any syntax errors back so you can
fix them. If mmdc is not installed, validation is skipped; the user can install it with:
npm install -g @mermaid-js/mermaid-cli
Mermaid diagrams are declared with a diagram type keyword followed by content. All diagrams can be embedded in markdown with triple-backtick fences:
```mermaid
<diagram-type>
<content>
```
| Diagram | Keyword | Best For |
|---------|---------|----------|
| Flowchart | flowchart | Processes, workflows, decision trees |
| Sequence | sequenceDiagram | Inter-service/actor message flows |
| Class | classDiagram | OOP structure, data models |
| ER | erDiagram | Database schemas |
| State | stateDiagram-v2 | State machines, lifecycle |
| Gantt | gantt | Project timelines |
| Requirement | requirementDiagram | System requirements (SysML) |
| C4 | C4Context / C4Container / C4Component | Software architecture |
| ZenUML | zenuml | Alternative sequence syntax |
| Mindmap | mindmap | Brainstorming, hierarchical ideas |
| Architecture | architecture-beta | Infrastructure, system components |
| Kanban | kanban | Task boards |
| Block | block-beta | Component layout |
| Packet | packet-beta | Network packet structure |
| Treemap | treemap-beta | Hierarchical data proportions |
| TreeView | treeView-beta | Directory/file trees |
For complete syntax details on each diagram type, see:
tools
--- name: update-readme description: Updates a project README.md with build instructions, unit test instructions, and a mermaid architecture diagram. Use when a project README needs to be created or refreshed. Trigger phrases: "update readme", "generate readme", "create readme", "refresh readme docs". Emphasizes project interfaces, extension points, and customization hooks in the diagram — not concrete implementations. Do NOT use for documentation sites, wikis, or non-project READMEs. argument-h
business
--- name: skill-stat description: Records skill usage statistics and issue reports into .claude/skill-stats.md. Increments the Uses count for a skill name, and optionally logs an issue report that increments the Issues count and appends a row to the Issue Reports table. Use when tracking how often a skill is invoked, when a user reports a problem with a skill, or when another skill needs to log its own usage. Trigger phrases: "record skill stat", "log skill usage", "report skill issue". Do NOT u
testing
--- name: revert description: Reverts ALL git changes in the working directory: staged changes, unstaged modifications, and new untracked files. Use when user asks to "revert all changes", "undo all changes", "discard all changes", "reset all git changes", or "clean working directory". Do NOT use for reverting a specific file or a specific commit — those need targeted git commands. disable-model-invocation: true --- Revert all git changes in the working directory. This is destructive and cannot
tools
Scans a Python codebase for duplicate or near-duplicate logic patterns across functions, classes, and files, then extracts those patterns into typed utility classes in a shared module. Use when the user asks to "refactor this Python code", "find duplicate logic", "extract shared utilities", "apply DRY to Python", "deduplicate Python code", or "find repeated patterns in Python". Groups extracted helpers by the object type they operate on (strings, numbers, dates, collections, etc.). Do NOT use for performance optimization (use optimize-python), for debugging logic errors, or for explaining code. Do NOT extract code that appears only once. Run this skill before optimize-python.