Canvas design decomposition
Mandatory triggers (load this skill first)
Load and follow this skill before proposing component structure for a
component library, writing implementation plans, or implementing
components—including when the user only asks for a plan or
breakdown—whenever you are modeling how UI should split into Canvas
components (a component library, section, or full page). The same
applies when you are about to build, add, or scaffold components (see
below). Treat any of the following as a trigger:
- Building or adding Canvas components: creating new folders under
src/components/, authoring component.yml and the entry file
(index.jsx/.tsx in React projects; the framework-appropriate file in
headless projects), scaffolding a component from a ticket or spec,
coding a section from a design, or implementing a named block (hero,
footer, card, and so on). Decompose before writing schema or
implementation code so names, slots, variants, and reuse stay aligned—unless
the task is a trivial one-line tweak inside an existing, stable API.
- Designing or evolving a component library for Canvas—naming regions,
deciding reuse, props/slots, and granularity—whether the stimulus is a file, a
site, or a conversation.
- The message contains a Figma URL (
figma.com/design, figma.com/make, or
branch URLs) or explicit node-id / frame language tied to Figma.
- The source of truth is an existing website, screenshot, scraped
page, or reference URL meant to drive layout or components (pair with
nebula-scrape-url when a live URL needs
capture).
- The source is text-only or generative: a written brief, markdown spec, or
an AI- / prompt-generated design (layout description, wireframe in words,
component list from a chat). Phase A still applies—classify intake and list
unknowns even when pixels are absent.
- The user asks to implement, build, match, recreate, or plan
implementation of a design, frame, screen, or page from any
artifact or description.
Do not skip (common failure mode)
- Greenfield work is not exempt. Implementing a new page or Figma frame
from scratch still requires this skill—you map the design to a coherent tree,
props, and slots before locking implementation details.
- Draft files in the repo are not a shortcut. Existing
pages/*.json,
partial components under src/components/, or scraped assets may be helpful
starting points, but they do not replace reading this skill and
completing phases A–G for the current artifact. Reconcile draft code
with the breakdown; do not assume prior work already did decomposition.
- Plans count. If the user asks only for an implementation plan, you
still load this skill and summarize regions → components → placement before
pixel work or tooling shortcuts.
Automated tool output (for example Figma MCP reference JSX, HTML export, or
generated code) is input to this workflow—not a substitute for completing
phases A–G.
Turn a design artifact into a stable component model: regions, tree, prop vs
slot decisions, and granularity checks. A breakdown is incomplete without
sketching props and slots for each node—Canvas authors interact with the
tree through that API, so plan it with structure, not after implementation.
During planning, step past the single frame or ticket: ask where else each
piece could appear and what would differ (copy, children, variant). Prefer
reusable machineNames, slots for variable regions, and presets via
variant over one-off names or props that hard-code one campaign’s content.
Do not implement pixels or write component.yml inside this workflow—finish
the structure and prop/slot sketch first, then hand off.
Skill order
- This skill — workflow, tree, and handoff.
canvas-component-composability
— shared props/slots rules, repeatable content, and granularity checks.
canvas-component-metadata — exact
component.yml schema.
canvas-component-definition —
folder contract, mocks, naming authority.
implement-design — pixel-level fidelity
when the source is Figma and after the tree is locked (requires Figma MCP
when used). For non-Figma sources, implement from the locked tree and tokens
without this step unless the user points back to a Figma file.
For repeatable lists/grids in Canvas, see
canvas-component-composability/references/repeatable-content.md.
Inputs
Classify the source in Phase A. Typical categories:
| Kind |
Examples |
| Design tool |
Figma file, frame export, FigJam |
| Live reference |
Existing production or staging site, competitor URL |
| Captured media |
Screenshots, PDFs, brand decks |
| Structured scrape |
HTML/CSS snapshot via tooling |
| Prompt / prose |
User brief, AI-generated layout description, markdown wireframe |
Optional helpers:
Workflow (mandatory)
Complete phases A → G in order. Each phase has an exit criterion. If
Phase F fails, fix the tree and re-run Phase E for affected nodes only.
Phase A — Intake and framing
- Identify input type: design file (e.g. Figma), live site / scrape, screenshot,
or text-only / prompt-generated spec.
- List unknowns: breakpoints, empty states, max copy length, media aspect
ratios, hover/focus/active, accessibility expectations.
- Tag each unknown with risk: low / medium / high (edits likely to churn
structure).
Exit: Input type stated; unknowns listed with risk (workflow continues even
if some answers are missing).
Phase B — Region map
- Divide the design into regions (e.g. header, hero, content band, sidebar,
footer, modal chrome).
- For each region: label, purpose (one line), class —
chrome
(shell), navigation, or content.
Exit: Ordered region list with purpose and class for each.
Phase C — Candidate component inventory
- Map regions to candidate
machineName values (kebab-case folder names per
canvas-component-definition).
- Prefer reusable base names; variants via props/composition, not extra
component names, unless truly one-off.
- Mark reuse count when the same pattern appears two or more times.
- Generalize: For each candidate, note other plausible contexts (other
pages, shorter copy, different children). If it only makes sense for this one
screen, rename or decompose until it is reusably scoped.
Exit: Table: candidate machineName, responsibility, reuse count, parent
region.
Phase D — Component tree
- Build parent/child relationships: layout shells vs content leaves.
- Layout ownership: multi-column grids, page-level stacks, and section
wrappers belong in layout-oriented components; avoid baking unrelated grids
into content components unless the layout is invariant for every instance.
- Express the tree as a nested outline or Mermaid diagram (Mermaid node IDs: no
spaces; use camelCase or underscores).
Exit: Tree covers every inventory row; layout vs content roles are explicit.
Phase E — Props vs slots (per node)
Required: Every decomposition includes this phase. Props and slots are not a
late add-on—they define how editors use the tree. For each tree node,
sketch:
- Props: configuration and simple values editors should set directly
(variants, booleans, short strings, URLs, enums). Note intent and broad type
class (
string, boolean, enum, image/reference)—not final YAML. Follow
canvas-component-composability
for the actual props-vs-slots rubric, variants-vs-granular guidance, and prop
ordering. This phase records the decision; it does not redefine that rubric.
- Slots: areas where authors compose child components or arbitrary blocks.
Name the slot, describe allowed content, and note empty behavior
(collapse, placeholder, min height).
- Implementation style: record
variants (default) or granular props with
a one-line rationale in the handoff. For the Phase E write-up convention, see
references/props-vs-slots-rubric.md.
Exit: Every node has a prop/slot sketch, implementation style is stated, and
repeatable rich children are not modeled as object arrays in props.
Phase F — Granularity audit
Run the shared granularity checklist in
canvas-component-composability.
In this phase, audit the candidate tree against that shared rule set and record
the result; do not create a second split/merge rubric here. For the Phase F
audit note, see references/granularity.md.
- Mark each node pass/fail with a short rationale.
- If any node fails, merge, split, or extract, then repeat Phase E for changed
nodes only.
- Document intentional exceptions explicitly.
Exit: All nodes pass or failures are documented with explicit rationale.
Phase G — Handoff
Deliver one Markdown artifact using the template below. Point next steps to:
Exit: Filled template ready to paste into an issue or MR.
Out of scope here: page JSON
(canvas-page-definition), validation
runs (nebula-component-validation).
Output template
Copy and fill:
## Summary
- **Design source:** (e.g. Figma URL | live URL | screenshots | prompt/spec
text)
- **Scope:** (single component | section | full page)
- **Version / date:**
## Assumptions and open questions
- ...
## Region map
| Region | Purpose | Class |
| ------ | ------- | ----- |
| ... | ... | ... |
## Component inventory
| machineName (candidate) | Responsibility | Reuse | Parent region | Notes |
| ----------------------- | -------------- | ----- | ------------- | ----- |
| ... | ... | ... | ... | ... |
## Component tree
(Nested list or Mermaid)
## API sketch (per component)
### `machine-name`
**Implementation style:** variants (default) | granular props — one-line
rationale
**Props** (table rows in editor order: **variant first** when there is a single
primary variation enum; **content first** otherwise—then configuration)
| Name (camelCase intent) | Purpose | Required? | Kind (string / bool / enum / …) |
| ----------------------- | ------- | --------- | ------------------------------- |
| ... | ... | ... | ... |
**Slots**
| Slot key | Purpose | Empty behavior |
| -------- | ------- | -------------- |
| ... | ... | ... |
## Granularity audit
| Component / node | Pass/Fail | Notes / fix |
| ---------------- | --------- | ----------- |
| ... | ... | ... |
## Next steps
- [ ] `canvas-component-composability` — edge cases for props/slots,
repeatability, or granularity
- [ ] `canvas-component-metadata` — draft `component.yml`
- [ ] `canvas-component-definition` — folder, entry file, mocks
- [ ] `implement-design` — Figma fidelity pass (only when matching a Figma file)
Further reading
Anti-duplication
1---2name: canvas-design-decomposition3description: Plans structure for a component library with props/slots and right-sized component granularity. Run before building or adding Canvas components (new component folders, component.yml, implementation), or for plan-only / breakdown-only work, whenever UI must map to a coherent tree. Mandatory for every new Figma frame or greenfield screen—repository drafts do not replace phases A–G.4---56# Canvas design decomposition78## Mandatory triggers (load this skill first)910Load and follow **this** skill **before** proposing component structure for a11component library, writing implementation plans, or implementing12components—**including** when the user only asks for a **plan** or13**breakdown**—whenever you are modeling **how** UI should split into Canvas14components (a **component library**, **section**, or **full page**). The same15applies when you are about to **build, add, or scaffold components** (see16below). Treat any of the following as a trigger:1718- **Building or adding Canvas components:** creating new folders under19 `src/components/`, authoring `component.yml` and the entry file20 (`index.jsx`/`.tsx` in React projects; the framework-appropriate file in21 headless projects), **scaffolding** a component from a ticket or spec,22 **coding** a section from a design, or **implementing** a named block (hero,23 footer, card, and so on). Decompose **before** writing schema or24 implementation code so names, slots, variants, and reuse stay aligned—unless25 the task is a trivial one-line tweak inside an existing, stable API.26- **Designing or evolving a component library** for Canvas—naming regions,27 deciding reuse, props/slots, and granularity—whether the stimulus is a file, a28 site, or a conversation.29- The message contains a **Figma URL** (`figma.com/design`, `figma.com/make`, or30 branch URLs) or explicit **node-id** / frame language tied to Figma.31- The source of truth is an **existing website**, **screenshot**, **scraped32 page**, or **reference URL** meant to drive layout or components (pair with33 [`nebula-scrape-url`](../nebula-scrape-url/SKILL.md) when a live URL needs34 capture).35- The source is **text-only or generative**: a written brief, markdown spec, or36 an **AI- / prompt-generated design** (layout description, wireframe in words,37 component list from a chat). Phase A still applies—classify intake and list38 unknowns even when pixels are absent.39- The user asks to **implement**, **build**, **match**, **recreate**, or **plan40 implementation** of a **design**, **frame**, **screen**, or **page** from any41 artifact or description.4243### Do not skip (common failure mode)4445- **Greenfield work is not exempt.** Implementing a **new** page or Figma frame46 from scratch still requires this skill—you map the design to a coherent tree,47 props, and slots before locking implementation details.48- **Draft files in the repo are not a shortcut.** Existing `pages/*.json`,49 partial components under `src/components/`, or scraped assets may be helpful50 **starting points**, but they do **not** replace reading this skill and51 completing phases **A–G** for the **current** artifact. Reconcile draft code52 with the breakdown; do not assume prior work already did decomposition.53- **Plans count.** If the user asks only for an implementation **plan**, you54 still load this skill and summarize regions → components → placement before55 pixel work or tooling shortcuts.5657Automated tool output (for example **Figma MCP reference JSX**, HTML export, or58generated code) is **input** to this workflow—not a substitute for completing59phases **A–G**.6061Turn a design artifact into a **stable component model**: regions, tree, prop vs62slot decisions, and granularity checks. A breakdown is **incomplete** without63sketching **props and slots** for each node—Canvas authors interact with the64tree through that API, so plan it **with** structure, not after implementation.6566During planning, **step past the single frame or ticket**: ask where else each67piece could appear and what would differ (copy, children, `variant`). Prefer68reusable `machineName`s, slots for variable regions, and presets via69**`variant`** over one-off names or props that hard-code one campaign’s content.7071**Do not** implement pixels or write `component.yml` inside this workflow—finish72the structure and prop/slot sketch first, then hand off.7374## Skill order75761. **This skill** — workflow, tree, and handoff.772. [`canvas-component-composability`](../canvas-component-composability/SKILL.md)78 — shared props/slots rules, repeatable content, and granularity checks.793. [`canvas-component-metadata`](../canvas-component-metadata/SKILL.md) — exact80 `component.yml` schema.814. [`canvas-component-definition`](../canvas-component-definition/SKILL.md) —82 folder contract, mocks, naming authority.835. [`implement-design`](../implement-design/SKILL.md) — pixel-level fidelity84 **when the source is Figma** and after the tree is locked (requires Figma MCP85 when used). For non-Figma sources, implement from the locked tree and tokens86 without this step unless the user points back to a Figma file.8788For repeatable lists/grids in Canvas, see89[`canvas-component-composability/references/repeatable-content.md`](../canvas-component-composability/references/repeatable-content.md).9091## Inputs9293Classify the source in Phase A. Typical categories:9495| Kind | Examples |96| --------------------- | --------------------------------------------------------------- |97| **Design tool** | Figma file, frame export, FigJam |98| **Live reference** | Existing production or staging site, competitor URL |99| **Captured media** | Screenshots, PDFs, brand decks |100| **Structured scrape** | HTML/CSS snapshot via tooling |101| **Prompt / prose** | User brief, AI-generated layout description, markdown wireframe |102103Optional helpers:104105- URL capture: [`nebula-scrape-url`](../nebula-scrape-url/SKILL.md) (not for106 Figma or docs).107- Figma fidelity pass (after decomposition):108 [`implement-design`](../implement-design/SKILL.md).109110## Workflow (mandatory)111112Complete phases **A → G** in order. Each phase has an **exit criterion**. If113Phase F fails, fix the tree and re-run Phase E for affected nodes only.114115### Phase A — Intake and framing116117- Identify input type: design file (e.g. Figma), live site / scrape, screenshot,118 or text-only / prompt-generated spec.119- List **unknowns**: breakpoints, empty states, max copy length, media aspect120 ratios, hover/focus/active, accessibility expectations.121- Tag each unknown with **risk**: low / medium / high (edits likely to churn122 structure).123124**Exit:** Input type stated; unknowns listed with risk (workflow continues even125if some answers are missing).126127### Phase B — Region map128129- Divide the design into **regions** (e.g. header, hero, content band, sidebar,130 footer, modal chrome).131- For each region: **label**, **purpose** (one line), **class** — `chrome`132 (shell), `navigation`, or `content`.133134**Exit:** Ordered region list with purpose and class for each.135136### Phase C — Candidate component inventory137138- Map regions to **candidate** `machineName` values (kebab-case folder names per139 [`canvas-component-definition`](../canvas-component-definition/SKILL.md)).140- Prefer reusable base names; variants via props/composition, not extra141 component names, unless truly one-off.142- Mark **reuse count** when the same pattern appears two or more times.143- **Generalize:** For each candidate, note **other plausible contexts** (other144 pages, shorter copy, different children). If it only makes sense for this one145 screen, rename or decompose until it is **reusably** scoped.146147**Exit:** Table: candidate `machineName`, responsibility, reuse count, parent148region.149150### Phase D — Component tree151152- Build parent/child relationships: **layout shells** vs **content leaves**.153- **Layout ownership:** multi-column grids, page-level stacks, and section154 wrappers belong in layout-oriented components; avoid baking unrelated grids155 into content components unless the layout is invariant for every instance.156- Express the tree as a nested outline or Mermaid diagram (Mermaid node IDs: no157 spaces; use camelCase or underscores).158159**Exit:** Tree covers every inventory row; layout vs content roles are explicit.160161### Phase E — Props vs slots (per node)162163**Required:** Every decomposition includes this phase. Props and slots are not a164late add-on—they define how editors use the tree. For **each** tree node,165sketch:166167- **Props:** configuration and simple values editors should set directly168 (variants, booleans, short strings, URLs, enums). Note intent and broad type169 class (`string`, `boolean`, `enum`, image/reference)—not final YAML. Follow170 [`canvas-component-composability`](../canvas-component-composability/SKILL.md)171 for the actual props-vs-slots rubric, variants-vs-granular guidance, and prop172 ordering. This phase records the decision; it does not redefine that rubric.173- **Slots:** areas where authors compose child components or arbitrary blocks.174 Name the slot, describe allowed content, and note **empty** behavior175 (collapse, placeholder, min height).176- **Implementation style:** record `variants` (default) or `granular props` with177 a one-line rationale in the handoff. For the Phase E write-up convention, see178 [references/props-vs-slots-rubric.md](references/props-vs-slots-rubric.md).179180**Exit:** Every node has a prop/slot sketch, implementation style is stated, and181repeatable rich children are not modeled as object arrays in props.182183### Phase F — Granularity audit184185Run the shared granularity checklist in186[`canvas-component-composability`](../canvas-component-composability/SKILL.md).187In this phase, audit the candidate tree against that shared rule set and record188the result; do not create a second split/merge rubric here. For the Phase F189audit note, see [references/granularity.md](references/granularity.md).190191- Mark each node pass/fail with a short rationale.192- If any node fails, merge, split, or extract, then repeat Phase E for changed193 nodes only.194- Document intentional exceptions explicitly.195196**Exit:** All nodes pass or failures are documented with explicit rationale.197198### Phase G — Handoff199200Deliver one Markdown artifact using the template below. Point **next steps** to:201202- Schema: [`canvas-component-metadata`](../canvas-component-metadata/SKILL.md)203- Composition edge cases:204 [`canvas-component-composability`](../canvas-component-composability/SKILL.md)205- Contract and mocks:206 [`canvas-component-definition`](../canvas-component-definition/SKILL.md)207- Visual fidelity from Figma: [`implement-design`](../implement-design/SKILL.md)208 (when applicable)209210**Exit:** Filled template ready to paste into an issue or MR.211212**Out of scope here:** page JSON213([`canvas-page-definition`](../canvas-page-definition/SKILL.md)), validation214runs ([`nebula-component-validation`](../nebula-component-validation/SKILL.md)).215216## Output template217218Copy and fill:219220```markdown221## Summary222223- **Design source:** (e.g. Figma URL | live URL | screenshots | prompt/spec224 text)225- **Scope:** (single component | section | full page)226- **Version / date:**227228## Assumptions and open questions229230- ...231232## Region map233234| Region | Purpose | Class |235| ------ | ------- | ----- |236| ... | ... | ... |237238## Component inventory239240| machineName (candidate) | Responsibility | Reuse | Parent region | Notes |241| ----------------------- | -------------- | ----- | ------------- | ----- |242| ... | ... | ... | ... | ... |243244## Component tree245246(Nested list or Mermaid)247248## API sketch (per component)249250### `machine-name`251252**Implementation style:** variants (default) | granular props — one-line253rationale254255**Props** (table rows in editor order: **variant first** when there is a single256primary variation enum; **content first** otherwise—then configuration)257258| Name (camelCase intent) | Purpose | Required? | Kind (string / bool / enum / …) |259| ----------------------- | ------- | --------- | ------------------------------- |260| ... | ... | ... | ... |261262**Slots**263264| Slot key | Purpose | Empty behavior |265| -------- | ------- | -------------- |266| ... | ... | ... |267268## Granularity audit269270| Component / node | Pass/Fail | Notes / fix |271| ---------------- | --------- | ----------- |272| ... | ... | ... |273274## Next steps275276- [ ] `canvas-component-composability` — edge cases for props/slots,277 repeatability, or granularity278- [ ] `canvas-component-metadata` — draft `component.yml`279- [ ] `canvas-component-definition` — folder, entry file, mocks280- [ ] `implement-design` — Figma fidelity pass (only when matching a Figma file)281```282283## Further reading284285- [`canvas-component-composability`](../canvas-component-composability/SKILL.md)286- [references/granularity.md](references/granularity.md)287- [references/props-vs-slots-rubric.md](references/props-vs-slots-rubric.md)288- [references/worked-example.md](references/worked-example.md)289290## Anti-duplication291292- Do not restate full `component.yml` grammar—use293 [`canvas-component-metadata`](../canvas-component-metadata/SKILL.md).294- Do not restate the reusable props/slots or granularity rulebooks here—link295 [`canvas-component-composability`](../canvas-component-composability/SKILL.md).