Agent skill

Figma From Code Setup Tokens

by bitovi in bitovi/ai-enablement-prompts

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

MITAuto-check passedFrontend & Design

Install Figma From Code Setup Tokens

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

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

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

At a glance

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

  • Works in 6 steps: Token Discovery → Create Variable Collections → Extract Variable Lookup Map → …
  • Tasks that involve CSS and styling
  • SKILL.md covers When to Use, Prerequisites, Required Inputs and Token Sources, plus 4 more sections
  • Calls node

What it does

Figma From Code Setup Tokens is an agent skill from bitovi/ai-enablement-prompts. Subagent for figma-from-code Phase 1. Creates Figma variable collections from the project's CSS and Tailwind tokens, extracts the CSS-variable-to-Figma-variable-ID map, and pre-computes all CSS colors as sRGB values.

Its SKILL.md is about 2.4k 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 Frontend & Design, covering CSS and styling, Design tokens and Subagents. It works with Figma and Tailwind CSS. The repository describes itself as: Prompts Bitovi uses for software development. The licence is MIT.

When your agent uses it

  • Tasks that involve CSS and styling
  • Tasks that involve Design tokens
  • Tasks that involve Subagents

Example prompts

  • “/figma-from-code-setup-tokens”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Token Discovery
  2. Create Variable Collections
  3. Extract Variable Lookup Map
  4. Resolve CSS Colors
  5. Write Summary
  6. Report

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 Setup Tokens loads about 2.4k tokens when it runs. Until then it costs about 61 tokens; SKILL.md has 692 words of instructions outside code blocks.

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

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). 692 words, ~2,395 tokens.

Download SKILL.mdSave it as .claude/skills/figma-from-code-setup-tokens/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-setup-tokens
description
Subagent for figma-from-code Phase 1. Creates Figma variable collections from the project's CSS and Tailwind tokens, extracts the CSS-variable-to-Figma-variable-ID map, and pre-computes all CSS colors as sRGB values.
model
claude-sonnet-4-5

Skill: Setup Tokens (Phase 1)

Creates Figma variable collections from the project's CSS and Tailwind tokens, extracts the CSS-variable-to-Figma-variable-ID map, and pre-computes all CSS colors as sRGB values. Runs as a subagent dispatched by the orchestrator, or standalone when tokens change.

When to Use

  • When figma-from-code orchestrator reaches Phase 1
  • Standalone to recreate variable collections and color maps after token changes

Prerequisites

Load figma:figma-use (mandatory) before any use_figma call.

Required Inputs

InputDescriptionSource
fileKeyFigma file keyState ledger or caller
existingCollectionsList of variable collection names that already existPhase 0a Figma inspection

Placeholders like {cssPath}, {tailwindConfigPath}, and {skillRoot} resolve from state.json → config.

Token Sources

FileWhat it contains
{cssPath}All CSS custom properties — palette colors and semantic aliases
{tailwindConfigPath}Color names mapped to CSS variables, border-radius extensions (optional)

Output Files

FileContentsConsumed by
.temp/figma-from-code/variables.jsonCSS var name -> Figma variable ID map (with scopes)Phase 3 build subagents
.temp/figma-from-code/resolved-colors.jsonPre-computed sRGB values for all CSS variablesPhase 3 build subagents
.temp/figma-from-code/color-index.jsonReverse RGB -> Figma variable index (for rebind sweeps)Phase 3 fix loops, resolve-color.js
.temp/figma-from-code/tokens-summary.jsonSmall summary for the orchestratorOrchestrator only

Workflow

1. Token Discovery

Rather than hardcoding token values, extract them dynamically from the project files:

  1. Read {cssPath} and parse all --variable-name: value declarations from :root or theme blocks
  2. Categorize variables into:
    • Palette colors: Raw color scales (e.g., --gray-50 through --gray-950) — group by color family
    • Semantic tokens: Aliases that reference palette colors or define contextual colors (e.g., --background, --primary, --foreground)
    • Spacing/sizing: Numeric values for radius, spacing, gaps
  3. If {tailwindConfigPath} is not null, read it to discover color name mappings to CSS variables, border-radius extensions, and spacing scale extensions
2. Create Variable Collections

Skip this step if all three collections (Palette, Semantic, Spacing) already exist in existingCollections.

Write a use_figma script to create the three collections. Work in batches of ~50 variables per call to stay under the incremental limit. Create Palette first, then Semantic (so alias references resolve correctly).

