/logo-construction-geometry:logo-construction-geometryfrom logo-construction-geometry
This skill should be used when a logo exists only as a raster or as a noisy auto-traced SVG and needs a clean vector built from real geometry — the user says "rebuild this logo as proper SVG", "the trace is lumpy / hundreds of nodes", "convert this PNG logo to real circles and lines", "find the geometry behind this logo", "make the logo parametric", or "write a prompt so Claude Design rebuilds it cleanly". It measures the construction (centres, radii, angles, stroke, nodes), infers the rule that ties them together, regenerates the mark from a handful of named parameters, and scores the result against the source.
Ships in logo-construction-geometry. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Auto-tracers (potrace, vtracer, "AI vectorize") outline the edges of pixels, so every anti-aliasing step becomes a node and a stroked ring becomes two lumpy filled contours. Most marks were drawn from a few primitives and one or two rules. Recover those, and the SVG becomes a few dozen commands that one parameter change updates consistently.
┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐
│ 1. Measure│-->│ 2. Infer │-->│ 3. Snap + │-->│ 4. Score │-->│ 5. Report │
│ evidence │ │ the rule │ │ generate │ │ vs source │ │ + decide │
└───────────┘ └───────────┘ └───────────┘ └───────────┘ └───────────┘
Work from the highest-resolution raster available. Ignore the traced SVG's paths; they are what you are replacing.
pip install numpy scipy scikit-image pillow cairosvg # once
python3 scripts/measure.py logo.png --color 39C5F3 [--crop x0,y0,x1,y1] > geometry.json
All coordinates are SVG coordinates: pixel i spans [i, i+1], so the script adds 0.5 to pixel indices. --index-coords gives the raw indices. Output is deterministic: the RANSAC and Hough seeds are fixed.
Run it once per ink colour and per region (icon vs. wordmark). It skeletonises the ink to centre-lines and reports:
| Field | Method | Read it as |
|---|---|---|
circles | iterative RANSAC + algebraic least-squares refit on the skeleton | several circles sharing a centre = concentric tracks; rms < 0.5 px = a true arc |
angle_hist | probabilistic Hough transform, length per 7.5° bin | a spike at 45°/135°/90° = a design angle; scattered short bins = arc chords (noise) |
stroke_width | ink area ÷ centre-line length | an upper bound: the synthetic benchmark measured it +0.6 to +2.2 px too wide (anti-aliased edges, node dots). Sweep downward and let the § 4 score decide |
solid_nodes / hollow_nodes | distance-transform peaks / small enclosed holes | terminals and on-track markers |
graph | skeleton pixel degree: endpoints (1), junctions (≥3) | topology: where tracks end, T-join, form a cusp, or merge into each other |
Topology before geometry. Read graph and look at a 10× crop of every place where
lines come close. Circle fits say which curves exist. They don't say where each one stops
or what it joins. A clean-looking model with the wrong topology fails there.
Check: the circles found match what you see; nothing important is missing from the lists. For letterforms, sample row and column runs across stems, arches and bars (stem width, x-height, baseline, counter radii). The same stem width usually drives the dot diameter, bar lengths and corner radii.
Look for relations, not values. Common ones:
d = 2√2·r_mid, because a
tangent line at distance r₁ from one centre and r₂ from the other only works when
r₁ + r₂ = d·sin θ.y = (c₁+c₂)/2 + (r₁²−r₂²)/(2d), x = ±√(r₁²−(y−c₁)²). Those two points are the arc
endpoints, so a merge stays pure A commands, with no clipPath.Each rule must predict a number you did not use to derive it. That prediction is the evidence. A rule that only restates the measurements is a curve fit, not a construction.
circle, ellipse, rect, line, and path with M L H V A Z.
No Béziers unless the source is organic.fill="none", round caps) for tracks, not filled outlines.<mask>. A background-coloured fill breaks on
transparent backgrounds.#track-A, #nodes-solid, #glyph-n). Put the parameter table in
<desc>.python3 scripts/overlay.py logo.png rebuilt.svg --diff diff.png # cairosvg
python3 scripts/overlay.py logo.png rebuilt.svg --diff diff.png --chromium # masks/filters exact
iou — raw overlap. At about 400 px wide, 0.75–0.8 is typical even when correct: stroke
edges are mostly anti-aliasing.iou_tolerant — with a 1 px tolerance. Aim for ≥ 0.9.off_px — ink more than 1.5 px from the other mask. This is the real shape error.--crop, not just the whole logo. A small part's error
disappears in the average. Measured 2026-09-24: a wrong topology for one glyph moved the
whole-logo tolerant IoU by only 0.003 (0.905 → 0.908). The glyph's own crop
showed it plainly: off-px 73 → 3, IoU 0.68 → 0.83.diff.png (yellow = both, red = source only, green = rebuild only). A
consistent red/green offset along one ring means a wrong radius or centre. Scattered
fringes are anti-aliasing.Check: a stroked-track mark should also rasterise cleanly at 16–32 px.
Close with a derived vs. assumed table:
| Part | Status | Evidence |
|---|---|---|
| e.g. 45° diagonals | Derived | Hough spike; the tangency invariant holds on every line |
| e.g. radii | Fitted → snapped | measured values → chosen values, largest shift in px |
| e.g. node angle | Assumed | a snap with no rule behind it |
Name the weakest assumption and what would settle it (a higher-resolution source, or the master file). Put every place where the source looks inconsistent (a jog, an off-centre ring) to the user as a decision: faithful or clean. Never silently "fix" the brand.
If the rebuild is delegated, the prompt carries: the ban on reusing the trace, the primitive whitelist, strokes not fills, the parameter table and the rules from § 2, the id structure, the § 4 scoring with the numbers to report, and the open decisions as questions. A prompt that only says "make it clean" gets a smoother trace, not a construction.
--chromium
when the SVG relies on masks.measure.ransac + CircleModel, transform.probabilistic_hough_line,
morphology.skeletonize: https://scikit-image.org/docs/stable/api/rudykon/logo-vector-tracing. It has no license, so it is cited only. This skill adds
measurement tooling, rule inference and scoring.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub kattakath/skills --plugin logo-construction-geometry