drawio
Installation
SKILL.md
Draw.io Diagram Skill
Generate draw.io diagrams as native .drawio files. Optionally export to PNG, SVG, or PDF with the diagram XML embedded (so the exported file remains editable in draw.io).
How to create a diagram
- Generate draw.io XML in mxGraphModel format for the requested diagram
- Write the XML to a
.drawiofile in the current working directory using the Write tool - Post-process edge routing (optional): If
npx @drawio/postprocessis available, run it on the.drawiofile to optimize edge routing (simplify waypoints, fix edge-vertex collisions, straighten approach angles). Skip silently if not available — do not install it or ask the user about it - If the user requested an export format (png, svg, pdf), locate the draw.io CLI (see below), export with
--embed-diagram, then delete the source.drawiofile. If the CLI is not found, keep the.drawiofile and tell the user they can install the draw.io desktop app to enable export, or open the.drawiofile directly - Open the result — the exported file if exported, or the
.drawiofile otherwise. If the open command fails, print the file path so the user can open it manually
Choosing the output format
Check the user's request for a format preference. Examples: