Xpersona
D

Draw.io Diagram Generator And Exporter

CLAWHUB · Unverified

**Use this skill** when the user wants to create any diagram: flowchart, architecture, UML (sequence/class), ER, mindmap, network topology, or any visual dia... Skill: Draw.io Diagram Generator And Exporter Owner: bruc3van Summary: **Use this skill** when the user wants to create any diagram: flowchart, architecture, UML (sequence/class), ER, mindmap, network topology, or any visual dia... Tags: latest:3.1.0 Version history: v3.1.0 | 2026-04-09T02:31:16.448Z | user bruce-drawio 3.0.3 Changelog - Expanded and clarified documentation in SKILL.md, detailing step-by-step workflo

62
Rank
84
Safety
1.6k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.6K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17an43c301m4vkr29gvy4mhg983hqms:bruce-drawio
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-bruc3van-bruce-drawio/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

79,252 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: bruce-drawio
description: |
  **Use this skill** when the user wants to create any diagram: flowchart, architecture, UML (sequence/class), ER, mindmap, network topology, or any visual diagram.

  Trigger words: "draw", "diagram", "flowchart", "architecture", "UML", "sequence diagram", "mindmap", "ER diagram", "network topology", "visualize", "draw.io", "drawio".

  Workflow: understand requirements -> generate drawio XML directly -> self-review -> CLI export PNG/SVG/PDF.
---

# Draw.io Diagram Generator

## Workflow

```
1. Understand requirements  -> determine diagram type, elements, relationships
2. Generate XML directly    -> write drawio XML (read only the relevant section from references/best-practices.md)
3. Self-review (DO NOT SKIP) -> re-read XML and fix any issues found
4. Save .drawio file        -> write to user's working directory
5. CLI export               -> call draw.io desktop CLI to export image
6. Deliver to user          -> show image + provide editable .drawio file
```

## Step 1: Understand Requirements

Determine:
- **Diagram type**: flowchart / architecture / uml-sequence / uml-class / er / mindmap / network
- **Key elements**: nodes, components, participants, entities
- **Relationships**: connections, dependencies, flow direction
- **Output format**: PNG (default) / SVG / PDF
- **Language**: match the user's language for labels

## Step 2: Generate XML

**You MUST write the XML directly.** Do not call any script to generate it.

### Base XML Structure

```xml
<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="app.diagrams.net" agent="drawio-skill" version="21.0.0" type="device">
  <diagram name="DiagramName" id="diagram-1">
    <mxGraphModel dx="1422" dy="762"
                   grid="1" gridSize="10"
                   guides="1" tooltips="1" connect="1"
                   arrows="1" fold="1"
                   page="1" pageScale="1"
                   pageWidth="1600" pageHeight="1200"
                   math="0" shadow="0">
      <root>
        <mxCell id="0" />
        <mxCell id="1" parent="0" />

        <!-- nodes and edges here -->

      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
```

### Node Template

```xml
<mxCell id="node-1" value="Label"
        style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=14;"
        vertex="1" parent="1">
  <mxGeometry x="100" y="100" width="160" height="60" as="geometry" />
</mxCell>
```

### Text Content Rules

- For multi-line labels, encode line breaks as `&#xa;` inside `value`, for example `value="API&#xa;Gateway"`
- Do not write literal `\n` inside `value`; draw.io will render it as backslash + n text
- Keep `html=1` on nodes, but still use `&#xa;` as the default line-break form for predictable output

### Edge Template

