Agent skill

Figma From Code Precapture

by bitovi in bitovi/ai-enablement-prompts

Subagent for figma-from-code Phase 2.5. An agent skill from bitovi/ai-enablement-prompts.

MITAuto-check passedAgent Workflows

Install Figma From Code Precapture

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

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

GitHub CLI
$ gh skill install bitovi/ai-enablement-prompts figma-from-code-precapture --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/5-precapture .claude/skills/figma-from-code-precapture && 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-precapture
GitHub stars
121
Token cost
~3.3k tokens
SKILL.md length
851 words
Files
2
Skills in repo
40
Repo updated
First seen
Licence
MIT

At a glance

Subagent for figma-from-code Phase 2.5. An agent skill from bitovi/ai-enablement-prompts.

  • Works in 4 steps: Read… → Derive the URL, selector, fallbacks, and… → Build two unified manifests (screenshot… → …
  • Tasks that involve Subagents
  • SKILL.md covers When to Use, Prerequisites, Manifest Building and Manifest Format, plus 5 more sections
  • Calls node

What it does

Figma From Code Precapture is an agent skill from bitovi/ai-enablement-prompts. Subagent for figma-from-code Phase 2.5. Captures app screenshots and structured text content for every UI component before Figma building begins. Produces a unified batch manifest to minimize browser navigations.

Its SKILL.md is about 3.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `README.md`).

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

When your agent uses it

  • Tasks that involve Subagents

Example prompts

  • “/figma-from-code-precapture”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Read .temp/figma-from-code/component-map.json to get all components and their capture data
  2. Derive the URL, selector, fallbacks, and interaction replay from each component's capture object (see Selector Strategy below)
  3. Build two unified manifests (screenshot + text) covering all screenshottable components, sorted by url; append one text entry per…
  4. Create a precapture-screens manifest for full-page screenshots of all discovered routes; for each route carry the list of top-level…

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

    Shell commands in SKILL.md call:

    • node

    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 Precapture loads about 3.3k tokens when it runs. Until then it costs about 60 tokens; SKILL.md has 851 words of instructions outside code blocks.

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

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). 851 words, ~3,312 tokens.

Download SKILL.mdSave it as .claude/skills/figma-from-code-precapture/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
figma-from-code-precapture
description
Subagent for figma-from-code Phase 2.5. Captures app screenshots and structured text content for every UI component before Figma building begins. Produces a unified batch manifest to minimize browser navigations.
model
claude-sonnet-4-5

Skill: Pre-capture Reference Material

Captures app screenshots and structured text content for every UI component before any Figma building begins. Decoupling capture from building means build agents never launch Chromium. A single unified batch manifest (sorted by URL) minimizes page navigations and avoids multi-subagent overhead.

When to Use

  • Before figma-from-code Phase 3 (component builds need app screenshots as reference)
  • To refresh app screenshots after UI changes without re-running the full pipeline
  • Standalone capture of component screenshots for design review

Prerequisites

  • Dev server running at {devServerUrl}
  • Playwright installed (node_modules/playwright-core)
  • Shared Playwright server optionally running (started by orchestrator before dispatching; scripts fall back to launching their own browser if absent):
    bash
    node {skillRoot}/scripts/browser-server.js &

Placeholders like {devServerUrl} and {skillRoot} resolve from state.json → config. Endpoint is written to .temp/figma-from-code/pw-endpoint.txt and auto-detected by scripts.

Manifest Building

The subagent builds all manifests itself before running any screenshots. Do not wait for external manifest files — build them from component-map.json.

  1. Read .temp/figma-from-code/component-map.json to get all components and their capture data
  2. Derive the URL, selector, fallbacks, and interaction replay from each component's capture object (see Selector Strategy below)
  3. Build two unified manifests (screenshot + text) covering all screenshottable components, sorted by url; append one text entry per discovered route (selector body) to all-text.json for screen text extraction
  4. Create a precapture-screens manifest for full-page screenshots of all discovered routes; for each route carry the list of top-level components (keyComponents) from component-map.json so the results file can be written without re-reading the map
Selector Strategy

Use component-map.json → capture as the authoritative source. It records exactly where and how the component was observed at discovery time:

  • capture.url — the exact concrete route where the selector was validated. Always use it as the manifest URL. Never substitute routes[0] — selectors derived on one route routinely fail on another.
  • capture.selector — the primary selector; capture.fallbackSelectors — ordered alternates, passed through so screenshot.js can retry on drift.
  • capture.interaction — the replay recipe for interaction-gated components: clicks (ordered array) and hover go straight into the manifest entry.
  • capture.viewport — when non-null, pass as width/height.

