Token导航 LogoToken导航

Agent Skill · 效率

diagram-generator(图表生成器)

diagram-generator 用于补充效率相关能力,适合在 OpenClaw 中需要让 Agent 承接效率相关任务时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

diagram-generator 是效率类 Agent Skill,可用宿主为 OpenClaw,通过ClawHub获取,权限为调用外部服务;许可证为 MIT-0,第三方扫描有提醒项,按安装量在效率类的 21,003 个 Skill 里排第 27。

总安装 742,127周安装 31,553GitHub Stars 39下载 259,997核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT-0
版本
1.1.1

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:diagram-generator(图表生成器)
来源仓库:https://github.com/matthewyin/diagram-generator
安装命令:
openclaw skills install diagram-generator
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install diagram-generator

这个 Skill 是做什么的

效率类 Skill 把重复的整理、汇总、转换工作交给助手完成,减少手工复制粘贴。

和生成各种类型的图表(drawio、mermaid、excalidraw)。支持流程图、关系图、类图、ER图、思维导图、架构图、网络拓扑图等图表类型。能够根据自然常见语言描述创建新的图表,也能读取并修改现有的drawio/mermaid/excalidraw文件。

使用独立的MCP服务器(mcp-diagram-generator)生成图表文件,减少令牌消耗并保证输出一致性。支持自动配置管理,默认输出路径为项目目录下的diagrams/{format}/,支持自定义路径和自动创建目录。

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 OpenClaw;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 openclaw skills install diagram-generator;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

diagram-generator 怎么安装?

在终端执行 openclaw skills install diagram-generator。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

diagram-generator 支持哪些 AI 工具?

公开资料标注支持 OpenClaw。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

diagram-generator 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

diagram-generator 是免费的吗?

来源标注的许可证是 MIT-0。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

diagram-generator 用的人多吗?

公开数据是累计安装 742,127 次,近一周安装 31,553 次,下载 259,997 次,GitHub 39 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

diagram-generator 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 专注 OpenClaw 一种宿主,触发方式和使用习惯不用来回切换。
  • 许可证明确为 MIT-0,商用和分发边界好判断。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 OpenClaw,想直接扩展它能力的人。
  • 需要处理效率类任务、又不想每次都手写提示词的人。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

效率类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
github

GitHub 代码协作 · OpenClaw

7,632,918545需要联网MIT-0通过
nano-pdf

Nano PDF 文档 · OpenClaw

4,249,476231需要联网MIT-0通过
auto-updater

自动更新程序 · OpenClaw

2,964,063386操作浏览器MIT-0通过
video-frames

视频帧 · OpenClaw

2,621,304112需要联网MIT-0通过
gemini

Gemini 助手 · OpenClaw

2,547,39648需要联网MIT-0有提醒
diagram-generator

图表生成器 · 本页

742,12739调用外部服务MIT-0有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

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.
Customization
Supports custom file paths and automatic directory creation.

Diagram Generator

Overview

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 tccio2023@gmail.com.

Prerequisites Check

IMPORTANT: This skill requires the mcp-diagram-generator MCP server to be installed and configured.

Quick Verification

Before using this skill, verify the MCP server is available by checking if you can access these tools:

  • mcp__mcp-diagram-generator__get_config
  • mcp__mcp-diagram-generator__generate_diagram
  • mcp__mcp-diagram-generator__init_config

If these tools are NOT available, you need to configure the MCP server first (see below).

Installation & Configuration

Option 1: Using npx (Recommended - Auto-downloads the package)

Add the following to your Claude Code configuration file:

  • Global config (~/.claude.json) for all projects, or
  • Project config (.claude.json) for specific project
{
  "mcpServers": {
    "mcp-diagram-generator": {
      "command": "npx",
      "args": ["-y", "mcp-diagram-generator"]
    }
  }
}

After adding this configuration:

  1. Restart Claude Code
  2. The MCP server will auto-download via npx on first use
  3. No manual installation needed

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"]
    }
  }
}

Verification Steps

After configuration, verify it works:

  1. Check configuration: Call get_config() tool
  2. If successful, you'll see current paths and initialization status
  3. If the tool doesn't exist, check your configuration file syntax

