by sparklabx
Teach your AI to draw correct, beautiful draw.io diagrams — declarative layout engine, ground-truth stencils, structural validator, vision self-check. AWS · Azure · GCP · Databricks · BPMN. Zero dependencies.
# Add to your Claude Code skills
git clone https://github.com/sparklabx/drawio-ai-kitGuides for using ai agents skills like drawio-ai-kit.
drawio-ai-kit is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by sparklabx. Teach your AI to draw correct, beautiful draw.io diagrams — declarative layout engine, ground-truth stencils, structural validator, vision self-check. AWS · Azure · GCP · Databricks · BPMN. Zero dependencies. It has 669 GitHub stars.
drawio-ai-kit's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/sparklabx/drawio-ai-kit" and add it to your Claude Code skills directory (see the Installation section above).
drawio-ai-kit is primarily written in TypeScript. It is open-source under sparklabx on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh drawio-ai-kit against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
An orchestration and validation framework enabling AI agents to generate structurally precise and aesthetically standardized draw.io diagrams, optimized for AWS, Azure & GCP architectures.
It mitigates common AI agent hallucinations (such as generating non-existent stencil IDs that result in empty shapes) using three key components:
mxgraph.aws4.*) to their respective taxonomies and canonical color palettes.skills/drawio/references/principles.md).Exposed to the AI via the self-contained drawio-ai CLI (one bundled file, nothing extra to install).
One diagram per platform — all generated end-to-end by the kit: no hand-placed coordinates, real stencils, validated, vision-checked. Full set in examples/.
Requirements: Node.js ≥20.6 or Bun 1.4+. Nothing else to install.
Bun-only machine (no
node)? The CLI's shebang is#!/usr/bin/env node(the Windows-safe standard), soinstall.shwrites~/.local/bin/drawio-aias a wrapper that runsbun <pkg>/dist/cli.mjs. Re-runinstall.shafterbun update -g. With a manualbun add -g, runbun $(bun pm bin -g)/../install/global/node_modules/drawio-ai-kit/dist/cli.mjsor install Node.
curl -fsSL https://raw.githubusercontent.com/sparklabx/drawio-ai-kit/refs/heads/main/install.sh | sh
It installs drawio-ai-kit@latest globally with Bun (if present) or npm, links the drawio-ai command into
~/.local/bin (pick another dir with BIN_DIR=/dir or --bin-dir /dir; pin a version with --version 2.0.1), then registers the drawio skill with every
agent it finds. It never installs a runtime and needs no sudo. Prefer to read it first? Download
install.sh, open it, then run sh install.sh (--dry-run prints the commands only; --help lists options).
Re-run it to upgrade. It first removes old installs so exactly one copy remains:
drawio-aws, drawio-cloud-architect, …) and their leftover foldersPass --no-clean to keep them.
npm i -g drawio-ai-kit && drawio-ai skill install # npm
bun add -g drawio-ai-kit && drawio-ai skill install # Bun
About 2 MB from the npm registry, so it takes seconds. drawio-ai skill install registers the skill straight
from the installed package, with no second download. Restart your agent, then try: "draw an AWS 3-tier web app".
npm i drawio-ai-kit # or: bun add drawio-ai-kit
import { Diagram, group, icon, renderTree } from "drawio-ai-kit"; // full TypeScript types included
Run such a script with plain node build.mjs or bun build.mjs. Without a local install, use the global CLI:
drawio-ai run build.mjs (it resolves "drawio-ai-kit" to the installed CLI).
The global install puts the drawio-ai binary on PATH (see INSTALL.md to pin a version).
Install only from the npm registry; installing from git or GitHub is not supported. The CLI ships as a Bun-minified production bundle (dist/)
that runs on Node or Bun. Its one library (icon search) is bundled inside, so users install nothing extra.
The skill step uses the skills CLI, which auto-detects Claude Code, Codex, Gemini CLI, … —
without it the agent never picks the kit up on its own.
One skill covers every domain: it asks you what's missing (which cloud? what to draw?), then loads just that domain's reference. It is written in short, explicit steps so small fast models (e.g. Claude Haiku) can drive it end-to-end.
drawio-ai render (the vision self-check); Graphviz enables vendor/autolayout.py for large graphs. Details in INSTALL.md.Short answer: yes — and you don't have to take my word for it.
postinstall (or any lifecycle) hooks — nothing runs on npm install. No dependencies are installed alongside it. No sudo, no runtime installs, no remote code at run time. The optional one-line installer is a short POSIX script you can read first. The shipped dist/ is minified, but it is a reproducible build of the readable src/: it is never committed; CI builds it on every PR (and checks the build is deterministic), and the release job builds the published copy from the tagged source.dependencies. The one library it uses (minisearch, for icon search) is a devDependency that Bun bundles into dist/, and npm audit --omit=dev runs in CI.npm uninstall -g drawio-ai-kit # remove the CLI (Bun: bun remove -g drawio-ai-kit)
npx skills remove drawio # remove the skill (Bun: bunx skills remove drawio)
npm i -g drawio-ai-kit@latest && drawio-ai skill install # CLI + skill (Bun: bun add -g drawio-ai-kit@latest)
The skill drives drawio-ai at runtime, so engine fixes reach you the moment you update the
CLI. Re-running drawio-ai skill install refreshes the skill's docs from the same version. Pin a release with
[email protected].
To report a security issue, see SECURITY.md.
Define a diagram topology (pipeline/hierarchy/network/hubspoke/hybrid/mesh/sequence), declare the nested structure, and the layout engine programmatically computes spatial coordinates (x/y/w/h) — frames auto-size to fit their children, while rows and columns auto-space. You define the logical topology, not raw pixels.
import { Diagram, group, icon, box, renderTree } from "drawio-ai-kit"; // run: drawio-ai run build.mjs (or plain node/bun where drawio-ai-kit is installed)
const d = new Diagram("network");
const tree = group("region", "group_region", "Region", { dir: "row" }, [
group("vpc", "group_vpc", "VPC", { dir: "col" }, [
icon("alb", "elastic_load_balancing", "ALB"),
icon("ec2", "ec2", "EC2"),
]),
]);
renderTree(d, tree); // engine lays everything out + sizes the page
d.title("My VPC");
d.link("alb", "ec2"); // edges by id; router picks straight/corridor
const res = d.validate(); // names real? colors/nesting/labels clean?
// d.mxfile("My VPC") → write to .drawio, export PNG, then vision self-check
Icon names are retrieved from drawio-ai search to prevent name fabrication (it tolerates typos, aliases like k8s/pg/es, and multi-keyword queries); edge routing, container sizing, alignment, and contextual corner styles are dynamically computed. The AI agent defines the logical layout and iterates via a render-analyze-rectify loop (vision-based self-correction). Example: examples/aws/build_mesh.mjs (zero manual coordinates).
At 2.0.0 the 5 domain skills (drawio-aws, drawio-azure, drawio-gcp, drawio-databricks,
drawio-bpmn) were merged into ONE drawio skill, and the CLI became a Bun-minified bundle in dist/.
install.sh. It removes the old skills and the old CLI, then installs fresh.npx skills remove drawio-aws drawio-azure drawio-gcp drawio-databricks drawio-bpmn, then drawio-ai skill install.npm i -g drawio-ai-kit (from the npm registry; the bin points at dist/cli.mjs)."drawio-ai-kit" (the package no longer ships src/). Re-scaffold, or replace the <ROOT>/src/builder.ts / layout-engine.ts / bpmn.ts imports with that one name. Run with drawio-ai run build.mjs.drawio-ai principles --mode … and drawio-ai workflow still work; they now print the skill's references/ and workflows/build.md.At 1.0.0 the MCP server and bespoke installer were removed. To migrate:
install.sh. It removes the drawio-ai-kit MCP entry and the old
`drawio-clou