Mermaid Diagram
/install mermaid-diagram
Mermaid Diagram Generator
Generate valid Mermaid diagram code from text descriptions.
Diagram Type Selection
| 需求 | 推荐类型 | Mermaid 关键字 |
|---|---|---|
| 业务流程 / 逻辑流程 | Flowchart | flowchart TD |
| 系统交互 / API 时序 | Sequence | sequenceDiagram |
| 产品架构 / 系统结构 | Flowchart / C4 | flowchart LR |
| 状态机 / 用户状态 | State | stateDiagram-v2 |
| 脑图 / 功能树 | Mindmap | mindmap |
| 数据库结构 | ER | erDiagram |
| 项目时间线 | Timeline | timeline |
| 用户旅程 | Journey | journey |
Output Rules
- Always wrap output in
```mermaidcode blocks - Use Chinese labels when the user writes in Chinese
- Add comments (
%%) for complex diagrams to explain sections - Keep node names short (≤10 chars) to avoid layout issues
- Validate syntax mentally before outputting — common mistakes:
- Missing quotes around labels with spaces/Chinese
- Wrong arrow syntax (
-->vs---vs->>) - Unclosed brackets
Quick Syntax Reference
flowchart TD
A[开始] --> B{判断条件}
B -- 是 --> C[执行操作]
B -- 否 --> D[结束]
C --> D
sequenceDiagram
用户->>服务端: 发起请求
服务端->>数据库: 查询数据
数据库-->>服务端: 返回结果
服务端-->>用户: 响应
mindmap
root((产品名))
功能A
子功能1
子功能2
功能B
Reference Files
- references/diagram-patterns.md — 产品经理常用图模式(带完整示例代码)
Read when: user asks for a specific diagram type or needs a complex multi-node diagram.
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install mermaid-diagram - After installation, invoke the skill by name or use
/mermaid-diagram - Provide required inputs per the skill's parameter spec and get structured output
What is Mermaid Diagram?
Generate valid Mermaid diagrams like flowcharts, sequence diagrams, mind maps, ER diagrams, or user journeys from text or product descriptions. It is an AI Agent Skill for Claude Code / OpenClaw, with 1407 downloads so far.
How do I install Mermaid Diagram?
Run "/install mermaid-diagram" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Mermaid Diagram free?
Yes, Mermaid Diagram is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Mermaid Diagram support?
Mermaid Diagram is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Mermaid Diagram?
It is built and maintained by pupujanet-eng (@pupujanet-eng); the current version is v1.0.0.