Designing — Design Tool Integration
Route to the right design tool based on the URL the user provides — Paper (preferred), Stitch, Figma, or local assets — to extract layout, content, and visual references for implementation.
When to use
- Starting implementation of a visual design
- Need to capture design reference before building
- Comparing implementation against design
- Populating plan assets directory with screenshots
Inputs required
- Design source: Stitch project ID, Figma file URL, or local asset path
- Optional: specific section/screen name to extract
Procedure
0) Determine source from user input (URL-based routing)
Routing is driven by what the user provided, not by which MCPs happen to be configured.
- URL match — inspect the user's input for a design URL:
paper.design/* or *.paper.design/* → paper branch (use mcp__paper__*)
figma.com/* → figma branch (use mcp__figma__* / mcp__claude_ai_Figma__*)
stitch.withgoogle.com/* (or other known stitch hosts) → stitch branch (use mcp__stitch__*)
- Path match — inspect user input for a
.pen reference:
- Input ends in
.pen OR input starts with design/ → pencil branch
- No input provided AND
design/ exists in the project root with .pen files:
list the available .pen page files (exclude *.lib.pen) and ask the user
which page to extract before proceeding.
- Local fallback — if no URL but
docs/plans/<active-plan>/assets/section-*.png exists → offline branch
- Ask — if neither URL nor local assets are present, ask the user for one
MCP gate: once the branch is known, ToolSearch the corresponding mcp__<tool>__* namespace. If the MCP is NOT configured, stop with this message:
⛔ You sent a {paper|figma|stitch} link but the `{tool}` MCP is not configured.
Configure it and re-run, or send a link from another source.
Do NOT silently fall back to a different MCP.
Pencil MCP gate: For the pencil branch, ToolSearch mcp__pencil__open_document.
If NOT configured:
⛔ .pen file detected but the Pencil MCP is not configured.
Install: claude mcp add pencil -- npx -y @anthropic/pencil-mcp
Restart the session after installing.
1) Extract design data (per section, never full design at once)
Paper workflow (preferred when source is paper.design):
mcp__paper__get_basic_info — get document metadata
mcp__paper__get_tree_summary — locate the target section node
mcp__paper__get_node_info on the section — capture structure, text, hierarchy
mcp__paper__get_screenshot — save as assets/section-{name}.png
mcp__paper__get_computed_styles — save as assets/section-{name}.styles.json (typography, colors, spacing — exact values; consumed by verifying for the style spot-check)
mcp__paper__get_jsx — save as assets/section-{name}.reference.jsx with this header comment as the FIRST lines of the file:// REFERÊNCIA ESTRUTURAL APENAS — NÃO COPIAR.
// Sage usa Blade, não React. Use isso só para entender
// hierarquia de componentes e nesting.
- Produce the structured output (see step 2) — same schema as the other branches.
Stitch workflow:
mcp__stitch__list_projects — find the project
mcp__stitch__list_screens — enumerate all screens
mcp__stitch__get_screen — extract one section at a time
- For each section, capture: headline, body text, components, colors, layout structure
Figma workflow:
mcp__figma__get_file — load the file structure
- Navigate frames to find sections
- Extract text layers, colors, component structure per section
Pencil workflow:
open_document(filePath) — open the .pen file the user indicated
get_editor_state() — confirm top-level nodes and document is active
batch_get with no nodeIds, readDepth: 1 — map all available sections
- For each section to extract: delegate to
pencil-extractor in SURGICAL mode,
passing filePath, sectionId, and planPath
- After all sections: optionally invoke
pencil-extractor in COMPONENT_MAP mode
to produce design/component-map.md
Offline workflow:
- Read images from
docs/plans/<plan>/assets/section-*.png
- Claude reads images natively — describe layout, content, colors
- If no assets exist, ask user to provide screenshots
2) Structure the output
For each section extracted, output:
### Section: {name}
**Layout:** {grid structure, column arrangement, alignment}
**Headline:** "{exact text}"
**Body:** "{exact text}"
**Components:** {cards, buttons, icons, images — with details}
**Colors:** {background, text, accent — hex values if visible}
**Typography:** {heading size, body size, weight, font family}
**Spacing:** {padding, margins, gaps — approximate}
**Icons:** {icon names/types, from which set}
3) Save to plan assets (if active plan exists)
If there's an active plan in docs/plans/:
- Save extracted data as structured notes in
assets/section-{name}.md
- If screenshots are available, note their paths
- Update
plan.md frontmatter with design-tool: paper|stitch|figma|offline
Key Principles
- Granular extraction — always per-section, never full design at once (prevents context overflow)
- Exact content — copy text verbatim, don't paraphrase headlines or body text
- Persist to disk — save everything to plan assets/ so it survives context compression
- Re-read before implementing — always re-read assets from disk, never rely on context memory
1---2name: superpowers-sage-designing3description: Design UI/UX in a Sage project — Figma to Blade, design tokens to Tailwind v4, Paper/Figma MCP integration, component design, layout design, responsive design, design-to-code workflow, visual design review, design system alignment, design approval before implementation4---56# Designing — Design Tool Integration78Route to the right design tool based on the URL the user provides — Paper (preferred), Stitch, Figma, or local assets — to extract layout, content, and visual references for implementation.910## When to use11- Starting implementation of a visual design12- Need to capture design reference before building13- Comparing implementation against design14- Populating plan assets directory with screenshots1516## Inputs required17- Design source: Stitch project ID, Figma file URL, or local asset path18- Optional: specific section/screen name to extract1920## Procedure2122### 0) Determine source from user input (URL-based routing)2324Routing is driven by what the user provided, not by which MCPs happen to be configured.25261. **URL match** — inspect the user's input for a design URL:27 - `paper.design/*` or `*.paper.design/*` → **paper** branch (use `mcp__paper__*`)28 - `figma.com/*` → **figma** branch (use `mcp__figma__*` / `mcp__claude_ai_Figma__*`)29 - `stitch.withgoogle.com/*` (or other known stitch hosts) → **stitch** branch (use `mcp__stitch__*`)302. **Path match** — inspect user input for a `.pen` reference:31 - Input ends in `.pen` OR input starts with `design/` → **pencil** branch32 - No input provided AND `design/` exists in the project root with `.pen` files:33 list the available `.pen` page files (exclude `*.lib.pen`) and ask the user34 which page to extract before proceeding.353. **Local fallback** — if no URL but `docs/plans/<active-plan>/assets/section-*.png` exists → **offline** branch364. **Ask** — if neither URL nor local assets are present, ask the user for one3738**MCP gate:** once the branch is known, ToolSearch the corresponding `mcp__<tool>__*` namespace. If the MCP is NOT configured, stop with this message:3940```41⛔ You sent a {paper|figma|stitch} link but the `{tool}` MCP is not configured.4243Configure it and re-run, or send a link from another source.44```4546Do NOT silently fall back to a different MCP.4748**Pencil MCP gate:** For the pencil branch, ToolSearch `mcp__pencil__open_document`.49If NOT configured:5051```52⛔ .pen file detected but the Pencil MCP is not configured.5354Install: claude mcp add pencil -- npx -y @anthropic/pencil-mcp55Restart the session after installing.56```5758### 1) Extract design data (per section, never full design at once)5960#### Paper workflow (preferred when source is paper.design):611. `mcp__paper__get_basic_info` — get document metadata622. `mcp__paper__get_tree_summary` — locate the target section node633. `mcp__paper__get_node_info` on the section — capture structure, text, hierarchy644. `mcp__paper__get_screenshot` — save as `assets/section-{name}.png`655. `mcp__paper__get_computed_styles` — save as `assets/section-{name}.styles.json` (typography, colors, spacing — exact values; consumed by `verifying` for the style spot-check)666. `mcp__paper__get_jsx` — save as `assets/section-{name}.reference.jsx` with this header comment as the FIRST lines of the file:67 ```68 // REFERÊNCIA ESTRUTURAL APENAS — NÃO COPIAR.69 // Sage usa Blade, não React. Use isso só para entender70 // hierarquia de componentes e nesting.71 ```727. Produce the structured output (see step 2) — same schema as the other branches.7374#### Stitch workflow:751. `mcp__stitch__list_projects` — find the project762. `mcp__stitch__list_screens` — enumerate all screens773. `mcp__stitch__get_screen` — extract one section at a time784. For each section, capture: headline, body text, components, colors, layout structure7980#### Figma workflow:811. `mcp__figma__get_file` — load the file structure822. Navigate frames to find sections833. Extract text layers, colors, component structure per section8485#### Pencil workflow:861. `open_document(filePath)` — open the `.pen` file the user indicated872. `get_editor_state()` — confirm top-level nodes and document is active883. `batch_get` with no nodeIds, `readDepth: 1` — map all available sections894. For each section to extract: delegate to `pencil-extractor` in SURGICAL mode,90 passing `filePath`, `sectionId`, and `planPath`915. After all sections: optionally invoke `pencil-extractor` in COMPONENT_MAP mode92 to produce `design/component-map.md`9394#### Offline workflow:951. Read images from `docs/plans/<plan>/assets/section-*.png`962. Claude reads images natively — describe layout, content, colors973. If no assets exist, ask user to provide screenshots9899### 2) Structure the output100101For each section extracted, output:102103```104### Section: {name}105106**Layout:** {grid structure, column arrangement, alignment}107**Headline:** "{exact text}"108**Body:** "{exact text}"109**Components:** {cards, buttons, icons, images — with details}110**Colors:** {background, text, accent — hex values if visible}111**Typography:** {heading size, body size, weight, font family}112**Spacing:** {padding, margins, gaps — approximate}113**Icons:** {icon names/types, from which set}114```115116### 3) Save to plan assets (if active plan exists)117118If there's an active plan in `docs/plans/`:119- Save extracted data as structured notes in `assets/section-{name}.md`120- If screenshots are available, note their paths121- Update `plan.md` frontmatter with `design-tool: paper|stitch|figma|offline`122123## Key Principles124- **Granular extraction** — always per-section, never full design at once (prevents context overflow)125- **Exact content** — copy text verbatim, don't paraphrase headlines or body text126- **Persist to disk** — save everything to plan assets/ so it survives context compression127- **Re-read before implementing** — always re-read assets from disk, never rely on context memory