Create software diagrams using Mermaid syntax. Use when users need to create, visualize, or document software through diagrams including class diagrams, sequence diagrams, flowcharts, ERDs, C4 architecture diagrams, state diagrams, git graphs, and other diagram types. Triggers include requests to diagram, visualize, model, map out, or show the flow of a system.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install mermaid-diagrams或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install mermaid-diagrams⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/mermaid-diagrams/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: mermaid-diagrams model: fast version: 1.0.0 description: > Create software diagrams using Mermaid syntax. Use when users need to create, visualize, or document software through diagrams including class diagrams, sequence diagrams, flowcharts, ERDs, C4 architecture diagrams, state diagrams, git graphs, and other diagram types. Triggers include requests to diagram, visualize, model, map out, or show the flow of a system. tags: [diagrams, mermaid, visualization, architecture, documentation, modeling] ---
Create professional software diagrams using Mermaid's text-based syntax. Mermaid renders diagrams from simple text definitions, making diagrams version-controllable, easy to update, and maintainable alongside code.
npx clawhub@latest install mermaid-diagrams
All Mermaid diagrams follow this pattern:
diagramType
definition content
Key principles:
classDiagram, sequenceDiagram, flowchart)%% for comments| Type | Use For | Reference | |------|---------|-----------| | Class Diagrams | Domain modeling, OOP design, entity relationships | references/class-diagrams.md | | Sequence Diagrams | API flows, auth flows, component interactions | references/sequence-diagrams.md | | Flowcharts | Processes, algorithms, decision trees, user journeys | references/flowcharts.md | | ERD | Database schemas, table relationships, data modeling | references/erd-diagrams.md | | C4 Diagrams | System context, containers, components, architecture | references/c4-diagrams.md | | State Diagrams | State machines, lifecycle states | — | | Git Graphs | Branching strategies | — | | Gantt Charts | Project timelines, scheduling | — |
For styling, themes, and layout options: See references/advanced-features.md
classDiagram
Title -- Genre
Title *-- Season
Title *-- Review
User --> Review : creates
class Title {
+string name
+int releaseYear
+play()
}
class Genre {
+string name
+getTopTitles()
}
sequenceDiagram
participant User
participant API
participant Database
User->>API: POST /login
API->>Database: Query credentials
Database-->>API: Return user data
alt Valid credentials
API-->>User: 200 OK + JWT token
else Invalid credentials
API-->>User: 401 Unauthorized
end
flowchart TD
Start([User visits site]) --> Auth{Authenticated?}
Auth -->|No| Login[Show login page]
Auth -->|Yes| Dashboard[Show dashboard]
Login --> Creds[Enter credentials]
Creds --> Validate{Valid?}
Validate -->|Yes| Dashboard
Validate -->|No| Error[Show error]
Error --> Login
erDiagram
USER ||--o{ ORDER : places
ORDER ||--|{ LINE_ITEM : contains
PRODUCT ||--o{ LINE_ITEM : includes
USER {
int id PK
string email UK
string name
datetime created_at
}
ORDER {
int id PK
int user_id FK
decimal total
datetime created_at
}
%% comments to explain complex relationships.mmd files alongside code for easy updatesConfigure diagrams using frontmatter:
---
config:
theme: base
themeVariables:
primaryColor: "#ff6b6b"
---
flowchart LR
A --> B
Available themes: default, forest, dark, neutral, base
Layout options:
layout: dagre (default) — classic balanced layoutlayout: elk — advanced layout for complex diagramsLook options:
look: classic — traditional Mermaid stylelook: handDrawn — sketch-like appearanceNative support in:
Export options:
npm install -g @mermaid-js/mermaid-cli then mmdc -i input.mmd -o output.pngAlways diagram when:
Use diagrams to:
{} in comments; escape special characters安装 Mermaid Diagrams 后,可以对 AI 说这些话来触发它
Help me get started with Mermaid Diagrams
Explains what Mermaid Diagrams does, walks through the setup, and runs a quick demo based on your current project
Use Mermaid Diagrams to create software diagrams using Mermaid syntax
Invokes Mermaid Diagrams with the right parameters and returns the result directly in the conversation
What can I do with Mermaid Diagrams in my data & analytics workflow?
Lists the top use cases for Mermaid Diagrams, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/mermaid-diagrams/ 目录(个人级,所有项目可用),或 .claude/skills/mermaid-diagrams/(项目级)。重启 AI 客户端后,用 /mermaid-diagrams 主动调用,或让 AI 根据上下文自动发现并使用。
Mermaid Diagrams 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Mermaid Diagrams 可免费安装使用。请查阅仓库了解许可证信息。
Create software diagrams using Mermaid syntax. Use when users need to create, visualize, or document software through diagrams including class diagrams, sequence diagrams, flowcharts, ERDs, C4 architecture diagrams, state diagrams, git graphs, and other diagram types. Triggers include requests to diagram, visualize, model, map out, or show the flow of a system.
Automate my data & analytics tasks using Mermaid Diagrams
Identifies repetitive steps in your workflow and sets up Mermaid Diagrams to handle them automatically
Mermaid Diagrams 属于「Data & Analytics」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。