Draw.io Skill treats export as part of the offline bundle workflow, not as a browser-only step.
Keep final delivery directories focused on the files users normally keep:
<name>.drawio<name>.svgKeep sidecars in a project-local work directory such as .drawio-tmp/<name>/ unless the user explicitly asks for a persistent sidecar bundle beside the output:
<name>.spec.yaml<name>.arch.jsonThis split supports local iteration without polluting final figure directories. Add .png only when the request is thesis, A4, Word, raster-first, screenshot rebuild, or explicitly asks for PNG, and only when draw.io Desktop export is available.
.drawio filenode skills/drawio/scripts/cli.js input.yaml output.drawio --validate --write-sidecars --sidecar-dir .drawio-tmp/output
node skills/drawio/scripts/cli.js input.yaml output.svg --validate --write-sidecars --sidecar-dir .drawio-tmp/output
node skills/drawio/scripts/cli.js input.yaml output.pdf --validate --use-desktop
node skills/drawio/scripts/cli.js input.yaml output.png --validate --use-desktop
.drawio FileIf you receive an existing .drawio file and want to edit it via the YAML-first workflow:
node skills/drawio/scripts/cli.js existing.drawio --input-format drawio --export-spec --write-sidecars
That generates an editable bundle you can version and re-render.
.drawio.svg requires draw.io Desktop and keeps round-trip editing metadata in the export pathUse --use-desktop when embedded export matters.
If you are already in a live browser session, export_diagram can still save .drawio, .png, or .svg.
That path is optional. The default export model remains local CLI generation.
Use exported artifacts for visual checks before any browser screenshot:
.drawio.svg.| Need | Best output |
|---|---|
| ongoing editing | .drawio + work-dir sidecars |
| paper figure | .svg |
| paper figure + editable source | final .drawio + .svg, sidecars in .drawio-tmp/<name>/ |
| slide deck image | .png or .jpg with Desktop |
| printable handoff | .pdf with Desktop |
--strict-warnings for paper-quality review