About this project

drawio-skill is an open-source Agent Skills package (MIT licensed) that lets AI coding agents — Claude Code, Cursor, Copilot, OpenClaw, Codex, Autohand Code, Hermes, or any Agent Skills-compatible host — generate, maintain, and repurpose professional draw.io diagrams from natural-language prompts and real system sources. Core generation flow: the skill plans the layout, writes .drawio XML, exports a draft PNG, self-checks the render and auto-fixes overlaps, clipped labels, and stacked edges (up to 2 rounds), then runs a 5-round user feedback loop before final export. Eleven diagram-type presets are built in: ERD, UML Class, Sequence, C4, Architecture, ML/Deep Learning, Flowchart, SysML, BPMN, Network Topology, and Cross-Functional Swimlane. Mermaid text (28 standard types including mindmap, gantt, timeline, journey, pie, sankey, kanban) converts to native editable .drawio on draw.io ≥ 30, and a raster2drawio.py tool rebuilds whiteboard photos or legacy PNGs as editable diagrams. Source-to-diagram importers cover Python, JS/TS, Go, and Rust import graphs plus Python class hierarchies; Terraform, Kubernetes, and docker-compose configs with official AWS/Azure/GCP/K8s icons; live infrastructure snapshots from `terraform show -json`, `docker inspect`, and `kubectl get -o json`; SQL DDL to ERD; OpenAPI/Swagger to API diagrams coloured by HTTP method; AsyncAPI to event-driven architecture diagrams; Protocol Buffers to message/service diagrams; GraphQL SDL to entity type diagrams; and GitHub Actions / GitLab CI to pipeline DAGs. Sequence diagrams use computed lifelines and activation bars; C4 models are multi-page with click-to-drill-down. Long-term maintenance is handled through a Diagram IR that separates meaning, provenance, and geometry, so executive, system, deployment, data-flow, and security views can be projected from one model. `diagramctl sync` performs incremental updates that preserve manually tuned coordinates, styles, and annotations, with removals kept reviewable. Diagram-as-Test rules in YAML/JSON (internet-to-database access, cycles, orphans, trust boundaries, contrast) are enforced by an official GitHub Action on every PR, alongside a PR action that renders visual diffs. Additional tooling queries components, owners, and paths; spots articulation points and high coupling; simulates failure propagation; and publishes accessible Story walkthroughs. Drift is visualised as colour-coded diffs between two diagrams or two live snapshots, and a time-lapse player replays how a codebase's architecture grew through git history. Sharing and restyling are one-command operations: interactive HTML viewer with pan/zoom/search, PowerPoint deck, animated data-flow SVG, Mermaid or Markdown export, click-through runbook, and exec-summary compression. Style presets (default, corporate, handdrawn, colorblind-safe Okabe-Ito, dark) can be learned from a user's own .drawio file; bilingual label variants preserve layout; data-driven heat maps shade nodes from CSV/JSON; and a tube-map mode restyles pipelines as London-Underground-style metro maps. A shapesearch.py tool resolves exact style strings across 10,000+ official draw.io shapes (AWS, Azure, GCP, Cisco, Kubernetes, UML, BPMN, ER, electrical, P&ID), while aiicons.py resolves 321 AI/LLM brand logos (OpenAI, Claude, Gemini, Mistral, Llama, Cohere, DeepSeek, Qwen, Ollama, LangChain, HuggingFace, etc.) plus 18 data-store brands (Redis, Postgres, MongoDB, Qdrant, Milvus, Supabase) that draw.io itself lacks. Everything is driven by a single `diagramctl` CLI (doctor/build/sync/views/query/test/review/whatif/story/publish/transform) with core workflows stdlib-only and offline; an optional MCP server exposes the same commands to Claude Desktop, Cursor, VS Code, Codex, and any MCP host. Layout uses Graphviz (optional) for placement, orthogonal routing, transitive reduction, and nested module containers; a deterministic validate.py linter provides `--score` and `--strict` gates for CI. Installation requires the draw.io desktop CLI (≥ 30 recommended) and `npx skills add Agents365-ai/drawio-skill -g`, or a manual clone into the agent's skills directory. The project is part of the Agents365-ai diagram-skill family alongside excalidraw-skill, mermaid-skill, plantuml-skill, and tldraw-skill, each targeting a different diagram style.