| name | figma-spec-build |
| description | Extract spec text from Figma frame "Description" side panels via the installed Figma MCP, propose codebase component mappings for each spec row, and produce structured spec files with component mappings. Use when the user provides one or more Figma frame URLs containing a "Description" panel and asks to turn them into an implementation plan (e.g. "Figma Description์ผ๋ก ๊ตฌํํด์ค", "์ด ๊ธฐํ์ ๋งํฌ๋ค ์คํ ๋ฝ์์ ์์
ํด์ค", "$figma-spec-build", "figma-spec-build"). Do not use for pure design-to-code translation (that is figma:figma-implement-design) or for writing back to Figma.
|
| allowed-tools | Read, Grep, Glob, Bash, Write, Edit, Skill, AskUserQuestion |
Figma Spec Build
Turn Figma "Description" side panels into machine-readable spec files and map
each numbered section to candidate codebase components. The user decides how to
proceed with the output (create issues, feed to Codex, etc.).
When this skill fires
- User shares one or more
figma.com/design/... URLs AND mentions extracting
specs, "Description", "์คํ", "์ค๋ช
์์ญ", or asks to build from them.
- User writes
$figma-spec-build or figma-spec-build verbatim.
When NOT to use
- Pure pixel design-to-code with no textual spec โ use
figma:figma-implement-design.
- User wants to push code INTO Figma โ use
figma:figma-generate-design +
figma:figma-use.
mcp__plugin_figma_figma__* tools are unavailable (Figma MCP not installed)
โ stop and report.
- URL is
figma.com/board/... (FigJam) โ not supported.
Input Validation
์คํฌ ์์ ์ ์๋ ์
๋ ฅ ์กฐ๊ฑด์ ๊ฒ์ฆํ๋ค. ํ๋๋ผ๋ ๋ถ์ถฉ๋ถํ๋ฉด ์ฆ์ ์ฌ์ฉ์์๊ฒ ๋ถ์กฑํ ํญ๋ชฉ์ ์๋ดํ๊ณ ๋ณด์์ ์์ฒญํ๋ค.
| ์กฐ๊ฑด | ๊ฒ์ฆ ๋ฐฉ๋ฒ | ์คํจ ์ |
|---|
| Figma URL์ด ์ต์ 1๊ฐ | URL ํ์ฑ์ผ๋ก figma.com/design/ ํจํด ํ์ธ | "figma.com/design/ ํ์์ URL์ ํ๋ ์ด์ ์ ๊ณตํด ์ฃผ์ธ์" |
URL์ node-id ํ๋ผ๋ฏธํฐ ์กด์ฌ | URL ์ฟผ๋ฆฌ์คํธ๋ง ํ์ฑ | "URL์ node-id ํ๋ผ๋ฏธํฐ๊ฐ ์์ต๋๋ค. Figma์์ ํ๋ ์์ ์ ํํ ์ํ์ URL์ ๋ณต์ฌํด ์ฃผ์ธ์" |
| Figma MCP ๋๊ตฌ ์ฌ์ฉ ๊ฐ๋ฅ | get_metadata ํธ์ถ ์๋ | "Figma MCP๊ฐ ์ฐ๊ฒฐ๋์ง ์์์ต๋๋ค. ์ค์ ์ ํ์ธํด ์ฃผ์ธ์" |
| ๋์ ํ๋ ์์ "Description" ์์ ๋
ธ๋ ์กด์ฌ | Phase 1์ find_description_nodes.py ๊ฒฐ๊ณผ | "์ด ํ๋ ์์ Description ํจ๋์ด ์์ต๋๋ค. URL์ ํ์ธํด ์ฃผ์ธ์" |
Hard Rules
- Read-only toward Figma: only
get_metadata, get_design_context,
get_screenshot are allowed. Never call use_figma from this skill.
- Scope MCP calls to Description nodes, not whole frames.
Whole-frame
get_design_context produces 100KB+ output; per-Description
calls are ~8KB. Whole-frame get_metadata is fine (only ID/name/position).
- Scripts do heavy parsing. Claude reads only clean markdown outputs
(
tasks/<slug>/specs/*.md), never raw XML/JSX.
- Checkpoint at every phase. Never jump from extraction to
implementation without user approval.
- No FIGMA_TOKEN needed. Reuse the installed Figma MCP.
- "Description" frame name is hardcoded.
x=1920 is the fallback hint.
- This skill produces specs and mappings, not code. Implementation is
the user's decision (Codex, manual, etc.).
- ์คํฌ๋ฆฝํธ ์คํจ ์ raw ๋ฐ์ดํฐ๋ก ๋์ฒดํ๋ค. Python ์คํฌ๋ฆฝํธ๊ฐ ImportError ๋๋ FileNotFoundError๋ก ์คํจํ๋ฉด, MCP์์ ๋ฐ์ raw ํ
์คํธ๋ฅผ ์ง์ ํ์ฑํ์ฌ ๋งํฌ๋ค์ด์ผ๋ก ๋ณํํ๋ค. ์คํฌ๋ฆฝํธ ๋ถ์ฌ๊ฐ ์ ์ฒด ์ํฌํ๋ก๋ฅผ ์ค๋จ์ํค์ง ์๋๋ค.
Workflow Phases
Phase 0: Bootstrap โ verify MCP, collect URLs, create slug
Phase 1: Extract โ per URL: find Description nodes, get JSX+screenshot, convert to markdown
Phase 2: Map โ per section: suggest candidates via grep, user confirms
Phase 3: Brief โ synthesize tasks/<slug>/BRIEF.md from specs + mappings
Phase 4: Handoff โ present artifacts and suggest next steps
Each phase ends with a checkpoint. User replies with one of:
[1] Approve and continue [2] Modify [3] Add context [4] Stop here.
Phase 0: Bootstrap
- Verify Figma MCP tools exist (attempt a minimal
get_metadata on first
URL, or check mcp__plugin_figma_figma__* is in the available tools list).
- Collect all URLs from user. Accept one per line or comma-separated.
- Derive a kebab-case slug (โค4 words) from a user-provided task name. Ask
if missing.
- Create workspace:
tasks/<slug>/
figma/urls.txt
figma/raw/ (get_metadata XML, get_design_context JSX dumps)
figma/screenshots/ (frame PNGs)
specs/ (clean markdown)
Checkpoint: "Found N URLs. Slug is <slug>. Proceed with extraction?"
Phase 1: Extract
For each URL in tasks/<slug>/figma/urls.txt, sequentially:
-
Parse URL:
python3 ${SKILL_DIR}/scripts/parse_url.py "<url>"
์คํฌ๋ฆฝํธ๊ฐ ์์ผ๋ฉด URL์์ ์ง์ fileKey์ nodeId๋ฅผ ์ ๊ท์์ผ๋ก ์ถ์ถํ๋ค:
fileKey = URL path์ /design/ ๋ค์ ์ธ๊ทธ๋จผํธ, nodeId = node-id ์ฟผ๋ฆฌ ํ๋ผ๋ฏธํฐ.
-
Fetch metadata (lightweight XML, text content NOT included):
mcp__plugin_figma_figma__get_metadata(fileKey, nodeId)
Save raw output to tasks/<slug>/figma/raw/metadata_<nodeId>.xml.
-
Find Description nodes:
python3 ${SKILL_DIR}/scripts/find_description_nodes.py \
--metadata tasks/<slug>/figma/raw/metadata_<nodeId>.xml
์คํฌ๋ฆฝํธ๊ฐ ์์ผ๋ฉด metadata์์ name์ด "Description"์ธ ๋
ธ๋๋ฅผ ์ง์ grep์ผ๋ก ์ฐพ๋๋ค.
Returns JSON: [{node_id, parent_node_id, parent_name, x, y, ...}].
-
For each Description node:
-
Capture screenshot of the PARENT frame (not Description):
mcp__plugin_figma_figma__get_screenshot(fileKey, <parent_node_id>)
Save to tasks/<slug>/figma/screenshots/<parent_node_id>.png.
Output: specs/*.md (clean markdown), screenshots/*.png.
Checkpoint: list frames + section counts + spec paths. Ask to proceed to
mapping.
Phase 2: Map
For each spec file under tasks/<slug>/specs/:
-
Determine target repo path. Default: current working directory. Ask user
if ambiguous (monorepo, frontend subdir, etc).
-
Run mapping suggester:
python3 ${SKILL_DIR}/scripts/suggest_mappings.py \
--spec tasks/<slug>/specs/<file>.md \
--repo <repo_path> \
--top-n 5
์คํฌ๋ฆฝํธ๊ฐ ์์ผ๋ฉด spec ํ์ผ์ ํค์๋๋ฅผ ์ถ์ถํ๊ณ grep -rl๋ก ์ฝ๋๋ฒ ์ด์ค์์ ๊ด๋ จ ํ์ผ์ ์ง์ ๊ฒ์ํ๋ค.
-
For each section with candidates, present via AskUserQuestion:
- Label each option:
<path> (score X.XX, <reason>)
- Include:
[new component: <suggested name>] option
- Include:
[skip this section] option
- Maximum 4 options per AskUserQuestion (1 is "Other" implicit); if there
are 5 candidates, show top-3 + "new component" + fall through to "Other".
-
Save to tasks/<slug>/mappings.json:
{
"<frame_node_id>": {
"spec_path": "specs/<id>.md",
"screenshot_path": "figma/screenshots/<id>.png",
"sections": [
{"id": "1", "title": "Date ์ค์ ๋๋กญ๋ค์ด",
"mapping": {"type": "existing", "path": "src/..."}},
{"id": "2", "title": "์ข์ธก ์ ๋ณด ์์ญ",
"mapping": {"type": "new", "proposed_name": "LeftInfoPanel"}}
]
}
}
Checkpoint: summary ("N sections mapped: X existing, Y new, Z skipped").
Ask to synthesize BRIEF.
Phase 3: Brief
Draft tasks/<slug>/BRIEF.md with sections:
Goal / Context / Scope / Success Criteria / Phases / Decisions / Risks / References / Status / Log.
Phase decomposition rules:
- Group mappings by target file. One BRIEF phase per target file, or per new
component.
- "New components" come first (so existing files can depend on them).
- Each BRIEF phase's Inputs lists: spec markdown path, screenshot path,
target code file path, section IDs within the spec that drive this phase.
- Each phase's Done when copies the section bullets verbatim as
behavioral acceptance criteria.
- Verification defaults to the project's usual lint+build+test commands
if detectable; otherwise leaves a
# TODO: verification command stub.
References section includes the Figma URLs (source of truth).
Checkpoint: present the BRIEF phase list. Ask: "N phases drafted. Approve
or modify?"
Phase 4: Handoff
- Print artifact summary:
tasks/<slug>/
BRIEF.md
mappings.json
specs/ (N files)
figma/screenshots/ (N images)
- Suggest next steps: create issues, feed to Codex, or proceed manually.
Success Criteria
์คํฌ ์คํ์ด ์ฑ๊ณตํ ๊ฒ์ผ๋ก ๊ฐ์ฃผํ๋ ์กฐ๊ฑด:
tasks/<slug>/specs/ ์ ์ต์ 1๊ฐ์ ๋งํฌ๋ค์ด spec ํ์ผ์ด ์์ฑ๋จ
- ๊ฐ spec ํ์ผ์ ๋ฒํธ๊ฐ ๋งค๊ฒจ์ง ์น์
์ด 1๊ฐ ์ด์ ์กด์ฌ
tasks/<slug>/mappings.json ์ด ์กด์ฌํ๊ณ , ์ต์ 1๊ฐ ์น์
์ ๋งคํ์ด ํ ๋น๋จ
tasks/<slug>/BRIEF.md ๊ฐ ์์ฑ๋จ (Phase 3๊น์ง ์งํํ ๊ฒฝ์ฐ)
Phase 4๊น์ง ์๋ฃ๋์ง ์๋๋ผ๋ ์ฌ์ฉ์๊ฐ [4] Stop here๋ก ์ค๋จํ ๋จ๊ณ๊น์ง์ ์ฐ์ถ๋ฌผ์ด ์ฌ๋ฐ๋ฅด๊ฒ ์์ฑ๋์ด ์์ผ๋ฉด ์ ์ ์ข
๋ฃ์ด๋ค.
Cooperation With Existing Skills
| Skill | Relation |
|---|
figma:figma-implement-design | Complementary. That skill does pixel-fidelity code-gen for whole designs. This skill extracts textual spec for structured implementation planning. |
architect | Use before this skill to explore design trade-offs. This skill handles Figma-specific extraction; architect handles design reasoning. |
figma:figma-use | Not used. We only read from Figma. |
Session Resumption
Each phase writes tasks/<slug>/figma/state.json:
{"phase": "extract|map|brief|done",
"urls": [...],
"completed_frames": [...],
"pending_frames": [...]}
On re-invocation, read this file to resume from the last completed phase.
Examples
Example invocation
User:
$figma-spec-build
https://www.figma.com/design/0CWIMb3Apd7wAiy66OqURb/Analysis?node-id=19030-97432&m=dev
https://www.figma.com/design/0CWIMb3Apd7wAiy66OqURb/Analysis?node-id=19030-98200
Claude responses (phase by phase):
- "Found 2 URLs. What slug should I use?" โ user: "sql-detail-spec"
- "Workspace created at tasks/sql-detail-spec/. Proceed?" โ user: "[1]"
- [extracts 6 Descriptions across 2 frames] โ "Review specs under
tasks/sql-detail-spec/specs/. Proceed to mapping?" โ "[1]"
- [presents candidates per section] โ user confirms each
- [drafts BRIEF.md] โ "N phases drafted. Approve?" โ "[1]"
- "Ready. Create issues or feed to Codex?"