跳到主内容
智客 ZICQ

技能库 智客分类:其他 diagram-generator OpenClaw

Diagram Generator

以 mcp-diagram-生成器 MCP 服务器生成并编辑图. 将这个技能用于新的图表, 已有 。 drawio/.mmd/.excalidraw 编辑,网络地貌,建筑,流程图,游泳跑道,序列,类,ER,和Excalidraw白板工作. 当用户要求绘制、生成、修改或导出任何图表时,总是使用这一技能.

1002 安装量 · 47 星标

官方网址:ClawHub

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

以 mcp-diagram-生成器 MCP 服务器生成并编辑图. 将这个技能用于新的图表, 已有 。 drawio/.mmd/.excalidraw 编辑,网络地貌,建筑,流程图,游泳跑道,序列,类,ER,和Excalidraw白板工作. 当用户要求绘制、生成、修改或导出任何图表时,总是使用这一技能.

何时用

官方 description 未单独写出 Use when。按规范,代理会在用户任务与这段 description 的关键词匹配时激活本技能。

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Diagram Generator、Purpose、Required MCP Tools、Main Workflow、1. Intake、2. Dispatch To A Playbook。 其中含规范建议的小节:分步指令。

文件分析

文件分析:除 SKILL.md 外,正文引用了 references/interaction-intake-guide.md、references/playbook-network-topology.md、references/playbook-architecture.md、references/playbook-flowchart.md、references/playbook-swimlane.md、references/playbook-uml.md,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

Generate and edit diagrams with the mcp-diagram-generator MCP server. Use this skill for new diagrams, existing .drawio/.mmd/.excalidraw edits, network topology, architecture, flowchart, swimlane, sequence, class, ER, and Excalidraw whiteboard work. Always use this skill when the user asks to draw, generate, revise, or export any diagram.

Diagram GeneratorPurposeRequired MCP ToolsMain Workflow1. Intake2. Dispatch To A Playbook3. Choose Format4. Build The JSON Specification5. Quality Gate6. GenerateConfiguration HelpersTroubleshooting

SKILL.md 与 Agent 调用

官方规范 ↗
name
diagram-generator
description
Generate and edit diagrams with the mcp-diagram-generator MCP server. Use this skill for new diagrams, existing .drawio/.mmd/.excalidraw edits, network topology, architecture, flowchart, swimlane, sequence, class, ER, and Excalidraw whiteboard work. Always use this skill when the user asks to draw, generate, revise, or export any diagram.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 10
  • references/interaction-intake-guide.md
  • references/playbook-network-topology.md
  • references/playbook-architecture.md
  • references/playbook-flowchart.md
  • references/playbook-swimlane.md
  • references/playbook-uml.md
  • references/playbook-excalidraw.md
  • references/format-selection-guide.md
  • references/layout-quality-guide.md
  • references/json-schema-guide.md

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「diagram-generator」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-a1b704107551e7db-Diagram-Generator.html
请存为 .cursor/skills/diagram-generator/SKILL.md 或 .claude/skills/diagram-generator/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://clawhub.ai/skills/diagram-generator 取完整目录,不要只建一个 SKILL.md。

当前没有明确的 GitHub 技能包地址,请按来源页面的安装器说明操作。

ClawHub ↗

