$ show Agents365-ai/drawio-skill
drawio-skill is a comprehensive AI agent skill for generating, editing, synchronizing, inspecting, testing, and publishing editable draw.io diagrams from natural language, codebases, infrastructure-as-code, and data schemas. It provides a unified CLI (`diagramctl.py`) orchestrating a pipeline of 39+ specialized scripts covering importers (Python, JS/TS, Go, Rust, Terraform, K8s, Docker, SQL DDL, OpenAPI, CI pipelines), auto-layout (Graphviz, ELK, deterministic sequence/C4/tube-map), shape search (10k+ official icons), AI/LLM brand logos (321 brands), style presets, diagram diff, time-lapse, heat maps, and export (PNG, SVG, PPTX, Mermaid, HTML viewer). The architecture is centered on a versioned Diagram IR (JSON Schema) that separates meaning, provenance, and geometry, enabling incremental sync preserving manual layout, multi-view projection, architecture contract testing (Diagram-as-Test), what-if failure simulation, and accessible Story Mode. It integrates with agent platforms via a SKILL.md and an optional MCP server (`diagramctl_mcp.py`) exposing nine tools over stdio, and supports CI integration through GitHub Actions for PR diff and architecture test gates. The project is actively maintained with semantic versioning, 174 unit tests, and a changelog tracking releases through v3.2.0.
The LLM identified 6 files worth highlighting for reuse:
Core semantic model for architecture diagrams: defines a versioned JSON Schema (Diagram IR v1) with nodes, edges, groups, views, and provenance metadata. Implements load_ir, normalize_ir, write_drawio (XML generation), reconcile (three-way merge preserving manual geometry), project_views (multi-view projection), semantic_findings (pluggable rule engine for architecture contracts), impact_analysis (what-if failure simulation), query (graph traversal), and story_html (accessible narrative output). Stdlib-only, no external dependencies. Reusable as a standalone library for any diagram generation pipeline that needs a semantic backbone independent of draw.io XML.
Graphviz-based auto-layout engine for draw.io diagrams. Accepts a graph JSON (nodes, edges, groups) and produces draw.io XML with computed geometry. Features group tinting, direction tuning (TB/LR/RL/BT), transitive reduction via Graphviz tred, orthogonal edge routing with waypoints, and route scoring to avoid crossing shapes. Can be extracted and reused for any graph visualization task that needs deterministic layout with Graphviz, independent of the rest of the skill.
Searches a bundled index of 10,446 official draw.io shapes (AWS, Azure, GCP, Cisco, K8s, UML, BPMN, etc.) to return exact style strings for use in diagram generation. Supports fuzzy matching by name and category. The shape index is gzipped JSON. This script is self-contained and can be reused in any project needing to resolve draw.io shape styles from a local index.
Resolves AI/LLM brand names (OpenAI, Claude, Gemini, Mistral, etc.) to draw.io image styles using a bundled manifest of 321 logos from lobe-icons (MIT). Supports embed mode to inline SVGs for offline export. Self-contained script that can be reused for any project needing to add AI brand icons to diagrams.
MCP (Model Context Protocol) server exposing nine tools (doctor, build, sync, views, architecture_test, review, query, whatif, story) via JSON-RPC 2.0 over stdio. Stdlib-only, offline, shells out to the diagramctl CLI. Implements proper tool descriptions, input schemas, and error handling. This pattern is reusable for wrapping any CLI tool as an MCP server for agent integration.
JSON Schema defining the structure of style presets: palette (colors for background, stroke, fill, gradient), roles (mapping element types to colors), shapes (default shape per role), font (family, size, color), edges (style, width, color, routing), and extras (shadow, sketch, opacity). Five built-in presets (default, corporate, handdrawn, colorblind-safe, dark) conform to this schema. The schema and preset files are reusable for any diagramming tool that needs a theming system.