Plumb · fit
plumb_fitCompare rendered element data against design specs, then output convergence score and prioritized fixes to iterate toward a pixel-perfect match.
Instructions
Self-healing build loop — iterate to a pixel-perfect match instead of a one-shot check. The loop:
Build the component, stamping data-plumb-id="" on each element using the PDS handles (same
elkeys plumb_node/plumb_query return).Capture box (getBoundingClientRect) + the getComputedStyle subset (backgroundColor, color, font*, padding*, gap, flex*, justifyContent, alignItems, borderRadius/Color/Width, opacity, textDecorationLine) + text for every tagged element. Same shape as plumb_verify.
Call plumb_fit with
rendered. You get back: • score — 0–100 convergence (coverage × fidelity), climbs as you go • done — true once score ≥ accept (default 98) and no errors remain • topFixes — the highest-leverage changes, sorted error-first • bar — a printable ▰▱ progress bar • instruction — what to do nextIf done=false, apply topFixes, re-render, call plumb_fit again. Repeat until done=true. Each round the score should rise; if it stalls, read the full
deltasandcoverage.untaggedto see what you missed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Screen id. | |
| url | No | Paste a full Figma URL — fileKey and node-id are auto-extracted. | |
| name | No | Screen name (plugin path). | |
| depth | No | PDS depth to fetch. Default 12 — deep enough for most screens. | |
| accept | No | Score at which to stop. Default 98. | |
| fileKey | No | File key (REST path). | |
| rendered | Yes | Each element you tagged data-plumb-id="<el>", with box + styles. | |
| iteration | No | Which pass this is (1, 2, 3…). Informational — sharpens the coaching. | |
| tolerances | No | Override default thresholds. |