Common Issues

Issue: "Tool not found" error

  • Solution: MCP server not configured. Follow installation steps above.

Issue: Configuration looks correct but tools still not available

  • Solution: Restart Claude Code to reload MCP server configuration

Quick Start

First Time Use

On first use, the MCP server will automatically:

  1. Create default configuration file (.diagram-config.json)
  2. Create default output directories if they don't exist
  3. Use sensible defaults: diagrams/{format}/

You can customize paths at any time using the init_config tool.

Basic Usage

Simple example - just provide diagram spec, let the server handle the rest:

User: "创建一个网络拓扑图"

Skill will:

  1. Generate JSON spec
  2. Call generate_diagram with only diagram_spec parameter
  3. Server auto-creates directories and saves to diagrams/{format}/{title}-{date}.{ext}

Workflow

Step 1: Understand Requirements

Extract from user's natural language:

  • Diagram type: flowchart, sequence diagram, class diagram, ER diagram, mindmap, architecture diagram, network topology
  • Content: nodes, relationships, nested structure (for network topology)
  • Style/theme: if mentioned (e.g., "clean style", "detailed")
  • Output preferences: specific filename? custom path?

Step 2: Choose Format

Use format-selection-guide.md to decide:

FormatBest For
drawioComplex diagrams, network topology with nested containers, fine-grained styling, manual editing
mermaidQuick generation, code-friendly, version control, documentation
excalidrawHand-drawn style, creative/diagrammatic flexibility, informal sketches

Step 3: Generate Structured JSON

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.

Step 4: Call MCP Server

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:

  • Validate the JSON schema
  • Generate the appropriate XML/JSON/markdown
  • Auto-create output directories if needed
  • Save to configured default path (e.g., 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
}

Step 5: Editing Existing Diagrams

  1. Read the existing file to understand structure
  2. Parse the diagram (use MCP tool if available, or read raw file)
  3. Modify the JSON description based on user's change request
  4. Generate new diagram (overwrite or create new file)

Configuration Management

Initialize Configuration

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"
  }
})

View Current Configuration

Call: get_config()
Returns: Current paths and initialization status

Update Single Path

Call: set_output_path({
  format: "drawio",
  path: "custom/drawio-path"
})

Supported Diagram Types

Flowchart

  • Simple process flows, decision trees
  • Use mermaid for quick output
  • Use drawio for complex layouts with multiple branches

Sequence Diagram

  • Show interactions over time between components
  • mermaid recommended (native support)
  • Use drawio if custom styling needed

Class Diagram

  • Show classes, methods, relationships
  • mermaid recommended (compact, standard UML)
  • drawio for detailed diagrams with many classes

ER Diagram

  • Database schema, entity relationships
  • mermaid recommended
  • drawio for complex schemas with many relationships

Mindmap

  • Hierarchical ideas, brainstorming
  • mermaid recommended (native support)
  • excalidraw for creative/hand-drawn style

Architecture Diagram

  • System architecture, component relationships
  • drawio recommended for complex systems
  • mermaid for high-level overviews

Network Topology

  • Network environments, datacenters, zones, devices
  • Must use drawio (4-layer nesting: environment → datacenter → zone → device)
  • See network-topology-examples.md for patterns

Network Topology Special Notes

Network topology diagrams require a 4-level hierarchical structure:

Environment (level="environment")
  └── Datacenter (level="datacenter")
        └── Zone (level="zone")
              └── Device (type="node")

Style conventions:

  • Environment: fillColor: #e1d5e7, strokeColor: #9673a6 (purple)
  • Datacenter: fillColor: #d5e8d4, strokeColor: #82b366 (green)
  • Zone: fillColor: #fff2cc, strokeColor: #d6b656 (yellow)
  • Device: Based on device type (router, switch, firewall, etc.)

Device types and styles:

  • Router: strokeColor: #607D8B (blue-gray)
  • Switch: strokeColor: #4CAF50 (green)
  • Firewall: strokeColor: #F44336 (red)
  • PC/Server: strokeColor: #607D8B (blue-gray)

Common Patterns

Pattern 1: Simple Flowchart (Mermaid)

User: "画一个用户登录流程图,包含登录验证、重定向、错误处理"