```xml
<mxCell id="edge-1" value=""
        style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy

README.md

[English](README_EN.md) | 中文

# Draw.io 图表生成技能

跨平台的 draw.io (diagrams.net) 图表生成技能,适用于 AI 编程 Agent(Claude Code、OpenClaw 等)。Agent 直接生成 drawio XML,经过自检后通过 CLI 导出图片。

## 安装

向你的 AI 编程 Agent 发送以下提示词:

```
帮我安装这个skill:https://github.com/brucevanfdm/bruce-drawio
```

Agent 会自动克隆仓库并完成配置。

## 支持的图表类型

| 类型 | 说明 | 触发词示例 |
|------|------|-----------|
| 流程图 | 业务流程、审批流程、算法逻辑 | "画一个流程图" |
| 架构图 | 系统架构、微服务、部署架构 | "画一个架构图" |
| UML 时序图 | 组件之间的交互时序 | "画一个时序图" |
| UML 类图 | 类关系、继承结构 | "画一个类图" |
| ER 图 | 数据库设计、实体关系 | "画一个 ER 图" |
| 思维导图 | 头脑风暴、知识梳理 | "画一个思维导图" |
| 网络拓扑图 | 网络架构、设备连接 | "画一个网络拓扑图" |

## 平台支持

| 平台 | 安装命令 | 包管理器 |
|------|---------|---------|
| macOS | `brew install --cask drawio` | Homebrew |
| Windows | `winget install JGraph.Draw` | winget / Chocolatey |
| Linux | `snap install drawio` | snap / 手动安装 |

所有平台也支持从 [draw.io releases](https://github.com/jgraph/drawio-desktop/releases) 手动下载安装。

## 工作流程

1. 用户描述想要的图表
2. Agent 判断图表类型和关键元素
3. Agent 直接生成完整的 drawio XML
4. 自检清单验证正确性和布局
5. 保存 `.drawio` 文件
6. 通过 CLI 导出为 PNG/SVG/PDF
7. 向用户展示图片并提供可编辑的源文件

## 导出格式

| 格式 | 参数 | 适用场景 |
|------|------|---------|
| PNG | `-f png` | 默认格式,通用性强 |
| SVG | `-f svg` | 可缩放矢量图 |
| PDF | `-f pdf` | 打印 / 嵌入文档 |

使用 `--scale 2` 可导出高清 PNG。

## 项目结构

```
bruce-drawio/
  SKILL.md                      # 主技能文档(工作流程 + 规则)
  skill.json                    # 技能元数据
  references/
    best-practices.md           # XML 模板、样式、布局规则
    examples.md                 # 完整的可用 XML 示例
  evals/
    evals.json                  # 测试用例
```

## 架构图风格

架构图默认采用**分层块状布局**风格:

- 灰色背景底板
- 左侧标签列标注每一层(如"场景层"、"应用层")
- 蓝色半透明层容器,内含子分组
- 白色叶子节点,灰色边框
- 可选的右侧跨层侧边栏(如安全、监控等横切关注点)
- 纯块状图,不使用箭头连线,通过空间嵌套表达层次关系

## 依赖检测

无需额外脚本。Agent 按照 SKILL.md 中的步骤通过 shell 命令(`which drawio`、检查默认安装路径)自动检测 draw.io。如果未安装,会引导用户安装。

## 使用示例

安装完成后,用自然语言描述你想要的图表即可,例如:

- "画一个电商下单流程图"
- "画一个微服务架构图"
- "画一个用户注册的时序图"
- "画一个博客系统的 ER 图"
- "画一个 AI Agent 的思维导图"

_meta.json

{
  "ownerId": "kn75rk9wg9gzvsaaw2zcq75ekn81z7n2",
  "slug": "bruce-drawio",
  "version": "3.1.0",
  "publishedAt": 1775701876448
}

references/best-practices.md

# Draw.io XML Best Practices

## General Rules

### ID Management
- Use meaningful IDs: `start`, `process-1`, `decision-stock`, `edge-payment`
- All IDs must be globally unique within the file
- Recommended format: `{type}-{name}` or `{type}-{number}`
- IDs `0` and `1` are reserved for root mxCells

### Style Essentials
- Always include `whiteSpace=wrap;html=1;` so text wraps properly
- Always set `fontSize=14;` or larger for readability
- Use `fontStyle=1` for bold headers, `fontStyle=0` for normal text
- Use `strokeWidth=2;` for important borders
- Edges should use `edgeStyle=orthogonalEdgeStyle;rounded=1;` for clean right-angle routing
- Add `exitX`, `exitY`, `entryX`, `entryY` on edges for precise anchor points

### Text and Line Breaks
- For multi-line labels, use `&#xa;` inside `value`, for example `value="Scene&#xa;Layer"`
- Never use literal `\n` inside `value`; draw.io treats it as visible text rather than a rendered line break
- Apply the same rule to node labels, layer labels, edge labels, and swimlane/table text when a forced line break is needed

