mermaid-creator by arisng/github-copilot-fc
npx skills add https://github.com/arisng/github-copilot-fc --skill mermaid-creator具备专业指南和代码转图表能力的 Mermaid 图表与文档系统。
本技能工作原理:
用户意图分析:
flowchart TD
Start([User Request]) --> Analyze{Analyze Intent}
Analyze -->|"workflow, process, business logic"| Activity[Load Activity Diagram Guide<br/>references/guides/diagrams/activity-diagrams.md]
Analyze -->|"infrastructure, deployment, cloud"| Deploy[Load Deployment Diagram Guide<br/>references/guides/diagrams/deployment-diagrams.md]
Analyze -->|"system architecture, components"| Arch[Load Architecture Guide<br/>references/guides/diagrams/architecture-diagrams.md]
Analyze -->|"API flow, interactions"| Sequence[Load Sequence Diagram Guide<br/>references/guides/diagrams/sequence-diagrams.md]
Analyze -->|"code to diagram"| CodeToDiag[Load Code-to-Diagram Guide<br/>references/guides/code-to-diagram/ + examples/]
Analyze -->|"design document, full docs"| DesignDoc[Load Design Document Template<br/>assets/*-design-template.md]
Analyze -->|"unicode symbols, icons"| Unicode[Load Unicode Symbols Guide<br/>references/guides/unicode-symbols/guide.md]
Analyze -->|"extract, validate, convert"| Scripts[Use Python Scripts<br/>scripts/extract_mermaid.py<br/>scripts/mermaid_to_image.py]
Activity --> Generate[Generate Diagram]
Deploy --> Generate
Arch --> Generate
Sequence --> Generate
CodeToDiag --> Generate
DesignDoc --> Generate
Unicode --> Generate
Scripts --> Execute[Execute Script]
Generate --> Validate{Validate?}
Validate -->|Yes| RunValidation[Run mmdc validation]
Validate -->|No| Output
RunValidation --> Output[Output Result]
Execute --> Output
classDef decision fill:#FFD700,stroke:#333,stroke-width:2px,color:black
classDef guide fill:#90EE90,stroke:#333,stroke-width:2px,color:darkgreen
classDef action fill:#87CEEB,stroke:#333,stroke-width:2px,color:darkblue
class Analyze,Validate decision
class Activity,Deploy,Arch,Sequence,CodeToDiag,DesignDoc,Unicode,Scripts guide
class Generate,Execute,RunValidation,Output action
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
references/guides/diagrams/)| 指南 | 完整路径 | 当用户需要时加载 | 示例 |
|---|---|---|---|
| 活动图 | references/guides/diagrams/activity-diagrams.md | 工作流、流程、业务逻辑、用户流、决策树 | "展示结账流程"、"记录 ETL 管道"、"创建审批工作流" |
| 部署图 | references/guides/diagrams/deployment-diagrams.md | 基础设施、云架构、K8s、无服务器、网络拓扑 | "展示 AWS 架构"、"记录 GCP 部署"、"创建 K8s 图表" |
| 架构图 | references/guides/diagrams/architecture-diagrams.md | 系统架构、组件设计、高层结构 | "展示系统组件"、"记录微服务"、"架构概览" |
| C4 模型图 | references/guides/diagrams/c4-model.md | 分层架构(上下文、容器、组件、部署) | "C4 上下文"、"C4 容器"、"C4 模型图"、"系统层次结构" |
| 序列图 | references/guides/diagrams/sequence-diagrams.md | API 交互、服务通信、请求/响应流 | "展示 API 调用序列"、"记录认证流程"、"服务交互" |
| 资源 | 完整路径 | 提供内容 |
|---|---|---|
| 主指南 | references/guides/code-to-diagram/README.md | 分析任何代码库并提取图表的完整工作流 |
| Spring Boot | examples/spring-boot/README.md | Controller→Service→Repository 架构、部署配置、方法序列、业务逻辑活动 |
| FastAPI | examples/fastapi/README.md | Python 异步模式、Pydantic 模型、依赖注入、云部署 |
| React | examples/react/README.md | 组件层次结构、状态管理、数据流、构建管道 |
| Python ETL | examples/python-etl/README.md | 数据管道、转换步骤、错误处理、调度 |
| Node/Express | examples/node-webapp/README.md | 中间件链、路由处理器、异步模式、部署 |
| Java Web 应用 | examples/java-webapp/README.md | 传统 MVC、servlet 容器、WAR 部署 |
| 模板 | 完整路径 | 用途 | 加载时机 |
|---|---|---|---|
| 架构设计 | assets/architecture-design-template.md | 全系统架构 | "创建架构文档"、"记录系统设计" |
| API 设计 | assets/api-design-template.md | API 规范 | "API 设计文档"、"记录 REST API" |
| 功能设计 | assets/feature-design-template.md | 功能规划 | "功能设计"、"规划新功能" |
| 数据库设计 | assets/database-design-template.md | 数据库模式 | "数据库设计"、"记录模式" |
| 系统设计 | assets/system-design-template.md | 完整系统 | "系统设计文档"、"完整系统文档" |
完整路径: references/guides/unicode-symbols/guide.md
当用户提及以下内容时加载: "unicode 符号"、"图表中的表情符号"、"语义图标"、"添加符号"
快速参考:
scripts/)| 脚本 | 用途 | 加载时机 |
|---|---|---|
extract_mermaid.py | 从 Markdown 中提取图表、验证语法、替换为图像 | "提取图表"、"验证 mermaid"、"查找所有图表" |
mermaid_to_image.py | 将 .mmd 转换为 PNG/SVG、批量转换、自定义主题 | "转换为图像"、"渲染图表"、"创建 PNG" |
resilient_diagram.py | 完整工作流:保存 .mmd、生成图像、验证、错误恢复 | "生成图表"、"创建带验证的图表"、"稳健图表" |
常见请求模式与指南选择。完整映射请参见"何时使用何种工具"。
| 模式 | 示例请求 | 需加载的指南 |
|---|---|---|
| 单一图表 | "为登录流程创建活动图" | 图表类型指南 + Unicode 符号 |
| 代码转图表 | "从 application.yml 生成部署图" | 框架示例 + 部署指南 |
| 设计文档 | "创建 API 设计文档" | assets/ 中的模板 + 相关图表指南 |
| 提取/验证 | "从 design.md 中提取图表" | 使用 scripts/extract_mermaid.py |
| 批量转换 | "将所有 .mmd 转换为 PNG" | 使用 scripts/mermaid_to_image.py |
关键: 这是所有图表生成的推荐方法。它确保验证、错误恢复和一致的文件组织。
完整指南: references/guides/resilient-workflow.md
flowchart LR
A[1. Identify Type] --> B[2. Save .mmd + Image]
B --> C{3. Valid?}
C -->|Yes| D[4. Add to Markdown]
C -->|No| E[5. Error Recovery]
E --> F{Fix Found?}
F -->|Yes| A
F -->|No| G[Search External]
G --> A
classDef step fill:#90EE90,stroke:#333,color:darkgreen
classDef decision fill:#FFD700,stroke:#333,color:black
class A,B,D,E,G step
class C,F decision
在图表通过验证之前,切勿将其添加到 markdown 中。 这可以防止文档中出现损坏的图表。
# 使用完整错误恢复生成
python scripts/resilient_diagram.py \
--code "flowchart TD; A-->B" \
--markdown-file design_doc \
--diagram-num 1 \
--title "process_flow" \
--format png \
--json
输出: .mmd 和 .png 文件均位于 ./diagrams/ 目录中。
./diagrams/<markdown_file>_<num>_<type>_<title>.mmd
./diagrams/<markdown_file>_<num>_<type>_<title>.png
示例: ./diagrams/api_design_01_sequence_auth_flow.png
当验证失败时,工作流会自动:
references/guides/troubleshooting.md(记录了 28 种错误)perplexity_ask MCP 进行语法问题查询brave_web_search MCP 查找最新解决方案gemini 技能获取替代视角WebSearch 工具作为后备方案如果脚本不可用:
references/guides/diagrams/ 加载参考指南./diagrams/<markdown_file>_<num>_<type>_<title>.mmdmmdc -i file.mmd -o file.png -b transparentreferences/guides/troubleshooting.md 中搜索匹配的错误用户: "创建一个序列图并将其添加到设计文档中"
技能操作:
识别意图:图表生成 + markdown 集成
加载工作流指南:references/guides/resilient-workflow.md
识别图表类型:序列图
加载图表指南:references/guides/diagrams/sequence-diagrams.md
使用模板生成 Mermaid 代码
执行稳健工作流:
python scripts/resilient_diagram.py \
--code "[generated code]" \
--markdown-file design_doc \
--diagram-num 1 \
--title "api_sequence" \
--json
如果验证失败 → 应用故障排除修复 → 重试
成功时 → 将  添加到 markdown
始终使用 Unicode 符号来增强图表的清晰度。常见模式:
graph TB
Client[👤 用户] --> LB[🌐 负载均衡器]
LB --> App1[⚙️ 应用服务器 1]
LB --> App2[⚙️ 应用服务器 2]
App1 --> DB[(💾 数据库)]
App1 --> Cache[(⚡ Redis)]
flowchart TD
Start([🚀 开始]) --> Process[⚙️ 处理数据]
Process --> Check{✓ 有效?}
Check -->|是| Save[💾 保存]
Check -->|否| Error[❌ 错误]
Save --> Complete([✅ 完成])
graph TB
API[🌐 API 网关] --> Auth[🔐 认证服务]
API --> Orders[📋 订单服务]
Orders --> Queue[📬 消息队列]
Queue --> Worker[⚙️ 后台工作器]
Worker --> Storage[📦 对象存储]
完整符号参考,请加载: references/guides/unicode-symbols/guide.md
# 列出所有图表
python scripts/extract_mermaid.py document.md --list-only
# 提取到单独的文件
python scripts/extract_mermaid.py document.md --output-dir diagrams/
# 验证所有图表
python scripts/extract_mermaid.py document.md --validate
# 替换为图像引用(用于 Confluence 上传)
python scripts/extract_mermaid.py document.md --replace-with-images \
--image-format png --output-markdown output.md
# 单一转换
python scripts/mermaid_to_image.py diagram.mmd output.png
# 使用自定义设置
python scripts/mermaid_to_image.py diagram.mmd output.svg \
--theme dark --background white --width 1200
# 批量转换目录
python scripts/mermaid_to_image.py diagrams/ output/ --format png --recursive
# 从标准输入
echo "graph TD; A-->B" | python scripts/mermaid_to_image.py - output.png
输入: "展示结账流程工作流"
技能决策路径:
1. 分析:工作流、流程 → 活动图
2. 加载指南:guides/diagrams/activity-diagrams.md
3. 查找模式:电子商务结账(指南中存在模板)
4. 使用模板 + Unicode 符号生成
5. 输出带有决策点的完整活动图
输出: 包含购物车、支付、订单状态 Unicode 符号的完整活动图。
输入: "这是我的 Spring Boot 控制器,创建图表"
技能决策路径:
1. 分析:Spring Boot,提供代码 → 代码转图表 + SPRING BOOT
2. 加载指南:
- examples/spring-boot/README.md
- guides/diagrams/architecture-diagrams.md(用于结构)
- guides/diagrams/sequence-diagrams.md(用于方法调用)
- guides/diagrams/activity-diagrams.md(用于业务逻辑)
3. 生成多个图表:
a. 从 @RestController/@Service/@Repository 注解生成的架构图
b. 从方法调用链生成的序列图
c. 从业务逻辑流生成的活动图
4. 输出所有图表并附解释
输出: 展示 Spring Boot 应用程序不同视图的 3-4 个图表。
输入: "记录我的 GCP Cloud Run 与 AlloyDB 部署"
技能决策路径:
1. 分析:基础设施、GCP、Cloud Run → 部署图
2. 加载指南:
- guides/diagrams/deployment-diagrams.md
- examples/spring-boot/ 或 examples/fastapi/(如果提供代码)
3. 检查 IaC 文件(Pulumi、Terraform、docker-compose)
4. 生成包含以下内容的部署图:
- 带规格的 Cloud Run 服务
- VPC 连接器
- AlloyDB 集群
- 安全(IAM、Secret Manager)
- 监控
5. 应用 Unicode 符号以提高清晰度
6. 输出带资源规格说明
输出: 包含所有标记资源的完整 GCP 部署图。
所有图表必须使用高对比度颜色:
graph TB
classDef primary fill:#90EE90,stroke:#333,stroke-width:2px,color:darkgreen
classDef secondary fill:#87CEEB,stroke:#333,stroke-width:2px,color:darkblue
classDef database fill:#E6E6FA,stroke:#333,stroke-width:2px,color:darkblue
classDef error fill:#FFB6C1,stroke:#DC143C,stroke-width:2px,color:black
%% 每个 classDef 必须包含 color: 属性
规则:
classDef 中指定 color:design-doc-mermaid/
├── SKILL.md # 此文件 - 主协调器
├── README.md # 用户文档
├── CLAUDE.md # Claude Code 说明
│
├── references/ # 参考资料
│ ├── mermaid-diagram-guide.md # 旧版通用指南
│ └── guides/ # 专业指南(按需加载)
│ ├── diagrams/
│ │ ├── activity-diagrams.md # 工作流、流程
│ │ ├── architecture-diagrams.md # 系统架构
│ │ ├── c4-model.md # C4 模型图
│ │ ├── deployment-diagrams.md # 基础设施、云
│ │ └── sequence-diagrams.md # API 交互
│ ├── code-to-diagram/
│ │ └── README.md # 代码分析主指南
│ ├── unicode-symbols/
│ │ └── guide.md # 完整符号参考
│ └── troubleshooting.md # 常见语法错误及修复
│
├── assets/ # 设计文档模板
│ ├── architecture-design-template.md
│ ├── api-design-template.md
│ ├── feature-design-template.md
│ ├── database-design-template.md
│ └── system-design-template.md
│ └── feature-design-template.md
│ └── c4-model-template.md
│
├── scripts/ # Python 实用工具
│ ├── extract_mermaid.py # 提取和验证图表
│ └── mermaid_to_image.py # 转换为 PNG/SVG
│
├── examples/ # 语言特定模式
│ ├── spring-boot/ # Spring Boot 模式
│ ├── fastapi/ # FastAPI 模式
│ ├── react/ # React 模式
│ ├── python-etl/ # 数据管道模式
│ ├── node-webapp/ # Express.js 模式
│ └── java-webapp/ # 传统 Java 模式
│
└── references/ # 通用 Mermaid 参考
└── mermaid-diagram-guide.md # 完整 Mermaid 语法指南
| 用户请求 | 加载此内容 |
|---|---|
| "活动图"、"工作流"、"流程流" | references/guides/diagrams/activity-diagrams.md |
| "部署"、"基础设施"、"云"、"k8s" | references/guides/diagrams/deployment-diagrams.md |
| "架构"、"系统设计"、"组件" | references/guides/diagrams/architecture-diagrams.md + 设计模板 |
| "C4"、"C4 模型"、"C4 上下文"、"层次结构" | references/guides/diagrams/c4-model.md |
| "API"、"序列"、"交互"、"流" | references/mermaid-diagram-guide.md(序列图部分) |
| "Spring Boot 代码" | examples/spring-boot/ + 相关图表指南 |
| "FastAPI 代码"、"Python API" | examples/fastapi/ + 相关图表指南 |
| "React 应用"、"前端" | examples/react/ + 架构指南 |
| "ETL"、"数据管道"、"Python 批处理" | examples/python-etl/ + 活动指南 |
| "符号"、"unicode"、"表情符号" | references/guides/unicode-symbols/guide.md |
| "语法错误"、"图表无法渲染"、"故障排除" | references/guides/troubleshooting.md |
| "提取图表" | scripts/extract_mermaid.py |
| "转换为图像"、"PNG"、"SVG" | scripts/mermaid_to_image.py |
| "创建图表"、"生成图表"、"将图表添加到 markdown" | scripts/resilient_diagram.py + references/guides/resilient-workflow.md |
| "设计文档"、"完整文档" | assets/*-design-template.md + 图表指南 |
color: 属性c4-model.md)Mermaid 新手? 从此开始:
references/guides/unicode-symbols/guide.md 了解符号含义references/guides/diagrams/activity-diagrams.md 了解基本模式examples/spring-boot/ 或 examples/fastapi/ 中的示例scripts/extract_mermaid.py --validate 检查你的工作需要记录代码? 遵循以下步骤:
examples/{framework}/创建设计文档? 遵循以下步骤:
assets/ 加载模板docs/design/ 并附带时间戳版本: 2.0(层次化架构) 最后更新: 2025-01-13 维护者: Claude Code Skills
每周安装数
1
仓库
GitHub 星标数
2
首次出现
1 天前
安全审计
安装于
zencoder1
amp1
cline1
openclaw1
opencode1
cursor1
Mermaid diagram and documentation system with specialized guides and code-to-diagram capabilities.
How this skill works:
User Intent Analysis:
flowchart TD
Start([User Request]) --> Analyze{Analyze Intent}
Analyze -->|"workflow, process, business logic"| Activity[Load Activity Diagram Guide<br/>references/guides/diagrams/activity-diagrams.md]
Analyze -->|"infrastructure, deployment, cloud"| Deploy[Load Deployment Diagram Guide<br/>references/guides/diagrams/deployment-diagrams.md]
Analyze -->|"system architecture, components"| Arch[Load Architecture Guide<br/>references/guides/diagrams/architecture-diagrams.md]
Analyze -->|"API flow, interactions"| Sequence[Load Sequence Diagram Guide<br/>references/guides/diagrams/sequence-diagrams.md]
Analyze -->|"code to diagram"| CodeToDiag[Load Code-to-Diagram Guide<br/>references/guides/code-to-diagram/ + examples/]
Analyze -->|"design document, full docs"| DesignDoc[Load Design Document Template<br/>assets/*-design-template.md]
Analyze -->|"unicode symbols, icons"| Unicode[Load Unicode Symbols Guide<br/>references/guides/unicode-symbols/guide.md]
Analyze -->|"extract, validate, convert"| Scripts[Use Python Scripts<br/>scripts/extract_mermaid.py<br/>scripts/mermaid_to_image.py]
Activity --> Generate[Generate Diagram]
Deploy --> Generate
Arch --> Generate
Sequence --> Generate
CodeToDiag --> Generate
DesignDoc --> Generate
Unicode --> Generate
Scripts --> Execute[Execute Script]
Generate --> Validate{Validate?}
Validate -->|Yes| RunValidation[Run mmdc validation]
Validate -->|No| Output
RunValidation --> Output[Output Result]
Execute --> Output
classDef decision fill:#FFD700,stroke:#333,stroke-width:2px,color:black
classDef guide fill:#90EE90,stroke:#333,stroke-width:2px,color:darkgreen
classDef action fill:#87CEEB,stroke:#333,stroke-width:2px,color:darkblue
class Analyze,Validate decision
class Activity,Deploy,Arch,Sequence,CodeToDiag,DesignDoc,Unicode,Scripts guide
class Generate,Execute,RunValidation,Output action
references/guides/diagrams/)| Guide | Full Path | Load When User Wants | Examples |
|---|---|---|---|
| Activity Diagrams | references/guides/diagrams/activity-diagrams.md | Workflows, processes, business logic, user flows, decision trees | "Show checkout flow", "Document ETL pipeline", "Create approval workflow" |
| Deployment Diagrams | references/guides/diagrams/deployment-diagrams.md | Infrastructure, cloud architecture, K8s, serverless, network topology | "Show AWS architecture", "Document GCP deployment", "Create K8s diagram" |
| Architecture Diagrams | references/guides/diagrams/architecture-diagrams.md | System architecture, component design, high-level structure | "Show system components", "Document microservices", "Architecture overview" |
| C4 Model Diagrams |
| Resource | Full Path | What It Provides |
|---|---|---|
| Master Guide | references/guides/code-to-diagram/README.md | Complete workflow for analyzing any codebase and extracting diagrams |
| Spring Boot | examples/spring-boot/README.md | Controller→Service→Repository architecture, deployment config, sequence from methods, activity from business logic |
| FastAPI | examples/fastapi/README.md | Python async patterns, Pydantic models, dependency injection, cloud deployment |
| React | examples/react/README.md |
| Template | Full Path | Use For | Load When |
|---|---|---|---|
| Architecture Design | assets/architecture-design-template.md | System-wide architecture | "Create architecture doc", "Document system design" |
| API Design | assets/api-design-template.md | API specifications | "API design doc", "Document REST API" |
| Feature Design | assets/feature-design-template.md | Feature planning | "Feature design", "Plan new feature" |
| Database Design | assets/database-design-template.md |
Full Path: references/guides/unicode-symbols/guide.md
Load when user mentions: "unicode symbols", "emoji in diagrams", "semantic icons", "add symbols"
Quick Reference:
scripts/)| Script | Use For | Load When |
|---|---|---|
extract_mermaid.py | Extract diagrams from Markdown, validate syntax, replace with images | "extract diagrams", "validate mermaid", "find all diagrams" |
mermaid_to_image.py | Convert .mmd to PNG/SVG, batch conversion, custom themes | "convert to image", "render diagram", "create PNG" |
resilient_diagram.py | Full workflow: save .mmd, generate image, validate, error recovery | "generate diagram", "create diagram with validation", "resilient diagram" |
Common request patterns and guide selection. See When to Use What for complete mapping.
| Pattern | Example Request | Guides to Load |
|---|---|---|
| Single Diagram | "Create activity diagram for login flow" | Diagram type guide + Unicode symbols |
| Code-to-Diagram | "Generate deployment from application.yml" | Framework example + Deployment guide |
| Design Document | "Create API design document" | Template from assets/ + Relevant diagram guides |
| Extract/Validate | "Extract diagrams from design.md" | Use scripts/extract_mermaid.py |
| Batch Convert | "Convert all .mmd to PNG" | Use scripts/mermaid_to_image.py |
CRITICAL: This is the recommended approach for ALL diagram generation. It ensures validation, error recovery, and consistent file organization.
Full Guide: references/guides/resilient-workflow.md
flowchart LR
A[1. Identify Type] --> B[2. Save .mmd + Image]
B --> C{3. Valid?}
C -->|Yes| D[4. Add to Markdown]
C -->|No| E[5. Error Recovery]
E --> F{Fix Found?}
F -->|Yes| A
F -->|No| G[Search External]
G --> A
classDef step fill:#90EE90,stroke:#333,color:darkgreen
classDef decision fill:#FFD700,stroke:#333,color:black
class A,B,D,E,G step
class C,F decision
NEVER add a diagram to markdown until it passes validation. This prevents broken diagrams in documentation.
# Generate with full error recovery
python scripts/resilient_diagram.py \
--code "flowchart TD; A-->B" \
--markdown-file design_doc \
--diagram-num 1 \
--title "process_flow" \
--format png \
--json
Output: Both .mmd and .png files in ./diagrams/ directory.
./diagrams/<markdown_file>_<num>_<type>_<title>.mmd
./diagrams/<markdown_file>_<num>_<type>_<title>.png
Example: ./diagrams/api_design_01_sequence_auth_flow.png
When validation fails, the workflow automatically:
references/guides/troubleshooting.md (28 documented errors)perplexity_ask MCP for syntax questionsbrave_web_search MCP for recent solutionsgemini skill for alternative perspectiveWebSearch tool as fallbackIf the script is unavailable:
references/guides/diagrams/./diagrams/<markdown_file>_<num>_<type>_<title>.mmdmmdc -i file.mmd -o file.png -b transparentreferences/guides/troubleshooting.md for matching errorUser: "Create a sequence diagram and add it to the design doc"
Skill Actions:
Identify intent: diagram generation + markdown integration
Load workflow guide: references/guides/resilient-workflow.md
Identify diagram type: sequence
Load diagram guide: references/guides/diagrams/sequence-diagrams.md
Generate Mermaid code using templates
Execute resilient workflow:
python scripts/resilient_diagram.py \
--code "[generated code]" \
--markdown-file design_doc \
--diagram-num 1 \
--title "api_sequence" \
--json
If validation fails → Apply troubleshooting fix → Retry
On success → Add  to markdown
Always use Unicode symbols to enhance diagram clarity. Common patterns:
graph TB
Client[👤 User] --> LB[🌐 Load Balancer]
LB --> App1[⚙️ App Server 1]
LB --> App2[⚙️ App Server 2]
App1 --> DB[(💾 Database)]
App1 --> Cache[(⚡ Redis)]
flowchart TD
Start([🚀 Start]) --> Process[⚙️ Process Data]
Process --> Check{✓ Valid?}
Check -->|Yes| Save[💾 Save]
Check -->|No| Error[❌ Error]
Save --> Complete([✅ Complete])
graph TB
API[🌐 API Gateway] --> Auth[🔐 Auth Service]
API --> Orders[📋 Order Service]
Orders --> Queue[📬 Message Queue]
Queue --> Worker[⚙️ Background Worker]
Worker --> Storage[📦 Object Storage]
For complete symbol reference, load: references/guides/unicode-symbols/guide.md
# List all diagrams
python scripts/extract_mermaid.py document.md --list-only
# Extract to separate files
python scripts/extract_mermaid.py document.md --output-dir diagrams/
# Validate all diagrams
python scripts/extract_mermaid.py document.md --validate
# Replace with image references (for Confluence upload)
python scripts/extract_mermaid.py document.md --replace-with-images \
--image-format png --output-markdown output.md
# Single conversion
python scripts/mermaid_to_image.py diagram.mmd output.png
# With custom settings
python scripts/mermaid_to_image.py diagram.mmd output.svg \
--theme dark --background white --width 1200
# Batch convert directory
python scripts/mermaid_to_image.py diagrams/ output/ --format png --recursive
# From stdin
echo "graph TD; A-->B" | python scripts/mermaid_to_image.py - output.png
Input: "Show the checkout process workflow"
Skill Decision Path:
1. Analyze: workflow, process → ACTIVITY DIAGRAM
2. Load guide: guides/diagrams/activity-diagrams.md
3. Find pattern: E-commerce checkout (template exists in guide)
4. Generate using template + Unicode symbols
5. Output activity diagram with decision points
Output: Complete activity diagram with Unicode symbols for cart, payment, order states.
Input: "Here's my Spring Boot controller, create diagrams"
Skill Decision Path:
1. Analyze: Spring Boot, code provided → CODE-TO-DIAGRAM + SPRING BOOT
2. Load guides:
- examples/spring-boot/README.md
- guides/diagrams/architecture-diagrams.md (for structure)
- guides/diagrams/sequence-diagrams.md (for method calls)
- guides/diagrams/activity-diagrams.md (for business logic)
3. Generate multiple diagrams:
a. Architecture diagram from @RestController/@Service/@Repository annotations
b. Sequence diagram from method call chain
c. Activity diagram from business logic flow
4. Output all diagrams with explanations
Output: 3-4 diagrams showing different views of the Spring Boot application.
Input: "Document my GCP Cloud Run deployment with AlloyDB"
Skill Decision Path:
1. Analyze: infrastructure, GCP, Cloud Run → DEPLOYMENT DIAGRAM
2. Load guides:
- guides/diagrams/deployment-diagrams.md
- examples/spring-boot/ or examples/fastapi/ (if code provided)
3. Check for IaC files (Pulumi, Terraform, docker-compose)
4. Generate deployment diagram with:
- Cloud Run services with specs
- VPC connector
- AlloyDB cluster
- Security (IAM, Secret Manager)
- Monitoring
5. Apply Unicode symbols for clarity
6. Output with resource specifications
Output: Complete GCP deployment diagram with all resources labeled.
ALL diagrams MUST use high-contrast colors:
graph TB
classDef primary fill:#90EE90,stroke:#333,stroke-width:2px,color:darkgreen
classDef secondary fill:#87CEEB,stroke:#333,stroke-width:2px,color:darkblue
classDef database fill:#E6E6FA,stroke:#333,stroke-width:2px,color:darkblue
classDef error fill:#FFB6C1,stroke:#DC143C,stroke-width:2px,color:black
%% Every classDef MUST have color: property
Rules:
color: in every classDefdesign-doc-mermaid/
├── SKILL.md # This file - Main orchestrator
├── README.md # User documentation
├── CLAUDE.md # Claude Code instructions
│
├── references/ # Reference materials
│ ├── mermaid-diagram-guide.md # Legacy general guide
│ └── guides/ # Specialized guides (load on-demand)
│ ├── diagrams/
│ │ ├── activity-diagrams.md # Workflows, processes
│ │ ├── architecture-diagrams.md # System architecture
│ │ ├── c4-model.md # C4 Model Diagrams
│ │ ├── deployment-diagrams.md # Infrastructure, cloud
│ │ └── sequence-diagrams.md # API interactions
│ ├── code-to-diagram/
│ │ └── README.md # Master guide for code analysis
│ ├── unicode-symbols/
│ │ └── guide.md # Complete symbol reference
│ └── troubleshooting.md # Common syntax errors & fixes
│
├── assets/ # Design document templates
│ ├── architecture-design-template.md
│ ├── api-design-template.md
│ ├── feature-design-template.md
│ ├── database-design-template.md
│ └── system-design-template.md
│ └── feature-design-template.md
│ └── c4-model-template.md
│
├── scripts/ # Python utilities
│ ├── extract_mermaid.py # Extract & validate diagrams
│ └── mermaid_to_image.py # Convert to PNG/SVG
│
├── examples/ # Language-specific patterns
│ ├── spring-boot/ # Spring Boot patterns
│ ├── fastapi/ # FastAPI patterns
│ ├── react/ # React patterns
│ ├── python-etl/ # Data pipeline patterns
│ ├── node-webapp/ # Express.js patterns
│ └── java-webapp/ # Traditional Java patterns
│
└── references/ # General Mermaid reference
└── mermaid-diagram-guide.md # Complete Mermaid syntax guide
| User Request | Load This |
|---|---|
| "activity diagram", "workflow", "process flow" | references/guides/diagrams/activity-diagrams.md |
| "deployment", "infrastructure", "cloud", "k8s" | references/guides/diagrams/deployment-diagrams.md |
| "architecture", "system design", "components" | references/guides/diagrams/architecture-diagrams.md + design template |
| "C4", "C4 model", "C4 context", "hierarchy" | references/guides/diagrams/c4-model.md |
| "API", "sequence", "interactions", "flow" | references/mermaid-diagram-guide.md (sequence section) |
color: property in stylesc4-model.md for C4-specific tips)New to Mermaid? Start here:
references/guides/unicode-symbols/guide.md for symbol meaningsreferences/guides/diagrams/activity-diagrams.md for basic patternsexamples/spring-boot/ or examples/fastapi/scripts/extract_mermaid.py --validate to check your workNeed to document code? Follow this:
examples/{framework}/Creating design docs? Follow this:
assets/docs/design/ with timestampVersion: 2.0 (Hierarchical Architecture) Last Updated: 2025-01-13 Maintained by: Claude Code Skills
Weekly Installs
1
Repository
GitHub Stars
2
First Seen
1 day ago
Security Audits
Gen Agent Trust HubPassSocketFailSnykWarn
Installed on
zencoder1
amp1
cline1
openclaw1
opencode1
cursor1
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
31,600 周安装
references/guides/diagrams/c4-model.md |
| Hierarchical architecture (Context, Container, Component, Deployment) |
| "C4 context", "C4 container", "C4 model diagram", "system hierarchy" |
| Sequence Diagrams | references/guides/diagrams/sequence-diagrams.md | API interactions, service communication, request/response flows | "Show API call sequence", "Document auth flow", "Service interactions" |
| Component hierarchy, state management, data flow, build pipeline |
| Python ETL | examples/python-etl/README.md | Data pipeline, transformation steps, error handling, scheduling |
| Node/Express | examples/node-webapp/README.md | Middleware chain, route handlers, async patterns, deployment |
| Java Web App | examples/java-webapp/README.md | Traditional MVC, servlet containers, WAR deployment |
| Database schema |
| "Database design", "Document schema" |
| System Design | assets/system-design-template.md | Complete system | "System design doc", "Full system documentation" |
| "Spring Boot code" | examples/spring-boot/ + relevant diagram guides |
| "FastAPI code", "Python API" | examples/fastapi/ + relevant diagram guides |
| "React app", "frontend" | examples/react/ + architecture guide |
| "ETL", "data pipeline", "Python batch" | examples/python-etl/ + activity guide |
| "symbols", "unicode", "emoji" | references/guides/unicode-symbols/guide.md |
| "syntax error", "diagram won't render", "troubleshoot" | references/guides/troubleshooting.md |
| "extract diagrams" | scripts/extract_mermaid.py |
| "convert to image", "PNG", "SVG" | scripts/mermaid_to_image.py |
| "create diagram", "generate diagram", "add diagram to markdown" | scripts/resilient_diagram.py + references/guides/resilient-workflow.md |
| "design document", "full docs" | assets/*-design-template.md + diagram guides |