mermaid-diagrams by ccheney/robust-skills
npx skills add https://github.com/ccheney/robust-skills --skill mermaid-diagrams在 Markdown 中生成可在 GitHub、GitLab、VS Code、Obsidian、Notion 中渲染的图表。
```mermaid
flowchart LR
A[开始] --> B{决策}
B -->|是| C[操作]
B -->|否| D[结束]
```
要可视化什么?
├─ 流程、算法、决策流 → flowchart
├─ API 调用、服务交互 → sequenceDiagram
├─ 数据库表、关系 → erDiagram
├─ 面向对象编程、类型层次结构、领域模型 → classDiagram
├─ 状态机、生命周期 → stateDiagram-v2
├─ 系统架构、服务 → flowchart + subgraphs (或 C4Context)
├─ 项目时间线、冲刺 → gantt
├─ 用户体验、痛点 → journey
├─ Git 分支 → gitGraph
├─ 数据分布 → pie
└─ 优先级矩阵 → quadrantChart
| 类型 | 声明 | 最适合 |
|---|---|---|
| 流程图 | flowchart LR/TB |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 流程、决策、数据流 |
| 序列图 | sequenceDiagram | API 流程、服务调用 |
| 实体关系图 | erDiagram | 数据库模式 |
| 类图 | classDiagram | 类型、领域模型 |
| 状态图 | stateDiagram-v2 | 状态机 |
| 甘特图 | gantt | 项目时间线 |
| 旅程图 | journey | 用户体验 |
| C4图 | C4Context | 系统架构 |
| Git图 | gitGraph | 分支可视化 |
flowchart LR
subgraph 客户端
浏览器 & 移动端
end
subgraph 服务
API --> 认证 & 核心
end
subgraph 数据
DB[(PostgreSQL)]
end
客户端 --> API
核心 --> DB
sequenceDiagram
autonumber
客户端->>+API: POST /orders
API->>认证: 验证
认证-->>API: 通过
API->>+DB: 插入
DB-->>-API: ID
API-->>-客户端: 201 已创建
erDiagram
用户 ||--o{ 订单 : 创建
订单 ||--|{ 订单项 : 包含
用户 { uuid id PK; string email UK }
订单 { uuid id PK; uuid user_id FK }
stateDiagram-v2
[*] --> 草稿
草稿 --> 已提交 : 提交()
已提交 --> 已批准 : 批准()
已提交 --> 已拒绝 : 拒绝()
已批准 --> [*]
[矩形] (圆角矩形) {菱形} [(数据库)] [[子程序]]
((圆形)) >非对称形] {{六边形}}
A --> B # 箭头
A --- B # 线
A -.-> B # 虚线箭头
A ==> B # 粗箭头
A -->|文本| B # 带标签
->> # 实线箭头 (请求)
-->> # 虚线箭头 (响应)
-x # X 结尾 (异步)
-) # 开放箭头
||--|| # 一对一
||--o{ # 一对多
}o--o{ # 多对多
LR 用于流程,TB 用于层次结构| 文件 | 用途 |
|---|---|
| references/FLOWCHARTS.md | 节点、边、子图、样式 |
| references/SEQUENCE.md | 参与者、消息、激活 |
| references/CLASS-ER.md | 类、实体关系图、关系 |
| references/STATE-JOURNEY.md | 状态、用户旅程 |
| references/DATA-CHARTS.md | 甘特图、饼图、时间线、象限图 |
| references/ARCHITECTURE.md | C4图、框图、看板图 |
| references/CHEATSHEET.md | 所有语法速查表 |
每周安装量
61
仓库
GitHub 星标数
22
首次出现
2026年1月21日
安全审计
安装于
github-copilot51
codex50
opencode49
gemini-cli49
cursor45
kimi-cli40
Generate diagrams in markdown that render in GitHub, GitLab, VS Code, Obsidian, Notion.
```mermaid
flowchart LR
A[Start] --> B{Decision}
B -->|Yes| C[Action]
B -->|No| D[End]
```
What to visualize?
├─ Process, algorithm, decision flow → flowchart
├─ API calls, service interactions → sequenceDiagram
├─ Database tables, relationships → erDiagram
├─ OOP, type hierarchy, domain model → classDiagram
├─ State machine, lifecycle → stateDiagram-v2
├─ System architecture, services → flowchart + subgraphs (or C4Context)
├─ Project timeline, sprints → gantt
├─ User experience, pain points → journey
├─ Git branches → gitGraph
├─ Data distribution → pie
└─ Priority matrix → quadrantChart
| Type | Declaration | Best For |
|---|---|---|
| Flowchart | flowchart LR/TB | Processes, decisions, data flow |
| Sequence | sequenceDiagram | API flows, service calls |
| ER | erDiagram | Database schemas |
| Class | classDiagram | Types, domain models |
| State | stateDiagram-v2 | State machines |
| Gantt | gantt | Project timelines |
| Journey | journey | User experience |
| C4 | C4Context | System architecture |
| Git | gitGraph | Branch visualization |
flowchart LR
subgraph Client
Browser & Mobile
end
subgraph Services
API --> Auth & Core
end
subgraph Data
DB[(PostgreSQL)]
end
Client --> API
Core --> DB
sequenceDiagram
autonumber
Client->>+API: POST /orders
API->>Auth: Validate
Auth-->>API: OK
API->>+DB: Insert
DB-->>-API: ID
API-->>-Client: 201 Created
erDiagram
USER ||--o{ ORDER : places
ORDER ||--|{ LINE_ITEM : contains
USER { uuid id PK; string email UK }
ORDER { uuid id PK; uuid user_id FK }
stateDiagram-v2
[*] --> Draft
Draft --> Submitted : submit()
Submitted --> Approved : approve()
Submitted --> Rejected : reject()
Approved --> [*]
[Rectangle] (Rounded) {Diamond} [(Database)] [[Subroutine]]
((Circle)) >Asymmetric] {{Hexagon}}
A --> B # Arrow
A --- B # Line
A -.-> B # Dotted arrow
A ==> B # Thick arrow
A -->|text| B # Labeled
->> # Solid arrow (request)
-->> # Dotted arrow (response)
-x # X end (async)
-) # Open arrow
||--|| # One to one
||--o{ # One to many
}o--o{ # Many to many
LR for flows, TB for hierarchies| File | Purpose |
|---|---|
| references/FLOWCHARTS.md | Nodes, edges, subgraphs, styling |
| references/SEQUENCE.md | Participants, messages, activation |
| references/CLASS-ER.md | Classes, ER diagrams, relationships |
| references/STATE-JOURNEY.md | States, user journeys |
| references/DATA-CHARTS.md | Gantt, Pie, Timeline, Quadrant |
| references/ARCHITECTURE.md | C4, Block, Kanban |
| references/CHEATSHEET.md |
Weekly Installs
61
Repository
GitHub Stars
22
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
github-copilot51
codex50
opencode49
gemini-cli49
cursor45
kimi-cli40
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
122,000 周安装
Aeon 时间序列机器学习工具包:Python 时间序列分类、预测、异常检测与聚类
208 周安装
bioRxiv数据库Python工具:高效搜索下载预印本,支持关键词/作者/日期/类别筛选
209 周安装
LitGPT 大语言模型实现教程:20+预训练模型加载、微调与LoRA训练指南
208 周安装
Railway部署指南:使用railway up命令快速部署代码到Railway云平台
211 周安装
邮件系统工程师最佳实践:提升送达率与反垃圾邮件策略指南
210 周安装
JavaScript/TypeScript 开发实战指南:配置、类型模式与现代编程技巧
208 周安装
| All syntax quick reference |