Editorial diagram design for Claude Code, Codex, GitHub Copilot, Cursor, Factory Droid, Qoder, and Pi. 45 diagram types. Self-contained HTML + SVG. No shadows. No Mermaid slop.
description: Export a diagram-design HTML file to SVG and PNG argument-hint: " [--svg-only|--png-only] [--scale=N] [--output=
Export diagram HTML at $1 to .svg or .png. Locate available diagram-design skill using its SKILL.md path advertised by Pi. Read that SKILL.md, then read references/export.md relative to its directory. Treat that reference as source of truth. Run scripts/export_svg.py and scripts/export_png.py relative to the skill directory for the requested formats. Do not assume the package lives under the current working directory. If --registry is present, also read references/export-registry.md relative to the same directory and follow it to emit the metadata sidecar — a separate procedure from the SVG/PNG rasterization above.
Full argument string: $ARGUMENTS
Defaults
- With no format flag (nothing, or only
--scale/--output) and no--registry: produce both.svgand.pngnext to source (for example,diagram.html→diagram.svg+diagram.png).--svg-onlyor--png-onlyrestricts image output to that one format. - Render PNG at
device_scale_factor=2. --registrygiven alone, with neither--svg-onlynor--png-onlyalso present, produces only the registry JSON — the SVG/PNG defaults above do not apply, and Playwright is never required. Add--svg-onlyor--png-onlyexplicitly to also get an image.
Flags
--svg-only— emit SVG only. Skip Playwright.--png-only— emit PNG only.--scale=N— override PNG device scale factor with a finite number from1to4, including fractional values such as1.25. Default2.--output=<path>— override output base path; append format extension.--registry— emit<basename>.registry.json, a metadata sidecar of every block'sdata-block-*attributes. Never needs Playwright. Used alone (see Defaults) it is the only output; combine with--svg-onlyor--png-onlyto also produce an image.
Required behavior
- No source path → ask user which
.htmlfile to export. Do not guess. - Source is
assets/index.html→ refuse; ask for specific diagram file. - Source lacks
<svg>→ refuse; write nothing. - PNG requested without Playwright → show install instruction from reference verbatim; stop. Do not auto-install.
- PNG requested with a non-numeric or non-finite
--scale, or a value outside the inclusive 1–4 range → reject. Fractional values within that range are valid. - Both
--svg-onlyand--png-onlysupplied → reject them as mutually exclusive. --registryrequested but source has nodata-block-idattributes → refuse; write nothing. Per the export-registry reference's edge-case section.--registryis the only flag given (no--svg-only/--png-only) → emit only the registry JSON; do not also produce SVG/PNG and do not check for Playwright.
After export, report output paths plus sizes.