You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: add layer composition analysis to plan→build pipeline
The planner now detects stacked Figma layers (image + gradient overlay +
decorative shapes) and describes how they collapse into minimal CSS
constructs. Section-level implementationNotes use a LAYERS: prefix when
composition is involved.
Both dev agents (shadcn + basecoat-wp) now read section composition
notes and follow the collapse strategy instead of creating a <div>
per Figma layer.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .claude-plugin/ui/commands/plan.md
+35-7Lines changed: 35 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,7 +128,35 @@ You are analyzing ONE section of a Figma design for Treble's design planner.
128
128
- Match to shadcn/ui if applicable (Button, Input, Card, Badge, etc.) with confidence 0.0-1.0
129
129
- For `image-extract` components: reference the `image-map.json` entry — include `imageRef` and `localPath`
130
130
131
-
6. Write DETAILED implementation notes for this section AND each component in it. Describe:
131
+
6.**Layer composition analysis** — CRITICAL. Before writing implementation notes, examine the Figma
132
+
tree for this section and identify stacked/overlapping layers that must COLLAPSE into fewer HTML
133
+
elements. Designers compose visuals by layering — the builder must NOT create a separate `<div>`
134
+
for every Figma layer.
135
+
136
+
**Common patterns to detect:**
137
+
| Figma structure | What it looks like | CSS translation |
138
+
|---|---|---|
139
+
| RECT(image) + RECT(gradient, opacity) stacked | Image with darkening overlay |`relative` container with `bg-[url(...)] bg-cover`, one `absolute inset-0` overlay div |
140
+
| Single node with multiple fills | Stacked color/gradient fills | Single `background:` shorthand with multiple layers |
141
+
| RECT(blur) + RECT(white, 10% opacity) | Frosted glass / glassmorphism |`backdrop-blur-md bg-white/10` on one element |
142
+
| Decorative shapes behind content | Circles, blobs, abstract graphics | CSS pseudo-elements or absolute decorative divs, NOT separate components |
143
+
| GROUP with shaped bottom child | Clipping mask |`overflow-hidden rounded-*` or `clip-path`|
144
+
| Layer with blend mode (multiply/screen) | Color tinting or light effects | Approximate with opacity; `mix-blend-mode` is fragile — note if skippable |
145
+
146
+
**How to write it:** Start the section's `implementationNotes` with a `LAYERS:` prefix when
147
+
composition is involved. Example:
148
+
```
149
+
"implementationNotes": "LAYERS: 3 stacked fills (photo RECT + linear-gradient RECT at 0.6 opacity
150
+
+ radial-gradient RECT with screen blend) → collapse to: relative container with bg-[url(...)]
151
+
bg-cover bg-center, one absolute inset-0 div for gradient overlay (bg-gradient-to-b from-transparent
152
+
to-black/60), skip radial bloom (screen blend unreliable in CSS). Content children get relative z-10.
Copy file name to clipboardExpand all lines: .claude-plugin/ui/skills/dev-basecoat-wp.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -220,6 +220,8 @@ Read the component's analysis entry from `analysis.json` (TEXT — fine in main
220
220
- `implementationNotes`— the detailed visual reproduction notes (THIS is your primary input)
221
221
- `referenceImages`— paths to screenshots (read these in a subagent, not here)
222
222
223
+
**For organisms/sections:** Also read the **section entry** from `pages.{page}.sections[]` in `analysis.json`. The section's `implementationNotes` contains layer composition strategy (prefixed with `LAYERS:`) that tells you how stacked Figma layers collapse into CSS. This is critical — multiple Figma layers often become a single HTML element with combined CSS. Do NOT create a separate `<div>` for every Figma layer. Follow the collapse strategy described in the notes.
224
+
223
225
**Use a subagent to examine reference images.** Spawn an Agent that reads the referenceImages PNGs and returns a text description of what it sees. This keeps images out of the main context.
224
226
225
227
Read node properties for exact measurements (TEXT — fine in main context):
@@ -250,6 +252,7 @@ Write the component as PHP partials / templates with Basecoat classes and Tailwi
250
252
- Layout matching the Figma structure (flexbox, grid via Tailwind)
251
253
- Content can be hardcoded — these are layout containers
252
254
- File at `partials/{name}.php`
255
+
- **Layer composition** — if the section's `implementationNotes` starts with `LAYERS:`, follow the collapse strategy exactly. Multiple Figma layers (image fill + gradient overlay + decorative shapes) become minimal HTML: typically a `relative` container, one or two `absolute inset-0` overlay divs, and content at `relative z-10`. Do NOT create a `<div>` per Figma layer.
253
256
254
257
**Pages:**
255
258
- WordPress page template with template header comment
Copy file name to clipboardExpand all lines: .claude-plugin/ui/skills/dev-shadcn.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -220,6 +220,8 @@ Read the component's analysis entry from `analysis.json` (TEXT — this is fine
220
220
-`implementationNotes` — the detailed visual reproduction notes (THIS is your primary input)
221
221
-`referenceImages` — paths to screenshots (read these in a subagent, not here)
222
222
223
+
**For organisms/sections:** Also read the **section entry** from `pages.{page}.sections[]` in `analysis.json`. The section's `implementationNotes` contains layer composition strategy (prefixed with `LAYERS:`) that tells you how stacked Figma layers collapse into CSS. This is critical — multiple Figma layers often become a single HTML element with combined CSS. Do NOT create a separate `<div>` for every Figma layer. Follow the collapse strategy described in the notes.
224
+
223
225
**Use a subagent to examine reference images.** Spawn an Agent that reads the referenceImages PNGs and returns a text description of what it sees — colors, layout, spacing, typography. This keeps images out of the main context.
224
226
225
227
Read node properties for exact measurements (TEXT — fine in main context):
@@ -248,6 +250,7 @@ Write the component following these rules. **File placement follows the feature-
248
250
- Use `SectionContainer` from `@/components/layout/SectionContainer` for full-bleed wrappers
249
251
- File at `src/features/{feature}/components/{ComponentName}.tsx`
250
252
- Sections are ALMOST NEVER reusable — they belong in their feature
253
+
-**Layer composition** — if the section's `implementationNotes` starts with `LAYERS:`, follow the collapse strategy exactly. Multiple Figma layers (image fill + gradient overlay + decorative shapes) become minimal HTML: typically a `relative` container, one or two `absolute inset-0` overlay divs, and content at `relative z-10`. Do NOT create a `<div>` per Figma layer.
0 commit comments