Diagrams pack
Claude SkillUpdated today

Draw.io Diagram Builder

Generate an editable draw.io diagram from a natural-language description, a codebase, Terraform or Kubernetes config, or a SQL schema, with official vendor shapes and PNG/SVG/PDF export through the draw.io desktop CLI.

What it does

Produces `.drawio` XML from a description or directly from existing artifacts: a Python/JS/Go/Rust project becomes an import graph, Terraform and Kubernetes manifests become an architecture diagram with official AWS/Azure/GCP/K8s icons, and SQL `CREATE TABLE` statements become an ER diagram with crow's-foot foreign-key edges. Shape styles are resolved against the 10,000+ official draw.io shape libraries instead of guessed, and a structural lint plus a rendered-output self-check catch overlaps, dangling edges, and clipped labels before delivery. The protocol is distilled from the Agents365-ai/drawio-skill repo (7,400+ stars, v2.1.0), which covers 11 diagram-type presets including C4 models with click-through drill-down pages. Exports to PNG, SVG, PDF, or JPG run locally through the draw.io desktop CLI, and PNG/SVG/PDF exports can embed the diagram XML so the file reopens as fully editable.

When to use

  • Polished architecture, network, or cloud diagrams that need official vendor icons (AWS, Azure, GCP, Cisco, Kubernetes) and solid, presentation-grade rendering
  • Diagrams derived from artifacts you already have: visualize a codebase's import structure, declared or live infrastructure from Terraform/Kubernetes/docker-compose, or an ER diagram straight from SQL DDL
  • Multi-page C4 models (System Context, Container, Component) where stakeholders click through from a high-level view into detail pages

When not to use

  • Diagrams that must render inline in Markdown, PR comments, or wikis and stay text-diffable in git: author Mermaid instead (mermaid-flowchart-builder)
  • Informal whiteboard sketches for mixed audiences where a hand-drawn look communicates better: use excalidraw-diagram-builder
  • When the draw.io desktop CLI is not installed and an exported image is required; without it you can still deliver the `.drawio` XML, but export and the rendered self-check are unavailable

Install

Download the .zip, then unzip into your Claude skills folder.

mkdir -p ~/.claude/skills
unzip ~/Downloads/drawio-diagram-builder.zip -d ~/.claude/skills/

# Restart Claude Code session.
# Skill is now available — Claude will use it when relevant.

SKILL.md

SKILL.md
---
name: drawio-diagram-builder
description: Use when the user wants a draw.io diagram — architecture, network, ERD, UML, C4, BPMN, or swimlane — as an editable .drawio file or an exported PNG/SVG/PDF, especially with official cloud/vendor icons, or generated from a codebase, Terraform/Kubernetes config, or SQL schema. Triggers on "draw.io", "drawio", "diagram with AWS icons", "diagram from my terraform", "editable diagram".
---

# Draw.io Diagram Builder

Author `.drawio` XML and export it locally with the draw.io desktop CLI. Protocol distilled from Agents365-ai/drawio-skill (v2.1.0).

## Route the request first

draw.io is one of three diagram toolchains, and the wrong one wastes the whole pass:

| The diagram needs | Toolchain |
|---|---|
| Official vendor icons, solid fills, swimlanes, print/export quality | draw.io (this skill) |
| Inline rendering in Markdown, git-diffable source | Mermaid |
| A hand-drawn whiteboard look for informal review | Excalidraw |

If the request fits draw.io, confirm three things before authoring: the diagram type (architecture, ERD, UML class, sequence, C4, BPMN, network, swimlane, flowchart), the output format (editable `.drawio`, or exported PNG/SVG/PDF), and the source of truth (a description, or an artifact such as a repo, Terraform config, Kubernetes manifests, or SQL DDL).

## Prefer generation from artifacts over generation from memory

When the system being diagrammed exists as files, derive the diagram from the files. The source repo ships importers for exactly this reason: an import graph extracted from a Python/JS/Go/Rust project, a resource-reference graph from Terraform or Kubernetes manifests, service topology from docker-compose, and table/foreign-key structure from `CREATE TABLE` statements. Edges that come from actual references (role ARNs, selectors, volume mounts, foreign keys) are correct by construction; edges recalled from a description are guesses. Reserve hand-authored XML for systems that only exist in the user's head.

## Authoring rules for hand-written XML

- **Never guess a shape style string.** draw.io styles like `shape=mxgraph.aws4.lambda_function` are exact identifiers; a typo renders a blank box. Resolve every vendor icon (AWS, Azure, GCP, Cisco, Kubernetes, UML, BPMN) against the official shape libraries before use.
- **Grid-align everything.** Snap coordinates to a consistent grid, scale spacing with diagram size, and route connectors around nodes rather than through them.
- **One fill color per logical tier** (clients, services, data stores, external systems), at most four colors. Color that does not encode a group comes out.
- **Containers for grouping.** Swimlanes and parent containers express ownership; loose boxes floating near each other do not.
- **Spread edges at the shape boundary.** When several edges meet one side of a node, pin distinct exit/entry points so the lines stay separated instead of stacking into one stroke.

## C4 models get pages, not one giant canvas

For C4 requests, build the multi-page set: System Context, Container, Component, each on its own page with the official C4 shapes, and link parent elements to their child page so a click drills down. One page trying to show all three levels fails at every level.

## Validate before you deliver

1. **Structural lint on the XML:** no dangling edges, no duplicate or reserved ids, no broken parent references, no overlapping nodes.
2. **Render and look at the output.** Export a PNG and inspect it for clipped labels, stacked edges, and overlaps the XML did not reveal. Fix and re-export, at most two rounds. Geometry that looks plausible as numbers is frequently wrong as pixels.

## Export

Export through the draw.io desktop CLI (`drawio` on PATH; on macOS `brew install --cask drawio`). PNG is the default; SVG for docs that scale, PDF for print. Use embedded-diagram export with a double extension (`name.drawio.png`) so the delivered image reopens in draw.io as the editable diagram. If the CLI is unavailable, say so and deliver the `.drawio` XML with a diagrams.net link as the fallback; do not silently skip the rendered self-check.

## Deliverable

The `.drawio` file (or export), plus two sentences: what the diagram shows and where the reader should look first. For multi-page C4 sets, name each page and its intended audience.

Example prompts

Once installed, try these prompts in Claude:

  • Create an architecture diagram of our platform: three Next.js apps behind an ALB, an API service on ECS, Postgres on RDS, Redis for sessions, S3 for uploads, and CloudFront in front. Use the official AWS icons and export a PNG I can drop into the design review doc.
  • Here is our terraform/ directory. Generate a draw.io architecture diagram of the declared infrastructure with official icons, and make the edges follow the actual resource references, not my guesses about what talks to what.
Recent changes
  • Aug 11, 2026New skill: editable draw.io diagrams with official vendor icons, generated from a description or derived from a codebase, Terraform/Kubernetes config, or SQL schema.