Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/HK-hub/AgentSkillsnpx agentmods add skills/hk-hub/agentskills/drawio-skillWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/hk-hub/agentskills/drawio-skill)<a href="https://agentmods.dev/skills/hk-hub/agentskills/drawio-skill"><img src="https://agentmods.dev/badge/skills/hk-hub/agentskills/drawio-skill/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/hk-hub/agentskills/drawio-skill"><img src="https://agentmods.dev/badge/skills/hk-hub/agentskills/drawio-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00160 | $0.10943 |
| Opus 5 | $0.00080 | $0.05471 |
| Sonnet 5 | $0.00032 | $0.02189 |
| Haiku 4.5 | $0.00016 | $0.01094 |
Grade A, and why
drawio-skill scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
98% identical to drawio-skill — 431 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 355 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Draw.io Diagrams
Overview
Generate .drawio XML files and export to PNG/SVG/PDF/JPG locally using the native draw.io desktop app CLI.
Supported formats: PNG, SVG, PDF, JPG — no browser automation needed.
PNG, SVG, and PDF exports support --embed-diagram (-e) — the exported file contains the full diagram XML, so opening it in draw.io recovers the editable diagram. Use double extensions (name.drawio.png) to signal embedded XML.
When to use / when NOT to use
Use this skill for: polished, precise diagrams (architecture, network, strict UML, ERD), anything needing solid opaque fills, 10,000+ stock/branded shapes, swimlanes, or custom geometry, exported as editable PNG/SVG/PDF.
Do NOT use it — route elsewhere — for:
- A casual hand-drawn / whiteboard look → excalidraw or tldraw.
- Diagrams-as-code that live in git / render in Markdown → mermaid (general) or plantuml (UML).
- Freeform infinite-canvas sketching or freehand strokes → tldraw.
Bundled resources
When the workflow references one of these, read it on demand — none of them need to be in context up front.
| File | Read it when |
|---|---|
references/toolbox.md |
You're not sure which bundled script fits a request, or want to chain several — a map of all 31 scripts grouped by use-case (author / import code / import IaC / import API spec / live infra / compare / annotate / reverse-export / utilities) with an "I have X, I want Y → use Z" guide |
references/xml-authoring.md |
You're about to hand-write .drawio XML (workflow step 3) — file skeleton, shape/edge cells, containers, connection distribution, palette, spacing/grid rules. Not needed when a bundled generator writes the XML |
references/mermaid-authoring.md |
The diagram is a standard type with no custom styling/icon needs (flowchart, state, gantt, mindmap, timeline, journey, pie, …) and the CLI is ≥ v30 — author it as Mermaid text and let the CLI convert to native .drawio (structure only, layout free). Also documents the CLI's ELK --layout pass for XML |
references/diagram-types.md |
The user names a specific diagram type (ERD, UML class, sequence, C4, architecture, ML/DL, flowchart, SysML, BPMN, network topology, swimlane) |
references/shapes.md + scripts/shapesearch.py |
The diagram needs a specific shape — a cloud icon (AWS/Azure/GCP), Cisco/Kubernetes/network symbol, UML/BPMN/ER/electrical/P&ID element — or any time you'd otherwise guess a style= string. shapesearch.py "<keywords>" returns the exact official style for 10k+ shapes |
scripts/aiicons.py |
The diagram involves an AI/LLM brand (OpenAI, Claude, Gemini, Mistral, Llama, HuggingFace, Ollama, LangChain, …) — aiicons.py "<brand>" returns a draw.io image style for the brand logo (lobe-icons via CDN; --embed to inline). draw.io has no built-in AI logos. See references/shapes.md → "AI / LLM brand logos" |
references/style-presets.md |
The user asks to learn / save / list / set-default / delete a style preset, or you've resolved an active preset and need the application rules |
references/style-extraction.md |
You're inside the Learn flow and need the extraction procedure (called from style-presets.md) |
references/troubleshooting.md |
An export fails, vision rejects a PNG, or a rendering looks wrong |
scripts/repair_png.py |
After every -e PNG export — fixes draw.io's truncated IEND chunk (issue #8) |
scripts/encode_drawio_url.py |
The CLI is unavailable and you need a browser-fallback diagrams.net URL (--edit for an editable editor URL) |
references/autolayout.md |
The diagram is large or layout-heavy (dependency/call graph, code structure, >~15 nodes) and you want Graphviz to place nodes + route edges instead of hand-placing coordinates |
scripts/pyimports.py · jsimports.py · goimports.py · rustimports.py |
The user wants to visualize a Python, JS/TS, Go, or Rust project structure — extracts the import graph (transitive-reduced, optional --group containers, nested by sub-package) for autolayout |
scripts/pyclasses.py |
The user wants a Python class hierarchy / class diagram — extracts classes + inheritance edges (boxed by module with --group) for autolayout |
scripts/tfimports.py · k8simports.py · composeimports.py |
The user wants to visualize declared infrastructure (Terraform .tf, Kubernetes manifests, or docker-compose) — extracts the resource/service reference graph (official AWS/Azure/GCP/K8s icons for tf/k8s; service boxes + volume cylinders for compose) for autolayout |
scripts/tfstate.py · dockerimports.py (+ k8simports.py) |
The user wants to draw what is ACTUALLY running / deployed — pipe terraform show -json (deployed state), docker inspect $(docker ps -q) (live containers), or kubectl get all,ing,cm,secret,pvc -o json (live cluster, via k8simports) and get the real topology with the same official icons. See references/live-infra.md |
scripts/drawiodiff.py |
The user wants to compare / diff two diagrams or two snapshots ("what changed", infra drift) — drawiodiff.py old.drawio new.drawio -o diff.json emits a colour-coded graph (added=green, removed=red, changed=orange, same=grey) for autolayout. Matches by cell id (importer/live-snapshot output) or --by-label (hand-drawn) |
scripts/timelapse.py |
The user wants an architecture time-lapse / to see how a codebase's structure evolved over git history — timelapse.py <dir> --importer pyimports re-runs an importer at each sampled commit and assembles a self-contained HTML player (embedded frames, play/step controls). Best on a package with real import edges (point <dir> at the module root) |
scripts/explain.py |
The user wants to describe / document / summarize an existing .drawio in words (reverse of generating one) — explain.py diagram.drawio emits structured Markdown: components grouped by container/tier, relations (A —label→ B), per-page sections for multi-page/C4. Good for a README/PR summary or a text-only read-out |
scripts/drawio2pptx.py |
The user wants a PowerPoint deck / slides from a diagram — drawio2pptx.py diagram.drawio -o deck.pptx puts each page on its own 16:9 slide (page name as title), so a multi-page C4 model becomes a ready-to-present deck. Needs python-pptx (pip install python-pptx) + the draw.io CLI |
scripts/drawiohtml.py |
The user wants a shareable interactive viewer for a diagram (pan / zoom / search, no draw.io needed) — drawiohtml.py diagram.drawio -o viewer.html inlines every page's SVG into ONE self-contained HTML with page tabs, drag-pan, wheel-zoom, node search (Enter cycles + centres matches) and working drill-down links (a C4 model's data:page/id links switch tabs). No server, no external requests — send the file to anyone |
scripts/svgflow.py |
The user wants an animated / "flowing" diagram (data-flow, moving edges) — svgflow.py diagram.drawio -o flow.svg exports to SVG and makes every edge a marching-ants animation (dashes travel along the arrows). Self-contained looping .svg that renders on GitHub / any browser; --speed / --dash / --reverse |
scripts/drawio2mermaid.py |
The user wants to convert a .drawio into Mermaid text (diagrams-as-code for a Markdown file that GitHub renders) — drawio2mermaid.py diagram.drawio emits a flowchart (containers → subgraphs, edge labels kept, cylinder/rhombus shapes mapped); --fenced wraps in ```mermaid, multi-page → one graph per page. Structural only (styling/icons don't survive) |
scripts/sqlerd.py |
The user wants an ER diagram from SQL DDL — parses CREATE TABLE statements into per-table nodes (columns with PK/FK markers) and crow's-foot FK edges for autolayout |
scripts/ciimports.py |
The user wants a CI pipeline diagram (GitHub Actions workflows or GitLab CI) — ciimports.py <repo-root> reads .github/workflows/*.yml + .gitlab-ci.yml and emits jobs (runner, matrix size, reusable-workflow calls), needs: dependency edges, per-workflow trigger nodes, and stage/workflow containers for autolayout. Needs PyYAML |
scripts/openapiimports.py |
The user wants an API diagram from an OpenAPI / Swagger spec — openapiimports.py spec.yaml maps each operation to a node coloured by HTTP method (GET blue, POST green, PUT/PATCH orange, DELETE red) plus one node per component schema, with edges from operations to the schemas they use and between nested schemas. --group boxes by tag, --no-schemas shows just the endpoint surface; feeds autolayout |
scripts/heatmap.py |
The user wants to colour an existing .drawio by data (a cost / latency / traffic / error-rate heat map) — heatmap.py diagram.drawio -m metrics.csv matches each metric (CSV key,value or JSON {key:value}) to a node by id or label and recolours it along a gradient (--palette heat|cool|warm, --reverse), optionally scaling node size (--size) and adding a legend. Post-processes any diagram; export as usual |
scripts/seqlayout.py |
The user wants a sequence diagram — describe participants + messages as JSON and the script computes all lifeline/activation/arrow geometry deterministically (no hand-placed coordinates, no Graphviz needed) |
scripts/c4.py |
The user wants a C4 model (System Context / Container / Component) — levels JSON in, one multi-page .drawio out with official C4 shapes/colors and click-to-drill-down links between levels |
scripts/relabel.py |
The user wants a language variant or bulk text swap of an existing .drawio (e.g. an EN diagram re-labelled in Chinese for a bilingual README) — relabel.py diagram.drawio --extract -o labels.json dumps every label as an identity JSON map; translate the values (keep the keys), then relabel.py diagram.drawio --map labels.json -o diagram_cn.drawio swaps them with layout/styles/ids untouched |
scripts/restyle.py |
The user wants to re-theme an EXISTING .drawio ("make this dark", "apply my corporate style to this diagram") — restyle.py diagram.drawio --preset <name> remaps every vertex fill/stroke to the preset palette by hue, applies font/extras (dark fontColor, edge color, background), and leaves layout, shapes, and edge routing untouched. Presets resolve like Step 0 (user dir, then built-ins) |
scripts/edgeports.py |
Edges stack on top of each other where they meet a shape — the usual swimlane/cross-functional complaint, and anywhere a node has several connections leaving the same side. edgeports.py diagram.drawio pins exitX/exitY+entryX/entryY: it picks the side of each node facing the other endpoint, then spreads that side's edges over evenly-spaced slots ordered by the far endpoint's position, so they keep their relative order instead of crossing. Resolves absolute coordinates through swimlane parents, skips ends you already pinned, and is idempotent. It is a port assigner, not a router — it separates lines at the shape boundary, it will not stop an edge crossing an unrelated shape mid-run (add waypoints for that) |
scripts/validate.py |
You generated a .drawio (especially via autolayout or for a large hand-placed diagram) and want a fast deterministic structural lint (dangling edges, dup/reserved ids, broken parents, overlaps) before the vision self-check. --score prints a readability score for comparing layout variants |
scripts/raster2drawio.py |
The user has an image of a diagram (whiteboard photo, legacy PNG, Visio screenshot) and wants an editable .drawio — read the image with your own vision, extract nodes/edges as JSON (schema + full workflow in references/derasterize.md), then raster2drawio.py graph.json -o out.drawio honours those coordinates/labels/shapes; nodes missing x/y fall back to autolayout.py placement |
scripts/buildup.py |
The user wants a diagram to build itself node-by-node as a video/GIF (a construction time-lapse of ONE static diagram — distinct from timelapse.py's git-history animation) — buildup.py diagram.drawio reveals cells in topological (dependency) order into a self-contained HTML player (play/pause/step/scrub); --gif also exports an animated GIF (needs Pillow). Needs the draw.io CLI |
scripts/compress.py |
The user wants an executive / boardroom summary of a big diagram — collapses clusters (pure-Python label propagation, no networkx) into one labeled node each with aggregated inter-cluster edges, emitting a 2-page .drawio (exec view + click-to-drill-down into the full original). Claude can rename clusters semantically afterward. Needs Graphviz dot |
scripts/runbook.py |
The user wants a flowchart/decision-tree .drawio turned into a click-through triage app (on-call runbook) — runbook.py flow.drawio reads the XML (no draw.io CLI needed) and emits a self-contained HTML runbook: current-step text, per-edge choice buttons, breadcrumb trail, Back/Restart, end-state on terminal nodes |
scripts/prdiff.py |
You're setting up automated PR diagram review in CI — for every .drawio changed between two git refs it renders base/head/diff PNGs and emits a Markdown report; ships with a composite GitHub Action (.github/actions/drawio-diff/) that posts a sticky PR comment. See references/pr-bot.md |
scripts/tubemap.py |
The user wants a metro / subway / tube map — a system, pipeline, or journey drawn as coloured transit lines with octilinear (H/V/45°) routing, white interchange circles, and station stops. Compose a metro JSON (lines = ordered stations on an integer grid, shared stations = interchanges), then tubemap.py metro.json -o metro.drawio. Stdlib-only; schema + the one grid rule in references/tubemap.md |
What ships with it
60 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- data/lobe-icons.json 13 KB
- data/SHAPE-INDEX-NOTICE.md 880 B
- data/shape-index.json.gz 426 KB
- references/autolayout.md 19 KB
- references/derasterize.md 2.5 KB
- references/diagram-types.md 16 KB
- references/live-infra.md 3.6 KB
- references/mermaid-authoring.md 4.5 KB
- references/pr-bot.md 3.4 KB
- references/shapes.md 7.0 KB
- references/style-extraction.md 17 KB
- references/style-presets.md 11 KB
- references/toolbox.md 8.9 KB
- references/troubleshooting.md 5.2 KB
- references/tubemap.md 3.2 KB
- references/xml-authoring.md 12 KB
- scripts/aiicons.py 7.8 KB runs code
- scripts/autolayout.py 18 KB runs code
- scripts/buildup.py 14 KB runs code
- scripts/c4.py 6.5 KB runs code
- scripts/ciimports.py 7.6 KB runs code
- scripts/composeimports.py 4.6 KB runs code
- scripts/compress.py 10 KB runs code
- scripts/dockerimports.py 6.2 KB runs code
- scripts/drawio2mermaid.py 5.8 KB runs code
- scripts/drawio2pptx.py 4.4 KB runs code
- scripts/drawiodiff.py 7.0 KB runs code
- scripts/drawiohtml.py 10 KB runs code
- scripts/edgeports.py 9.1 KB runs code
- scripts/encode_drawio_url.py 2.2 KB runs code
- scripts/explain.py 6.0 KB runs code
- scripts/goimports.py 5.4 KB runs code
- scripts/heatmap.py 9.0 KB runs code
- scripts/jsimports.py 6.2 KB runs code
- scripts/k8simports.py 9.6 KB runs code
- scripts/openapiimports.py 6.6 KB runs code
- scripts/prdiff.py 7.8 KB runs code
- scripts/pyclasses.py 6.1 KB runs code
- scripts/pyimports.py 6.2 KB runs code
- scripts/raster2drawio.py 7.3 KB runs code
- scripts/relabel.py 4.1 KB runs code
- scripts/repair_png.py 1.1 KB runs code
- scripts/restyle.py 7.1 KB runs code
- scripts/runbook.py 9.9 KB runs code
- scripts/rustimports.py 7.4 KB runs code
- scripts/seqlayout.py 9.7 KB runs code
- scripts/shapesearch.py 5.8 KB runs code
- scripts/sqlerd.py 6.6 KB runs code
- scripts/svgflow.py 3.6 KB runs code
- scripts/tfimports.py 12 KB runs code
- scripts/tfstate.py 5.4 KB runs code
- scripts/timelapse.py 11 KB runs code
- scripts/tubemap.py 6.7 KB runs code
- scripts/validate.py 13 KB runs code
- styles/built-in/colorblind-safe.json 1.4 KB
- styles/built-in/corporate.json 1.4 KB
- styles/built-in/dark.json 1.5 KB
- styles/built-in/default.json 1.4 KB
- styles/built-in/handdrawn.json 1.4 KB
- styles/schema.json 5.2 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 355 lines · 160 tokens per session scan A b5b6f5cb2f53
drawio-skill is a skill published in the GitHub repository HK-hub/AgentSkills (6 stars, last pushed 25d ago), licensed MIT. It adds 160 tokens to every session and 10,943 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. It is 98% identical to drawio-skill, differing in 431 lines, and is treated as a copy.
Other skills, from other repositories
mermaid
Create, validate, and repair Mermaid.js diagrams. Use when generating flowcharts, sequence, class, ER, state, or Gantt diagrams, or any visualization.
loft
Loft the shape before cutting steel — answer a design question that prose cannot settle by building a throwaway artifact: a pure logic module in a clickable shell, or structurally different UI variants behind one route. The captain reacts to the artifact; the answer folds into the decision; the artifact never docks.…
plannotator-annotate
Open Plannotator's annotation UI for a file, folder, or URL, then address the returned annotations.
slides
Build a Grida slides deck — a .canvas bundle in slides mode whose pages are SVG documents (16:9, one SVG per slide). Use when creating a presentation, pitch deck, slideshow, or talk.
visual-qa
Runs rigorous visual QA across web, terminal, and paginated surfaces with screenshot evidence and a verdict. Use for any UI build or change, or when asked whether a page, component, or TUI looks right.
frontend
Builds, styles, and polishes web UI and UX. Use for any frontend, page, component, styling, layout, animation, or visual-quality task, or when asked to make an interface look or feel a certain way.