# drawio-skill

> Turns prompts, code and infrastructure into editable .drawio diagrams

- Category: Agents & Automation / Agent Skills & Plugins
- Language: Python
- Licence: MIT
- Repository: https://github.com/Agents365-ai/drawio-skill
- Website: https://agents365-ai.github.io/drawio-skill/
- Canonical page: https://ai-tldr.dev/tools/drawio-skill/

## In short

drawio-skill is an Agent Skill that produces maintainable `.drawio` architecture models rather than one-off pictures. It sits in the Agent Skills & Plugins category of the Agents & Automation tools and is open-source, written in Python and licensed MIT. To get started: install the draw.io desktop CLI.

## Overview

drawio-skill is an Agent Skill that produces maintainable `.drawio` architecture models rather than one-off pictures. From a prompt it plans the layout, writes the XML, exports, then self-checks its own PNG and auto-fixes overlaps, clipped labels and stacked edges for up to two rounds before handing back for feedback. It ships 11 diagram-type presets — ERD, UML class, sequence, C4, architecture, ML/deep learning, flowchart, SysML, BPMN, network topology and cross-functional swimlane — and converts 28 standard Mermaid types into laid-out, editable `.drawio` files on draw.io 30 or newer.

It also reads real sources instead of only prose. Import graphs for Python, JavaScript/TypeScript, Go and Rust become codebase diagrams with Graphviz placement and nested module containers; Terraform, Kubernetes and docker-compose configs render with official AWS, Azure, GCP and Kubernetes icons, and can be snapshotted from what is actually deployed via `terraform show -json`, `docker inspect` or `kubectl get -o json`; SQL DDL becomes an ER diagram, OpenAPI an API diagram coloured by HTTP method, AsyncAPI an event-driven diagram, Protobuf a message/service diagram, GraphQL SDL an entity diagram, and GitHub Actions or GitLab CI a pipeline DAG. A whiteboard photo or legacy PNG can be rebuilt as an editable diagram with `raster2drawio.py`.

The maintenance half is what separates it from a generator. A Diagram IR separates meaning, provenance and geometry so executive, system, deployment, data-flow and security views project from one model; `diagramctl sync` updates changed nodes and relations while preserving hand-tuned coordinates, styles and annotations, with removals reviewable by default; YAML/JSON architecture rules (internet-to-database access, cycles, orphans, trust boundaries, contrast) run as tests in CI through an official GitHub Action, and a PR action renders visual diffs. You can query components, owners and paths, find articulation points and high coupling, and simulate failure propagation.

Everything is driven by one CLI — `diagramctl doctor/build/sync/views/query/test/review/whatif/story/publish/transform` — whose core workflows are standard-library-only and run offline, with an optional MCP server exposing the same commands to Claude Desktop, Cursor, VS Code, Codex and any other MCP host. It works with Claude Code, Cursor, Copilot, OpenClaw, Codex, Autohand Code, Hermes and anything else that speaks the Agent Skills format. MIT-licensed.

## What it does

- 11 diagram-type presets plus Mermaid → native `.drawio` conversion for 28 standard types (draw.io ≥ 30)
- Self-checking export loop: renders its own PNG and fixes overlaps, clipped labels and stacked edges automatically
- Imports from code (Python, JS/TS, Go, Rust), Terraform, Kubernetes, docker-compose, SQL DDL, OpenAPI, AsyncAPI, Protobuf, GraphQL and CI configs
- Whiteboard photo or raster screenshot rebuilt into an editable diagram with raster2drawio.py
- Incremental `diagramctl sync` that updates a model without discarding manual layout
- Architecture rules as tests in CI, with an official GitHub Action and visual PR diffs
- Query, review and what-if analysis: paths, owners, articulation points, failure propagation
- Exports to interactive HTML, PowerPoint, animated SVG, Mermaid and Markdown; 10,000+ official shapes plus 321 AI/LLM logos
- One CLI with an optional MCP server, core workflows stdlib-only and offline

## Getting started

Two installs: the draw.io desktop CLI that does the rendering, then the skill itself into your agent's skills directory.

1. Install the draw.io desktop CLI

   Version 30 or newer is recommended — it unlocks Mermaid conversion and the ELK layout pass. Verify with `drawio --version`. On Linux, `sudo apt install xvfb` is needed for headless rendering.

```bash
brew install --cask drawio   # macOS
drawio --version
```

2. Install the skill

   The `skills` CLI installs it globally for any compatible agent; a plain clone into the agent's skills directory works too.

```bash
npx skills add Agents365-ai/drawio-skill -g
```

3. Or clone it manually

   Clone into whichever skills directory your agent reads.

```bash
git clone https://github.com/Agents365-ai/drawio-skill.git \
  ~/.claude/skills/drawio-skill
```

4. Describe the diagram you want

   After installation you just describe it. The skill plans the layout, generates the XML, exports, self-checks and lets you iterate.

```text
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
```

5. Keep it true over time

   Re-sync the model from the source when the system changes, and run the architecture rules as tests.

```bash
diagramctl doctor
diagramctl sync
diagramctl test
```

## When to use it

- Reach for it when an architecture diagram has to stay correct across changes rather than being redrawn each quarter
- Reach for it to generate a first diagram straight from Terraform, Kubernetes manifests or a live cluster snapshot
- Reach for it to enforce architecture rules — no internet-to-database path, no cycles, no orphans — on every pull request
- Reach for it when a whiteboard photo or an old PNG needs to become an editable, versionable file
