When to use this skill
ALWAYS use this skill when the user mentions:
- Drawing, creating, generating, making, or building any diagram, chart, or graph
- Visualizing processes, workflows, systems, architectures, or data
- Any request to "画图" (draw diagram), "绘图" (draw chart), "生成图" (generate diagram), "创建图" (create diagram)
- Flowcharts, sequence diagrams, class diagrams, state diagrams, or any diagram type
- Architecture diagrams, system diagrams, or design diagrams
- Data visualization, charts, or graphs
- Process flows, workflows, or business processes
- Project timelines, schedules, or Gantt charts
- User journeys, mindmaps, or hierarchical structures
- Database schemas, ER diagrams, or entity relationships
- Git branching structures or version control diagrams
- Any visual representation or diagrammatic content
Trigger phrases include:
- "画一个图" (draw a diagram), "画流程图" (draw flowchart), "画架构图" (draw architecture diagram)
- "创建一个图表" (create a chart), "生成一个图" (generate a diagram)
- "帮我画" (help me draw), "给我画" (draw for me), "画出来" (draw it out)
- "用图表示" (represent with diagram), "可视化" (visualize), "画个图说明" (draw a diagram to explain)
- "流程图" (flowchart), "时序图" (sequence diagram), "类图" (class diagram), "状态图" (state diagram)
- "架构图" (architecture diagram), "系统图" (system diagram), "设计图" (design diagram)
- "甘特图" (Gantt chart), "思维导图" (mindmap), "时间线" (timeline)
- "用 Mermaid" (use Mermaid), "Mermaid 画图" (draw with Mermaid), "Mermaid 语法" (Mermaid syntax)
- Any mention of "diagram", "chart", "graph", "flowchart", "visualization", "drawing", "Mermaid"
IMPORTANT: Mermaid vs PlantUML - Two Different Diagramming Tools:
Mermaid and PlantUML are two different diagramming tools with different purposes:
Mermaid: A JavaScript-based diagramming tool designed for Markdown documentation. It uses Markdown-inspired syntax and renders directly in Markdown renderers (GitHub, GitLab, wikis, blogs). Best for quick diagrams, Markdown documentation, and simple visualizations.
PlantUML: A component that allows you to create various UML diagrams through simple textual descriptions. It focuses on UML standards and complex system architecture. Best for UML diagrams, enterprise architecture, C4 models, and diagrams requiring precise UML notation.
When both PlantUML and Mermaid skills are matched:
- If the user explicitly mentions "Mermaid" or "Markdown diagram", use this skill (Mermaid)
- If the user explicitly mentions "PlantUML" or "UML diagram", use the PlantUML skill instead
- If the user mentions both or neither, ALWAYS ask the user to choose: "I can create this diagram using either Mermaid or PlantUML. Mermaid is a JavaScript-based tool designed for Markdown documentation and renders directly in GitHub/GitLab. PlantUML is focused on UML diagrams and enterprise architecture. Which would you prefer?"
How to use this skill
CRITICAL: Mermaid is a Markdown-focused diagramming tool. This skill should be triggered when the user explicitly mentions "Mermaid", needs diagrams for Markdown documentation, or wants diagrams that render directly in Markdown renderers (GitHub, GitLab, wikis, blogs).
Trigger this skill when you see:
- User says "用 Mermaid" (use Mermaid), "Mermaid 画图" (draw with Mermaid), "Markdown 图" (Markdown diagram)
- User needs diagrams for Markdown documentation, GitHub, GitLab, wikis, or blogs
- User wants quick diagrams that render directly in Markdown renderers
- User mentions any diagram type for Markdown: flowchart, sequence diagram, class diagram, etc.
- User wants to visualize, represent, or illustrate something with a diagram in Markdown format
When both PlantUML and Mermaid are matched, ALWAYS ask the user to choose the output format or tool, as they are two different diagramming tools with different purposes.
To create a Mermaid diagram:
Identify the diagram type from the user's request:
- Flowchart/flow chart/流程图 →
flowchart or graph
- Sequence diagram/时序图 →
sequenceDiagram
- Class diagram/类图 →
classDiagram
- State diagram/状态图 →
stateDiagram or stateDiagram-v2
- Entity relationship diagram/实体关系图 →
erDiagram
- User journey/用户旅程图 →
journey
- Gantt chart/甘特图 →
gantt
- Pie chart/饼图 →
pie
- Quadrant chart/象限图 →
quadrantChart
- Requirement diagram/需求图 →
requirementDiagram
- Git graph/Git图 →
gitGraph
- C4 diagram/C4图 →
C4Context, C4Container, C4Component, C4Deployment, or C4Dynamic
- Mindmap/思维导图 →
mindmap
- Timeline/时间线图 →
timeline
- ZenUML/禅UML →
zenuml
- Sankey diagram/桑基图 →
sankey
- XY chart/XY图 →
xychart
- Block diagram/方块图 →
block
- Packet diagram/数据包图 →
packet
- Kanban/看板图 →
kanban
- Architecture diagram/架构图 →
architecture-beta (requires Mermaid v11.1.0+)
- Radar chart/雷达图 →
radar-beta (requires Mermaid v11.1.0+)
- Treemap/树状图 →
treemap-beta (requires Mermaid v11.1.0+)
Load the appropriate example file from the examples/ directory:
examples/flowchart.md - For flowcharts and process diagrams
examples/sequence.md - For sequence diagrams showing interactions
examples/class.md - For class diagrams and object-oriented designs
examples/state.md - For state diagrams and state machines
examples/er.md - For entity relationship diagrams
examples/journey.md - For user journey maps
examples/gantt.md - For Gantt charts and project timelines
examples/pie.md - For pie charts
examples/quadrant.md - For quadrant charts
examples/requirement.md - For requirement diagrams
examples/gitgraph.md - For Git branching diagrams
examples/c4.md - For C4 architecture diagrams
examples/mindmap.md - For mindmaps
examples/timeline.md - For timeline diagrams
examples/zenuml.md - For ZenUML diagrams
examples/sankey.md - For Sankey flow diagrams
examples/xychart.md - For XY charts (bar/line charts)
examples/block.md - For block diagrams
examples/packet.md - For packet diagrams
examples/kanban.md - For Kanban boards
examples/architecture.md - For architecture diagrams
examples/radar.md - For radar charts
examples/treemap.md - For treemap diagrams
Follow the specific instructions in that example file for syntax, structure, and best practices
Important Notes:
- Beta diagram types (
architecture-beta, radar-beta, treemap-beta) require Mermaid v11.1.0 or higher
- If the rendering environment doesn't support beta diagram types, use the flowchart alternatives provided in the example files
- Always check the example file for version compatibility notes and alternative syntax options
Generate the Mermaid code wrapped in a Markdown code block with proper syntax highlighting:
IMPORTANT: Always wrap the Mermaid code in a Markdown code block with mermaid language tag. This ensures the format is preserved when users copy the content.
Example format (use actual Mermaid syntax, not placeholders):
flowchart TD
A[Start] --> B[Process]
B --> C[End]
Output Format Requirements:
- Always use triple backticks (```) with
mermaid language tag
- Never output raw Mermaid code without code block markers
- The code block must be complete and properly formatted
- Use actual valid Mermaid syntax, not placeholders like
<diagram-type> or ...diagram content...
- This ensures users can copy the code without losing formatting
Include styling and configuration when needed:
- Use
%%{ init: { theme: 'base' } }%% for theme configuration
- Apply
style directives for node styling
- Use
classDef for reusable style classes
Validate the syntax:
- Ensure all required elements are present
- Check that relationships and connections are properly defined
- Verify date formats for Gantt charts (YYYY-MM-DD)
- Confirm data formats for charts (pie, quadrant, etc.)
- For ER diagrams: Use underscores instead of hyphens in entity names (e.g.,
LINE_ITEM not LINE-ITEM)
- For flowcharts: Avoid using "end" as a node label (use "End" or "END" instead)
- For class diagrams: Escape special characters in labels using backticks
- Check version compatibility for beta diagram types
Save the diagram to project directory:
- Default behavior: When generating a Mermaid diagram, save it to the current project directory
- Recommended locations:
docs/diagrams/ - For documentation diagrams
docs/ - For general documentation
diagrams/ - For standalone diagram files
- Current directory (
.) - If no specific directory structure exists
- File naming: Use descriptive names like
system-architecture.md, user-flow.md, database-schema.md, etc.
- File format: Save as
.md file with the Mermaid code block inside
- Example: If user requests a system architecture diagram, save it as
docs/diagrams/system-architecture.md or diagrams/system-architecture.md
- Ask if needed: If the project structure is unclear, ask the user where they'd like the diagram saved, but default to creating a
docs/ or diagrams/ directory if it doesn't exist
Output Format and File Saving:
When generating a diagram, follow this response structure:
Save the file first: Create the diagram file in the project directory (e.g., docs/diagrams/system-architecture.md)
Inform the user: Tell them where the file was saved
Display the diagram: Show the Mermaid code in a properly formatted Markdown code block with mermaid language tag
Example Response Structure:
- First line: "I've created the Mermaid diagram and saved it to
docs/diagrams/system-architecture.md."
- Then show the diagram wrapped in a code block:
- Start with: three backticks +
mermaid + newline
- Then the Mermaid code
- End with: three backticks + newline
Critical Requirements:
- The Mermaid code block MUST ALWAYS be properly formatted with triple backticks (```) and
mermaid language tag
- NEVER output raw Mermaid code without code block markers
- The code block must be complete (opening and closing backticks)
- This ensures users can copy the code without losing formatting
- Always save the diagram file to the current project directory (default:
docs/diagrams/ or diagrams/)
If the diagram type doesn't match any existing example, refer to the Mermaid documentation or ask the user for clarification about the desired visualization.
Version Compatibility
Some diagram types have specific version requirements:
If a beta diagram type is not supported, the example files provide flowchart alternatives that work with all Mermaid versions.
Best Practices
- Always use code blocks: Wrap all Mermaid code in Markdown code blocks with
mermaid language tag
- Check compatibility: Verify version requirements before using beta diagram types
- Use alternatives: When beta types aren't supported, use the provided flowchart alternatives
- Follow naming conventions: Avoid reserved keywords and special characters in node labels
- Test syntax: Validate diagram syntax before saving to ensure proper rendering
- Organize files: Save diagrams in appropriate directories (
docs/diagrams/ or diagrams/)
- Use descriptive names: Name diagram files clearly (e.g.,
system-architecture.md, user-flow.md)
Mermaid vs PlantUML - Key Differences
Mermaid (This Skill):
- Purpose: JavaScript-based diagramming tool designed for Markdown documentation
- Main Use Case: Help documentation catch up with development
- Best For:
- Markdown documents, GitHub, GitLab, wikis, blogs
- Quick diagrams that render directly in Markdown renderers
- Simple flowcharts, sequence diagrams, basic charts
- Rapid prototyping and iteration
- When the user explicitly requests Mermaid or needs Markdown-compatible diagrams
PlantUML (Different Skill):
- Purpose: Component for creating various UML diagrams through textual descriptions
- Main Use Case: UML-focused diagramming with emphasis on standard UML notation
- Best For:
- Complex UML diagrams requiring precise notation (class, component, deployment diagrams)
- Enterprise architecture diagrams and C4 model diagrams
- Standard UML compliance requirements
- Diagrams requiring advanced customization, styling, or layout control
- When the user explicitly requests PlantUML or UML diagrams
When Both Skills Are Matched:
- ALWAYS ask the user to choose: "I can create this diagram using either Mermaid or PlantUML. Mermaid is a JavaScript-based tool designed for Markdown documentation and renders directly in GitHub/GitLab. PlantUML is focused on UML diagrams and enterprise architecture. Which would you prefer?"
- These are two different diagramming tools with different purposes - do not automatically choose one
- If the user explicitly mentions one tool, use that tool
- If the user mentions both or neither, ask the user to choose based on their needs
Keywords
English keywords:
mermaid, diagram, chart, graph, flowchart, flow chart, sequence diagram, class diagram, state diagram, entity relationship, ER diagram, user journey, Gantt chart, pie chart, quadrant chart, requirement diagram, Git graph, C4 diagram, mindmap, timeline, ZenUML, Sankey diagram, XY chart, block diagram, packet diagram, Kanban, architecture diagram, radar chart, treemap, draw, create, generate, make, build, visualize, visualization, drawing, plotting, mapping, schematics, blueprint, design diagram, system diagram, process flow, workflow, data visualization, visual representation
Chinese keywords (中文关键词):
流程图, 时序图, 类图, 状态图, 实体关系图, 用户旅程图, 甘特图, 饼图, 象限图, 需求图, Git图, C4图, 思维导图, 时间线图, 桑基图, XY图, 方块图, 数据包图, 看板图, 架构图, 雷达图, 树状图, 画图, 绘图, 生成图, 创建图, 制作图, 画流程图, 画架构图, 画时序图, 画类图, 画状态图, 画甘特图, 画思维导图, 画时间线, 可视化, 图表, 图形, 示意图, 设计图, 系统图, 流程图, 架构图, 时序图, 类图, 状态图, 甘特图, 思维导图, 时间线, 用图表示, 画出来, 给我画, 帮我画, 画一个, 创建一个图, 生成一个图, 画个图说明, 用图表展示, 可视化展示
1---2name: mermaid-23description: Provides comprehensive guidance for creating Mermaid diagrams. Mermaid is a JavaScript-based diagramming and charting tool that uses Markdown-inspired text definitions and a renderer to create and modify complex diagrams. The main purpose of Mermaid is to help documentation catch up with development. Mermaid is particularly well-suited for use in Markdown documents, GitHub, GitLab, wikis, blogs, and other Markdown-based platforms. Use when the user wants to draw, create, generate, make, build, or visualize any diagram, chart, graph, flowchart, architecture diagram, sequence diagram, class diagram, state diagram, Gantt chart, mindmap, timeline, or any other visual diagram in Markdown-friendly format. This skill covers all 23+ Mermaid diagram types including flowcharts, sequence diagrams, class diagrams, state diagrams, ER diagrams, Gantt charts, pie charts, quadrant charts, Git graphs, C4 diagrams, mindmaps, timelines, and more. Always use this skill when the user mentions Mermaid, needs diagrams for Markdown 4license: Complete terms in LICENSE.txt5---6
7## When to use this skill
8
9**ALWAYS use this skill when the user mentions:**
10- Drawing, creating, generating, making, or building any diagram, chart, or graph
11- Visualizing processes, workflows, systems, architectures, or data
12- Any request to "画图" (draw diagram), "绘图" (draw chart), "生成图" (generate diagram), "创建图" (create diagram)
13- Flowcharts, sequence diagrams, class diagrams, state diagrams, or any diagram type
14- Architecture diagrams, system diagrams, or design diagrams
15- Data visualization, charts, or graphs
16- Process flows, workflows, or business processes
17- Project timelines, schedules, or Gantt charts
18- User journeys, mindmaps, or hierarchical structures
19- Database schemas, ER diagrams, or entity relationships
20- Git branching structures or version control diagrams
21- Any visual representation or diagrammatic content
22
23**Trigger phrases include:**
24- "画一个图" (draw a diagram), "画流程图" (draw flowchart), "画架构图" (draw architecture diagram)
25- "创建一个图表" (create a chart), "生成一个图" (generate a diagram)
26- "帮我画" (help me draw), "给我画" (draw for me), "画出来" (draw it out)
27- "用图表示" (represent with diagram), "可视化" (visualize), "画个图说明" (draw a diagram to explain)
28- "流程图" (flowchart), "时序图" (sequence diagram), "类图" (class diagram), "状态图" (state diagram)
29- "架构图" (architecture diagram), "系统图" (system diagram), "设计图" (design diagram)
30- "甘特图" (Gantt chart), "思维导图" (mindmap), "时间线" (timeline)
31- "用 Mermaid" (use Mermaid), "Mermaid 画图" (draw with Mermaid), "Mermaid 语法" (Mermaid syntax)
32- Any mention of "diagram", "chart", "graph", "flowchart", "visualization", "drawing", "Mermaid"
33
34**IMPORTANT: Mermaid vs PlantUML - Two Different Diagramming Tools:**
35
36Mermaid and PlantUML are two different diagramming tools with different purposes:
37
38- **Mermaid**: A JavaScript-based diagramming tool designed for Markdown documentation. It uses Markdown-inspired syntax and renders directly in Markdown renderers (GitHub, GitLab, wikis, blogs). Best for quick diagrams, Markdown documentation, and simple visualizations.
39
40- **PlantUML**: A component that allows you to create various UML diagrams through simple textual descriptions. It focuses on UML standards and complex system architecture. Best for UML diagrams, enterprise architecture, C4 models, and diagrams requiring precise UML notation.
41
42**When both PlantUML and Mermaid skills are matched:**
43- If the user explicitly mentions "Mermaid" or "Markdown diagram", use this skill (Mermaid)
44- If the user explicitly mentions "PlantUML" or "UML diagram", use the PlantUML skill instead
45- If the user mentions both or neither, **ALWAYS ask the user to choose**: "I can create this diagram using either Mermaid or PlantUML. Mermaid is a JavaScript-based tool designed for Markdown documentation and renders directly in GitHub/GitLab. PlantUML is focused on UML diagrams and enterprise architecture. Which would you prefer?"
46
47## How to use this skill
48
49**CRITICAL: Mermaid is a Markdown-focused diagramming tool. This skill should be triggered when the user explicitly mentions "Mermaid", needs diagrams for Markdown documentation, or wants diagrams that render directly in Markdown renderers (GitHub, GitLab, wikis, blogs).**
50
51**Trigger this skill when you see:**
52- User says "用 Mermaid" (use Mermaid), "Mermaid 画图" (draw with Mermaid), "Markdown 图" (Markdown diagram)
53- User needs diagrams for Markdown documentation, GitHub, GitLab, wikis, or blogs
54- User wants quick diagrams that render directly in Markdown renderers
55- User mentions any diagram type for Markdown: flowchart, sequence diagram, class diagram, etc.
56- User wants to visualize, represent, or illustrate something with a diagram in Markdown format
57
58**When both PlantUML and Mermaid are matched, ALWAYS ask the user to choose the output format or tool, as they are two different diagramming tools with different purposes.**
59
60To create a Mermaid diagram:
61
621. **Identify the diagram type** from the user's request:
63 - Flowchart/flow chart/流程图 → `flowchart` or `graph`
64 - Sequence diagram/时序图 → `sequenceDiagram`
65 - Class diagram/类图 → `classDiagram`
66 - State diagram/状态图 → `stateDiagram` or `stateDiagram-v2`
67 - Entity relationship diagram/实体关系图 → `erDiagram`
68 - User journey/用户旅程图 → `journey`
69 - Gantt chart/甘特图 → `gantt`
70 - Pie chart/饼图 → `pie`
71 - Quadrant chart/象限图 → `quadrantChart`
72 - Requirement diagram/需求图 → `requirementDiagram`
73 - Git graph/Git图 → `gitGraph`
74 - C4 diagram/C4图 → `C4Context`, `C4Container`, `C4Component`, `C4Deployment`, or `C4Dynamic`
75 - Mindmap/思维导图 → `mindmap`
76 - Timeline/时间线图 → `timeline`
77 - ZenUML/禅UML → `zenuml`
78 - Sankey diagram/桑基图 → `sankey`
79 - XY chart/XY图 → `xychart`
80 - Block diagram/方块图 → `block`
81 - Packet diagram/数据包图 → `packet`
82 - Kanban/看板图 → `kanban`
83 - Architecture diagram/架构图 → `architecture-beta` (requires Mermaid v11.1.0+)
84 - Radar chart/雷达图 → `radar-beta` (requires Mermaid v11.1.0+)
85 - Treemap/树状图 → `treemap-beta` (requires Mermaid v11.1.0+)
86
872. **Load the appropriate example file** from the `examples/` directory:
88 - `examples/flowchart.md` - For flowcharts and process diagrams
89 - `examples/sequence.md` - For sequence diagrams showing interactions
90 - `examples/class.md` - For class diagrams and object-oriented designs
91 - `examples/state.md` - For state diagrams and state machines
92 - `examples/er.md` - For entity relationship diagrams
93 - `examples/journey.md` - For user journey maps
94 - `examples/gantt.md` - For Gantt charts and project timelines
95 - `examples/pie.md` - For pie charts
96 - `examples/quadrant.md` - For quadrant charts
97 - `examples/requirement.md` - For requirement diagrams
98 - `examples/gitgraph.md` - For Git branching diagrams
99 - `examples/c4.md` - For C4 architecture diagrams
100 - `examples/mindmap.md` - For mindmaps
101 - `examples/timeline.md` - For timeline diagrams
102 - `examples/zenuml.md` - For ZenUML diagrams
103 - `examples/sankey.md` - For Sankey flow diagrams
104 - `examples/xychart.md` - For XY charts (bar/line charts)
105 - `examples/block.md` - For block diagrams
106 - `examples/packet.md` - For packet diagrams
107 - `examples/kanban.md` - For Kanban boards
108 - `examples/architecture.md` - For architecture diagrams
109 - `examples/radar.md` - For radar charts
110 - `examples/treemap.md` - For treemap diagrams
111
1123. **Follow the specific instructions** in that example file for syntax, structure, and best practices
113
114 **Important Notes**:
115 - Beta diagram types (`architecture-beta`, `radar-beta`, `treemap-beta`) require Mermaid v11.1.0 or higher
116 - If the rendering environment doesn't support beta diagram types, use the flowchart alternatives provided in the example files
117 - Always check the example file for version compatibility notes and alternative syntax options
118
1194. **Generate the Mermaid code** wrapped in a Markdown code block with proper syntax highlighting:
120
121 **IMPORTANT**: Always wrap the Mermaid code in a Markdown code block with `mermaid` language tag. This ensures the format is preserved when users copy the content.
122
123 **Example format** (use actual Mermaid syntax, not placeholders):
124 ```mermaid
125 flowchart TD
126 A[Start] --> B[Process]
127 B --> C[End]
128 ```
129
130 **Output Format Requirements**:
131 - Always use triple backticks (```) with `mermaid` language tag
132 - Never output raw Mermaid code without code block markers
133 - The code block must be complete and properly formatted
134 - Use actual valid Mermaid syntax, not placeholders like `<diagram-type>` or `...diagram content...`
135 - This ensures users can copy the code without losing formatting
136
1375. **Include styling and configuration** when needed:
138 - Use `%%{ init: { theme: 'base' } }%%` for theme configuration
139 - Apply `style` directives for node styling
140 - Use `classDef` for reusable style classes
141
1426. **Validate the syntax**:
143 - Ensure all required elements are present
144 - Check that relationships and connections are properly defined
145 - Verify date formats for Gantt charts (YYYY-MM-DD)
146 - Confirm data formats for charts (pie, quadrant, etc.)
147 - For ER diagrams: Use underscores instead of hyphens in entity names (e.g., `LINE_ITEM` not `LINE-ITEM`)
148 - For flowcharts: Avoid using "end" as a node label (use "End" or "END" instead)
149 - For class diagrams: Escape special characters in labels using backticks
150 - Check version compatibility for beta diagram types
151
1527. **Save the diagram to project directory**:
153 - **Default behavior**: When generating a Mermaid diagram, save it to the current project directory
154 - **Recommended locations**:
155 - `docs/diagrams/` - For documentation diagrams
156 - `docs/` - For general documentation
157 - `diagrams/` - For standalone diagram files
158 - Current directory (`.`) - If no specific directory structure exists
159 - **File naming**: Use descriptive names like `system-architecture.md`, `user-flow.md`, `database-schema.md`, etc.
160 - **File format**: Save as `.md` file with the Mermaid code block inside
161 - **Example**: If user requests a system architecture diagram, save it as `docs/diagrams/system-architecture.md` or `diagrams/system-architecture.md`
162 - **Ask if needed**: If the project structure is unclear, ask the user where they'd like the diagram saved, but default to creating a `docs/` or `diagrams/` directory if it doesn't exist
163
164**Output Format and File Saving**:
165
166When generating a diagram, follow this response structure:
167
1681. **Save the file first**: Create the diagram file in the project directory (e.g., `docs/diagrams/system-architecture.md`)
169
1702. **Inform the user**: Tell them where the file was saved
171
1723. **Display the diagram**: Show the Mermaid code in a properly formatted Markdown code block with `mermaid` language tag
173
174**Example Response Structure**:
175- First line: "I've created the Mermaid diagram and saved it to `docs/diagrams/system-architecture.md`."
176- Then show the diagram wrapped in a code block:
177 - Start with: three backticks + `mermaid` + newline
178 - Then the Mermaid code
179 - End with: three backticks + newline
180
181**Critical Requirements**:
182- The Mermaid code block MUST ALWAYS be properly formatted with triple backticks (```) and `mermaid` language tag
183- NEVER output raw Mermaid code without code block markers
184- The code block must be complete (opening and closing backticks)
185- This ensures users can copy the code without losing formatting
186- Always save the diagram file to the current project directory (default: `docs/diagrams/` or `diagrams/`)
187
188If the diagram type doesn't match any existing example, refer to the Mermaid documentation or ask the user for clarification about the desired visualization.
189
190## Version Compatibility
191
192Some diagram types have specific version requirements:
193
194- **Beta diagram types** (require Mermaid v11.1.0+):
195 - `architecture-beta` - Architecture diagrams
196 - `radar-beta` - Radar charts
197 - `treemap-beta` - Treemap diagrams
198
199- **Advanced features** (require specific versions):
200 - Participant types with JSON configuration: Mermaid v10.0.0+
201 - Actor creation/destruction: Mermaid v10.3.0+
202 - Edge IDs and curve styles: Mermaid v11.10.0+
203 - New shapes with `@{}` syntax: Mermaid v11.3.0+
204
205If a beta diagram type is not supported, the example files provide flowchart alternatives that work with all Mermaid versions.
206
207## Best Practices
208
2091. **Always use code blocks**: Wrap all Mermaid code in Markdown code blocks with `mermaid` language tag
2102. **Check compatibility**: Verify version requirements before using beta diagram types
2113. **Use alternatives**: When beta types aren't supported, use the provided flowchart alternatives
2124. **Follow naming conventions**: Avoid reserved keywords and special characters in node labels
2135. **Test syntax**: Validate diagram syntax before saving to ensure proper rendering
2146. **Organize files**: Save diagrams in appropriate directories (`docs/diagrams/` or `diagrams/`)
2157. **Use descriptive names**: Name diagram files clearly (e.g., `system-architecture.md`, `user-flow.md`)
216
217## Mermaid vs PlantUML - Key Differences
218
219**Mermaid (This Skill):**
220- **Purpose**: JavaScript-based diagramming tool designed for Markdown documentation
221- **Main Use Case**: Help documentation catch up with development
222- **Best For**:
223 - Markdown documents, GitHub, GitLab, wikis, blogs
224 - Quick diagrams that render directly in Markdown renderers
225 - Simple flowcharts, sequence diagrams, basic charts
226 - Rapid prototyping and iteration
227 - When the user explicitly requests Mermaid or needs Markdown-compatible diagrams
228
229**PlantUML (Different Skill):**
230- **Purpose**: Component for creating various UML diagrams through textual descriptions
231- **Main Use Case**: UML-focused diagramming with emphasis on standard UML notation
232- **Best For**:
233 - Complex UML diagrams requiring precise notation (class, component, deployment diagrams)
234 - Enterprise architecture diagrams and C4 model diagrams
235 - Standard UML compliance requirements
236 - Diagrams requiring advanced customization, styling, or layout control
237 - When the user explicitly requests PlantUML or UML diagrams
238
239**When Both Skills Are Matched:**
240- **ALWAYS ask the user to choose**: "I can create this diagram using either Mermaid or PlantUML. Mermaid is a JavaScript-based tool designed for Markdown documentation and renders directly in GitHub/GitLab. PlantUML is focused on UML diagrams and enterprise architecture. Which would you prefer?"
241- These are two different diagramming tools with different purposes - do not automatically choose one
242- If the user explicitly mentions one tool, use that tool
243- If the user mentions both or neither, ask the user to choose based on their needs
244
245## Keywords
246
247**English keywords:**
248mermaid, diagram, chart, graph, flowchart, flow chart, sequence diagram, class diagram, state diagram, entity relationship, ER diagram, user journey, Gantt chart, pie chart, quadrant chart, requirement diagram, Git graph, C4 diagram, mindmap, timeline, ZenUML, Sankey diagram, XY chart, block diagram, packet diagram, Kanban, architecture diagram, radar chart, treemap, draw, create, generate, make, build, visualize, visualization, drawing, plotting, mapping, schematics, blueprint, design diagram, system diagram, process flow, workflow, data visualization, visual representation
249
250**Chinese keywords (中文关键词):**
251流程图, 时序图, 类图, 状态图, 实体关系图, 用户旅程图, 甘特图, 饼图, 象限图, 需求图, Git图, C4图, 思维导图, 时间线图, 桑基图, XY图, 方块图, 数据包图, 看板图, 架构图, 雷达图, 树状图, 画图, 绘图, 生成图, 创建图, 制作图, 画流程图, 画架构图, 画时序图, 画类图, 画状态图, 画甘特图, 画思维导图, 画时间线, 可视化, 图表, 图形, 示意图, 设计图, 系统图, 流程图, 架构图, 时序图, 类图, 状态图, 甘特图, 思维导图, 时间线, 用图表示, 画出来, 给我画, 帮我画, 画一个, 创建一个图, 生成一个图, 画个图说明, 用图表展示, 可视化展示