Extract Figma
This skill mirrors the /extract-figma workflow.
Use it to turn a Figma URL or frame into an implementation-ready design spec file that other workflows can reuse without re-reading Figma.
Inputs
- Figma URL or frame URL
- Optional output slug in kebab-case
Output
docs/ai/features/designs/DD-MM-YYYY-figma-{name}.md
The output must be detailed enough to:
- implement the UI without reopening Figma
- validate implementation against the design later
Tool Mapping
- Figma access tools -> use any available Figma integration or repository-provided workflow when present
- File read/write/edit tools -> inspect supporting files with the runtime's file tools and update outputs with precise edits
- User clarification -> ask the user directly only when the file, frame, or next extraction target is unclear
Workflow
1. Validate input and setup
Parse:
- the Figma URL
- the target output name
- the output path
docs/ai/features/designs/DD-MM-YYYY-figma-{name}.md
If the file already exists:
- if
status: complete, ask whether to overwrite or stop
- if
status: partial, resume from the unchecked extraction items
Do not continue if the Figma source cannot be accessed or if no suitable Figma integration is available in the current runtime.
2. Scan layout before detailed extraction
Always inspect the frame structure first to estimate complexity:
- frame name and path
- top-level sections
- approximate nesting depth
- approximate node count
Choose strategy:
- low complexity -> full extraction
- medium or high complexity -> progressive extraction
Report the chosen strategy briefly before continuing.
3. Use the right extraction strategy
Full extraction
Use this when the frame is small enough to capture in one pass.
Extract:
- frame overview
- layout hierarchy
- design tokens
- component specs with states and variants
- responsive specs
- assets
- interaction patterns
- validation notes
Set status: complete unless some sections were intentionally skipped.
Progressive extraction
Use this when the frame is large or complex.
First pass:
- extract only the layout structure and section inventory
- create placeholders for each top-level section
- set
status: partial
Then iterate section by section:
- design tokens
- individual UI sections such as header, hero, form, sidebar
- responsive specs
- assets
After each extracted section:
- replace the placeholder with real content
- update extraction-status checkboxes
- ask which remaining section to extract next when needed
4. Extract exact specs only
Never guess or approximate values.
Capture exact values for:
- colors with hex codes and usage notes
- typography with family, size, weight, line-height, tracking when relevant
- spacing scale and repeated layout values
- shadows and border radius
- component dimensions
- padding, gaps, and margins
- states: default, hover, active, focus, disabled, loading, error, success when present
- variants: size, style, intent
- responsive differences by breakpoint
- icons, images, and export-sensitive assets:
- For each icon: node ID, library (Heroicons/Lucide/Custom), container size, icon size, color, placeholder path (
{ICONS_PATH}/{name}.svg), export format SVG
- For each image: node ID, container size, object-fit, aspect ratio, border-radius, placeholder path (
{IMAGES_PATH}/{name}.{ext}), export format
- Icon spec example:
Icon: chevron-right | Node ID: 123:456 | Container: 24×24px | Color: #374151 | Path: {ICONS_PATH}/chevron-right.svg
- Image spec example:
Image: hero-banner | Node ID: 789:012 | Container: 1440×480px | object-fit: cover | Path: {IMAGES_PATH}/hero-banner.jpg | Format: JPG 2x
- Produce a consolidated Assets Export Table at the end of the Assets section:
- First line defines the symbolic vars:
ICONS_PATH = (replace with project path) and IMAGES_PATH = (replace with project path)
- Table columns: Name | Node ID | Type | Dimensions | Color | Placeholder Path | Format
- Dev replaces the two vars once per project — no other changes needed
5. Write the output file
Follow docs/ai/features/designs/figma-template.md when it exists.
If the template is missing, use this fallback structure:
- frontmatter
- reference
- frame overview
- layout structure
- design tokens
- component specifications
- responsive specifications
- assets
- interaction patterns
- validation notes
- extraction status
Frontmatter should include:
---
frame_url: {url}
frame_name: {frame name}
file_name: {figma file name}
extracted: {YYYY-MM-DD}
status: complete
---
Use status: partial if any planned extraction sections remain unfinished.
Completion Checklist
- all values are exact, not inferred
- all important components include states and variants
- responsive changes are explicit
- large frames keep resumable extraction status
- the output is sufficient for implementation without reopening Figma
Error Handling
- If Figma access fails, stop and tell the user what is missing.
- If the URL is invalid or the frame cannot be found, ask for the correct frame.
- If a partial file exists, resume from it instead of starting over by default.
- If
docs/ai/features/designs/figma-template.md is missing, use the fallback structure and continue.
Integration with Spec-Driven Workflow
/spec should read the generated DD-MM-YYYY-figma-{name}.md file when turning a design into a durable feature spec.
If that file does not exist yet, the spec creation flow should stop guessing and tell the user to run /extract-figma first.
1---2name: extract-figma3description: Use when the user wants to extract a Figma frame into `docs/ai/features/designs/DD-MM-YYYY-figma-{name}.md` with exact specs, partial-progress support, and large-frame handling.4---56# Extract Figma78This skill mirrors the `/extract-figma` workflow.9Use it to turn a Figma URL or frame into an implementation-ready design spec file that other workflows can reuse without re-reading Figma.1011## Inputs1213- Figma URL or frame URL14- Optional output slug in kebab-case1516## Output1718- `docs/ai/features/designs/DD-MM-YYYY-figma-{name}.md`1920The output must be detailed enough to:21221. implement the UI without reopening Figma232. validate implementation against the design later2425## Tool Mapping2627- Figma access tools -> use any available Figma integration or repository-provided workflow when present28- File read/write/edit tools -> inspect supporting files with the runtime's file tools and update outputs with precise edits29- User clarification -> ask the user directly only when the file, frame, or next extraction target is unclear3031## Workflow3233### 1. Validate input and setup3435Parse:3637- the Figma URL38- the target output name39- the output path `docs/ai/features/designs/DD-MM-YYYY-figma-{name}.md`4041If the file already exists:4243- if `status: complete`, ask whether to overwrite or stop44- if `status: partial`, resume from the unchecked extraction items4546Do not continue if the Figma source cannot be accessed or if no suitable Figma integration is available in the current runtime.4748### 2. Scan layout before detailed extraction4950Always inspect the frame structure first to estimate complexity:5152- frame name and path53- top-level sections54- approximate nesting depth55- approximate node count5657Choose strategy:5859- low complexity -> full extraction60- medium or high complexity -> progressive extraction6162Report the chosen strategy briefly before continuing.6364### 3. Use the right extraction strategy6566#### Full extraction6768Use this when the frame is small enough to capture in one pass.6970Extract:7172- frame overview73- layout hierarchy74- design tokens75- component specs with states and variants76- responsive specs77- assets78- interaction patterns79- validation notes8081Set `status: complete` unless some sections were intentionally skipped.8283#### Progressive extraction8485Use this when the frame is large or complex.8687First pass:8889- extract only the layout structure and section inventory90- create placeholders for each top-level section91- set `status: partial`9293Then iterate section by section:9495- design tokens96- individual UI sections such as header, hero, form, sidebar97- responsive specs98- assets99100After each extracted section:101102- replace the placeholder with real content103- update extraction-status checkboxes104- ask which remaining section to extract next when needed105106### 4. Extract exact specs only107108Never guess or approximate values.109Capture exact values for:110111- colors with hex codes and usage notes112- typography with family, size, weight, line-height, tracking when relevant113- spacing scale and repeated layout values114- shadows and border radius115- component dimensions116- padding, gaps, and margins117- states: default, hover, active, focus, disabled, loading, error, success when present118- variants: size, style, intent119- responsive differences by breakpoint120- icons, images, and export-sensitive assets:121 - For each icon: node ID, library (Heroicons/Lucide/Custom), container size, icon size, color, placeholder path (`{ICONS_PATH}/{name}.svg`), export format SVG122 - For each image: node ID, container size, object-fit, aspect ratio, border-radius, placeholder path (`{IMAGES_PATH}/{name}.{ext}`), export format123 - Icon spec example:124 ```125 Icon: chevron-right | Node ID: 123:456 | Container: 24×24px | Color: #374151 | Path: {ICONS_PATH}/chevron-right.svg126 ```127 - Image spec example:128 ```129 Image: hero-banner | Node ID: 789:012 | Container: 1440×480px | object-fit: cover | Path: {IMAGES_PATH}/hero-banner.jpg | Format: JPG 2x130 ```131 - Produce a consolidated Assets Export Table at the end of the Assets section:132 - First line defines the symbolic vars: `ICONS_PATH = (replace with project path)` and `IMAGES_PATH = (replace with project path)`133 - Table columns: Name | Node ID | Type | Dimensions | Color | Placeholder Path | Format134 - Dev replaces the two vars once per project — no other changes needed135136### 5. Write the output file137138Follow `docs/ai/features/designs/figma-template.md` when it exists.139If the template is missing, use this fallback structure:1401411. frontmatter1422. reference1433. frame overview1444. layout structure1455. design tokens1466. component specifications1477. responsive specifications1488. assets1499. interaction patterns15010. validation notes15111. extraction status152153Frontmatter should include:154155```yaml156---157frame_url: {url}158frame_name: {frame name}159file_name: {figma file name}160extracted: {YYYY-MM-DD}161status: complete162---163```164165Use `status: partial` if any planned extraction sections remain unfinished.166167## Completion Checklist168169- all values are exact, not inferred170- all important components include states and variants171- responsive changes are explicit172- large frames keep resumable extraction status173- the output is sufficient for implementation without reopening Figma174175## Error Handling176177- If Figma access fails, stop and tell the user what is missing.178- If the URL is invalid or the frame cannot be found, ask for the correct frame.179- If a partial file exists, resume from it instead of starting over by default.180- If `docs/ai/features/designs/figma-template.md` is missing, use the fallback structure and continue.181182## Integration with Spec-Driven Workflow183184`/spec` should read the generated `DD-MM-YYYY-figma-{name}.md` file when turning a design into a durable feature spec.185If that file does not exist yet, the spec creation flow should stop guessing and tell the user to run `/extract-figma` first.