Research Draw.io Diagram Skill
A portable agent skill for producing publication-style, editable diagrams.net / draw.io figures from papers, prompts, codebases, project context, screenshots, and one or more visual references.
npx skills add Will-hxw/drawio-diagram-builder-skill
中文版
Quick Install With An Agent
Copy this prompt into Codex, Claude Code, or another local coding agent:
Install and test the drawio-diagram-builder skill from:
https://github.com/Will-hxw/drawio-diagram-builder-skill
After installing, run its smoke test and tell me the exact skill path.
After installation, ask the agent to run the bundled update check against its installed skill path:
python \scripts\check_skill_update.py
Prerequisites
| Requirement | Why |
|---|
| Python 3 (3.7+) | Preview and validation scripts |
| Browser automation (Playwright MCP, Puppeteer, browser tools, etc.) | Screenshot feedback loop — the skill is evidence-driven |
| Internet access | Preview loads https://embed.diagrams.net/ |
Without browser automation the agent can still generate .drawio XML, but cannot visually verify the result. The iterative refinement loop is the skill's main value.
Why This Exists
LLMs can write draw.io XML, but the first result is usually not right:
- text overlaps or escapes boxes
- arrows route incorrectly
- loop arrows look wrong
- icons are missing or inconsistent
- reference figures get embedded as images instead of redrawn as editable objects
- large diagrams crash on Windows with long-URL failures
This skill gives the agent a repeatable workflow: synthesize the user's text and image inputs into a diagram brief → create editable XML → preview through a local URL (not a giant encoded one) → screenshot → self-review visible and semantic defects → fix → repeat → validate.
For reference-image replication, the skill now enforces a stricter protocol: the agent must write a visual spec, coordinate layout grid, asset ledger, and defect log before drawing. Final handoff must include a screenshot-reviewed defect log, not just valid XML.
For prompt, paper, codebase, or mixed-input diagrams, the skill now also requires a self-supervision protocol: classify each input as content, structure, style, layout, or asset evidence; define connector semantics before drawing arro