Getting Started
Draw.io Skill is a desktop-first, offline-first workflow for producing professional draw.io diagrams from natural language, YAML, Mermaid, CSV, or imported .drawio files.
What You Need
- One supported client: Claude, Gemini, or Codex
- Node.js for
npxand the local CLI - Optional: draw.io Desktop for PNG, PDF, JPG, or embedded SVG export
- Optional: next-ai MCP only when you want real-time browser refinement
Install the Skill
Recommended:
bash
npx skills add bahayonghang/drawio-skillsThen restart your client so it reloads the skill.
See Installation for client-specific paths and optional MCP configuration.
Choose the Runtime Path
Offline-first
Use this for normal create, edit, validate, and export work.
- Generate
.drawio - Keep
.spec.yamland.arch.jsonbeside it - Re-run the CLI after edits
Desktop-enhanced
Use this when draw.io Desktop is installed and you need:
- PNG, PDF, or JPG export
- embedded
.drawio.svg - a quick local preview in the desktop app
Optional live MCP
Use this only when you explicitly want in-session browser editing.
- Configure
@next-ai-drawio/mcp-server - open a session with
start_session - use
get_diagrambeforeedit_diagram
Your First Diagram
Route from natural language
text
/drawio create a horizontal tech-blue login flow with 6 nodesRoute from YAML
yaml
meta:
theme: tech-blue
layout: horizontal
nodes:
- id: start
label: Start
type: terminal
- id: auth
label: Auth Service
type: service
- id: db
label: PostgreSQL
type: database
edges:
- from: start
to: auth
type: primary
- from: auth
to: db
type: dataRender it:
bash
node skills/drawio/scripts/cli.js input.yaml output.drawio --validate --write-sidecarsFirst Edit
If the skill created the diagram, edit the sidecar bundle:
- Update
output.spec.yaml - Re-render
output.drawio - Keep
output.arch.jsonin sync with--write-sidecars
If you only have a .drawio file, import it first:
bash
node skills/drawio/scripts/cli.js existing.drawio --input-format drawio --export-spec --write-sidecarsFirst Export
Generate a standalone SVG:
bash
node skills/drawio/scripts/cli.js input.yaml output.svg --validate --write-sidecarsUse draw.io Desktop when you need raster or PDF export:
bash
node skills/drawio/scripts/cli.js input.yaml output.pdf --validate --use-desktop