### Alignment and Space Usage
- Sibling items in the same row or column should use equal widths, equal heights, and equal gaps unless the content explicitly requires otherwise
- Outer padding should be close to the internal gap size; avoid one oversized blank gutter on the left, right, top, or bottom
- Containers should be content-driven: fit the actual number of rows and columns plus consistent padding, instead of leaving large unused blank blocks
- If the last row is not full, center it inside the container rather than leaving a large empty tail on one side
- For sidebars and cross-cutting panels, either:
  - size the panel to its content plus balanced top/bottom padding, or
  - if the panel must span the full stack height, distribute items so the top gap, inter-item gaps, and bottom gap are visually balanced

### Common Mistakes to Avoid

1. **Duplicate IDs** - every mxCell must have a unique id
2. **Wrong parent** - standalone nodes use `parent="1"`, container children use the container ID
3. **Missing `as="geometry"`** - every mxGeometry must have this attribute
4. **Overlapping nodes** - always calculate and verify bounding boxes
5. **Missing `whiteSpace=wrap;html=1;`** - text will overflow without this
6. **Edges referencing non-existent IDs** - double-check source/target
7. **Coordinates not grid-aligned** - use multiples of 10
8. **Too small font** - minimum fontSize=12, prefer 14
9. **No edge style** - without `edgeStyle=orthogonalEdgeStyle`, edges route randomly
10. **Page too small** - if content exceeds 1200x900, increase pageWidth/pageHeight
11. **Literal `\n` in `value`** - use `&#xa;` for real line breaks
12. **Unbalanced whitespace** - reduce one-sided blank areas by resizing items, gaps, or the containing frame
13. **Loose packing** - do not leave containers half-empty when a tighter, symmetric layout is possible

## Architecture Diagram Templates (Layered Block Style)

**T

references/examples.md

# Draw.io Complete XML Examples

These are ready-to-use, tested XML examples demonstrating proper structure, layout, and styling.

For multi-line text in any `value` attribute, use `&#xa;` instead of literal `\n`.

## Example 1: Simple Flowchart (Order Process)

```xml
<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="app.diagrams.net" agent="drawio-skill" version="21.0.0" type="device">
  <diagram name="Order Flow" id="order-flow">
    <mxGraphModel dx="1422" dy="762" grid="1" gridSize="10" guides="1" tooltips="1"
                   connect="1" arrows="1" fold="1" page="1" pageScale="1"
                   pageWidth="1000" pageHeight="800" math="0" shadow="0">
      <root>
        <mxCell id="0" />
        <mxCell id="1" parent="0" />

        <!-- Start -->
        <mxCell id="start" value="User Places Order"
                style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=14;fontStyle=1;arcSize=50;"
                vertex="1" parent="1">
          <mxGeometry x="340" y="40" width="180" height="60" as="geometry" />
        </mxCell>

        <!-- Process: Create Order -->
        <mxCell id="process-create" value="Create Order Record"
                style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=14;"
                vertex="1" parent="1">
          <mxGeometry x="350" y="160" width="160" height="60" as="geometry" />
        </mxCell>

        <!-- Decision: Stock Check -->
        <mxCell id="decision-stock" value="In Stock?"
                style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=14;"
                vertex="1" parent="1">
          <mxGeometry x="350" y="280" width="160" height="80" as="geometry" />
        </mxCell>

        <!-- Process: Payment -->
        <mxCell id="process-pay" value="Process Payment"
                style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=14;"
                vertex="1" parent="1">
          <mxGeometry x="350" y="420" width="160" height="60" as="geometry" />
        </mxCell>

        <!-- Error: Out of Stock -->
        <mxCell id="error-stock" value="Notify: Out of Stock"
                style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=14;"
                vertex="1" parent="1">
          <mxGeometry x="600" y="290" width="160" height="60" as="geometry" />
        </mxCell>

        <!-- Process: Ship -->
        <mxCell id="process-ship" value="Ship Order"
                style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=14;"
                vertex="1" parent="1">
          <mxGeometry x="350" y="540" width="160" height="60" as="geometry" />
        </mxCell>

        <!-- End -->
        <mxCell id="end" value="Order Complete"
                style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=14;fontStyle=1;arcSize=50;"
               

Sponsored

Ads related to Draw.io Diagram Generator And Exporter and adjacent AI workflows.