Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

drawio-generator绘图生成器

Agent Skill

drawio-generator 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

466

周安装

20

GitHub Stars

68

下载量

163
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/luongnv89/skills --skill drawio-generator

简介

drawio-generator 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中整理协作事项。

  • 适用于围绕仓库状态、代码变更或协作流程进行信息梳理的场景。
  • 通过 npx skills add 命令安装,需结合原始 README 核验具体用法。
  • 安装前建议确认权限范围、维护状态及是否会触发联网或文件读写操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Draw.io Diagram Generator

You generate professional diagrams and visualizations as valid draw.io XML. Every diagram goes through four phases: Understand the request, Propose options, Generate the XML, and Validate it against 9 quality checks before writing the file.

Environment Check

If the Agent tool is available, use subagents as described in the Subagent Architecture section below. This provides fresh-context validation loops and avoids single-pass context overflow for large diagrams.

If the Agent tool is not available (e.g., Claude.ai), execute each phase inline instead:

  • Phase 1 (Understand) & Phase 2 (Propose): Gather requirements directly in conversation
  • Phase 3 (Generate): Generate the XML in this context
  • Phase 4 (Validate): Self-review the output against the 9 checks (less rigorous, but functional)

Core Workflow

Follow these four phases for every diagram request:

Phase 1: Understand

Before generating anything, make sure you know what to draw.

If the user provides a clear description, confirm briefly and propose the visualization type:

"I'll create a C4 container diagram showing your microservices. I'll use a layered layout with the API gateway at top, services in the middle, and databases at the bottom. Sound good?"

If the input is ambiguous, ask targeted questions:

  • What are the main entities/nodes?
  • What are the relationships/connections?
  • Is there a natural flow direction?
  • Do you need multiple pages (e.g., C4 levels)?

If the user provides code, data, or files, analyze them to extract structure:

  • Code → class diagrams, dependency graphs, architecture diagrams
  • SQL/schema → ER diagrams
  • JSON/YAML config → system architecture, deployment diagrams
  • Steps/process → flowcharts, sequence diagrams

Phase 2: Propose

Present your plan with selectable options:

  1. Diagram type — which visualization fits best. If multiple types could work, present numbered options.
  2. Key elements — list the nodes/shapes you'll include
  3. Layout options — propose 2-3 layouts:

- e.g., (A) Top-to-bottom, (B) Left-to-right, (C) Layered/grouped

  1. Style options:

- Color palette: (1) Professional (draw.io defaults), (2) C4 official colors, (3) Monochrome

  1. Multi-page? — for C4 models, offer separate pages for each level
  2. Estimated complexity — small (< 10 elements), medium (10-30), large (30+)

Wait for the user to confirm before proceeding. For straightforward requests, use sensible defaults and proceed directly.

Phase 3: Generate

Generate the draw.io XML and write it as a .drawio file (raw XML).

Read references/drawio-format.md for the exact XML schema. Here are the critical rules:

File structure

Every .drawio file must have:

  1. <mxfile> root element
  2. One or more <diagram> elements (one per page)
  3. <mxGraphModel> with canvas settings
  4. <root> containing all cells
  5. System cells: <mxCell id="0"/> and <mxCell id="1" parent="0"/> — these are mandatory

Shape cells

Every shape is an <mxCell> with vertex="1":

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

Key rules:

  • Always include html=1;whiteSpace=wrap; in every shape's style — this enables proper text rendering
  • Use descriptive IDs: "node-api-gateway", "db-postgres"
  • Set parent="1" for top-level shapes, or the container's ID for children
  • Size shapes to fit their text (see sizing guide below)

Edge cells

Every connection is an <mxCell> with edge="1":

<mxCell id="edge-a-to-b" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;" edge="1" parent="1" source="node-a" target="node-b">
  <mxGeometry relative="1" as="geometry"/>
</mxCell>

Key rules:

  • Set source and target to the connected shape IDs
  • Use edgeStyle=orthogonalEdgeStyle;rounded=1; for clean routing
  • Always include html=1 in edge styles
  • Edge labels go in the value attribute

Text and sizing

Draw.io wraps text within shapes automatically, but shapes must be large enough:

  • Single-line label: width 120+, height 40–50
  • Title + 1-2 description lines: width 160+, height 80
  • Title + 3-4 lines: width 160+, height 100–120
  • For multi-line text in value, use <br/> for line breaks
  • Use <b>...</b> for bold titles

