skills/drawio-generator/SKILL.md
Generate professional diagrams as valid draw.io XML — flowcharts, architecture, C4 models, ER diagrams, sequence diagrams, mind maps, and swimlanes. Don't use for Excalidraw or Mermaid output, hand-drawn sketch styles, or slide decks/presentations.
npx skillsauth add luongnv89/skills drawio-generatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate professional diagrams as valid draw.io XML. Every request flows through four phases — Understand, Propose, Generate, Validate — before the file is written. Body content is intentionally lean to respect the agent's context budget; depth lives in references/.
If the Agent tool is available, use subagents per the Subagent Architecture section. This provides fresh-context validation loops and avoids single-pass context overflow on large diagrams.
If the Agent tool is unavailable (e.g., Claude.ai), execute each phase inline:
Confirm what to draw before generating anything.
"I'll create a C4 container diagram with a layered layout: API gateway on top, services in the middle, databases at the bottom. Sound good?"
Present a numbered plan and wait for confirmation. For straightforward requests, use sensible defaults and proceed.
(A) Top-to-bottom, (B) Left-to-right, (C) Layered(1) Professional, (2) C4 official, (3) MonochromeGenerate the draw.io XML and write a .drawio file (raw XML).
Read references/xml-authoring.md for shape/edge/container syntax, sizing rules, multi-page structure, and file naming. Read references/drawio-format.md for the full XML schema and color palettes.
Critical rules every shape must follow:
html=1;whiteSpace=wrap; in the style stringnode-api-gateway)<mxGeometry x y width height as="geometry"/> sized to fit the labelsource, target, and <mxGeometry relative="1" as="geometry"/>Run all 9 checks before writing the file. Fix and re-check until every check passes. See references/validation-checks.md for the full check list, fix patterns, and the validation-report template.
Summary of checks:
html=1;whiteSpace=wrap; mandatory)source/target reference existing vertices<mxGeometry relative="1" as="geometry"/>fontSize ≥ 11, shapes sized to fit valueA valid .drawio file written to disk (raw XML). Minimal example:
<mxfile>
<diagram name="Flow" id="page-1">
<mxGraphModel dx="1422" dy="762" grid="1" gridSize="10" page="1" pageWidth="1169" pageHeight="827">
<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
Verify these for every run:
.drawio file is written to disk with valid XML (parses without error).id="0" and id="1" parent="0".html=1;whiteSpace=wrap; and every edge has <mxGeometry relative="1" as="geometry"/>.source/target attributes resolve to existing vertex IDs in the same page.fontSize values ≥ 11; shapes are sized so labels fit without overflow.9/9 checks passed. Given the user's request, then every entity and relationship described is represented in the output..drawio file extension: read it first, preserve existing cell IDs, append new elements — never regenerate from scratch.<diagram> has its own ID namespace; system cells id="0" and id="1" must be present on every page independently.After completing each major step, output a status report:
◆ [Step Name] ([step N of M] — [context])
··································································
[Check 1]: √ pass
[Check 2]: √ pass (note if relevant)
[Check 3]: × fail — [reason]
[Criteria]: √ N/M met
____________________________
Result: PASS | FAIL | PARTIAL
Per-phase checks:
Requirements gathered, Scope confirmedProposal approved, User confirmedXML valid, Layout correct, Requirements coveredXML valid, Layout correct, Quality checks 9/9orthogonalEdgeStyle with rounded=1.Full palettes and tokens: references/drawio-format.md.
| Category | Types | |---|---| | Flow & Process | Flowchart, sequence, swimlane, state machine, activity, BPMN | | Architecture | System, microservices, network, cloud, C4, deployment | | Data & Relationships | ER, class, dependency graph, mind map, tree, org chart | | Planning | Gantt, roadmap, timeline, Kanban | | Comparison | Quadrant, SWOT, comparison matrix, Venn | | UX/Design | Wireframe, user flow, sitemap | | Custom | Any freeform diagram |
When iterating on an existing diagram, read the file, modify the XML in place, and rewrite. Preserve element IDs that haven't changed. Common requests: add/remove elements, change layout, adjust style, add a page.
When a diagram exceeds 30 elements, spawn a review loop to avoid single-context degradation. Use the complexity estimate from Phase 2 step 6: large (30+) spawns the subagent review loop below; small/medium proceed inline.
Phase 3 — agents/xml-generator.md
Phase 4 — review loop (max 3 cycles)
agents/xml-validator.md. Outputs PASS/FAIL for all 9 checks.agents/xml-fixer.md with the report. Patches XML; never regenerates. Skips semantic/structure issues (those require generator revision).Fallback — without the Agent tool, validate inline using references/validation-checks.md. Less rigorous but functional.
tools
Run Herdr loops for one open GitHub issue (resolve→review→fix) or an existing PR (review→lazy fixer) until CLEAN. Don't use for plain resolution without review, review-only/no-fix requests, backlog automation, or merging.
tools
Manage AI agent fleets in Herdr: split root + sub-agents into one tab as a tiled grid, message/wait/read via herdr CLI, steer any pane. Use for Herdr multi-agent fleets. Don't use for tmux, screen, or non-Herdr terminals.
development
Generate or update docs to match the code, citing each claim to path:line and asking on ambiguity; runbook docs also get a check-only validation script. Don't use for API-reference autogen (JSDoc/Sphinx), landing pages, or CLAUDE.md/AGENTS.md.
testing
Generate a diagram and route to the right engine — draw.io XML (precise, editable, C4, swimlanes) or Excalidraw JSON (hand-drawn, sketch, wireframes). One entry for flowcharts, architecture, ER, sequence, mind maps. Don't use for Mermaid or slides.