Handbook
One parse, many projections. The engine never treats Figma’s auto-layout fields as truth — coordinates are ground truth; layout intent is re-inferred.
FigmaNode ──adapter──→ Node ──normalize──→ IR ──render──→ code
(platform) (generic) flatten (framework-free) N targets
regroup
measure
──synthesizeLoops──→ (IR → IR)
──match(index)──→ (design system)
Node..map / v-for / unrolled HTML.Humans scan UI top-down: global rhythm → repeating units → holes inside units. The engine does the same. Loops are high-dimensional structure: once a feed is established, low-dimensional variance (different text, icons, child counts inside the unit) becomes holes — it does not veto the class.
| Stage | Role |
|---|---|
| UnitCut | Geometry cuts list items + prefix/suffix |
| RhythmHyp | Coarse shell declares a feed run |
| SoftGeneralize | Anchors + mid slots; variance → holes |
| Classic fold | Isomorphic ≥3 / period / partial runs as fallback |
Among all CSS that reproduces the pixels, Calque prefers the most semantic, content-resilient form:
gap, not N absolute topsjustify-betweenjustify-center / items-centerMetrics used in dogfood: structure floor r = b = 0 on corpus, mean geometry IoU ≈ 0.97.
| Piece | Location |
|---|---|
| Engine core | src/plugin/ (also cloud Worker) |
| Plugin UI | src/ iframe app |
| CLI | src/cli/ · thin client → cloud |
| MCP | src/mcp/ |
| Scan index | Always on the customer machine (local FS) |