# drawio-skill: editable draw.io diagrams from text or code (Agents365-ai/drawio-skill) — skill card for AI agents

> AgentGid skill card. Checked on 2026-11-06 against commit 5727082 (version 3.4.3).
> Every fact comes from the pack's own files at that commit. Numbers marked "as reported" are the author's.
> Human page: https://agentgid.com/skills/agents365-ai/drawio-skill/

> Note: the pack has changed since this check; re-read its files before relying on details.

## Explain it to a non-programmer
Your AI assistant draws diagrams you can still edit: architecture maps, flowcharts, database charts, org charts and more, saved as draw.io files. It can also read your code, server setup files or database tables and draw them for you. It checks its own picture, fixes overlaps and shows you a draft before the final export.

## Who it is for
- You want a diagram you can open and change in draw.io, not a flat picture
- You want a map of an existing project, its servers or its database drawn from the real files
- You make slides or documents with system diagrams and want real AWS, Kubernetes or AI brand icons
- You use Claude Code, Cursor, Copilot, Codex or a similar assistant that can run commands
- Not for: A simple text diagram in your docs is enough: the author points to Mermaid or PlantUML for that
- Not for: You want a hand-drawn whiteboard look: the author points to its sibling excalidraw-skill or tldraw-skill

## What it is
- Kind: scripts, knowledge
- License: MIT
- Repository: https://github.com/Agents365-ai/drawio-skill

## What it does
- Picks a route for the request: hand-written draw.io XML for precise styling, Mermaid conversion for standard charts (draw.io 30+), automatic layout for graphs of about 15+ nodes
- Imports real sources into diagrams: Python, JS/TS, Go and Rust code, Terraform, Kubernetes, docker-compose, SQL tables, OpenAPI, AsyncAPI, Protobuf, GraphQL and CI pipelines
- Keeps one model of the system (Diagram IR) and projects executive, system, deployment, data-flow and security views from it
- Updates a diagram from changed sources without losing your manual layout; removed parts stay as faded, reviewable elements
- Checks diagrams: a structural linter with a score, architecture rules from a policy file, queries, a written review and failure what-if
- Searches over 10,000 official draw.io shapes and 321 AI brand logos instead of guessing icon names
- Exports to PNG, SVG and PDF, and repurposes a diagram as an HTML viewer, slide deck, Mermaid, Markdown, animated SVG or a click-through walkthrough
- Rebuilds an editable diagram from a screenshot or a whiteboard photo
- Never cuts: Source-backed relationships over guesses; inferred findings are not presented as verified facts; no secrets in diagram properties

## Skills
| Skill | Call | Changes code? | In plain words |
|---|---|---|---|
| drawio-skill | /drawio-skill, then describe the diagram (Codex: $drawio-skill) | no | Draws, updates, checks and exports editable draw.io diagrams; writes new diagram files, not your code |

### drawio-skill
- Asks for: What to draw, in words (or a screenshot or whiteboard photo)
- Asks for: Or the source to draw from: a code folder, Terraform, Kubernetes or compose files, SQL, an API schema
- Asks for: Optional: a style name (corporate, dark, colorblind-safe, handdrawn or your own)
- Asks for: Optional: the output formats you want (PNG, SVG, PDF)
- Gives: An editable .drawio file
- Gives: A PNG by default; SVG or PDF with the diagram embedded on request
- Gives: A validation score and, on request, an architecture review in Markdown
- Gives: Optional extras: linked views, a what-if impact report, an offline HTML walkthrough
- Say: "Use drawio-skill to draw a microservices e-commerce architecture with an API gateway, five services, Kafka and three databases"

## Know before installing
- In Claude Code it does not switch on by itself: the skill file disables automatic loading, so call it by name.
- Codex may pick it up on its own: its agent file allows implicit invocation.
- It asks for broad tools: running commands, reading and writing files, and fetching web pages.
- It writes outside your project: style presets you save go to ~/.drawio-skill/styles/, after you approve a preview.
- AI brand logos load from a public icon CDN when the diagram is opened, unless you ask for embedded icons.
- Keep secrets out of diagram labels and properties: they are saved inside the .drawio and HTML files.