Legacy maps without capture: fall back to the top-level selector field paired with routes[0], as before. Do not read any other skill file to obtain selectors.

Components with no capture data (skip entirely)

Skip a component only when both capture and the legacy selector field are null. These are typically loading states, error states, and components genuinely not reachable in the UI. They proceed to Phase 3 build with appScreenshot: null (the build skill handles the no_app_reference path). List each one in the skipped array.

Manifest Format

The subagent constructs a unified manifest for all screenshottable components. The manifest is a JSON array where each entry has: url, output, selector, fallbackSelectors (optional), click (optional, string or ordered array), hover (optional), nth (optional), width/height (optional).

Write two manifest files (sorted by url to cluster same-route entries; within a URL, put entries without click first so passive captures are never polluted by leftover overlays):

  • .temp/figma-from-code/manifests/all-screenshots.json — all screenshot entries
  • .temp/figma-from-code/manifests/all-text.json — all text extraction entries
Screenshot manifest entry format
json
{
  "url": "{devServerUrl}{capture.url}",
  "output": ".temp/figma-from-code/screenshots/{name}/app.png",
  "selector": "{capture.selector}",
  "fallbackSelectors": ["{capture.fallbackSelectors...}"],
  "click": ["{capture.interaction.clicks...}"],
  "hover": "{capture.interaction.hover}",
  "nth": 0
}

Omit click/hover when capture.interaction is null. Add "width"/"height" when capture.viewport is set.

Show full SKILL.md (342 more words)Show less
Text manifest entry format
json
{
  "url": "{devServerUrl}{capture.url}",
  "output": ".temp/figma-from-code/screenshots/{name}/text.json",
  "selector": "{capture.selector}",
  "fallbackSelectors": ["{capture.fallbackSelectors...}"],
  "click": ["{capture.interaction.clicks...}"],
  "nth": 0
}
Screen manifest entries (no selector — full page)

One entry per discovered route goes into manifests/precapture-screens.json:

json
[
  {
    "url": "{devServerUrl}{route}",
    "output": ".temp/figma-from-code/screenshots/screens/{ScreenName}/app.png",
    "screenName": "{ScreenName}",
    "route": "{route}",
    "pageSourceFile": "{pageSourceFile}",
    "keyComponents": ["{ComponentName}", "..."]
  }
]

One additional entry per route is appended to manifests/all-text.json for screen text extraction:

json
{
  "url": "{devServerUrl}{route}",
  "output": ".temp/figma-from-code/screenshots/screens/{ScreenName}/text.json",
  "selector": "body"
}

Build one entry per discovered route from component-map.json. Name screens by converting route paths to PascalCase (e.g., /items/new → CreateItemPage). keyComponents is the list of top-level components on that route.

Subagent Prompt Template

The orchestrator dispatches one subagent that handles manifest-building and all captures inline.

Chunking: screenshot.js has a 60-second timeout per run. If all-screenshots.json contains more than 15 entries, split it into chunk files of 15 entries each (chunk-01.json, chunk-02.json, …) and run each chunk sequentially. The default chunk size of 15 assumes ~3s per component; use chunks of 10 when a chunk contains entries with click steps (interaction replays add ~2–4s each), and reduce further if your app has slow navigation.

Capture app screenshots and text content for UI components and app screens from a running dev server.

Skill file: plugins/figma-from-code/skills/figma-from-code/5-precapture/SKILL.md
Read it for manifest format, selector strategy, and output format.

Step 0 — Build manifests from component-map.json:
  Read .temp/figma-from-code/component-map.json
  For each component with a non-null capture object (or, legacy fallback, a
  non-null top-level selector field), create entries in:
    .temp/figma-from-code/manifests/all-screenshots.json
    .temp/figma-from-code/manifests/all-text.json  (components only at this point)
  Entry fields come from capture: url = {devServerUrl}{capture.url} (exact route,
  never routes[0]), selector = capture.selector, fallbackSelectors, and when
  capture.interaction is set: click = interaction.clicks (array), hover = interaction.hover.
  Skip a component only when BOTH capture and selector are null — list it in skipped.
  For each distinct route in component-map.json, collect the top-level components
  that appear on that route (keyComponents list), then build:
    .temp/figma-from-code/manifests/precapture-screens.json
  Each screens manifest entry: { url, output, screenName, route, pageSourceFile, keyComponents }
  Also append one text entry per route into all-text.json:
    { url, output: ".temp/figma-from-code/screenshots/screens/{ScreenName}/text.json", selector: "body" }
  Sort all manifests by url (entries without click first within each url) before writing.

