
mermaid-diagramming
Mermaid diagram creation covering flowcharts, sequence diagrams, ERDs, state machines, Gantt charts, and architecture views. Use when creating or updating technical diagrams in documentation.
- Installs
- 105
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/nickcrew/claude-cortex --skill mermaid-diagramming- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads mermaid-diagramming automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Mermaid Diagramming
Create clear, professional Mermaid diagrams for technical documentation. Covers all major diagram types with both basic and styled variants, rendering guidance, and export recommendations.
When to Use This Skill
- Creating flowcharts for process documentation or decision trees
- Drawing sequence diagrams for API interactions or system communication
- Building ERDs for database schema documentation
- Designing state machine diagrams for workflow states
- Producing Gantt charts for project timelines
- Documenting system architecture with C4 or network diagrams
- Adding visual aids to README files, ADRs, or design docs
Quick Reference
| Resource | Purpose | Load when |
|---|---|---|
references/diagram-types.md | Syntax, patterns, and code examples for every Mermaid diagram type | Choosing or building a diagram |
Workflow Overview
Phase 1: Scope → Identify what to visualize, audience, and diagram type
Phase 2: Draft → Write base Mermaid code with correct syntax
Phase 3: Style → Add theming, colors, and accessibility annotations
Phase 4: Deliver → Provide rendering instructions and suggest iterations
Phase 1: Scope
Before writing any code, clarify:
- What is the narrative? The diagram should tell a story or answer a question.
- Who is the audience? Developers need detail; stakeholders need overview.
- What entities and relationships exist? List nodes and edges before drawing.
- Which diagram type fits? Use the selection guide below.
Diagram Type Selection
| If you need to show... | Use |
|---|---|
| Process flow, decisions, branching | flowchart |
| Interactions over time between systems/actors | sequenceDiagram |
| Data model and relationships | erDiagram |
| Object structure and inheritance | classDiagram |
| States and transitions | stateDiagram-v2 |
| Project schedule and dependencies | gantt |
| Proportions or distribution | pie |
| Hierarchical idea mapping | mindmap |
| Events over time | timeline |
| System architecture layers | C4 context/container diagrams |
| Code version history | gitGraph |
| User experience flow | journey |
Phase 2: Draft
Structure Rules
- One concept per diagram — split complex systems into multiple views
- Limit nodes — keep under 15 nodes per diagram; split if larger
- Meaningful labels — use descriptive text, not single letters
- Consistent direction — prefer top-to-bottom (
TB) or left-to-right (LR) - Group related nodes — use
subgraphto cluster related elements
Code Conventions
%% Always start with a comment describing the diagram's purpose
%% Use consistent quoting for labels with special characters
flowchart LR
A["User Request"] --> B{"Auth Check"}
B -->|Valid| C["Process Request"]
B -->|Invalid| D["Return 401"]
- Use double quotes for labels containing special characters
- Add comments (
%%) explaining non-obvious relationships - Prefer
-->for solid lines,-.->for dashed,==>for thick - Use descriptive edge labels:
-->|"reason"| TargetNode
Phase 3: Style
Theming
Apply consistent styling using %%{init: ...}%% directives:
%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#4A90D9'}}}%%
flowchart TB
A["Start"] --> B["End"]
Node Styling
flowchart LR
A["Normal"]
B["Highlighted"]:::highlight
classDef highlight fill:#f9f,stroke:#333,stroke-width:2px
Accessibility
- Use high-contrast color combinations
- Do not rely on color alone to convey meaning — add labels and shapes
- Include alt text when embedding:
 - Provide a text summary alongside complex diagrams
Phase 4: Deliver
Always Provide
- Basic version — clean, unstyled diagram that renders anywhere
- Styled version — themed variant with colors and emphasis
- Rendering note — where to preview (GitHub, Mermaid Live, VS Code extension)
- Suggestions — complementary diagrams or next iterations
Rendering Options
| Platform | Support |
|---|---|
| GitHub markdown | Native rendering in .md files |
| GitLab markdown | Native rendering |
| Mermaid Live Editor | https://mermaid.live for interactive editing |
| VS Code | Mermaid extension for preview |
| Docusaurus / MkDocs | Plugin-based rendering |
Export Formats
- SVG: Best for web and docs (scalable, searchable text)
- PNG: Fallback for platforms without Mermaid support
- PDF: For print or formal documentation
Best Practices
- Start simple — get the structure right before adding style
- Test rendering — verify on the target platform before committing
- Version diagrams — update diagrams when the underlying system changes
- Colocate with docs — keep diagrams in the same directory as related documentation
- Use subgraphs — group related nodes to reduce visual complexity
Anti-Patterns
- Putting too many nodes in one diagram (split at 15+ nodes)
- Using single-letter node IDs without labels
- Relying on color alone to convey meaning
- Hard-coding pixel widths that break on different renderers
- Leaving diagrams out of date after system changes
FAQ
What does the mermaid-diagramming skill do?
Mermaid diagram creation covering flowcharts, sequence diagrams, ERDs, state machines, Gantt charts, and architecture views. Use when creating or updating technical diagrams in documentation.
How do I install mermaid-diagramming?
Run npx skills add https://github.com/nickcrew/claude-cortex --skill mermaid-diagramming in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/mermaid-diagramming/ (personal) or .claude/skills/mermaid-diagramming/ (project).
Which AI agents can use mermaid-diagramming?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is mermaid-diagramming safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains mermaid-diagramming?
It is published by nickcrew in nickcrew/claude-cortex. It has 105 recorded installs.
More from nickcrew/claude-cortex
react-performance-optimization
nickcrew/claude-cortex
React performance optimization patterns using memoization, code splitting, and efficient rendering strategies. Use when optimizing slow React applications, reducing bundle size, or improving user experience with large datasets.
owasp-top-10
nickcrew/claude-cortex
OWASP Top 10 security vulnerabilities with detection and remediation patterns. Use when conducting security audits, implementing secure coding practices, or reviewing code for common security vulnerabilities.
ui-design-aesthetics
nickcrew/claude-cortex
Generates high-quality, non-generic UI designs with a focus on performance, progressive disclosure, and distinctive aesthetics.
threat-modeling-techniques
nickcrew/claude-cortex
Threat modeling methodologies using STRIDE, attack trees, and risk assessment for proactive security analysis. Use when designing secure systems, conducting security reviews, or identifying potential attack vectors in applications.
token-efficiency
nickcrew/claude-cortex
Compressed communication using symbols and abbreviations. Use when context is limited or brevity is needed.
helm-chart-patterns
nickcrew/claude-cortex
Helm chart development patterns for packaging and deploying Kubernetes applications. Use when creating reusable Helm charts, managing multi-environment deployments, or building application catalogs for Kubernetes.
Popular docs & writing skills
grill-with-docs
mattpocock/skills
A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.
lark-markdown
open.feishu.cn
飞书 Markdown:查看、创建、上传、编辑和比较飞书中的原生 Markdown 文件。当用户要操作飞书 Markdown 文件,或比较其远端版本及本地草稿时使用。纯本地 Markdown 文件操作不触发本 skill。不负责将 Markdown 导入为飞书在线文档,也不负责文件搜索、权限、评论、移动、删除等云空间管理操作。
writing-beats
mattpocock/skills
Writing, exploit; assemble raw material into a journey of beats, grounding each term before a beat leans on it.
writing-shape
mattpocock/skills
Writing, exploit: shape raw material into an article, paragraph by paragraph.
writing-fragments
mattpocock/skills
Writing, explore: mine raw fragments, no structure yet.
writing-for-agents
mattpocock/skills
Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.