AI Mermaid Diagrams
/install ai-mermaid-diagrams
Mermaid Diagrams Skill
Generates Mermaid diagrams and renders them to PNG using the mmdc CLI.
Reference Files
- Architecture patterns (flowchart, C4, cloud, network, microservices) →
references/architecture-patterns.md - Sequence diagram patterns (API flows, auth, CI/CD, DLP flows) →
references/sequence-patterns.md
Load the relevant reference file based on diagram type requested.
Rendering Tool
Use mermaid.ink (free online renderer, no browser/install needed):
mkdir -p /home/bcaddy/.openclaw/workspace/diagrams
ENCODED=$(cat \x3Cinput.mmd> | base64 -w 0)
curl -s "https://mermaid.ink/img/${ENCODED}?bgColor=white&width=2048" \
-o /home/bcaddy/.openclaw/workspace/diagrams/\x3Cname>.png
- Output directory:
/home/bcaddy/.openclaw/workspace/diagrams/ - Width: 2048px default; increase for very wide diagrams (
&width=3000) - Always create output directory first:
mkdir -p /home/bcaddy/.openclaw/workspace/diagrams
Workflow
1. Identify Diagram Type
- Network/system/cloud/microservices → use
flowchartorC4Context - API/auth/data flows, step-by-step processes → use
sequenceDiagram - When in doubt: sequence for "how does X work step by step", architecture for "what does X look like"
2. Load Reference File
- Architecture →
references/architecture-patterns.md - Sequence →
references/sequence-patterns.md
3. Generate Mermaid Code
- Write complete, valid Mermaid syntax
- Use descriptive node labels (not just A, B, C)
- Use subgraphs to group related components in architecture diagrams
- Use alt/loop/note blocks to add clarity in sequence diagrams
- Match the style of the patterns in the reference file
4. Save .mmd File
Save to: /home/bcaddy/.openclaw/workspace/diagrams/\x3Cdescriptive-name>.mmd
Use kebab-case, descriptive filenames: auth-flow.mmd, aws-architecture.mmd, api-gateway-sequence.mmd
5. Render to PNG via mermaid.ink
ENCODED=$(cat /home/bcaddy/.openclaw/workspace/diagrams/\x3Cname>.mmd | base64 -w 0)
curl -s "https://mermaid.ink/img/${ENCODED}?bgColor=white&width=2048" \
-o /home/bcaddy/.openclaw/workspace/diagrams/\x3Cname>.png
6. Confirm Output
Report the full path to the saved PNG. Offer to adjust layout, add components, or generate a .mmd file for further editing in mermaid.live or VS Code.
Tips
flowchart LRfor left-to-right pipelines and network flowsflowchart TDfor top-down hierarchies and cloud stacks- Wide diagrams: increase
-w(width); tall diagrams: increase-H(height) - For very complex diagrams, break into multiple diagrams
- Always include a title comment at the top of the .mmd file:
%% Title: ...
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install ai-mermaid-diagrams - 安装完成后,直接呼叫该 Skill 的名称或使用
/ai-mermaid-diagrams触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
AI Mermaid Diagrams 是什么?
Generate architecture diagrams (network, system, cloud, microservices) and sequence diagrams (API flows, auth flows, data flows) as PNG files using Mermaid.... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 320 次。
如何安装 AI Mermaid Diagrams?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install ai-mermaid-diagrams」即可一键安装,无需额外配置。
AI Mermaid Diagrams 是免费的吗?
是的,AI Mermaid Diagrams 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
AI Mermaid Diagrams 支持哪些平台?
AI Mermaid Diagrams 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 AI Mermaid Diagrams?
由 OpieTaylor911(@opietaylor911)开发并维护,当前版本 v1.0.0。