diagram-design-export-diagram
Export a diagram-design HTML file to .svg and .png next to the source
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- diagram-design-export-diagram
- description
- Export a diagram-design HTML file to .svg and .png next to the source
02 资源文件 3
- 许可证LICENSE1.0 KB
- 参考文档SOURCE.md331 B
- 参考文档THIRD_PARTY_LICENSES.md3.1 KB
03 SKILL.md 正文
Export the diagram HTML at $1 to .svg and/or .png, following the procedure documented in skills/diagram-design/references/export.md. Treat that reference as the source of truth — don't reimplement the logic here. Run the packaged skills/diagram-design/scripts/export_svg.py and skills/diagram-design/scripts/export_png.py helpers for the requested formats. If --registry is present, also follow skills/diagram-design/references/export-registry.md 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 the source (e.g.diagram.html→diagram.svg+diagram.png).--svg-onlyor--png-onlyrestricts the image output to that one format. - PNG renders at
device_scale_factor=2. --registrygiven by itself, with neither--svg-onlynor--png-onlyalso present, produces only the registry JSON. The SVG/PNG defaults above do not also apply, and Playwright is never required for a registry-only call. To get an image alongside the registry, add--svg-onlyor--png-onlyexplicitly.
Flags
--svg-only— emit only the SVG. Skip Playwright entirely.--png-only— emit only the PNG.--scale=N— override the PNG device scale factor with a finite number from1to4, including fractional values such as1.25. Default2.--output=<path>— override the output base path; the format extension is appended. Applies to both formats when both are produced.--registry— emit<basename>.registry.json, a metadata sidecar of every block'sdata-block-*attributes. Followsskills/diagram-design/references/export-registry.md, a procedure independent of the SVG/PNG rasterization above — it never needs Playwright. Used alone (see Defaults), it is the only output produced. Combine with--svg-onlyor--png-onlyto also produce an image in the same call.
Required behaviour
- No source path provided → ask the user which
.htmlfile to export. Don't guess. - Source is
assets/index.html(the gallery, multiple SVGs in one file) → refuse and ask which specific diagram file. Per the reference's edge-case section. - Source has no
<svg>block → refuse and tell the user; don't write anything. - PNG requested but Playwright not installed → surface the install instruction from the reference verbatim and 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 and tell the user; don't emit an empty or partial registry file. 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 — a registry-only call must succeed on a host that doesn't have it installed at all.
After producing the outputs, report the file paths and sizes back to the user.
04 同仓库更多 Skills
writing-for-agents
Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.
wrangler
Run or troubleshoot Wrangler CLI commands in projects that have a wrangler.jsonc, wrangler.json, or wrangler.toml file, including local development, Previews, deployment, and resource management. For new projects and projects without a Wrangler configuration file, use the cf CLI instead.
workers-profiling
Profile or debug CPU usage and memory allocation in deployed Cloudflare Workers and Durable Objects. Then use this information to optimize your code.
workers-development
Run, inspect, and debug Cloudflare Workers during local development with cf dev, wrangler dev, or the Cloudflare Vite plugin, using Local Explorer to read and seed binding data and query local traces and logs. Also routes production debugging to Workers observability. Use for debugging requests whether or not the project uses Wrangler.
workers-best-practices
Cloudflare Workers best practices for production applications. Use when writing, reviewing, or configuring Workers.
wordpress-pro
Develops custom WordPress themes and plugins, creates and registers Gutenberg blocks and block patterns, configures WooCommerce stores, implements WordPress REST API endpoints, applies security hardening (nonces, sanitization, escaping, capability checks), and optimizes performance through caching and query tuning. Use when building WordPress themes, writing plugins, customizing Gutenberg blocks, extending WooCommerce, working with ACF, using the WordPress REST API, applying hooks and filters, or improving WordPress performance and security.