← 返回 Skills 市场
opietaylor911

AI Mermaid Diagrams

作者 OpieTaylor911 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
320
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install ai-mermaid-diagrams
功能描述
Generate architecture diagrams (network, system, cloud, microservices) and sequence diagrams (API flows, auth flows, data flows) as PNG files using Mermaid....
使用说明 (SKILL.md)

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 flowchart or C4Context
  • 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 LR for left-to-right pipelines and network flows
  • flowchart TD for 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: ...
安全使用建议
This skill will produce Mermaid .mmd files locally but then sends the diagram source to mermaid.ink by embedding the base64-encoded .mmd in the URL. Before installing or using it, consider: (1) Do not include any sensitive information (internal hostnames, IP ranges, credentials, tokens, or proprietary architecture text) in diagrams you render with this skill, because that content will be transmitted to a third-party service and may appear in logs or proxies. (2) The use of a GET URL with base64 can leak content in web server logs, referrers, or proxies and may hit URL length limits; prefer rendering methods that POST the payload or render locally. (3) The SKILL.md hardcodes /home/bcaddy/...; update the output directory to a path appropriate for your environment to avoid accidental writes or permission errors. (4) If you need offline/private rendering, use a local renderer (mermaid-cli mmdc or a self-hosted renderer) instead of mermaid.ink. If you want me to, I can suggest a safer SKILL.md that renders locally or uses a POST-based renderer, or point you to commands to install mermaid-cli for offline rendering.
功能分析
Type: OpenClaw Skill Name: ai-mermaid-diagrams Version: 1.0.0 The skill provides instructions for the agent to execute shell commands (`cat`, `base64`, `curl`) to transmit file contents to an external third-party service (mermaid.ink) for rendering. While this is functionally necessary for the stated purpose of generating diagrams without a local renderer, it creates a high-risk pathway for data exfiltration if the agent is manipulated into processing sensitive files instead of Mermaid code. The skill also relies on hardcoded absolute paths for a specific user directory (/home/bcaddy/), which is a common indicator of poorly scoped or environment-specific scripts.
能力评估
Purpose & Capability
The name/description match the instructions: generate Mermaid .mmd files and render PNGs. The required capabilities are minimal and consistent. Note: SKILL.md hardcodes a user-specific path (/home/bcaddy/.openclaw/workspace/diagrams), which is an operational assumption that may not fit other environments.
Instruction Scope
Instructions require encoding the entire .mmd content and invoking https://mermaid.ink/img/<BASE64> via curl. This sends diagram source to an external service (third party). Diagrams often contain sensitive internal details (hostnames, IPs, architecture notes, or credentials if accidentally included), so this is a potential data‑exfiltration/privacy risk. Using a GET path with base64 also exposes content in logs, referrers, and proxies and may hit URL length limits. The skill does not instruct any local/offline rendering alternative.
Install Mechanism
Instruction-only skill; no install spec or downloaded code. Low installation risk because nothing is written to disk by an installer beyond the .mmd and .png files the agent would create per instructions.
Credentials
No environment variables or credentials are required — appropriate and minimal. Observe however the hardcoded filesystem path using a specific username (bcaddy), which is unexpected and could cause failures or accidental writes in other environments.
Persistence & Privilege
Does not request persistent privileges, always:false, and doesn't modify other skills or system-wide settings. It will write output files to the workspace directory per its instructions (normal for this functionality).
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install ai-mermaid-diagrams
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /ai-mermaid-diagrams 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release — generate architecture diagrams (network, system, cloud, microservices) and sequence diagrams (API flows, auth flows, CI/CD) as PNG using mermaid.ink renderer. No local browser required.
元数据
Slug ai-mermaid-diagrams
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

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。

💬 留言讨论