agentleFS
296711867296711867/figcraft-skills/skills/hand-svg-structure/SKILL.md

hand-svg-structure-figure

Skill13 starsChanged 33 days agoMITView on GitHub

Replicate a bitmap/screenshot structure diagram (block diagram, flowchart, network, schematic) as a hand-authored static SVG — programmatic geometry/color probing, live-page export, full pitfall list.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Copy text verbatim: Every string checked against the reference.

    line 15

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Hand-authored SVG structure-figure replication

When to use

The reference is a bitmap (paper screenshot, scan, slide export) showing a structure figure — block diagram / flowchart / network / schematic — and you need an editable, print-quality vector replica. Do not use this route for data plots (see data-figures-rerender).

Workflow (five steps)

  1. Probe, don't eyeball. Use probe_geometry.py (this folder) to extract exact pixel values from the reference bitmap: box bounds via fill-color connected components, circle centers/diameters via ring scans, text-row baselines, connector endpoints, dash/fill/border colors. Build the first draft in the reference's coordinate system — it lands ~80% right with zero guessing.
  2. Copy text verbatim. Every string checked against the reference. Sub/superscripts via tspan dy (math letters in italic serif; upright digit subscripts need explicit font-style="normal" — tspans inherit italics).
  3. Hand-write the SVG. Styles centralized in a <style> block + semantic color constants (see repo-root METHOD.md); structural comments per region; default ink color inherited from a wrapping <g fill="...">.
  4. Export PNG. prepare_export_pages.py builds inline-HTML pages → set the browser viewport to the exact content size → plain screenshot (never fullPage — it triggers the tiling bug); for content taller than ~2160 px, capture top/bottom halves and stitch with PIL.
  5. Acceptance. Live-page screenshot + an independent vision-model judge comparing replica vs reference (criteria: every string, arrow source→target topology, no overflow/overlap; intentional style upgrades are not defects). On FAIL, fix root causes using the judge's pixel evidence.

Hard-won pitfalls (all real)

  • SVG <style> overrides presentation attributes: text{fill:…} beats fill="" on elements → colored titles render near-black. Keep fill out of CSS; inherit defaults from a wrapping <g fill> and set colors per-element.
  • Never export via <img src="*.svg">: renders wrong (italic leakage, cascade anomalies); standalone SVG documents screenshot as scaled tiles. Inline HTML is the only reliable channel.
  • Signature style of fully-connected network figures: incoming edges converge on the target circle's left pole, arrowheads stacked in a cluster — radial rim distribution reads as "wrong".
  • Judge "likeness" at the structural-semantic level: the reference is a semantic target, not a pixel template.

Examples (examples/)

  • fig-prefix-classifier — two-section pipeline figure (blue/orange dashed groups, feedback loop), replicated from a bitmap in the reference coordinate system (ecg_reference.png is the source bitmap).
  • fig1-1_roadmap — four-stage research roadmap redrawn from a matplotlib source script (coordinates mapped 1:1).

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.