## Install (official commands)
- Any agent (skills installer): `npx skills add Agents365-ai/drawio-skill -g` — Update with npx skills update drawio-skill -g.
- Claude Code (manual): `mkdir -p ~/src` && `git clone https://github.com/Agents365-ai/drawio-skill.git ~/src/drawio-skill` && `mkdir -p ~/.claude/skills` && `ln -s ~/src/drawio-skill/skills/drawio-skill ~/.claude/skills/drawio-skill` — Use cp -R instead of ln -s on hosts that do not follow symlinks. Link only the skills/drawio-skill folder, not the whole repository. Remove: `delete ~/.claude/skills/drawio-skill (and ~/src/drawio-skill)`.
- Codex, Opencode, OpenClaw, Autohand Code: Same folder, other skill roots: ~/.agents/skills/ (Codex), ~/.config/opencode/skills/, ~/.openclaw/skills/, ~/.autohand/skills/.
- draw.io desktop (for exports): `brew install --cask drawio` — macOS; Windows and Linux use the installers from jgraph/drawio-desktop releases. Check with drawio --version.
- MCP hosts (optional): `claude mcp add drawio-skill -- python3 <path>/scripts/diagramctl_mcp.py` — Optional: exposes build, sync, views, test, review, query, what-if and story as MCP tools to Claude Desktop, Cursor, VS Code or Codex.

## What runs on the user's machine
- Code on the machine: yes (when the assistant uses the skill (no hooks, nothing runs at install))
- Network: optional
- Install: Markdown, data files and Python scripts are copied. No hooks, no install scripts.
- Every diagram: The assistant runs the bundled Python scripts (diagramctl.py, validate.py and others) and writes .drawio, PNG, HTML or JSON files where you ask, by default in the working folder. Core commands are offline.
- Export and layout: Launches the local draw.io desktop app, Graphviz dot, and git for history or pull-request diffs. Subprocesses use argument lists, not a shell.
- Saving a style preset: Writes a temp file /tmp/drawio-preset-<name>.json, then ~/.drawio-skill/styles/<name>.json after you approve.
- Network: --embed icons: aiicons.py --embed and dbxicons.py --embed download icons only from allow-listed HTTPS hosts (unpkg, simple-icons, the Databricks icons site). Without --embed the diagram links to those URLs.
- Network: maintainer refresh: dbxicons.py --refresh-manifest calls the GitHub API; the docs say not to run it for normal diagrams.
- No draw.io app: encode_drawio_url.py puts the diagram into a diagrams.net link fragment; nothing is uploaded until you open it, and the fragment stays in your browser.
- Optional MCP server: diagramctl_mcp.py runs over stdio when you register it; no network, no GUI launch.
- Live infrastructure: Only reads JSON you supply from terraform show, docker inspect or kubectl; it does not choose credentials.

