chore(Skill): read Mística Figma grid layouts into GridLayout/ResponsiveLayout#1605
chore(Skill): read Mística Figma grid layouts into GridLayout/ResponsiveLayout#1605aweell wants to merge 2 commits into
Conversation
…veLayout The mistica-figma skill builds Figma sections as native 12-column GRID frames with column spans and full-width padded ResponsiveLayout frames. The mistica-react reading path (doc/llms/figma-mcp.md) was written against the older flex/Tailwind MCP output and had no guidance for these, so a design built with the new conventions was implemented with raw Grid/flex divs instead of GridLayout/ResponsiveLayout. - figma-mcp.md: add mapping-table rows for the plain ResponsiveLayout section, the `grid grid-cols-[repeat(12,…)]` section, and `col-[S/span_N]` children; add a "Reading grid sections" subsection with a child-span → template lookup (6+6, 8+4, 4+6, 3+9, 5+4, 10, 8), the wrap rule (ResponsiveLayout supplies side margins only, GridLayout the columns), px→margin / py→Box padding, background→variant, mobile collapse, and a worked 3+9 example. - figma-verifier.md: flag raw grid/flex/Grid/spacers used instead of a span-matched GridLayout, an unwrapped GridLayout, a padded section without ResponsiveLayout, and double-wrapped nav/tabs. Validated with an A/B test per TESTING-MISTICA-SKILL.md (claude-opus-4-8, 3 runs/arm, isolated workspaces): correct GridLayout template usage went from 2/3 (baseline) to 3/3 (modified), removing the failure mode of hand-building the split with low-level Grid/GridItem + non-responsive hardcoded padding, at no measurable cost in tokens, time, or pixel parity. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Size stats
|
There was a problem hiding this comment.
Pull request overview
Updates the LLM-facing Figma→Mistica reading guidance so that 12-column GRID sections produced by the newer mistica-figma conventions are implemented with semantic ResponsiveLayout + GridLayout (including template selection) rather than low-level grid/flex constructs.
Changes:
- Extends
doc/llms/figma-mcp.mdwith explicit mapping rules for full-width padded sections, 12-col grid sections, andcol-[start/span_N]children, plus a “Reading grid sections” template-lookup and worked example. - Extends
doc/llms/agents/figma-verifier.mdwith new verification checks that enforce usingGridLayouttemplates and correctResponsiveLayoutwrapping (and avoiding double wrapping for components that embed it).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| doc/llms/figma-mcp.md | Adds updated mapping table + detailed guidance for reading 12-col grid sections into ResponsiveLayout/GridLayout. |
| doc/llms/agents/figma-verifier.md | Adds verifier rules to flag incorrect layout primitive usage and missing/extra ResponsiveLayout wrapping. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
A/B test report — mistica-react skill: Figma grid-layout readingDate: 2026-06-30. Methodology: TL;DR verdict
Headline: the change improves grid-structure correctness and run-to-run consistency — it eliminates the Methodology
Per-run dataBaseline (
|
| run | input | cache read | cache create | output | cost | wall | GridLayout | template= | ResponsiveLayout | compliance |
|---|---|---|---|---|---|---|---|---|---|---|
| no-1 | 11,252 | 2,536,055 | 144,712 | 22,876 | $3.34 | 364s | 2 | 2 | 5 | 1.0 |
| no-2 | 28,097 | 1,387,652 | 114,741 | 10,896 | $2.26 | 177s | 2 | 2 | 5 | 1.0 |
| no-3 | 21,859 | 1,812,181 | 125,223 | 17,781 | $2.71 | 285s | 0 | 0 | 3 | 1.0 |
Modified (with-*)
| run | input | cache read | cache create | output | cost | wall | GridLayout | template= | ResponsiveLayout | compliance |
|---|---|---|---|---|---|---|---|---|---|---|
| with-1 | 18,563 | 1,953,772 | 116,442 | 18,786 | $2.70 | 280s | 2 | 2 | 5 | 1.0 |
| with-2 | 11,246 | 2,111,962 | 107,311 | 17,329 | $2.62 | 284s | 2 | 2 | 5 | 1.0 |
| with-3 | 18,562 | 1,693,485 | 107,964 | 16,884 | $2.44 | 277s | 2 | 2 | 5 | 1.0 |
Token volume is overwhelmingly cache reads on the input side (>98%); the "fewer tokens" question is a wash
once decomposed, consistent with the methodology's caution.
The baseline failure mode (no-3)
Instead of the semantic GridLayout template, no-3 reproduced the Figma grid-cols-12 / col-span DOM
literally with the low-level primitive and hardcoded responsive padding:
<ResponsiveLayout fullWidth>
<Box paddingX={48} paddingY={32}>
<Grid columns={12} gap={24}>
<GridItem columnSpan={3}><FilterPanel /></GridItem>
<GridItem columnSpan={9}><Table … /></GridItem>
</Grid>
</Box>
</ResponsiveLayout>This still scores compliance = 1.0 (Grid/GridItem are Mistica components), and at desktop 1440 it
renders pixel-equivalent — so neither the compliance metric nor the screenshot flags it. The defect is
altitude and responsiveness: the hardcoded paddingX={48} does not shrink to 16 px on mobile the way
ResponsiveLayout margins do, and the template name (3+9) is lost. All three modified runs avoided this.
Screenshot gallery
| baseline | modified | |
|---|---|---|
| run 1 | ![]() |
![]() |
| run 2 | ![]() |
![]() |
| run 3 | ![]() |
![]() |
All six faithfully reproduce the reference layout (6+6 hero with four KPI cards, 3+9 filter-sidebar + table,
nav, footer). Cosmetic-only variation: invented vs. literal (HRow cell) table data, KPI-card vertical gap,
and with-3 adding nav sections — none attributable to the variable under test.
Interpretation
- Measured effect: the change makes correct
GridLayouttemplate usage reliable (3/3 vs 2/3) and removes
the hand-built-grid failure path. It also tightened output-token, cost, and wall-clock variance. - Artefact, not effect: the baseline already used
GridLayoutin 2/3 runs becauselayout.md(read in
every run) documents the templates. So this change raises reliability, not capability from zero. With
n=3 the failure-rate reduction (1/3 → 0/3) is suggestive, not statistically tight. - No regression: tokens, cost, time, and pixel parity are ties; the modified arm is never worse.
|
Deploy preview for mistica-web ready!
Deployed with vercel-action |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| @@ -36,22 +36,77 @@ nicer" numbers. | |||
|
|
|||
| ## Mapping Figma flex to Mistica layout primitives | |||
| A full-width section laid out as a 12-column grid is a `GridLayout`. The MCP output makes this explicit — the | ||
| section `div` carries `grid grid-cols-[repeat(12,minmax(0,1fr))]` (plus `gap-x-[24px]` on desktop / `16px` on | ||
| tablet), and each direct child carries a `col-[start/span_N]` class. Read the `span_N` of each child, in | ||
| order, and match the sequence to a `GridLayout` template: |
|
Accessibility report ℹ️ You can run this locally by executing |






Summary
Teaches the
mistica-reactskill to read the layouts the updatedmistica-figmaskill produces, so a design built with the new Figma conventions is implemented withGridLayout/ResponsiveLayoutinstead of rawGrid/flexdivs.The mistica-figma skill builds sections as native 12-column GRID frames (column spans + template naming) and full-width padded
ResponsiveLayoutframes. The reading path (doc/llms/figma-mcp.md) predates this and was written against the older flex/Tailwind MCP output — it had noGridLayoutrow and no guidance for the grid/section conventions. The mapping rules here are grounded in the real Figma MCP DOM (grid grid-cols-[repeat(12,minmax(0,1fr))]+col-[start/span_N]) and verified against the@telefonica/misticasource (GridLayouttemplates, theVariantenum, theResponsiveLayoutwrap requirement).Changes
doc/llms/figma-mcp.md— mapping-table rows for the plainResponsiveLayoutsection, thegrid grid-cols-[repeat(12,…)]section, andcol-[S/span_N]children; a "Reading grid sections" subsection with a child-span →templatelookup (6+6,8+4,4+6,3+9,5+4,10,8), the wrap rule (ResponsiveLayout= side margins only,GridLayout= columns),px→margin /py→Box, background→variant, mobile collapse, and a worked3+9example.doc/llms/agents/figma-verifier.md— flag raw grid/flex/Grid/spacers used instead of a span-matchedGridLayout, an unwrappedGridLayout, a padded section withoutResponsiveLayout, and double-wrapped nav/tabs.Validation (A/B test per
TESTING-MISTICA-SKILL.md)claude-opus-4-8, 3 runs/arm, isolated workspaces differing only in these two files, same byte-for-byte prompt against a Figma frame with a6+6hero and a3+9sidebar+table.GridLayouttemplate usageThe baseline failure run hand-built the split with low-level
Grid/GridItem+ non-responsive hardcodedpaddingX={48}(still "Mistica primitives", so compliance and the desktop screenshot did not flag it). The modified arm reliably used the semanticGridLayouttemplates. No regression in tokens, cost, latency, or fidelity.🤖 Generated with Claude Code