Generate draw.io diagrams from natural language — 11 presets (UML, SysML/MBSE, BPMN, network, C4…), 36 tools: codebase/CI/infra-to-diagram, image→editable diagr
Generate draw.io diagrams from natural language — 11 presets (UML, SysML/MBSE, BPMN, network, C4…), 36 tools: codebase/CI/infra-to-diagram, image→editable diagr
## ✨ Highlights **From a prompt** - **Describe it, get an editable `.drawio`** — the skill plans the layout, writes the XML, exports, then self-checks its own PNG and auto-fixes overlaps, clipped labels, and stacked edges (up to 2 rounds), with up to 5 rounds of your feedback - **Mermaid → native .drawio** (draw.io ≥ 30) — author 28 standard types as Mermaid text (**mindmap, gantt, timeline, journey, pie, sankey, kanban**…) and the CLI converts them into a laid-out, editable `.drawio`: structure in, layout free - **Whiteboard photo / screenshot → editable diagram** — snap a legacy PNG or a physical whiteboard, let vision extract the graph, and `raster2drawio.py` rebuilds it as a real, editable `.drawio` honouring the original layout - **11 diagram type presets** — ERD, UML Class, Sequence, C4, Architecture, ML/Deep Learning, Flowchart, SysML, BPMN, Network Topology, Cross-Functional Swimlane **From real sources** - **Visualize a codebase** — import graphs for Python / JS-TS / Go / Rust and Python class hierarchies, with Graphviz placement, transitive reduction, and nested module containers - **IaC and live infrastructure** — Terraform, Kubernetes, and docker-compose configs become diagrams with official AWS / Azure / GCP / K8s icons; snapshot what's *actually deployed* from `terraform show -json`, `docker inspect`, or `kubectl get -o json` - **Schemas and pipelines** — SQL DDL → ER diagram, OpenAPI/Swagger → API diagram coloured by HTTP method, AsyncAPI → event-driven architecture diagram, Protocol Buffers → message/service diagram, GraphQL SDL → entity type diagram, GitHub Actions / GitLab CI → pipeline DAG - **Deterministic engines** — sequence diagrams with computed lifelines and activation bars; multi-page C4 models with click-to-drill-down **Keep it true over time** - **Architecture digital twin / Diagram IR** — separate meaning, provenance, and geometry; project executive, system, deployment, data-flow, and security views from one model - **Incremental sync without losing manual layout** — `diagramctl sync` updates changed nodes/relations while preserving tuned coordinates, styles, and annotations; removals stay reviewable by default - **Diagram-as-Test, in CI** — YAML/JSON architecture rules (Internet-to-database access, cycles, orphans, trust boundaries, contrast…) plus an official GitHub Action that enforces them on every PR, and a PR action that renders visual diffs - **Query, review, what-if** — query components/owners/paths, spot articulation points and high coupling, simulate failure propagation, publish an accessible Story walkthrough - **Drift and history** — colour-coded diffs between two diagrams or two live snapshots; a time-lapse player of how a codebase's architecture grew **Share and restyle** - **Repurpose with one command** — interactive HTML viewer (pan/zoom/search), PowerPoint deck, animated data-flow SVG, Mermaid or Markdown export, click-through runbook, exec-summary compression - **Restyle and enrich** — style presets (yours or built-in `dark`/`corporate`/…), bilingual label variants with layout untouched, data-driven heat maps, white-to-metro tubemap mode - **10,000+ official shapes + 321 AI/LLM logos** — resolve exact AWS / Cisco / K8s / UML icon styles instead of guessing, plus brand logos draw.io itself lacks - **One CLI, optional MCP server** — `diagramctl doctor/build/sync/views/query/test/review/whatif/story/publish/transform`, core workflows stdlib-only and offline; the MCP server exposes them to Claude Desktop, Cursor, VS Code, Codex, and any MCP host. Portable to any Agent Skills-compatible agent, no daemon ## ️ Feature Map A bird's-eye view of everything the skill does — diagram types, import sources, layout engines, styling, export formats, and repurposing — in one map. Fittingly, this map was itself drawn with drawio-skill. ## Installation ### 1. Install the draw.io desktop CLI | Platform | Command | | ---------- | --------- | | **macOS** | `brew install --cask drawio` | | **Windows** | [Download installer](https://github.com/jgraph/drawio-desktop/releases) | | **Linux** | `.deb`/`.rpm` from [releases](https://github.com/jgraph/drawio-desktop/releases); `sudo apt install xvfb` for headless | Verify with `drawio --version`. **Version ≥ 30 recommended** — it unlocks Mermaid → `.drawio` conversion and the ELK `--layout` pass (both unavailable on ≤ 29). On **WSL2** the CLI is the Windows desktop exe reached via `/mnt/c` — the skill detects this automatically (see [troubleshooting](skills/drawio-skill/references/troubleshooting.md)). Full recipes in [docs/INSTALL_CLI.md](docs/INSTALL_CLI.md). ### 2. Install the skill ```bash # Any agent (Claude Code, Cursor, Copilot, ...) npx skills add Agents365-ai/drawio-skill -g ``` ```bash # Manual install git clone https://github.com/Agents365-ai/drawio-skill.git \ ~/.claude/skills/drawio-skill # Autohand Code global install git clone https://github.com/Agents365-ai/drawio-skill.git \ ~/.autohand/skills/drawio-skill # Autohand Code project-level install git clone https://github.com/Agents365-ai/drawio-skill.git \ .autohand/skills/drawio-skill ``` Autohand Code also supports `autohand --skill-install` for cataloged skills, with `--project` for workspace-level installs. Until this skill is listed there, use the direct clone path above. Also indexed on [SkillsMP](https://skillsmp.com/skills/agents365-ai-drawio-skill-skills-drawio-skill-skill-md). **Updating:** `skills update drawio-skill` (SkillsMP) or `git pull` for manual installs. See [docs/INSTALL_SKILL.md#updates](docs/INSTALL_SKILL.md#updates). Release history in [CHANGELOG.md](CHANGELOG.md). ## ⚡ Quick Start After installation, just describe what you want. For example, an ML model: ```text Draw a Transformer encoder-decoder for machine translation: 6-layer encoder with self-attention, 6-layer decoder with cross-attention, input embeddings (batch × 512 × 768), positional encoding, and a final output projection. Annotate tensor shapes between layers and color-code by layer type. ``` The skill plans the layout, generates the `.drawio` XML, exports to your chosen format, self-checks the result, and lets you iterate. ## ️ Examples
> [!TIP] > **The diagram above was generated from this single prompt:** ```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 ``` The maintained [Architecture Studio showcase](examples/architecture-studio/) covers code → IR → `.drawio`, conflict-aware synchronization that preserves a manually tuned layout, and architecture → policy/views/what-if/accessible Story. Every artifact is regenerated by one script and verified in the test suite. The skill is designed to route edges cleanly across different topologies, avoiding lines that cross through shapes:
|
Star · 7 nodes Central message broker with 6 microservices radiating outward, no edge crossings on this example. |
Layered · 10 nodes / 4 tiers E-commerce stack with horizontal and diagonal cross-connections routed via corridors. |
Ring · 8 nodes CI/CD pipeline with a closed loop and 2 spur branches flowing along the perimeter. |
↑ Python's
logging package as a class hierarchy — one command, modules auto-boxed, every inheritance edge resolved.
Under the hood it runs a bundled extractor → auto-layout → validate pipeline:
```bash
# source -> graph JSON -> placed, editable .drawio
python3 scripts/tfimports.py ./infra -o graph.json # Terraform -> official AWS icons
python3 scripts/autolayout.py graph.json -o architecture.drawio
# drift between two states, then share as one interactive file
python3 scripts/drawiodiff.py v1.drawio v2.drawio -o drift.json
python3 scripts/drawiohtml.py architecture.drawio -o architecture.html
```
The full toolbox, grouped by stage:
| Stage | Tools |
| --- | --- |
| **Import** | 16 extractors: **Python · JS/TS · Go · Rust** import graphs, **Python class inheritance**, **Terraform / Kubernetes / docker-compose** with official cloud icons, **live** infra from `terraform show -json` / `docker inspect` / `kubectl get -o json`, **SQL DDL → ERD**, **OpenAPI → API diagram** (coloured by HTTP method), **AsyncAPI → event-driven architecture diagram**, **Protobuf → message/service diagram**, **GraphQL SDL → entity type diagram**, **GitHub Actions + GitLab CI → DAG** |
| **Compare & evolve** | `drawiodiff.py` colour-codes drift between two diagrams or two live snapshots (added=green, removed=red, changed=orange); `timelapse.py` replays git history as an HTML player; `prdiff.py` renders PR diffs in CI |
| **Repurpose** | `explain.py` → Markdown, `drawiohtml.py` → pan/zoom/search HTML viewer, `drawio2pptx.py` → deck, `svgflow.py` → animated SVG, `drawio2mermaid.py` → diagrams-as-code, `runbook.py` → clickable triage app, `compress.py` → exec summary with drill-down, `buildup.py` → self-drawing player, `tubemap.py` → metro map |
| **Restyle & enrich** | `restyle.py` applies presets by hue remap, `relabel.py` produces translated twins with layout untouched, `heatmap.py` shades nodes from a metrics CSV/JSON, `edgeports.py` un-stacks edges at shape boundaries |
| **Layout & lint** | `autolayout.py` (Graphviz placement, orthogonal routing, `--tune` direction picking, `--group` containers, transitive reduction: asyncio 149 → 46 edges), `seqlayout.py`, `c4.py`, and the deterministic `validate.py` linter (`--score` / `--strict`) |
Layout needs Graphviz (`brew install graphviz` / `apt install graphviz`) — optional; everything else works without it. Full format + flag reference in [references/autolayout.md](skills/drawio-skill/references/autolayout.md), every tool in [references/toolbox.md](skills/drawio-skill/references/toolbox.md). Regenerate, validate (`--strict` gate) and render headlessly in CI: [docs/CI.md](docs/CI.md).
## Supported Diagram Types
| Category | Examples | Notable featNo open issues yet, or sync has not completed.