Containers and boundaries

For system boundaries, swimlanes, and groups:

<mxCell id="boundary" value="System Boundary" style="rounded=1;container=1;swimlane=1;startSize=30;fillColor=none;strokeColor=#666;dashed=1;html=1;" vertex="1" parent="1" connectable="0">
  <mxGeometry x="50" y="50" width="500" height="400" as="geometry"/>
</mxCell>

Children use parent="boundary" and coordinates relative to the container.

Multi-page diagrams

For C4 models or complex systems, use multiple <diagram> elements:

<mxfile>
  <diagram name="Context" id="page-1">...</diagram>
  <diagram name="Container" id="page-2">...</diagram>
</mxfile>

Each page has its own independent cell IDs and system cells (id="0", id="1").

File naming

Use descriptive kebab-case names: auth-flow.drawio, system-architecture.drawio. If the user specifies a path, use that instead.

Phase 4: Validate

After generating the XML but before writing the file, run every check below. Fix any failures and re-check until all pass.

Check 1: Valid XML structure

  • The XML parses without error
  • Has <mxfile><diagram><mxGraphModel><root> hierarchy
  • Each page has system cells id="0" and id="1" parent="0"

Check 2: All shapes have required attributes

Every vertex cell must have: id, value, style, vertex="1", parent, and a child <mxGeometry> with x, y, width, height, as="geometry".

Every style string must include html=1;whiteSpace=wrap;.

Fix: Add missing attributes with defaults.

Check 3: Unique IDs

All id values must be unique within each page. No duplicates.

Fix: Append suffix to duplicates.

Check 4: Edge bindings valid

Every edge with source or target must reference an existing vertex ID in the same page.

Fix: Remove broken references or add missing shapes.

Check 5: Edge geometry

Every edge must have <mxGeometry relative="1" as="geometry"/>.

Fix: Add missing geometry.

Check 6: No overlapping shapes

Check that vertex bounding boxes don't overlap by more than 10px (unless one is a container parent of the other).

Fix: Shift overlapping shapes.

Check 7: Container hierarchy valid

Every cell with parent="X" (where X is not "0" or "1") must reference an existing container cell. Children coordinates must be relative to the container.

Fix: Correct parent references.

Check 8: Semantic completeness

Every entity, relationship, or concept from the user's request is represented.

Fix: Add missing elements.

Check 9: Text readable and shapes sized

  • All fontSize >= 11
  • All shapes are wide/tall enough for their value text
  • Single line: height >= 40. Multi-line: add ~20px per extra line.

Fix: Increase shape dimensions or font size.

Validation report

After all checks pass:

Validation: 9/9 checks passed
- Pages: N
- Elements: X shapes, Y edges
- Containers: Z
- All IDs unique, all edges bound, no overlaps

Expected Output

A valid .drawio file written to disk (raw XML). Example output for a two-node flowchart:

<mxfile>
  <diagram name="Flow" id="page-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="1169" pageHeight="827" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>
        <mxCell id="node-start" value="Start" style="ellipse;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
          <mxGeometry x="100" y="80" width="120" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="node-process" value="Process Request" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
          <mxGeometry x="100" y="200" width="160" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="edge-start-process" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;" edge="1" parent="1" source="node-start" target="node-process">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>

After file write, the skill reports:

Validation: 9/9 checks passed
- Pages: 1
- Elements: 2 shapes, 1 edge
- Containers: 0
- All IDs unique, all edges bound, no overlaps
File written: flow.drawio

Edge Cases

  • Empty or vague input (e.g., "make a diagram"): Ask targeted clarifying questions (entities, relationships, flow direction) before generating anything — never produce a placeholder diagram.
  • Very large diagram (>50 elements): Warn the user that a single page may become crowded; offer to split into multiple pages or hierarchical C4 levels.
  • Unsupported diagram type: If the requested type cannot be represented cleanly in draw.io XML (e.g., a Gantt chart with real date-axis ticks), explain the limitation and propose the closest supported alternative (e.g., a swimlane timeline).
  • Existing .drawio file being extended: Read the existing file first, preserve all existing cell IDs, and append new elements — never regenerate from scratch.
  • Conflicting layout constraints: If the user specifies both "left-to-right" and "circular" layouts, surface the conflict and ask which takes priority.
  • IDs that would collide across pages: Each <diagram> element has its own ID namespace; system cells id="0" and id="1" must be present on every page independently.
  • Text longer than shape capacity: Auto-increase shape height by ~20px per extra line rather than letting text overflow silently.

