Agent skill

Figma From Code Build Component

by bitovi in bitovi/ai-enablement-prompts

Unified skill for figma-from-code Phase 3 per-component pipeline.

MITAuto-check passedAgent Workflows

Install Figma From Code Build Component

skills CLI
$ npx skills add bitovi/ai-enablement-prompts --skill figma-from-code-build-component -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install bitovi/ai-enablement-prompts figma-from-code-build-component --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/bitovi/ai-enablement-prompts.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/figma-from-code/skills/figma-from-code/7-build-component .claude/skills/figma-from-code-build-component && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
figma-from-code-build-component
GitHub stars
121
Token cost
~4.5k tokens
SKILL.md length
1,171 words
Files
15
Skills in repo
40
Repo updated
First seen
Licence
MIT

At a glance

Unified skill for figma-from-code Phase 3 per-component pipeline.

  • Agent Workflows work in your project
  • SKILL.md covers Required Inputs, Pre-Existing Components Rule, Variant Strategy and Acceptance Thresholds, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Figma From Code Build Component is an agent skill from bitovi/ai-enablement-prompts. 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.

Its SKILL.md is about 4.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 14 other files (for example `README.md`, `figma-utils.md` and `step-1-analyze.md`).

It sits in Agent Workflows. It works with Figma. The repository describes itself as: Prompts Bitovi uses for software development. The licence is MIT.

When your agent uses it

  • Agent Workflows work in your project

Example prompts

  • “/figma-from-code-build-component”

What it can do on your machine

Read from SKILL.md and the folder at commit df229b1. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Figma From Code Build Component loads about 4.5k tokens when it runs. Until then it costs about 65 tokens; SKILL.md has 1,171 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~65
When it runs · the whole SKILL.md, loaded when a task matches
~4.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from bitovi/ai-enablement-prompts at commit df229b1, republished under its MIT licence (© bitovi). 1,171 words, ~4,520 tokens.

