/h2t-arch:drawiofrom h2t-arch
Generates, exports, and validates draw.io architecture diagrams. Creates styled .drawio files from graph descriptions using project-specific shape libraries (TOML). Supports PNG/SVG/PDF export via draw.io Desktop CLI. Triggers on: /drawio, 'create diagram', 'architecture diagram', 'draw.io diagram', 'export diagram', 'generate drawio'., 'h2t-arch:drawio'
Ships in h2t-arch. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Generate production-quality .drawio architecture diagrams from structured graph descriptions with project-specific styling.
Run this before any other command of this skill:
h2t-ops version --expect 4.1.3 --json
Act on the result, in this order:
"ok": true — continue."ok": false — show the user error.hint as it is and stop this skill until
it is resolved. Do not run anything the hint names unless the user asks you to: on
reason: path it is a command for the user to decide on. error.details.reason names the
case: not_installed, version or path.command not found — read ~/.h2t/run/install.env
(grep -E '^(STATE|H2T_HOOK)=' ~/.h2t/run/install.env). With STATE=ready the install
is fine and PATH does not reach it: show the directory of the H2T_HOOK= path, ask the
user to restart the harness, and offer uv tool update-shell for them to run. Without
it there is no install: give the user uvx --isolated --python 3.12.11 --managed-python -c "https://github.com/lichtpfad/h2t-skills/releases/download/v4.1.3/constraints.txt" --from "h2t-ops @ https://github.com/lichtpfad/h2t-skills/releases/download/v4.1.3/h2t_ops-4.1.3-py3-none-any.whl" h2t-setup sync.uvx --isolated --python 3.12.11 --managed-python -c "https://github.com/lichtpfad/h2t-skills/releases/download/v4.1.3/constraints.txt" --from "h2t-ops @ https://github.com/lichtpfad/h2t-skills/releases/download/v4.1.3/h2t_ops-4.1.3-py3-none-any.whl" h2t-setup sync.Everything runs through one command, h2t-drawio, with three subcommands: generate,
export and shapes. Only generate needs drawpyo, which is the CLI's drawio extra:
h2t-setup sync --extra drawio adds it and keeps it on every later sync (from a developer
checkout, h2t-setup dev-sync --extra drawio). Without it, generate exits 3 and prints
the exact command rather than an ImportError; export and shapes work on a base install.
Export additionally needs the draw.io Desktop CLI at
/Applications/draw.io.app/Contents/MacOS/draw.io, overridable through
.drawio-skill.yaml (export.drawio_path).
| Command | Description | Status |
|---|---|---|
/drawio create <path> | Create new diagram from graph description | Available |
/drawio export <path> [--format png|svg|pdf] | Export to raster/vector | Available |
/drawio validate <path> | Check diagram quality | Planned (Iter 4) |
/drawio update <path> | Modify existing diagram | Planned (Iter 3) |
/drawio convert <mermaid> --output <drawio> | Convert Mermaid to styled .drawio | Planned (Iter 3) |
h2t-drawio generate to create the .drawio fileThe skill looks for two files in the project root:
.drawio-skill.yaml — Theme, layout settings, export config.drawio-shapes.toml — Shape library (colors, shapes, sizes per entity type)Without these, the skill uses built-in defaults (light theme, generic shapes).
/drawio create)The keys, shown as a Python dict for the comments. In YAML None is null and False is
false; in JSON drop the comments.
graph = {
"nodes": [
{
"id": "unique_id", # Required — unique identifier
"label": "Display\\nName", # Required — use \\n for line breaks
"type": "shape_type", # From TOML shape library
"x": 100, "y": 200, # Optional — explicit position (pixels)
"width": 140, "height": 60, # Optional — override TOML defaults
"link": "docs/adr/008.md", # Optional — clickable link in draw.io
"tooltip": "Description", # Optional — hover tooltip
},
],
"edges": [
{
"from": "source_id", # Required
"to": "target_id", # Required
"label": "relationship", # Optional — edge label
"tooltip": "details", # Optional — hover tooltip
"style": "solid", # solid | dashed | dotted
"arrow": "classic", # classic | block | open | diamond
"color": None, # None = auto from target type, or "#hex"
"routing": "orthogonal", # orthogonal | straight | curved
"bidirectional": False, # Arrows on both ends
},
],
"containers": [
{
"id": "group_id", # Required
"label": "Group Name", # Required
"type": "layer_boundary", # From TOML shape library
"children": ["node_id"], # Node IDs inside this container
"x": 0, "y": 0, # Position
"width": 400, "height": 300, # Size
},
],
}
# Without project config (uses defaults):
h2t-drawio generate graph.yaml output.drawio
# With project config:
h2t-drawio generate graph.yaml docs/diagrams/my_diagram.drawio \
--shapes .drawio-shapes.toml --config .drawio-skill.yaml
Regenerating keeps the positions and nodes a user moved or added in draw.io; --reset
overwrites them instead. The command prints the path it wrote.
open <path_to_drawio_file>
/drawio export)Export .drawio to PNG, SVG, or PDF via draw.io Desktop CLI:
# Basic export:
h2t-drawio export diagram.drawio --format png
# With project config:
h2t-drawio export docs/diagrams/arch.drawio --format png --config .drawio-skill.yaml
# Export specific page:
h2t-drawio export diagram.drawio --format svg --page 0
# Export all pages:
h2t-drawio export diagram.drawio --format pdf --all-pages
Output is saved as <name>.drawio.<fmt> next to the source file.
With embed_diagram: true in config, PNG/SVG contain editable XML inside.
Check available shape types — the shipped library, with the project's file merged on top
the way generate merges it:
h2t-drawio shapes --shapes .drawio-shapes.toml --json
When edge color is None, color is automatically resolved from the target node type using the [_edges] section in the TOML. This ensures visual consistency:
Override with explicit "color": "#hex" when needed.
Nodes with link become clickable in draw.io Desktop:
"link": "docs/adr/008-killswitch-policy.md" — opens file"link": "src/execution/order_manager.py" — opens sourceWhen nodes don't have explicit x/y, they are placed in an auto-grid:
node_spacing (default 200px)level_spacing (default 120px)For precise layouts, always specify x/y explicitly.
Containers group nodes visually. Children are positioned relative to the container.
Common container types: layer_boundary (labeled swimlane), external_layer (dashed border).
x/y for production diagrams — auto-grid is for quick drafts\\n in labels for multi-line textembed_diagram: true so PNG/SVG remain editableorthogonal (right angles) looks best for architecture diagramsWhat SKILL.md sets; muted values are Claude Code's defaults
2 skills in this plugin
Other plugins' skills for the same job
npx claudepluginhub lichtpfad/h2t-skills --plugin h2t-arch