Scripts (already exist, do not modify):
  Screenshot: node {skillRoot}/scripts/screenshot.js
  Text:       node {skillRoot}/scripts/extract-text.js

Both scripts support batch mode for faster execution (one browser, many captures):

1. Capture all component screenshots (chunk if > 15 entries — run each chunk sequentially):
   node {skillRoot}/scripts/screenshot.js \
     --batch .temp/figma-from-code/manifests/all-screenshots.json

2. Extract all text content in one batch (includes both component and screen text entries):
   node {skillRoot}/scripts/extract-text.js \
     --batch .temp/figma-from-code/manifests/all-text.json

3. Capture all screen (full-page) screenshots — screens are few so one chunk suffices:
   node {skillRoot}/scripts/screenshot.js \
     --batch .temp/figma-from-code/manifests/precapture-screens.json

4. Write component results to .temp/figma-from-code/precapture-all.json:
   {"group": "all", "captured": [{"name": "...", "app": "...", "text": "..."}], "skipped": [...], "failed": [{"name": "...", "error": "...", "url": "...", "selectorTried": "...", "fallbacksTried": N}]}
   For failed entries, copy the manifest url/selector and the fallback count from the
   screenshot.js error output so selector drift is diagnosable from the results file alone.

5. Write screen results to .temp/figma-from-code/precapture-screens.json:
   {
     "screens": [
       {
         "screenName": "CasesPage",
         "route": "/cases",
         "pageSourceFile": "src/pages/CasesPage.tsx",
         "keyComponents": ["CaseList", "CaseFilters"],
         "appScreenshot": ".temp/figma-from-code/screenshots/screens/CasesPage/app.png",
         "textFile": ".temp/figma-from-code/screenshots/screens/CasesPage/text.json",
         "status": "captured"
       }
     ]
   }
   status is "captured", "failed", or "skipped" per screen.

Output Files

Written to .temp/figma-from-code/:

FileContents
precapture-all.jsonResults for all component screenshots and text (single file)
precapture-screens.jsonResults for full-page screen screenshots and screen text
precapture-all.json format
json
{
  "group": "all",
  "captured": [
    { "name": "Button", "app": ".temp/.../Button/app.png", "text": ".temp/.../Button/text.json" }
  ],
  "skipped": ["Skeleton"],
  "failed": [{ "name": "Calendar", "error": "selector not found or timeout (tried 3: ...)", "url": "http://localhost:5173/cases/", "selectorTried": "[aria-label=\"Calendar\"]", "fallbacksTried": 2 }]
}
precapture-screens.json format
json
{
  "screens": [
    {
      "screenName": "CasesPage",
      "route": "/cases",
      "pageSourceFile": "src/pages/CasesPage.tsx",
      "keyComponents": ["CaseList", "CaseFilters"],
      "appScreenshot": ".temp/figma-from-code/screenshots/screens/CasesPage/app.png",
      "textFile": ".temp/figma-from-code/screenshots/screens/CasesPage/text.json",
      "status": "captured"
    }
  ]
}

keyComponents lists the top-level components that appear on the route (sourced from component-map.json). status is "captured", "failed", or "skipped" per screen.

Scripts Reference

ScriptLocationPurpose
screenshot.js{skillRoot}/scripts/screenshot.jsPlaywright element/page screenshots, supports --batch
extract-text.js{skillRoot}/scripts/extract-text.jsStructured text extraction by role, supports --batch
browser-server.js{skillRoot}/scripts/browser-server.jsShared Playwright WebSocket server

Do NOT modify these scripts.

All screenshots are captured at 1x scale (deviceScaleFactor: 1 is enforced in screenshot.js). This prevents Retina 2x doubling and ensures consistent dimensions for downstream comparison against Figma screenshots (which must also use scale: 1 in get_screenshot calls).

Skip / Resume

If called with resume: true, check whether .temp/figma-from-code/precapture-all.json and precapture-screens.json both exist. If both are present, skip. If either is missing, re-run the missing capture.

Error Handling