## Examples (from the pack's own files)
- A microservices architecture from one prompt: prompt "Create a microservices e-commerce architecture with Mobile/Web/Admin clients, API Gateway (auth + rate limiting + routing), Auth/User/Order/Product/Payment services, Kafka message queue, Notification service, and User DB / Order DB / Product DB / Redis Cache / Stripe API"; without the skill: None lines; with it: The author's rendered result is assets/microservices-example.png, with the editable source in assets/microservices-example.drawio. (README.md; None, the author's run)
- Architecture Studio showcase: prompt "python3 examples/architecture-studio/generate.py"; without the skill: None lines; with it: Code becomes a model and an editable import graph; a manually tuned diagram is reconciled with label conflicts marked; a checkout architecture gets linked views, a policy result, a failure overlay and an offline HTML walkthrough. All outputs are in examples/architecture-studio/generated/. (examples/architecture-studio/README.md; None, the author's run)

## Author's numbers (as reported, not run by AgentGid)
- 10,000+ official draw.io shapes searchable for exact icon styles. Source: Agents365-ai/drawio-skill/README.md
- 321 AI/LLM brand logos plus 18 data-store brands. Source: Agents365-ai/drawio-skill/README.md
- Transitive reduction cuts the asyncio import graph from 149 to 46 edges. Source: Agents365-ai/drawio-skill/README.md

## Steps only the person can do
- Install the draw.io desktop app (version 30 or newer recommended) for PNG, SVG and PDF exports (https://github.com/jgraph/drawio-desktop/releases) Then: The agent exports drafts and final files with the drawio command
- For live infrastructure diagrams, export the state yourself (terraform show -json, docker inspect or kubectl ... -o json) and remove secrets (skills/drawio-skill/references/live-infra.md) Then: The agent imports the sanitized JSON into a diagram
- For the PR diff bot, add the GitHub workflow to your repository and allow it to write pull request comments (skills/drawio-skill/references/pr-bot.md) Then: Each pull request that touches a .drawio file gets a rendered before/after comment

## Mistakes to avoid
- Not: Clone the whole repository into the skills folder. Instead: Clone it elsewhere and link or copy only skills/drawio-skill into the skills folder. Why: The host must find SKILL.md one level down; a nested repository root is not discovered reliably
- Not: Expect Claude Code to use the skill on its own when you ask for a diagram. Instead: Call /drawio-skill by name. Why: The skill file turns off automatic invocation
- Not: Export an AI or data-store logo diagram offline without --embed. Instead: Pass --embed to inline the icons, or use generic local shapes. Why: Logos are linked from a CDN by default, so an offline render shows empty boxes
- Not: Use -e on the draft PNG or combine --width with -s in one export. Instead: Draft PNG without -e; final PNG with -e and -s, then run repair_png.py. Why: The skill's export rules forbid both combinations
- Not: Sync with --prune to tidy an updated diagram. Instead: Run sync without --prune and review the faded removed elements. Why: --prune is the only mode that deletes retired parts from the new file

## What leaves the machine
- Requests for AI and data-store logo SVGs → The icon CDNs on the skill's allow-list (unpkg, simple-icons, the Databricks icons site), When aiicons.py or dbxicons.py runs with --embed. Opt out: Use generic or local shapes, or skip --embed and brand logos
- Requests for logo images linked inside the diagram → The unpkg CDN, Each time a diagram with linked (not embedded) logos is opened or rendered. Opt out: Pass --embed to inline the icons
- A comment with rendered before/after diagram images → GitHub, on the pull request, Only if you set up the optional PR diff GitHub Action. Opt out: Do not add the workflow

## Lines in the pack aimed at agents (ask the person first)
- "If the CLI crashes in a macOS sandbox, try one permitted escalated run, then use" (skills/drawio-skill/SKILL.md): Ask the person before running the draw.io app outside the sandbox; otherwise deliver the .drawio file or a diagrams.net link
- "`--refresh-manifest` is a maintainer operation that intentionally contacts an" (skills/drawio-skill/references/security.md): Never run --refresh-manifest for ordinary diagrams; it calls an upstream catalog

## May I use it like this?
- commercial-app: yes (MIT: keep the license notice)
- redistribute-files: conditions (MIT notice for the skill; the bundled shape index comes from Apache 2.0 sources, so keep its attribution file)
- client-work: conditions (MIT allows it; brand logos in diagrams are third-party trademarks used for identification only)

## Which one to pick
- If You want editable draw.io files, imports from code, IaC and SQL, and architecture checks: skill:Agents365-ai/drawio-skill
- If You want a self-contained HTML and SVG editorial diagram rather than a draw.io file: skill:cathrynlavery/diagram-design
- If You want an interactive diagram of an idea, plan or codebase: skill:tt-a1i/archify
- If You want themed Mermaid diagrams rendered as SVG or terminal ASCII: skill:imxv/Pretty-mermaid-skills

## Works well with
- agent:claude-code: The README shows the Claude Code install and the skill is called as /drawio-skill
- agent:openai-codex: The repo ships a Codex plugin manifest and a Codex agent file
- tool:skills: The README installs the skill with npx skills add

## Works in and needs
- Works in Claude Code: skills folder
- Works in Codex: plugin or skills folder
- Works in OpenCode: skills folder
- Works in Any agent (Cursor, Copilot and others): skills CLI
- Works in Claude Desktop, Cursor, VS Code: MCP server (optional)
- Needs Python 3: All bundled scripts are Python
- Needs draw.io desktop app: PNG, SVG and PDF exports; version 30+ for Mermaid conversion
- Needs Graphviz (optional): Automatic layout of large graphs
- Needs git: History and PR diff workflows

## How to tell it works
Install the skill and the draw.io desktop app, then ask "Use drawio-skill to draw a three-tier web app: browser, API server, Postgres". You should get a .drawio file and a PNG in your folder, and the assistant should show you a draft before the final export.

## Related
- Agents365-ai/excalidraw-skill
- Agents365-ai/mermaid-skill
- Agents365-ai/plantuml-skill
- Agents365-ai/tldraw-skill
- jgraph/drawio-mcp

## Safety
Only install from github.com/Agents365-ai/drawio-skill. The skill runs bundled Python scripts and asks for command, file and web-fetch tools. Treat labels and source files as data, and use sanitized JSON for live infrastructure, since secrets in it end up inside the diagram.