Generate JSON:

{
  "format": "mermaid",
  "title": "用户登录流程",
  "elements": [
    {"type": "node", "id": "start", "name": "开始", "geometry": {"x": 0, "y": 0}},
    {"type": "node", "id": "login", "name": "输入用户名密码", "geometry": {"x": 0, "y": 100}},
    {"type": "node", "id": "validate", "name": "验证", "geometry": {"x": 0, "y": 200}},
    {"type": "node", "id": "success", "name": "登录成功", "geometry": {"x": -100, "y": 300}},
    {"type": "node", "id": "error", "name": "显示错误", "geometry": {"x": 100, "y": 300}},
    {"type": "edge", "source": "start", "target": "login"},
    {"type": "edge", "source": "login", "target": "validate"},
    {"type": "edge", "source": "validate", "target": "success", "label": "成功"},
    {"type": "edge", "source": "validate", "target": "error", "label": "失败"}
  ]
}

Call MCP:

generate_diagram({
  diagram_spec: <above JSON>,
  format: "mermaid"
  // No output_path needed - auto-saves to diagrams/mermaid/
})

Pattern 2: Network Topology (Drawio)

User: "创建一个网络拓扑图,包含省中心机房(上联区、汇聚区、终端区),连接到生产网"

Generate JSON with nested containers (see json-schema-guide.md for details).

Call MCP:

generate_diagram({
  diagram_spec: <network topology JSON>,
  filename: "省中心网络拓扑" // Optional, for custom filename
})

Resources

references/

  • format-selection-guide.md: When to use drawio vs mermaid vs excalidraw
  • json-schema-guide.md: Complete JSON schema with examples for all diagram types
  • network-topology-examples.md: Example JSON for network topology patterns

assets/

  • No templates needed - MCP server handles all generation

scripts/

  • Not used - all generation delegated to MCP server

Troubleshooting

MCP Server Setup

If mcp-diagram-generator is not available, you need to install it.

Option 1: Using npx (Recommended)

Add to your Claude Code/OpenCode settings:

{
  "mcpServers": {
    "diagram-generator": {
      "command": "npx",
      "args": ["-y", "mcp-diagram-generator"]
    }
  }
}

Option 2: Local Development

  1. Install dependencies: cd mcp-diagram-generator && npm install
  2. Build: npm run build
  3. Configure with local path:
{
  "mcpServers": {
    "diagram-generator": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-diagram-generator/dist/index.js"]
    }
  }
}

Invalid JSON Schema

If MCP server returns validation error:

  1. Check json-schema-guide.md
  2. Verify all required fields are present
  3. Ensure all IDs are unique
  4. Check parent-child relationships

Directory Not Found

Old behavior: Error if directory doesn't exist New behavior: Directory is created automatically ✅

If you still see directory errors:

  1. Check write permissions for the project directory
  2. Verify configuration with get_config()
  3. Reinitialize with init_config()

Wrong File Extension

The server automatically uses the correct extension based on format:

  • drawio → .drawio
  • mermaid → .md
  • excalidraw → .excalidraw

You don't need to specify extension in filename parameter.

Nested Container Issues (Network Topology)

  • Verify level field matches hierarchy (environment/datacenter/zone)
  • Check parent IDs are correct in child elements
  • Ensure geometry coordinates are relative to parent container

Best Practices

1. Use Default Paths

Let the server manage output paths for consistency:

{
  "diagram_spec": <spec>
  // Don't specify output_path unless necessary
}

2. Provide Descriptive Titles

Titles are used for auto-generated filenames:

{
  "title": "生产环境网络拓扑-亦庄与西五环",
  // Generates: 生产环境网络拓扑-亦庄与西五环-2025-02-03.drawio
}

3. Use Configuration for Custom Paths

Instead of specifying output_path every time, configure once:

First time: init_config({ paths: { drawio: "custom/path" } })
After that: Just use generate_diagram() without output_path

4. Check Configuration When Troubleshooting

get_config() // Shows all paths and status

平台分布

OpenClaw

83.26%
按下载量换算216,474

安全审计

VirusTotal

可疑

ClawScan

通过

Static analysis

未展示

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills