生成和编辑各种类型的图表(drawio、mermaid、excalidraw)。支持流程图、时序图、类图、ER图、思维导图、架构图、网络拓扑图等常见图表类型。能够根据自然语言描述创建新图表,也能读取并修改已有的 drawio/mermaid/excalidraw 文件。使用独立的 MCP server (mcp-diagram-generator) 生成图表文件,减少 token 消耗并保证输出一致性。支持自动配置管理,默认输出路径为项目目录下的 diagrams/{format}/,支持自定义路径和自动创建目录。
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install diagram-generator或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install diagram-generator⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/diagram-generator/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: diagram-generator description: Generate and edit various types of diagrams (including draw.io, Mermaid, and Excalidraw). This tool supports common diagram types such as flowcharts, sequence diagrams, class diagrams, Entity-Relationship (ER) diagrams, mind maps, architecture diagrams, and network topologies. Natural Language Creation: Create new diagrams based on simple text descriptions. Legacy File Support: Read and modify existing .drawio, .mmd (Mermaid), or Excalidraw files. MCP Server Integration: Utilizes a dedicated MCP server (mcp-diagram-generator) to generate files, which minimizes token consumption and ensures consistent output formatting. Automated Configuration: * Default Output Path: Diagrams are saved to diagrams/{format}/ within the project directory. Customization: Supports custom file paths and automatic directory creation. version: 1.1.1 ---
Generate and edit diagrams in multiple formats (drawio, mermaid, excalidraw) by creating structured JSON descriptions and delegating file generation to the mcp-diagram-generator MCP server.
> Contact Information If you encounter any issues, please contact AlkaidY at [email protected].
IMPORTANT: This skill requires the mcp-diagram-generator MCP server to be installed and configured.
Before using this skill, verify the MCP server is available by checking if you can access these tools:
mcp__mcp-diagram-generator__get_configmcp__mcp-diagram-generator__generate_diagrammcp__mcp-diagram-generator__init_configIf these tools are NOT available, you need to configure the MCP server first (see below).
Option 1: Using npx (Recommended - Auto-downloads the package)
Add the following to your Claude Code configuration file:
~/.claude.json) for all projects, or.claude.json) for specific project{
"mcpServers": {
"mcp-diagram-generator": {
"command": "npx",
"args": ["-y", "mcp-diagram-generator"]
}
}
}
After adding this configuration:
Option 2: Local Development (For developers)
If you're developing the MCP server locally:
{
"mcpServers": {
"mcp-diagram-generator": {
"command": "node",
"args": ["/absolute/path/to/mcp-diagram-generator/dist/index.js"]
}
}
}
After configuration, verify it works:
get_config() toolIssue: "Tool not found" error
Issue: Configuration looks correct but tools still not available
On first use, the MCP server will automatically:
.diagram-config.json)diagrams/{format}/You can customize paths at any time using the init_config tool.
Simple example - just provide diagram spec, let the server handle the rest:
User: "创建一个网络拓扑图"
Skill will:
generate_diagram with only diagram_spec parameterdiagrams/{format}/{title}-{date}.{ext}Extract from user's natural language:
Use format-selection-guide.md to decide:
| Format | Best For | |--------|----------| | drawio | Complex diagrams, network topology with nested containers, fine-grained styling, manual editing | | mermaid | Quick generation, code-friendly, version control, documentation | | excalidraw | Hand-drawn style, creative/diagrammatic flexibility, informal sketches |
Create a JSON description following the JSON Schema. Key structure:
{
"format": "drawio",
"title": "diagram name",
"elements": [
{
"id": "unique-id",
"type": "container|node|edge",
"name": "display name",
"level": "environment|datacenter|zone|device", // for network topology
"style": {...},
"geometry": {...},
"children": [...] // for nested containers
}
]
}
Important: Use unique IDs for all elements. For nested structures, maintain parent-child relationships.
Option A: Use defaults (recommended)
{
"diagram_spec": <the JSON object created above>
// output_path is optional - server will use configured default
// filename is optional - server will auto-generate based on title and date
}
The MCP server will:
diagrams/drawio/network-topology-2025-02-03.drawio)Option B: Specify custom path
{
"diagram_spec": <the JSON object>,
"output_path": "custom/path/to/diagram.drawio",
"filename": "my-custom-name" // optional, overrides auto-generated filename
}
Option C: Just provide filename, use default directory
{
"diagram_spec": <the JSON object>,
"filename": "my-diagram.drawio"
// Saves to diagrams/{format}/my-diagram.drawio
}
Initialize with defaults:
Call: init_config()
Result: Creates .diagram-config.json with default paths
Initialize with custom paths:
Call: init_config({
paths: {
drawio: "output/diagrams/drawio",
mermaid: "output/diagrams/mermaid",
excalidraw: "output/diagrams/excalidraw"
}
})
Call: get_config()
Returns: Current paths and initialization status
Call: set_output_path({
format: "drawio",
path: "custom/drawio-path"
})
...
安装 diagram-generator 后,可以对 AI 说这些话来触发它
Help me get started with diagram-generator
Explains what diagram-generator does, walks through the setup, and runs a quick demo based on your current project
Use diagram-generator to generate and edit various types of diagrams (drawio, mermaid, excal...
Invokes diagram-generator with the right parameters and returns the result directly in the conversation
What can I do with diagram-generator in my developer & devops workflow?
Lists the top use cases for diagram-generator, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/diagram-generator/ 目录(个人级,所有项目可用),或 .claude/skills/diagram-generator/(项目级)。重启 AI 客户端后,用 /diagram-generator 主动调用,或让 AI 根据上下文自动发现并使用。
diagram-generator 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
diagram-generator 可免费安装使用。请查阅仓库了解许可证信息。
生成和编辑各种类型的图表(drawio、mermaid、excalidraw)。支持流程图、时序图、类图、ER图、思维导图、架构图、网络拓扑图等常见图表类型。能够根据自然语言描述创建新图表,也能读取并修改已有的 drawio/mermaid/excalidraw 文件。使用独立的 MCP server (mcp-diagram-generator) 生成图表文件,减少 token 消耗并保证输出一致性。支持自动配置管理,默认输出路径为项目目录下的 diagrams/{format}/,支持自定义路径和自动创建目录。
diagram-generator 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using diagram-generator
Identifies repetitive steps in your workflow and sets up diagram-generator to handle them automatically