No layout
ELK layout, box render
Every diagram becomes a native .drawio file first, then whatever format you asked for.
The official draw.io skill, shipped byte-identical to Claude Code, Codex, Copilot, Cursor and Antigravity. Author as Mermaid or XML, repair it, lay it out with ELK, and export with the XML embedded so every PNG stays editable. I read the skill, ran both servers’ test suites and the shared modules. Every diagram becomes a native .drawio file first, then is delivered in the requested output format, whether you authored Mermaid or XML.
Agents in terminals (Claude Code, Codex, Copilot CLI) where diagrams cannot render inline.
A .drawio, an embedded-XML PNG/SVG/PDF, or an app.diagrams.net link.
The skill is one pipeline with two ways in.
Inline first. Inline viewer first. In chats that render diagrams, the MCP create_diagram tool wins.
Author. Mermaid when the desktop CLI exists; XML otherwise. If Mermaid was requested but no desktop CLI is available, author the same diagram as XML.
Repair. It changes nothing in a well-formed file, and needs only Node.js.
Lay out. The CLI's --layout step auto-positions XML-authored diagrams with the same ELK layouts as the editor's Arrange ▸ Layout menu and the draw.io MCP app server.
Deliver. Exports use double extensions so the name says the XML is inside.
Pick an authoring route, a layout or an output. Quotes are checked against SKILL.md at build time.
ELK layouts and Mermaid conversions rendered on this box, plus the repo’s own gallery. Click to enlarge.
ELK layout, box render
ELK layout, box render
ELK layout, box render
ELK layout, box render
Mermaid → .drawio → PNG, box render
Mermaid → .drawio → PNG, box render
Mermaid → .drawio → PNG, box render
Mermaid → .drawio → PNG, box render
Mermaid → .drawio → PNG, box render
Mermaid → .drawio → PNG, box render
Mermaid → .drawio → PNG, box render
Mermaid → .drawio → PNG, box render
Mermaid → .drawio → PNG, box render
Mermaid → .drawio → PNG, box render
Mermaid → .drawio → PNG, box render
Mermaid → .drawio → PNG, box render
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
Repo gallery (docs/images/gallery)
The skill’s inline repair step is a small version of repair-xml.js. I imported each module and ran it on test input.
All runs used a copy of the repo in /tmp, with nice and timeout, at commit 05c1747.
| Run | Result | Note |
|---|---|---|
| mcp-tool-server npm test | 125/125 pass | About 1 s. |
| mcp-app-server npm test | 76 pass, 2 skipped | Skipped tests need a live Worker (EDGE_COMPARE_URL). |
| SKILL.md repair one-liner | fixed | Prose, fence, unescaped label and self-parented layer. |
| SKILL.md URL one-liner | round-trips | 247-character link for a tiny diagram. |
| Shared modules | work | repair, normalize, mermaid-elk and shape search all behaved as documented. |
| 5 SKILL.md ports | byte-identical | A CI workflow enforces it. |
| draw.io Desktop CLI | not on the box | Mermaid conversion, layout and export need it. |
Without it the skill can only write XML and a URL. The skill says so and falls back cleanly.
SKILL.md tells the agent to fetch xml-essentials.md and mermaid-reference.md from raw.githubusercontent.com/…/main, so a skill pinned at one commit reads rules from another.
The inline one-liner and repair-xml.js do overlapping work; only the module reports what it changed or handles leaked tool-call tags.
“cisco router” returns a stencil titled “10700” above “ATM Router”.
-e embeds the XML, and the double extension tells people it is there.
One workflow fails the build if any port’s SKILL.md drifts from the Claude Code copy.
One native artifact, many deliveries. Write the source format first; derive the rest.
Prefer a layout engine to model coordinates. Ask for structure, not positions.
Measure the model’s mistakes, then fix them in code. repair-xml.js says its three fixes covered all 15 broken diagrams out of 473.
Detect the environment exhaustively. The Windows chain checks PATH, install paths, registry and other drives before giving up.
Keep ports identical by CI.
Each quote on this page is compared with its source file at build time; the build fails on any mismatch.