From bahayonghang-drawio-skills
Create, edit, and export draw.io diagrams offline using a YAML-first CLI workflow. Supports architecture, flowcharts, UML, ER, Mermaid/CSV conversion, and style presets.
How this skill is triggered — by the user, by Claude, or both
Slash command
/bahayonghang-drawio-skills:drawioThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Create, edit, validate, replicate, import, and export draw.io diagrams through the shared YAML-first Draw.io Base Skill.
CHANGELOG.mdagents/interface.yamlassets/catalog/shape-catalog.json.gzassets/examples/login-flow-test.drawioassets/examples/login-flow.drawioassets/examples/microservices.drawioassets/examples/neural-network.drawioassets/schemas/spec.schema.jsonassets/themes/academic-color.jsonassets/themes/academic.jsonassets/themes/dark.jsonassets/themes/high-contrast.jsonassets/themes/nature.jsonassets/themes/tech-blue.jsonevals/baseline-prompts.jsonevals/evals.jsonevals/fixtures/import-simple-compressed.drawioevals/fixtures/import-simple.drawioevals/fixtures/industrial-architecture.yamlevals/fixtures/replicate-academic-highlight.svgCreate, edit, validate, replicate, import, and export draw.io diagrams through the shared YAML-first Draw.io Base Skill.
This package is the single maintained base capability surface for sibling overlays. It owns the local CLI, schemas, shared references, themes, reusable examples, style presets, Desktop export helpers, diagrams.net URL fallback, and optional live-refinement backend.
Use this base skill for general draw.io work:
.drawio import, sidecar export, and local validationFor paper, thesis, IEEE, journal, manuscript, or publication-ready figure requests, use drawio-academic-skills as the policy overlay. The overlay depends on this sibling base for execution; the base does not automatically apply academic publication gates.
Use the lightest path that satisfies the request.
| Runtime | Role | Source of truth | Notes |
|---|---|---|---|
| Offline Authoring Path | Default create/edit/replicate/import/export | YAML spec in project work dir | Generates final .drawio and standalone SVG locally; keeps .spec.yaml and .arch.json in a separate work dir unless explicitly requested beside the output. |
| Desktop-Enhanced Export | Optional final export | Existing offline bundle | Adds PNG/PDF/JPG or embedded .drawio.svg when draw.io Desktop is available. |
| Live Refinement Backend | Optional browser refinement provider | Offline bundle remains canonical | Use only when the user explicitly wants browser/inline iteration and required live capabilities exist. |
| Direct XML Exception | Tiny one-off or raw mxGraph handoff | .drawio XML | Use only when YAML/CLI is unavailable or exact XML control is the real requirement. |
The optional MCP/live backend is a refinement provider only. Do not treat it as required for normal authoring, editing, import, replication, or export.
Choose the route first, then load only the references needed for that route.
| Route | When to use | Required references |
|---|---|---|
create | New diagram from text, YAML, Mermaid, CSV, or a concise spec | references/workflows/create.md, references/docs/design-system/README.md, references/docs/design-system/specification.md |
edit | Modify an existing sidecar bundle or imported .drawio | references/workflows/edit.md, references/docs/migration-readiness.md |
replicate | Redraw an uploaded image, screenshot, SVG, or reference diagram | references/workflows/replicate.md, references/docs/design-system/README.md, references/docs/design-system/specification.md, references/docs/design-system/color-guide.md |
math-formula | Labels contain formulas, equations, LaTeX, AsciiMath, MathJax, or Chinese formula keywords | references/docs/math-typesetting.md, references/docs/design-system/formulas.md |
stencil-heavy | Cloud, provider icon, network gear, or exact draw.io shape work | references/docs/stencil-library-guide.md, references/official/xml-reference.md, references/official/style-reference.md |
network-topology | Network topology, VLAN / subnet / gateway, campus / data-center / cloud network maps(拓扑、子网、网关、VLAN) | references/docs/ieee-network-diagrams.md, references/docs/stencil-library-guide.md, references/official/xml-reference.md |
edge-audit | Dense diagrams or routing-sensitive diagrams | references/docs/edge-quality-rules.md, references/official/xml-reference.md |
live-refinement | Explicit browser/inline visual refinement | references/docs/mcp-tools.md, references/docs/migration-readiness.md |
direct-xml | Tiny XML-only handoff or raw mxGraph edits | references/official/xml-reference.md, references/official/style-reference.md, references/docs/xml-format.md, references/upstream/pure-drawio-skill.md |
Use network-topology when the diagram is a network/infrastructure map; use stencil-heavy when the focus is provider icons or exact draw.io shapes in any diagram type.
Academic triggers such as paper, thesis, IEEE, journal, manuscript, or publication-ready figure should route to the sibling drawio-academic-skills overlay when that skill is available. If the overlay is not available, this base can still render a local YAML bundle, but report that academic overlay policy was not applied.
.drawio files are input surfaces that normalize into YAML before rendering.<name>.drawio and <name>.svg; keep canonical sidecars such as <name>.spec.yaml and <name>.arch.json in a project-local work directory such as .drawio-tmp/<name>/..drawio.svg.start_session, read_diagram_xml, or patch capabilities are unavailable, edit the offline YAML bundle instead of blocking.$$...$$ for standalone formulas, \(...\) for inline formulas, and AsciiMath backticks. Do not generate $...$, \[...\], or bare LaTeX commands.meta.replication, use meta.canvas for reference page size, use bounds for standalone text/formula boxes, and use labelOffset when connector labels must sit off the line. Do not deliver a rebuild as one full-page embedded reference image..agents/skills/drawio as part of normal diagram generation. If renderer or CLI behavior needs a fix, port it to this repository's skill source and verify it there.fillColor=none;strokeColor=none;labelBackgroundColor=none (the converter ignores white fills on type: text and warns) and text boxes are sized just wider than their content. Vertical CJK labels are one character per line ("可\n视\n化"), never horizontal=0 or wrap-faked. See references/docs/design-system/tokens.md § Text & Label Styling.source/target node ids; never standalone arrow shapes or floating edges), no-waypoint orthogonal edges must be collinear (same absolute exit/entry coordinate — auto-routing handles this; --validate flags avoidable bends), and block arrows default to endFill=1;endSize=12. See references/docs/edge-quality-rules.md.horizontal, vertical, hierarchical (edge-aware layered auto-layout via the CLI when no node has explicit bounds/position; legacy grid fallback with a warning when the vendored engine is unavailable), star, mesh, tiered (North-South network rows from network.tier/network.role or node type).--validate also reports layout quality metrics (node crossings, edge crossings, total edge length)..drawio and .svg in the requested output directory, and write sidecars to a project-local work directory unless the user explicitly asks for a persistent sidecar bundle beside the output.Typical commands:
node <base-skill-dir>/scripts/cli.js input.yaml output.drawio --validate --write-sidecars --sidecar-dir .drawio-tmp/output
node <base-skill-dir>/scripts/cli.js input.yaml output.svg --validate --write-sidecars --sidecar-dir .drawio-tmp/output
Use --strict or --strict-warnings for release-grade engineering review.
Prefer editing the sidecar bundle. If only a .drawio file exists, import it first:
node <base-skill-dir>/scripts/cli.js existing.drawio --input-format drawio --export-spec --write-sidecars --sidecar-dir .drawio-tmp/existing
After import, inspect the generated .spec.yaml in the work directory, edit YAML first, then regenerate the requested .drawio or .svg with sidecars directed to the work directory. Use beside-output sidecars only when the user asks for a reproducible editing bundle.
Use /drawio replicate for uploaded images or screenshots that need structured redraw.
meta.source: replicated.Desktop-enhanced exports require draw.io Desktop:
node <base-skill-dir>/scripts/cli.js input.yaml output.pdf --validate --use-desktop
node <base-skill-dir>/scripts/cli.js input.yaml output.png --validate --use-desktop
node <base-skill-dir>/scripts/cli.js input.yaml output.drawio.svg --validate --write-sidecars --sidecar-dir .drawio-tmp/output --use-desktop
If Desktop is unavailable, still deliver the final .drawio and SVG, with sidecars in the work directory. For browser handoff, generate a diagrams.net URL from the .drawio file:
node <base-skill-dir>/scripts/runtime/diagrams-net-url.js output.drawio
The diagram content is encoded in the URL fragment after #R and is not sent as a server query parameter.
The base owns shared bundled style presets under styles/built-in/. User presets should live outside the repository, for example ~/.drawio-skill/styles/ or an overlay-specific user directory.
To learn a reusable preset from an existing diagram ("learn my style from <path> as <name>") and render an approval sample, follow references/docs/style-extraction.md.
Never mutate bundled presets. Copy a bundled preset to the user preset directory before making it the default or editing it.
Validate before claiming completion.
If validation fails, fix the YAML or imported XML first and rerun validation. If an optional export cannot run because Desktop or a live backend is unavailable, report the missing provider and provide the offline bundle fallback.
End with a concise report containing:
references/workflows/create.md, edit.md, replicate.md: route playbooksreferences/docs/design-system/specification.md: YAML schema and authoring contractreferences/docs/math-typesetting.md: formula delimiters and export guidancereferences/docs/edge-quality-rules.md: routing and label-clearance checksreferences/docs/stencil-library-guide.md: provider-icon and stencil fallback rulesreferences/docs/ieee-network-diagrams.md: IEEE-style network topology and infrastructure referencereferences/docs/mcp-tools.md: optional live-refinement capability vocabularyreferences/official/xml-reference.md: upstream XML-generation mirrorreferences/official/style-reference.md: upstream style-property mirrorreferences/upstream/pure-drawio-skill.md: vendored upstream pure-XML skill, for the direct-XML exception path onlyreferences/docs/style-extraction.md: learn a reusable style preset from an existing diagramreferences/examples/: reusable YAML examplesnpx claudepluginhub bahayonghang/drawio-skillsScans a codebase for architectural friction, presents candidates as a visual HTML report with before/after diagrams, and guides you through deepening refactors.