agentleFS
zombicozombico/mojulo/.claude/skills/view-svg/SKILL.md

view-svg

Skill4 starsChanged 33 days agoApache-2.0View on GitHub

Rasterize SVG file(s) to PNG so they can be visually evaluated with the Read tool. Use whenever you need to *see* an SVG — illustration-experiment outputs under lite-template/integration/**/spike-output/, a stored sketch's SVG, or any .svg path. The Read tool renders PNG/JPG but not SVG; this bridges that gap. Invoke as `/view-svg <path|dir|glob>...`.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the printed PNG paths to evaluate them.

    line 37

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

view-svg

Turn SVG(s) into PNG(s) you can actually look at. The Read tool renders raster images visually but treats SVG as text, so to evaluate a generated illustration (shape, proportion, color, composition) you must rasterize first.

This is a dev affordance: run one command, then Read the PNGs it prints. Don't hand-roll conversion or reason about the SVG markup — let the raster show you.

Use it

node .claude/skills/view-svg/rasterize.mjs <path|dir|glob>... [options]

Inputs (mix freely):

  • a .svg file → rasterized
  • a directory → every .svg under it (recursive) is rasterized
  • a shell glob (e.g. lite-template/integration/**/spike-output/figure-*/*.svg) → let the shell expand it

Options:

  • --out DIR — output dir (default /tmp/svg-preview/<timestamp>/, mirroring the source tree so same-named files don't collide)
  • --density N — render DPI, higher = crisper (default 200)
  • --max PX — cap the longest output side, aspect preserved (default 2000)
  • --bg COLOR|none — flatten onto a background (default white; none keeps transparency)

The script prints each written PNG's absolute path to stdout, one per line, and a rasterized N/M → <dir> summary to stderr.

Then look

Read the printed PNG paths to evaluate them. For many files, rasterize the whole directory in one call, then Read the specific PNGs worth inspecting rather than all of them.

Where the illustration experiments live

The polygonizer spikes (the *.spike.gen.test.js files in control/lib/graph/polygonizer/) write SVGs to lite-template/integration/<date>/spike-output/<name>/*.svg. To review a fresh run: run the gen test, then point this skill at that spike's output directory.

Notes

  • Uses control's bundled sharp (libvips + librsvg), resolved via createRequire against control/package.json — no extra install, and it doesn't matter what directory you run from.
  • Output goes to /tmp by default; it's disposable. Pass --out if you want previews kept somewhere specific.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.