ScenarioAction
Dev server not runningHalt, tell user to start the dev server
Screenshot script fails for one componentLog in failed array, continue with remaining components
Entire batch failsReport error, offer retry for the failed chunk or full manifest
Missing selectorsComponent goes in skipped array, non-fatal

© 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 1 other file in plugins/figma-from-code/skills/figma-from-code/5-precapture of bitovi/ai-enablement-prompts.

  • SKILL.md
  • README.md

Open the folder on GitHubat commit df229b1

Compare with similar skills

Figma From Code Precapture 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 Precapture compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Figma From Code Precapture this skillbitovi/ai-enablement-prompts121—~3.3kAutomated safety check: PassMIT
Agent Developmentmajiayu000/claude-skill-registry6661 repos~2.9kAutomated safety check: PassMIT
Bangle Followup Operatorbangle-io/bangle-io1.2k—~991Automated safety check: PassAGPL-3.0
Verifier SetupAI-Builder-Club/skills1.3k—~2.1kAutomated safety check: PassNone
Igniteui Wc Figma To AppIgniteUI/igniteui-webcomponents170—~7.2kAutomated safety check: PassMIT
Permission ManageraAAaqwq/AGI-Super-Team1051 repos~1.3kAutomated safety check: PassMIT

Similar skills

  • Agent Development

    majiayu000/claude-skill-registry

    Design and build custom Claude Code agents with effective descriptions, tool access patterns, and self-documenting prompts.

    666 GitHub starsUsed in 1 repo~2.9k tokens
    Agent WorkflowsAuto-check passed
  • Bangle Followup Operator

    bangle-io/bangle-io

    Operate recurring Bangle.io agent follow-ups after a thread has already started.

    1.2k GitHub stars~991 tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • Verifier Setup

    AI-Builder-Club/skills

    Set a repo up to prove engineering-task work actually works before it ships.

    1.3k GitHub stars~2.1k tokensUpdated 22 days ago
    Testing & QAAuto-check passed
  • Igniteui Wc Figma To App

    IgniteUI/igniteui-webcomponents

    Builds Ignite UI Web Components views from Figma designs, supporting Indigo.Design kits, third-party kits (Material 3, Fluent 2, shadcn/ui, Untitled UI, in-house), and plain frames.

    170 GitHub stars~7.2k tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Permission Manager

    aAAaqwq/AGI-Super-Team

    管理Claude Code的全局工具权限配置,自动将MCP命令或其他工具添加到allowedTools中,避免每次使用时都需要手动批准。工作流程:确认用户需要添加的命令 - 确认添加级别(默认全局~/.claude.json) - 执行添加 - 验证并提醒重启。

    105 GitHub starsUsed in 1 repo~1.3k tokens
    Testing & QAAuto-check passed
  • QA

    Kiln-AI/Kiln

    Multi-agent, browser-driven QA pass over a branch or PR — scope it, plan it, fan out one subagent per testing area in its own isolated sandbox, compile a severity-ranked markdown report.

    5.2k GitHub stars~3.6k tokensUpdated today
    Testing & QAAuto-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 Precapture

What does Figma From Code Precapture do?

Subagent for figma-from-code Phase 2.5. An agent skill from bitovi/ai-enablement-prompts. Figma From Code Precapture is an agent skill from bitovi/ai-enablement-prompts.5.

When should I use Figma From Code Precapture?

Figma From Code Precapture fits situations like: tasks that involve Subagents.

How do I install Figma From Code Precapture in Claude Code?

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

How do I install Figma From Code Precapture in Codex?

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

Can I use Figma From Code Precapture 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-precapture -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-precapture, .gemini/skills/figma-from-code-precapture, .github/skills/figma-from-code-precapture and .opencode/skills/figma-from-code-precapture in your project.

What does Figma From Code Precapture need to run?

Going by SKILL.md and its folder, Figma From Code Precapture needs the command-line tools its instructions call (node).

Does Figma From Code Precapture 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 Precapture 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 Precapture use?

Figma From Code Precapture 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 Precapture use?

About 3.3k tokens (SKILL.md is roughly 13k 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 Precapture?

Skills that share tags, products or a category with Figma From Code Precapture: Agent Development (majiayu000/claude-skill-registry, 666 stars), Bangle Followup Operator (bangle-io/bangle-io, 1.2k stars), Verifier Setup (AI-Builder-Club/skills, 1.3k stars) and Igniteui Wc Figma To App (IgniteUI/igniteui-webcomponents, 170 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 Precapture?

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.