Tools / agent-svgtools / The agent loop
The agent loop
The tool is built around a tight iterate-and-improve loop: read the target colors, author or revise the SVG, score it, attack the worst region, repeat.
agent-svgtools colors <reference>— read the exact hex values to target.- (optional)
agent-svgtools trace <reference> start.svg— a starting-point SVG. - Author or revise
candidate.svg. agent-svgtools judge <reference> candidate.svg --diff-image diff.png --grid— score it and localize the errors.- Read the scores and
regions, opendiff.png, attack the worst region, and return to step 3. Stop whencombinedclears your target (or--thresholdpasses).
Run agent-svgtools skill > SKILL.md to install the full, agent-facing workflow
guide into a project.
Quick start
# Score an SVG against a reference image (TOON by default).
agent-svgtools judge logo.png candidate.svg
# With artifacts and a coordinate grid for a vision model.
agent-svgtools judge logo.png candidate.svg \
--diff-image diff.png --side-by-side sbs.png --grid
# CI gate: exit code 2 if the combined score is below 95.
agent-svgtools judge logo.png candidate.svg --threshold 95
Example judge output:
reference:
path: logo.png
width: 512
height: 512
candidate: candidate.svg
scores:
pixel_match: 96.4
ssim: 88.1
combined: 92.25
regions[2]{x,y,width,height,error}:
192,64,128,96,41.2
0,416,96,96,33.7
artifacts:
diff_image: diff.png