feat: add native Pi package support

This commit is contained in:
Daan Balm
2026-08-11 16:15:13 +02:00
parent c5805a0c7f
commit 81cb965267
4 changed files with 122 additions and 60 deletions
+30
View File
@@ -0,0 +1,30 @@
---
description: Export a diagram-design HTML file to SVG and PNG
argument-hint: "<html-file> [--svg-only|--png-only] [--scale=N] [--output=<path>]"
---
Export diagram HTML at `$1` to `.svg` or `.png`, following `skills/diagram-design/references/export.md` from installed diagram-design package. Read that reference first; treat it as source of truth.
Full argument string: `$ARGUMENTS`
## Defaults
- Produce both `.svg` and `.png` next to source (for example, `diagram.html` → `diagram.svg` + `diagram.png`).
- Render PNG at `device_scale_factor=2`.
## Flags
- `--svg-only` — emit SVG only. Skip Playwright.
- `--png-only` — emit PNG only.
- `--scale=1`, `--scale=2`, or `--scale=3` — override PNG device scale factor.
- `--output=<path>` — override output base path; append format extension.
## Required behavior
1. No source path → ask user which `.html` file to export. Do not guess.
2. Source is `assets/index.html` → refuse; ask for specific diagram file.
3. Source lacks `<svg>` → refuse; write nothing.
4. PNG requested without Playwright → show install instruction from reference verbatim; stop. Do not auto-install.
5. `--scale` outside {1, 2, 3} → reject.
After export, report output paths plus sizes.