bitovi/ai-enablement-prompts/7-build-component
Claude Code and agent skill by bitovi/ai-enablement-prompts
- community
Checking that the SKILL.md file is still in the repository.
Unified skill for figma-from-code Phase 3 per-component pipeline. Executes the full analyze→build→review→fix process (steps 1–7) inline within a single agent. One agent per component, dispatched by the orchestrator in tier order.
Install
npx vskill@latest install bitovi/ai-enablement-prompts/7-build-componentSKILL.md
Skill: Build and Review a Figma Component (Steps 1–7)
Full per-component pipeline. Analyzes source, creates the Figma node, captures screenshot, runs comparison, executes the fix loop, finalizes tracking, and returns the result. All steps run inline — no subagent dispatching.Figma MCP tools available:use_figma,get_screenshot.
Required Inputs
Placeholders like{componentsRoot}resolve fromstate.json → config.{componentsRoot}is an array of directory paths.
| Input | Description | Source | |
|---|---|---|---|
componentName | Name of the component (e.g., Button, UserProfile) | Build order / caller | |
fileKey | Figma file key | State ledger or caller | |
parentFrameId | Node ID of the tier/container frame to append the component into | State ledger | |
sourceFile | Absolute path to the component's .tsx source file | Project's component source directory | |
sourceDir | Component's modlet root directory (parent of .figma/) | Derived from sourceFile path | |
devServerUrl | URL of the running dev server — required for Step 1g live inspection | State ledger or caller | |
textContent | Extracted text JSON from the live app | .temp/figma-from-code/screenshots/{name}/text.json | |
iconUsage | Which Lucide icons and SVG assets the component uses, with sizes | Source code imports + icons.json | |
builtComponents | Map of {componentName: nodeId} for all previously built components available for instance reuse | State ledger builtComponents | |
preExistingComponents | Immutable snapshot of components that existed in Figma BEFORE this orchestrator run started | State ledger preExistingComponents (Phase 0a snapshot) |
Screenshot directory is always .temp/figma-from-code/screenshots/{componentName}/ — derived from componentName, not passed as an input.
Optional Inputs
| Input | Description | |
|---|---|---|
computedStyles | Resolved CSS values from computed-styles.json (produced by inspect-styles.js in step 1g). Authoritative for colors, spacing, typography. Also contains layoutContext.parent.clientWidth — used by Step 1a to promote hug→fill when the parent slot is meaningfully wider than the element | |
stateScreenshots | Paths to state screenshots (state-hover.png, state-focus.png, state-disabled.png) and style diffs from states.json | |
cssFile | Path to the component's .css module file if external styles exist | |
figmaVariant | Variant properties that match the app rendering |
Also reads from disk
.temp/figma-from-code/builtComponents.json— for instance resolution during fix loop.temp/figma-from-code/color-index.json— reverse RGB → variable index for the Step 5R rebind sweepstate.json → preExistingComponents— for the pre-existing guard.temp/figma-from-code/screenshots/{componentName}/app.png— app reference screenshot{sourceDir}/.figma/code.json— written by Step 1; consumed by Step 4a{sourceDir}/.figma/figma.json— written by Step 2f; consumed by Step 4a
Pre-Existing Components Rule
Before doing any work that resolves to a node ID in preExistingComponents, stop. That node existed in Figma before this run; modifying it requires explicit user authorization per the orchestrator skill's "Pre-Existing Components Rule".
Concretely:
- If
componentNameitself maps to a node inpreExistingComponents: writestatus: "needs_authorization"andpreExistingTouched: ["<name>"]to the result file and return immediately. Do not calluse_figma. - If a _child_ you would instantiate is in
preExistingComponents: instancing it is fine — that's reuse, not modification. Modifying its master is not. - The fix loop (Step 5) must never edit a node whose ID appears in
preExistingComponents. If a comparison finding requires modifying such a node, surface it in the result and let the orchestrator/user decide.
Variant Strategy
Variants are computed by Step 1b — they are not a caller input. See step-1-analyze.md §1b for the full extraction algorithm (variant library definitions, CSS pseudo-states, responsive breakpoints, prop-driven structural states), the representative set algorithm, and the budget guardrail (cap: 30 combos).
Acceptance Thresholds
| Metric | Pass threshold | |
|---|---|---|
matchPct | ≥ 90% | |
borderMatchPct | ≥ 85% |
Both must pass for verdict: "match". matchPct alone passing yields "minor_diff". Below matchPct threshold is "mismatch".
Result File Schema
Written to .temp/figma-from-code/build-results/{componentName}.json on every execution path.
status values:
success— built and passed acceptance thresholdspartial_match— built, fix loop ran 3 iterations without reaching thresholdsno_app_reference— built, noapp.pngfound; comparison skippedneeds_authorization—componentNameis inpreExistingComponents; no build performedrejected— missing child components;missingChildrenlist is populated; no build performedfailed— Figma API error during build or fix loop;errorfield is required
Inline Workflow
All steps run inline within a single agent. There is no subagent dispatching.
Flow
Fix iteration model: Step 5 runs up to 3 iterations inline. Each iteration: diagnose from diff.png/comparison.json, apply fix via use_figma, re-enumerate instances (Step 2f re-run), re-screenshot, re-compare. If all 3 iterations complete without match, set status: "partial_match" and proceed to Step 6. Do not retry Step 5.
Step Files (shared library)
All step instruction files live directly in this folder. Each step has a quick reference (condensed, ~100 lines) and a full reference (exhaustive, ~600 lines). Default to the quick versions and only escalate to full references when dealing with complex components or failed builds.
Quick references (default — use these first):
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/figma-from-code/skills/figma-from-code/7-build-component/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/bitovi/ai-enablement-prompts/7-build-component)