Step Completion Reports

After completing each major step, output a status report in this format:

◆ [Step Name] ([step N of M] — [context])
··································································
  [Check 1]:          √ pass
  [Check 2]:          √ pass (note if relevant)
  [Check 3]:          × fail — [reason]
  [Check 4]:          √ pass
  [Criteria]:         √ N/M met
  ____________________________
  Result:             PASS | FAIL | PARTIAL

Adapt the check names to match what the step actually validates. Use for pass, × for fail, and to add brief context. The "Criteria" line summarizes how many acceptance criteria were met. The "Result" line gives the overall verdict.

Skill-specific checks per phase

Phase: Understand — checks: Requirements gathered, Scope confirmed

Phase: Propose — checks: Proposal approved, User confirmed

Phase: Generate — checks: XML valid, Layout correct, Requirements gathered

Phase: Validate — checks: XML valid, Layout correct, Quality checks 9/9

Style Guidelines

Default style: Professional

  • Font: Helvetica (draw.io default)
  • Font size: 14 for labels, 11 for descriptions
  • Colors: draw.io Professional palette from references/drawio-format.md
  • Edge routing: orthogonalEdgeStyle with rounded=1

C4 style

  • Use official C4 colors from references/drawio-format.md
  • White text on dark backgrounds
  • Bold titles, regular descriptions
  • Dashed boundaries for system/container scopes

Color assignment strategy

  • Flowcharts: Blue for process, green for start/end, orange for decisions, red for errors
  • Architecture: Color by layer — blue for frontend, green for backend, purple for data, gray for external
  • C4: Use official C4 palette (blue tones by depth level)

Supported Diagram Types

CategoryTypes
Flow & ProcessFlowchart, sequence diagram, swimlane, state machine, activity diagram, BPMN
ArchitectureSystem architecture, microservices, network topology, cloud, C4 model, deployment
Data & RelationshipsER diagram, class diagram, dependency graph, mind map, tree, org chart
PlanningGantt chart, roadmap, timeline, Kanban board
ComparisonQuadrant chart, SWOT, comparison matrix, Venn diagram
UX/DesignWireframe, user flow, sitemap
CustomAny freeform diagram from description

Iteration

After generating the first version, the user may want changes:

  • "Add X" — add new shapes/connections
  • "Remove Y" — remove elements
  • "Change layout" — rearrange positions
  • "Change style" — adjust colors, fonts
  • "Add a page" — add another diagram page

When iterating, read the existing file, modify the XML, and rewrite. Preserve element IDs that haven't changed.


Subagent Architecture

When the diagram complexity exceeds 30 elements, spawn a review loop to ensure quality without single-context degradation:

Complexity Threshold Check

At the end of Phase 2 (Propose), estimate element count:

  • Small (< 10 elements): Proceed inline (Phases 3-4 in main agent context)
  • Medium (10-30 elements): Proceed inline with careful validation
  • Large (> 30 elements): Spawn subagent review loop (recommended)

Phase 3: Generate → xml-generator subagent

Spawn agents/xml-generator.md with the confirmed plan:

  • Receives: diagram type, elements list, edges list, style options, complexity estimate
  • Outputs: Complete draw.io XML with all required shape and edge attributes
  • Key constraint: Must size shapes to fit all text labels

Phase 4: Validate → Review Loop (max 3 cycles)

If complexity > 30:

  1. Cycle 1: Fresh Validation

- Spawn agents/xml-validator.md with generated XML - Receives: Complete XML, original plan - Outputs: Structured validation report with PASS/FAIL for all 9 checks

  1. If NEEDS_FIX:

- Spawn agents/xml-fixer.md with validation report - Receives: Original XML, fix priorities, cycle number - Outputs: Patched XML (never regenerated from scratch) - Constraint: Apply only targeted fixes; skip semantic/structure issues (require generator revision)

  1. If still NEEDS_FIX and cycle < 3:

- Return to step 1 (re-validate) with cycle++

  1. If cycle == 3 or PASS:

- Return to main agent for file write or user review

Fallback (if Agent tool unavailable)

Execute validation inline with self-review against the 9 checks. Less rigorous but functional.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.79%
按下载量换算55

Claude

32.22%
按下载量换算53

Cursor

18.22%
按下载量换算30

Gemini CLI

9.45%
按下载量换算15

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills