Your AI draws architecture diagrams; this kit keeps it honest
Because AI-generated architecture diagrams often feature hallucinated icons and sloppy layouts, this kit enforces correctness through a ground-truth stencil catalog, declarative layout engine, and structural validator.

What it does
drawio-ai-kit is a validation and layout framework for AI agents that generate draw.io diagrams. It maintains a ground-truth catalog of real stencil IDs and canonical colors for AWS, Azure, GCP, Databricks, and BPMN, while a static analysis validator catches unknown icons, dangling edges, geometry overlaps, and aesthetic violations before serialization. A declarative layout engine computes coordinates from logical topology descriptions—pipeline, hierarchy, hub-and-spoke, and others—so the agent describes the architecture instead of hardcoding pixel positions.
The interesting bit
The project closes the feedback loop with a vision self-check: the kit renders a diagram to PNG so the agent can read its own output and rectify mistakes iteratively. It also ships as five thin Domain Skills that wrap the zero-dependency CLI into agent-friendly workflows, keeping the engine local and self-contained while the skill front-ends update independently.
Key highlights
- Runs locally with no telemetry; the only optional outbound call is opt-in icon fetching from public CDNs.
- Declarative layout engine auto-computes coordinates, frame sizes, and edge routing from topology types like
mesh,hubspoke, orsequence. - Structural validator lints XML for fake stencil IDs, broken AWS group nesting, recolored icons, geometry overlaps, and visual fan-out.
- Vision self-check renders diagrams to PNG for agent-driven render-analyze-rectify loops.
- Covers AWS, Azure, GCP, Databricks, and BPMN with official color palettes and connection points.
Caveats
- Not yet published to the npm registry; the package currently installs only from GitHub.
- Vision self-check and rendering require the draw.io desktop app; large-graph auto-layout needs Graphviz.
- The catalog compilation pipeline requires Python 3.11, though the runtime orchestration layer is Node 18+.
Verdict
Worth a look if you are building AI agents that need to produce accurate cloud architecture diagrams without hand-holding. Skip it if you just need quick, informal sketches and do not care whether your VPC icon is officially sanctioned.
Frequently asked
- What is sparklabx/drawio-ai-kit?
- Because AI-generated architecture diagrams often feature hallucinated icons and sloppy layouts, this kit enforces correctness through a ground-truth stencil catalog, declarative layout engine, and structural validator.
- Is drawio-ai-kit open source?
- Yes — sparklabx/drawio-ai-kit is open source, released under the MIT license.
- What language is drawio-ai-kit written in?
- sparklabx/drawio-ai-kit is primarily written in JavaScript.
- How popular is drawio-ai-kit?
- sparklabx/drawio-ai-kit has 560 stars on GitHub.
- Where can I find drawio-ai-kit?
- sparklabx/drawio-ai-kit is on GitHub at https://github.com/sparklabx/drawio-ai-kit.