Download SKILL.mdSave it as .claude/skills/figma-from-code-build-component/SKILL.md (or your agent's skills folder). This skill also uses 14 other files; get the full folder from GitHub.
name
figma-from-code-build-component
description
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.
model
claude-opus-4-6

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 from state.json → config. {componentsRoot} is an array of directory paths.

InputDescriptionSource
componentNameName of the component (e.g., Button, UserProfile)Build order / caller
fileKeyFigma file keyState ledger or caller
parentFrameIdNode ID of the tier/container frame to append the component intoState ledger
sourceFileAbsolute path to the component's .tsx source fileProject's component source directory
sourceDirComponent's modlet root directory (parent of .figma/)Derived from sourceFile path
devServerUrlURL of the running dev server — required for Step 1g live inspectionState ledger or caller
textContentExtracted text JSON from the live app.temp/figma-from-code/screenshots/{name}/text.json
iconUsageWhich Lucide icons and SVG assets the component uses, with sizesSource code imports + icons.json
builtComponentsMap of {componentName: nodeId} for all previously built components available for instance reuseState ledger builtComponents
preExistingComponentsImmutable snapshot of components that existed in Figma BEFORE this orchestrator run startedState 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
InputDescription
computedStylesResolved 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
stateScreenshotsPaths to state screenshots (state-hover.png, state-focus.png, state-disabled.png) and style diffs from states.json
cssFilePath to the component's .css module file if external styles exist
figmaVariantVariant 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 sweep
  • state.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 componentName itself maps to a node in preExistingComponents: write status: "needs_authorization" and preExistingTouched: ["<name>"] to the result file and return immediately. Do not call use_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

MetricPass 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.

json
{
  "componentName": "Button",
  "status": "success | partial_match | no_app_reference | needs_authorization | rejected | failed",
  "nodeId": "123:45",
  "screenshotNodeId": "123:46",
  "type": "COMPONENT_SET | COMPONENT",
  "variants": [{ "name": "Variant=primary, Size=regular", "nodeId": "123:46" }],
  "figmaScreenshot": ".temp/figma-from-code/screenshots/Button/figma.png",
  "figmaVariant": { "Variant": "primary", "State": "Default" },
  "sourceDir": "path/to/Button",
  "comparison": {
    "verdict": "match | minor_diff | mismatch | no_app_reference",
    "matchPct": 94.2,
    "borderMatchPct": 91.0,
    "iterations": 1,
    "fixes": ["border-radius 4px -> 8px"]
  },
  "preExistingTouched": [],
  "missingChildren": [],
  "rebindSweep": { "rebound": 3, "alreadyBound": 12, "unmatched": ["48,110,232"] },
  "trackingFile": { "written": true },
  "error": "only present when status is \"failed\""
}

status values:

  • success — built and passed acceptance thresholds
  • partial_match — built, fix loop ran 3 iterations without reaching thresholds
  • no_app_reference — built, no app.png found; comparison skipped
  • needs_authorization — componentName is in preExistingComponents; no build performed
  • rejected — missing child components; missingChildren list is populated; no build performed
  • failed — Figma API error during build or fix loop; error field is required

Inline Workflow

All steps run inline within a single agent. There is no subagent dispatching.

Steps 1–7 (all inline):
  1.  Analyze    → read source + reference material, write .figma/code.json
  2.  Build      → create Figma component via use_figma, write .figma/figma.json
  3.  Screenshot → capture Figma result via get_screenshot
  4a. Instance check → run check-instances.js (hard gate)
  4b. Sizing check   → verify dimensions match intent
  4c. Pixel diff     → compare against app screenshot → verdict
  5.  Fix loop       → if verdict is not "match", diagnose and fix (up to 3 iterations)
  5R. Rebind sweep   → always — bind hardcoded colors that match a token variable
  6.  Track          → verify/refresh figma-component.json tracking files
  7.  Return         → write final result file
Flow
 1.  Execute Step 1 (Analyze) → produces code.json
 1a. If result shows "needs_authorization" → write result with that status, stop
 1b. If result shows "rejected"            → write result with status "rejected" + missingChildren, stop
 2.  Read code.json, execute Step 2 (Build)
     Post-Step 2 invariant: componentNodeId must be a non-null string before proceeding
 2a. If use_figma throws "node_not_accessible" → write result with status "failed",
     error "node_not_accessible: <id>", stop. Do NOT record the nodeId in builtComponents.
 3.  Execute Step 3 (Screenshot) → produces figma.png
 4.  Execute Step 4a (instance check)
     If 4a reports missing_instances → enter Step 5 fix loop with missing_instances
                                       (skip 4b/4c for this first pass)
 5.  If 4a passes → execute Steps 4b, 4c → get verdict
 6.  If app.png is missing → skip comparison, set verdict "no_app_reference", proceed to Step 5R
 7.  If verdict is "match" → skip the fix loop, proceed to Step 5R
 8.  If verdict is not "match" → execute Step 5 fix loop (up to 3 iterations)
 9.  Execute Step 5R rebind sweep (always — even when verdict was "match" or comparison was skipped)
10.  Execute Step 6 (track), Step 7 (return) → write final result

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.

Show full SKILL.md (467 more words)Show less
Quick references (default — use these first):
FileStepsLinesCovers
step-1-quick.md1~90Analysis sequence, sizing rules, output schema
step-2-quick.md2~110Build pattern, fixSizing, variable binding, 2f
step-3-quick.md3~35Screenshot capture (all cases)
step-4-quick.md4a/4b/4c~60Instance gate, sizing check, pixel diff
step-5-quick.md5/6/7~95Fix loop, rebind sweep, track, return
Full references (escalate when needed):
FileStepWhen to escalate
step-1-analyze.md1Responsive variants, prop-state overlays, promotion rules
step-2-build.md2Responsive builds, full Tailwind table, color chain
step-3-screenshot.md3Rarely needed
step-4-compare.md4a/4b/4cDetailed rejection handling, sizing edge cases
step-5-fix-loop.md5Full discrepancy table, rebind sweep internals
step-6-track.md6Folder resolution rules, legacy file migration
step-7-return.md7Canonical result schema details
Script references

Placeholders like {skillRoot} resolve from state.json → config.

  • check-instances.js — lives at {skillRoot}/scripts/check-instances.js
  • check-prereqs.js — lives at {skillRoot}/scripts/check-prereqs.js
  • compare.js — lives at {skillRoot}/scripts/compare.js
  • inspect-styles.js — lives at {skillRoot}/scripts/inspect-styles.js
  • resolve-color.js — lives at {skillRoot}/scripts/resolve-color.js

Workflow Step Instructions

Each step has a condensed quick reference (default) and a full reference (for complex cases). Start with the quick files. Only escalate to the full file when:

  • The component has responsive-breakpoint variants or prop-driven structural states
  • The build fails on the first iteration and you need edge-case guidance
  • The component is a page-level layout with parent-context promotion
Default (quick references — use these first):
StepFilePhaseWhat it does
1step-1-quick.mdAnalyzeRead source + reference material, inspect live component, write code.json
2step-2-quick.mdBuildCreate component in Figma via use_figma, enumerate instances, write figma.json
3step-3-quick.mdBuildCapture the Figma result via get_screenshot
4step-4-quick.mdCompareInstance gate + sizing check + pixel diff → verdict
5+6+7step-5-quick.mdFix/DoneFix loop + rebind sweep + track + return result
Full references (escalate only when needed):
StepFileWhen to use
1step-1-analyze.mdResponsive variants, prop-state overlays, parent-context promotion
2step-2-build.mdResponsive variants, full Tailwind table, color resolution chain
3step-3-screenshot.mdRarely needed
4step-4-compare.mdInstance-usage gate details, sizing edge cases, rejection handling
5step-5-fix-loop.mdFull discrepancy patterns table, detailed fix examples, rebind internals
6step-6-track.mdFolder resolution rules, legacy file migration
7step-7-return.mdCanonical result schema details

Error Handling

ScenarioAction
componentName in preExistingComponentsWrite status: "needs_authorization", stop immediately
Missing child components (prereq gate fails)Write status: "rejected" with missingChildren, stop
use_figma API error during buildWrite status: "failed" with error message, stop
No app screenshot (app.png missing)Skip comparison, write status: "no_app_reference", proceed to Step 5R
Fix loop reaches 3 iterations without matchSet status: "partial_match", proceed to Step 6 — do not retry
use_figma API error during fix loopRecord error in result, return current best status, proceed to Step 6
Fix loop would edit a preExistingComponents nodeStop fix loop, surface in result, let orchestrator/user decide
color-index.json missing and not regenerableSkip Step 5R, set rebindSweep: "skipped_no_index", proceed to Step 6

Never fail silently. Every error or skip must appear in the final result file.

© bitovi, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 14 other files in plugins/figma-from-code/skills/figma-from-code/7-build-component of bitovi/ai-enablement-prompts.

  • SKILL.md
  • README.md
  • figma-utils.md
  • step-1-analyze.md
  • step-1-quick.md
  • step-2-build.md
  • step-2-quick.md
  • step-3-quick.md
  • step-3-screenshot.md
  • step-4-compare.md
  • step-4-quick.md
  • step-5-fix-loop.md
  • step-5-quick.md
  • step-6-track.md
  • step-7-return.md

Open the folder on GitHubat commit df229b1

Compare with similar skills

Figma From Code Build Component next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Figma From Code Build Component compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Figma From Code Build Component this skillbitovi/ai-enablement-prompts121—~4.5kAutomated safety check: PassMIT
MCP SDK Auditawdr74100/figwright977—~4.1kAutomated safety check: PassMIT
Integration Orchestratorrampstackco/claude-skills935—~5.3kAutomated safety check: PassMIT
Product Designqf-studio/navigator354—~5.1kAutomated safety check: NotesMIT
MCP ServerWellApp-ai/Well345—~679Automated safety check: PassMIT
Figma Handoff Gatehashgraph-online/awesome-codex-plugins1.2k—~5kAutomated safety check: PassMIT

Similar skills

  • MCP SDK Audit

    awdr74100/figwright

    Upgrade @modelcontextprotocol/server (the MCP TypeScript SDK v2) and prove the wire contract survived.

    977 GitHub stars~4.1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Integration Orchestrator

    rampstackco/claude-skills

    Generate a phased delivery orchestration plan for creative-direction-driven work: which skills run when, what locks at which gate, how handoffs occur, and how the cadence implements in the team's…

    935 GitHub stars~5.3k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Product Design

    qf-studio/navigator

    Automates design review, token extraction, component mapping, and implementation planning.

    354 GitHub stars~5.1k tokensUpdated yesterday
    Agent WorkflowsAuto-check: notes
  • MCP Server

    WellApp-ai/Well

    Guide for creating new MCP server integrations. An agent skill from WellApp-ai/Well.

    345 GitHub stars~679 tokensUpdated 7 days ago
    Agent WorkflowsAuto-check passed
  • Figma Handoff Gate

    hashgraph-online/awesome-codex-plugins

    Pre-ship gate for a Figma handoff. An agent skill from hashgraph-online/awesome-codex-plugins.

    1.2k GitHub stars~5k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Loora Design Guide

    lassejlv/loora

    Build, edit, refine, troubleshoot, and review polished responsive product interfaces through the Loora MCP server and its structured Canvas schemas.

    140 GitHub stars~2.4k tokensUpdated 10 days ago
    Frontend & DesignAuto-check passed

More from bitovi/ai-enablement-prompts

All 40 skills in this repo
  • Component Registry

    bitovi/ai-enablement-prompts

    Track reusable UI components and unextracted patterns. An agent skill from bitovi/ai-enablement-prompts.

    121 GitHub stars~597 tokensUpdated 27 days ago
    Auto-check passed
  • Computed Styles

    bitovi/ai-enablement-prompts

    Extract and compare computed CSS styles between a baseline URL and a dev/Storybook URL using Playwright MCP evaluate calls.

    121 GitHub stars~2.4k tokensUpdated 27 days ago
    Auto-check passed
  • Create Plugin

    bitovi/ai-enablement-prompts

    A skill your agent uses when the user asks to "create a plugin", "add a plugin", "make a new plugin", "build a plugin", or wants to package skills into an installable plugin for this marketplace.

    121 GitHub stars~2k tokensUpdated 27 days ago
    Auto-check passed
  • Create React Modlet

    bitovi/ai-enablement-prompts

    Create React components, hooks, or utilities following the modlet pattern.

    121 GitHub stars~2.1k tokensUpdated 27 days ago
    Auto-check passed
  • Create Skill

    bitovi/ai-enablement-prompts

    A skill your agent uses when the user asks to "create a skill", "add a skill", "make a new skill", "build a skill", or wants to automate a repeated workflow into a reusable prompt.

    121 GitHub stars~1.6k tokensUpdated 27 days ago
    Auto-check passed
  • Create Skill

    bitovi/ai-enablement-prompts

    Create new Agent Skills for this project. An agent skill from bitovi/ai-enablement-prompts.

    121 GitHub stars~1.7k tokensUpdated 27 days ago
    Auto-check passed

Works with

Categories

Questions about Figma From Code Build Component

What does Figma From Code Build Component do?

Unified skill for figma-from-code Phase 3 per-component pipeline. Figma From Code Build Component is an agent skill from bitovi/ai-enablement-prompts. Unified skill for figma-from-code Phase 3 per-component pipeline.

When should I use Figma From Code Build Component?

Figma From Code Build Component fits situations like: agent Workflows work in your project.

How do I install Figma From Code Build Component in Claude Code?

Run `npx skills add bitovi/ai-enablement-prompts --skill figma-from-code-build-component -a claude-code`. Or copy the skill folder (plugins/figma-from-code/skills/figma-from-code/7-build-component in bitovi/ai-enablement-prompts) into .claude/skills/figma-from-code-build-component in your project. Claude Code loads it when a task matches its description.

How do I install Figma From Code Build Component in Codex?

Run `npx skills add bitovi/ai-enablement-prompts --skill figma-from-code-build-component -a codex`. Or copy the skill folder (plugins/figma-from-code/skills/figma-from-code/7-build-component in bitovi/ai-enablement-prompts) into .agents/skills/figma-from-code-build-component in your project. Codex loads it when a task matches its description.

Can I use Figma From Code Build Component in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add bitovi/ai-enablement-prompts --skill figma-from-code-build-component -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/figma-from-code-build-component, .gemini/skills/figma-from-code-build-component, .github/skills/figma-from-code-build-component and .opencode/skills/figma-from-code-build-component in your project.

What does Figma From Code Build Component need to run?

SKILL.md names no scripts, command-line tools or credentials: Figma From Code Build Component is instructions for the agent only.

Does Figma From Code Build Component access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Figma From Code Build Component safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Figma From Code Build Component use?

Figma From Code Build Component is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Figma From Code Build Component use?

About 4.5k tokens (SKILL.md is roughly 18k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Figma From Code Build Component?

Skills that share tags, products or a category with Figma From Code Build Component: MCP SDK Audit (awdr74100/figwright, 977 stars), Integration Orchestrator (rampstackco/claude-skills, 935 stars), Product Design (qf-studio/navigator, 354 stars) and MCP Server (WellApp-ai/Well, 345 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Figma From Code Build Component?

bitovi (a GitHub organization) maintains it in bitovi/ai-enablement-prompts, which has 121 GitHub stars. The repository holds 40 skills in this directory. The repository was last updated on September 11, 2026.

Source: bitovi/ai-enablement-prompts on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.