Plumb · review
plumb_reviewSelf-critiques Figma designs against authored intent and design rubrics, scoring structure, design, and optional vision grade, then coaches iterative refinements to meet quality targets.
Instructions
Self-critique the design you just emitted into Figma, and coach the refine loop — the write-direction mirror of plumb_fit. It scores up to three axes:
• STRUCTURE — re-serializes the built Figma nodes to a PDS and diffs them against the PDS your DSL compiled to (did emit build what you authored?). Uses the same verify engine as plumb_verify/plumb_fit. The two docs are joined by ids = EmitResult.ids (authored el → Figma node id) — pass it or the diff can't line up.
• DESIGN — a deterministic rubric over hierarchy, spacing rhythm, contrast (WCAG AA), alignment, type-scale, and professional-vs-templated polish. Failing contrast is an error and blocks done.
• DIRECTOR (optional, director: {score, verdict?, issues?}) — a vision creative-director grade of the rendered screenshot: visual balance, focal flow, image composition/crop, optical spacing, and the "designed vs generated" gestalt a deterministic pass over the PDS can't see. There is NO server-side vision call and NO API key needed here — YOU (the calling agent) already have vision, so YOU grade the screenshot yourself and pass your verdict in. The loop: call plumb_screenshot on the emitted rootId, look at the PNG, grade it as a demanding creative director (any response with no director input echoes the exact grading criteria + output shape at the end of its instruction), then call plumb_review again passing director: { score, verdict, issues }. With the director present, weights reshuffle to structure 0.4 / design 0.3 / director 0.3 and a director error-severity issue blocks done too, so the bar is harder (and more honest) to clear.
Returns: score (0–100 blended), done, bar, topFixes (error-first across all active axes, director fixes tagged [director/<dim>]), instruction, dimensions[] (per-rubric-dimension sub-scores), directorScore/directorVerdict when graded, plus the raw structural deltas + coverage. Provide the authored PDS inline via authored, or a path to it via authoredPath (the JSON plumb_apply writes). Point id/name/url at the emitted root (EmitResult.rootId). Canonical loop: plumb_design → repeat[ plumb_screenshot (rootId) → grade it yourself → plumb_review(..., director: {score, issues}) → if !done, apply topFixes and plumb_design(mode:"sync") ] until done or an iteration cap. If done=false, apply topFixes, re-apply the DSL (mode:"sync" keeps plumbKey), and call plumb_review again — the score should climb.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Emitted root node id (EmitResult.rootId). | |
| ids | No | EmitResult.ids — authored el → Figma node id. The join key for the structural diff. | |
| url | No | Paste a full Figma URL — fileKey and node-id are auto-extracted. | |
| name | No | Screen name (plugin path). | |
| brief | No | Optional design intent (type scale, fonts, spacing grid) to grade against. | |
| depth | No | PDS depth to re-serialize. Default 12. | |
| accept | No | Blended score at which to stop. Default 90. | |
| fileKey | No | File key (REST path). | |
| authored | No | The authored PdsDocument (what the DSL compiled to). Inline alternative to authoredPath. | |
| director | No | YOUR OWN vision grade of the rendered screenshot — no server-side model call, no API key. Look at the PNG from plumb_screenshot, grade it yourself as a demanding creative director (see directorGuidance in a no-director response for the exact criteria), and pass { score, verdict?, issues? } here. When present, reweights the blend to structure 0.4 / design 0.3 / director 0.3 and a director error blocks `done`. | |
| iteration | No | Which refine pass this is (1, 2, 3…). Informational — sharpens the coaching. | |
| tolerances | No | Override default structural thresholds. | |
| authoredPath | No | Path to a JSON file holding the authored PdsDocument (written by plumb_apply). |