Collection: Palette (mode: Value)

Raw color scales extracted from CSS. Set scopes to [] on every variable (hidden from property pickers — used only for aliasing by Semantic). Groups are discovered dynamically from CSS variable naming patterns (--{color}-{step} where step is 50→950).

Collection: Semantic (mode: Light)

Alias tokens that components bind to. Set scopes based on usage:

Token patternScope
background, card/*, popover/*, sidebar/* fillsFRAME_FILL, SHAPE_FILL
foreground, *-foregroundTEXT_FILL
border/*, ring/*, outline/*STROKE_COLOR

Where a semantic token's value maps to a palette variable, create an alias reference. Where it's a standalone hex value, use a direct color.

Show full SKILL.md (269 more words)Show less
Collection: Spacing (mode: Value)

Float variables from CSS or Tailwind config. Set CORNER_RADIUS scope for radius variables; GAP, WIDTH_HEIGHT scope for spacing variables.

For all variables in all collections, set WEB code syntax to var(--variable-name) matching the CSS variable name exactly.

3. Extract Variable Lookup Map

Run this use_figma call to build the CSS-variable-name to Figma-variable-ID map:

javascript
const collections = await figma.variables.getLocalVariableCollectionsAsync();
const map = {};
for (const col of collections) {
  for (const varId of col.variableIds) {
    const v = await figma.variables.getVariableByIdAsync(varId);
    if (v.codeSyntax && v.codeSyntax.WEB) {
      map[v.codeSyntax.WEB] = {
        id: v.id,
        name: v.name,
        collectionName: col.name,
        resolvedType: v.resolvedType,
        scopes: v.scopes,
      };
    }
  }
}
return JSON.stringify(map);

Write the returned JSON to .temp/figma-from-code/variables.json.

4. Resolve CSS Colors

Run the color resolution script to pre-compute all CSS variable colors as sRGB:

bash
node {skillRoot}/scripts/resolve-colors.js \
  {cssPath} \
  [--tailwind {tailwindConfigPath}] \
  --output .temp/figma-from-code/resolved-colors.json

Omit the --tailwind flag entirely when config.tailwindConfigPath is null.

4b. Generate Reverse Color Index

Join variables.json and resolved-colors.json into the RGB-to-variable reverse index used by build agents and fix-loop rebind sweeps:

bash
node {skillRoot}/scripts/resolve-color.js --dump-index \
  --output .temp/figma-from-code/color-index.json

The index is keyed by 8-bit "r,g,b" strings, each mapping to the candidate Figma variables that resolve to that color. Build agents inline it into use_figma scripts (the plugin sandbox has no filesystem access); single lookups go through resolve-color.js <class|var|color> instead of reading the JSON into context.

5. Write Summary

Count the entries in variables.json and resolved-colors.json, then write the summary:

bash
node -e "
  const vars = JSON.parse(require('fs').readFileSync('.temp/figma-from-code/variables.json','utf-8'));
  const colors = JSON.parse(require('fs').readFileSync('.temp/figma-from-code/resolved-colors.json','utf-8'));
  const index = JSON.parse(require('fs').readFileSync('.temp/figma-from-code/color-index.json','utf-8'));
  const varCount = Object.keys(vars).length;
  const colorCount = Object.keys(colors.cssVariables || {}).length;
  const indexCount = Object.keys(index.index || {}).length;
  const collections = [...new Set(Object.values(vars).map(v => v.collectionName))];
  const summary = { collections, variableCount: varCount, resolvedColorCount: colorCount, colorIndexCount: indexCount, variableMapPath: '.temp/figma-from-code/variables.json', resolvedColorsPath: '.temp/figma-from-code/resolved-colors.json', colorIndexPath: '.temp/figma-from-code/color-index.json' };
  require('fs').writeFileSync('.temp/figma-from-code/tokens-summary.json', JSON.stringify(summary, null, 2));
  console.log('Tokens summary: ' + collections.length + ' collections, ' + varCount + ' variables, ' + colorCount + ' resolved colors, ' + indexCount + ' indexed color keys');
"
6. Report
Phase 1 complete:
- {collections.length} variable collections: {collection names}
- {variableCount} CSS variables mapped to Figma variable IDs
- {resolvedColorCount} CSS colors pre-computed as sRGB
- {colorIndexCount} reverse color-index keys for RGB -> variable matching

Skip / Resume

Skip the entire phase if all four output files exist and are non-empty:

  • .temp/figma-from-code/variables.json
  • .temp/figma-from-code/resolved-colors.json
  • .temp/figma-from-code/color-index.json
  • .temp/figma-from-code/tokens-summary.json

Skip only Step 2 (collection creation) if all three collections already appear in existingCollections; proceed with Steps 3–5 to regenerate the maps.

Error Handling

ScenarioAction
Collection creation failsReport error; variable creation is required for downstream phases
use_figma variable extraction failsRetry once; if still failing, report error
resolve-colors.js failsReport error; Phase 3 can still build using computed-styles.json fallback
resolve-color.js --dump-index failsReport error; Phase 3 builds work but rebind sweeps degrade to no-ops

© 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/3-setup-tokens of bitovi/ai-enablement-prompts.

  • SKILL.md
  • README.md

Open the folder on GitHubat commit df229b1

Compare with similar skills

Figma From Code Setup Tokens 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 Setup Tokens compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Figma From Code Setup Tokens this skillbitovi/ai-enablement-prompts121—~2.4kAutomated safety check: PassMIT
Extract DesignManavarya09/design-extract4.2k—~786Automated safety check: NotesMIT
Shift UI Componentsshift-editor/shift347—~2.5kAutomated safety check: PassApache-2.0
Ad Designalexandremendoncaalvaro/CorridorKey-Runtime755—~1.1kAutomated safety check: PassCustom licence
Design System Generatemohitagw15856/pm-claude-skills1.4k—~1.7kAutomated safety check: PassMIT
MCP Developmentcoollabsio/coolify63k1 repos~949Automated safety check: PassMIT

Similar skills

  • Extract Design

    Manavarya09/design-extract

    Extract the full design language from any website URL. An agent skill from Manavarya09/design-extract.

    4.2k GitHub stars~786 tokensUpdated 9 days ago
    Frontend & DesignAuto-check: notes
  • Shift UI Components

    shift-editor/shift

    Guides design, implementation and review of Shift interface work: shared Base UI wrappers, Tailwind v4 theme tokens, Figma matching and accessible interaction states.

    347 GitHub stars~2.5k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Ad Design

    alexandremendoncaalvaro/CorridorKey-Runtime

    Generate DESIGN.md at the repo root by scanning existing design tokens (Figma export, tailwind.config, tokens.json, stylesheet) and synthesizing W3C-compatible YAML frontmatter + Markdown rationale…

    755 GitHub stars~1.1k tokensUpdated 2 mo ago
    Frontend & DesignAuto-check passed
  • Design System Generate

    mohitagw15856/pm-claude-skills

    Generate a complete, accessibility-checked design system from scratch — colour ramps, type scale, spacing, elevation, and exports for CSS, Tailwind, design tokens, Figma, VS Code and PowerPoint.

    1.4k GitHub stars~1.7k tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • MCP Development

    coollabsio/coolify

    A skill your agent uses for Laravel MCP development. An agent skill from coollabsio/coolify.

    63k GitHub starsUsed in 1 repo~949 tokens
    Frontend & DesignAuto-check passed
  • Tailwind Design System

    SuFxGIT/scoutarr

    Build scalable design systems with Tailwind CSS v4, design tokens, component libraries, and responsive patterns.

    114 GitHub starsUsed in 5 repos~5.6k tokens
    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

Questions about Figma From Code Setup Tokens

What does Figma From Code Setup Tokens do?

Subagent for figma-from-code Phase 1. An agent skill from bitovi/ai-enablement-prompts. Figma From Code Setup Tokens is an agent skill from bitovi/ai-enablement-prompts. Subagent for figma-from-code Phase 1.

When should I use Figma From Code Setup Tokens?

Figma From Code Setup Tokens fits situations like: tasks that involve CSS and styling; tasks that involve Design tokens; tasks that involve Subagents.

How do I install Figma From Code Setup Tokens in Claude Code?

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

How do I install Figma From Code Setup Tokens in Codex?

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

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

What does Figma From Code Setup Tokens need to run?

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

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

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

About 2.4k tokens (SKILL.md is roughly 9.6k 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 Setup Tokens?

Skills that share tags, products or a category with Figma From Code Setup Tokens: Extract Design (Manavarya09/design-extract, 4.2k stars), Shift UI Components (shift-editor/shift, 347 stars), Ad Design (alexandremendoncaalvaro/CorridorKey-Runtime, 755 stars) and Design System Generate (mohitagw15856/pm-claude-skills, 1.4k 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 Setup Tokens?

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.