阅读排版
--- name: diagram-generator description: Generate and edit diagrams with the mcp-diagram-generator MCP server. Use this skill for new diagrams, existing .drawio/.mmd/.excalidraw edits, network topology, architecture, flowchart, swimlane, sequence, class, ER, and Excalidraw whiteboard work. Always use this skill when the user asks to draw, generate, revise, or export any diagram. --- # Diagram Generator ## Purpose Create and edit diagrams by converting user intent into a structured JSON specification, then delegating file generation to the `mcp-diagram-generator` MCP server. Supported formats: - Draw.io: `.drawio` - Mermaid: `.mmd` or markdown Mermaid content - Excalidraw: `.excalidraw` Supported work: - Natural-language diagram creation - Existing `.drawio`, `.mmd`, and `.excalidraw` edits - Default output paths under `diagrams/{format}/` - Custom filenames and output paths ## Required MCP Tools Before generating a diagram, verify that the MCP server tools are available: - `mcp__mcp-diagram-generator__get_config` - `mcp__mcp-diagram-generator__generate_diagram` - `mcp__mcp-diagram-generator__init_config` If the tools are missing, configure the MCP server. Recommended remote configuration: ```json { "mcpServers": { "mcp-diagram-generator": { "command": "npx", "args": ["-y", "mcp-diagram-generator"] } } } ``` After changing configuration, restart the agent environment. On first use, the server creates `.diagram-config.json` and default output directories. For local development configuration, see the "Tool missing" entry in Troubleshooting. ## Main Workflow ### 1. Intake For new diagrams, collect the basic options before accepting or processing the full diagram prompt: - Diagram type - Output format - Layout direction - Usage context - Optional filename or output directory Read `references/interaction-intake-guide.md` before asking intake questions. Skip intake when the user already provided all required options and the full prompt. For existing-file edits, ask only for the target file and requested changes if missing. ### 2. Dispatch To A Playbook Select exactly one primary playbook based on the diagram type: | User Intent | Primary Playbook | | --- | --- | | Network topology, datacenter, zone, router, switch, firewall | `references/playbook-network-topology.md` | | System architecture, application architecture, layered component diagram | `references/playbook-architecture.md` | | Flowchart, process, decision tree | `references/playbook-flowchart.md` | | Swimlane, cross-team handoff, approval workflow by department | `references/playbook-swimlane.md` | | Sequence, class, ER, UML-style diagrams | `references/playbook-uml.md` | | Whiteboard sketch, hand-drawn style, informal Excalidraw diagram | `references/playbook-excalidraw.md` | | Unsure about format | `references/format-selection-guide.md` first, then the matching playbook | Only read the playbook needed for the current diagram. If a playbook points to `json-schema-guide.md` or `network-topology-examples.md`, read only the relevant section. For explicit geometry, also read `references/layout-quality-guide.md`. ### 3. Choose Format Use these defaults unless the user explicitly chooses otherwise: | Diagram Type | Default Format | Default Direction | | --- | --- | --- | | Network topology | Draw.io | Vertical | | Architecture | Draw.io | Vertical or automatic | | Flowchart | Mermaid | Vertical | | Swimlane | Draw.io | Horizontal | | Sequence | Mermaid | Automatic | | Class | Mermaid | Automatic | | ER | Mermaid | Automatic | | Whiteboard sketch | Excalidraw | Automatic | Usage context can override defaults: - Word: prefer portrait-friendly vertical layouts. - PPT: horizontal layouts are acceptable when readability improves. - Code repositories and documentation: prefer Mermaid for simple flow, sequence, class, and ER diagrams. - Whiteboard collaboration: prefer Excalidraw. - Complex network or architecture diagrams: prefer Draw.io unless the user explicitly asks for Excalidraw. ### 4. Build The JSON Specification Follow `references/json-schema-guide.md` for the schema. Core structure: ```json { "format": "drawio", "diagramType": "architecture", "title": "Diagram title", "elements": [ { "id": "unique-id", "type": "container", "name": "Display name", "level": "environment", "geometry": { "x": 0, "y": 0, "width": 800, "height": 600 }, "children": [] }, { "type": "edge", "source": "source-id", "target": "target-id" } ] } ``` Universal rules: - `elements` must be an array. - IDs must be unique. - Edges must be top-level elements, never inside `children`. Full field reference: `references/json-schema-guide.md`. ### 5. Quality Gate Before calling the MCP server, verify: - The chosen format matches the intake answer and playbook. - `diagramType` is explicit when supported. - Layout direction is reflected in coordinates or generator-specific fields. - Complex Draw.io and Excalidraw diagrams have explicit `geometry`. - Container hierarchy is valid. - Edges are top-level elements. - Text and connector rules for the selected format are followed. After generation, inspect the saved file enough to confirm the expected format-specific properties exist. For code changes to the MCP server, also run `npm run test:diagrams` from `mcp-diagram-generator/`. ### 6. Generate Preferred call: ```json { "diagram_spec": "" } ``` Optional filename: ```json { "diagram_spec": "", "filename": "my-diagram.drawio" } ``` Optional explicit output path: ```json { "diagram_spec": "", "output_path": "custom/path/to/diagram.drawio" } ``` The MCP server validates the schema, creates missing directories, and writes to the configured default directory when no output path is supplied. ## Configuration Helpers Initialize defaults: ```text init_config() ``` Set custom paths: ```json { "paths": { "drawio": "output/diagrams/drawio", "mermaid": "output/diagrams/mermaid", "excalidraw": "output/diagrams/excalidraw" } } ``` Inspect configuration: ```text get_config() ``` Update one format path: ```json { "format": "drawio", "path": "custom/drawio-path" } ``` ## Troubleshooting Tool missing: - Configure the MCP server with the remote (npx) block above and restart the agent environment. - For local development, use `"command": "node", "args": ["/absolute/path/to/mcp-diagram-generator/dist/index.js"]` instead. Schema validation failed: - Read `references/json-schema-guide.md`. - Check required fields, unique IDs, edge source/target, and parent-child structure. Directory error: - Check write permissions. - Run `get_config()`. - Reinitialize with `init_config()` if needed. Wrong extension: - Draw.io uses `.drawio`. - Mermaid uses `.mmd` or markdown output. - Excalidraw uses `.excalidraw`. Nested container issue: - Child coordinates are relative to the direct parent. - Container sizes must fit child bounds plus padding. - Network topology must follow environment -> datacenter -> zone -> device. ## Reference Index Read only what is needed: - `references/interaction-intake-guide.md`: interactive intake defaults and question template. - `references/format-selection-guide.md`: format selection matrix. - `references/playbook-network-topology.md`: Draw.io and Excalidraw network topology rules. - `references/playbook-architecture.md`: layered architecture rules. - `references/playbook-flowchart.md`: process and decision flow rules. - `references/playbook-swimlane.md`: swimlane and handoff rules. - `references/playbook-uml.md`: sequence, class, and ER rules. - `references/playbook-excalidraw.md`: Excalidraw whiteboard and binding rules. - `references/layout-quality-guide.md`: explicit geometry, spacing, and connector readability rules. - `references/json-schema-guide.md`: schema details and examples. - `references/network-topology-examples.md`: network topology JSON patterns. ## Output Discipline When responding to the user: - Confirm the selected diagram type, format, direction, and output file. - Do not paste the full JSON unless the user asks. - Provide the saved file path. - Mention any validation or regression command that was run.

相关技能

其他

Self Improving Agent

掌握学习、错误和校正,以便不断改进。 使用时间:(1) 命令或操作意外失败, (2) 用户更正 Claude ('No, that's wrong...', 'Actually...'), (3)用户请求具备不存在的能力,(4)外部API或工具失败,(5)克洛德意识到其知识已经过…

其他

Self Improving + Proactive Agent

自我反省+自我批评+自我学习+自我组织记忆. 特工评估自己的工作,发现错误,并永久改进. 当 (1) 命令,工具, API, 或操作失败时使用; (2) 用户纠正或拒绝您的工作; (3) 您意识到您的知识已经过时或不正确; (4) 您发现更好的方法; (5) 用户明确安装或引用当…

其他

Proactive Agent

将AI代理人从任务跟踪者转变为预先预测需要并不断改进的主动伙伴. 现在WAL协议,工作缓冲,自主克龙, 和战斗测试模式。 哈尔·斯塔克的一部分

其他

Multi Search Engine

多搜索引擎集成16个引擎(7个CN+9 Global). 支持高级搜索操作员,时间过滤器,站点搜索,隐私引擎,和WolframAlpha知识查询. 不需要 API 密钥 .