Skip to main content
skill CX Codex

figma-developer — Claude Code skill: Figma to React, how to install

figma-developer pulls colours, type styles and icons out of Figma over the REST API and turns them into CSS variables and React components. Useful when the design file moves faster than your code.

MIT 114 installs ★ 29 updated 2026-08-17

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add oakoss/agent-skills --skill figma-developer -a claude-code
Open on GitHub

What figma-developer does

The skill reads a Figma file through the REST API and converts what it finds into code. Colour, type and spacing tokens land in CSS variables and JSON, icons become SVG React components, and node trees turn into component scaffolding. A CI recipe ships with it: a scheduled GitHub Actions job plus peter-evans/create-pull-request opens a PR whenever the file changes.

You also get an endpoint table (GET /v1/files/:key, /v1/files/:key/styles, /v1/files/:key/components, /v1/files/:key/variables/local), a library list (figma-api, @figma/rest-api-spec, style-dictionary, svgo, @svgr/core) and a rundown of mistakes that bite. Figma has no endpoint that hands you tokens, so styles must be parsed out of the GET /v1/files/:key response by hand. Colours arrive as 0–1 RGB; multiply by 255 before going to hex.

Authentication against the Figma API has its own setup reference. Exported image URLs expire after 14 days, so a CI job that caches them will start failing and icons need re-fetching. For a one-off nudge to a layout, copying the values yourself is quicker than wiring any of this up.

What it helps with

  • export Figma design tokens to CSS variables and JSON
  • ship an icon set as SVG React components
  • scaffold components from Figma variants
  • run a scheduled design sync that opens pull requests
  • parse styles out of the GET /v1/files/:key response

Example prompts for the agent

  • Pull the colour and text styles from my Figma file into CSS variables and a JSON file.
  • Export every icon in the Icons frame as an SVG React component and optimise them with svgo.
  • Set up a GitHub Actions job that opens a pull request when the Figma tokens change.

How to install figma-developer

1Skills CLI (Vercel)

npx skills add oakoss/agent-skills --skill figma-developer -a claude-code

2Manually: put the files in place

~/.claude/skills/figma-developer/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/figma-developer/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about figma-developer

How do I install figma-developer in Claude Code?

Run npx skills add oakoss/agent-skills --skill figma-developer -a claude-code. The skill file ends up at ~/.claude/skills/figma-developer/SKILL.md.

What does figma-developer do?

It extracts styles, components and icons from a Figma file over the REST API and turns them into CSS variables, SVG React components and component scaffolding.

Which libraries does it use?

figma-api and @figma/rest-api-spec for API access, style-dictionary for token transforms, svgo and @svgr/core for icon export to React.

Source text

SKILL.md · MIT
---
name: figma-developer
description: 'Extracts design data from Figma via the REST API and converts designs to React code. Use when syncing Figma tokens to CSS variables, exporting icons as SVG components, generating code from Figma designs, or automating design-to-code workflows. Use for design token extraction, icon export, component generation, and CI-based Figma sync.'
license: MIT
metadata:
  author: oakoss
  version: '1.1'
---

# Figma Developer

## Overview

Automates the Figma-to-code bridge using the Figma REST API. Extracts design tokens (colors, typography, spacing) as CSS variables and JSON, exports icons as SVG React components, generates React components from Figma node structures, and sets up CI pipelines for continuous design sync.

**When to use:** Syncing design tokens from Figma to code, exporting icon sets as React components, generating component scaffolding from Figma variants, setting up automated design sync in CI.

**When NOT to use:** Manual one-off design tweaks (just copy values), Figma plugin development (use the Plugin API instead), real-time collaborative editing (use Figma webhooks directly), or projects without a Figma design system.

## Quick Reference

| Pattern            | API / Approach                                          | Key Points                                           |
| ------------------ | ------------------------------------------------------- | ---------------------------------------------------- |
| Get file data      | `GET /v1/files/:key`                                    | Returns full document tree with styles and fills     |
| Get specific nodes | `GET /v1/files/:key/nodes?ids=...`                      | Fetch only the nodes you need to reduce payload      |
| Export images      | `GET /v1/images/:key?ids=...&format=svg`                | Renders nodes as SVG/PNG/PDF; URLs expire in 14 days |
| Get styles         | `GET /v1/files/:key/styles`                             | Lists all published color, text, and effect styles   |
| Get components     | `GET /v1/files/:key/components`                         | Lists all published components with metadata         |
| Get component sets | `GET /v1/files/:key/component_sets`                     | Returns variant groupings for components             |
| Get variables      | `GET /v1/files/:key/variables/local`                    | Extracts Figma Variables (colors, spacing, etc.)     |
| Publish variables  | `POST /v1/variables`                                    | Publishes local variables organization-wide          |
| Token extraction   | Parse styles from file response, transform to CSS/JSON  | No built-in "extract tokens" endpoint exists         |
| CI sync            | GitHub Actions cron + `peter-evans/create-pull-request` | Auto-sync PRs on Figma file changes                  |

## Figma File Organization

| Section    | Contents                                            |
| ---------- | --------------------------------------------------- |
| Colors     | All color styles with `/` hierarchy (`Primary/500`) |
| Typography | Text styles (`Heading/Large`, `Body/Regular`)       |
| Spacing    | Spacing guide values                                |
| Components | Variant groups (`Button/Primary`, `Card/Default`)   |
| Icons      | All icons in one exportable frame                   |

## Common Mistakes

| Mistake                                                   | Fix                                                              |
| --------------------------------------------------------- | ---------------------------------------------------------------- |
| Using fabricated API methods like `extractDesignTokens()` | Parse styles from `GET /v1/files/:key` response manually         |
| Hardcoding Figma values instead of using tokens           | Extract tokens to CSS variables, reference with `var()`          |
| Not normalizing Figma style names                         | Lowercase + replace special chars with hyphens                   |
| Forgetting Figma uses 0-1 RGB not 0-255                   | Multiply by 255 and round before hex conversion                  |
| No API response caching                                   | Cache with TTL to avoid rate limits                              |
| Manual icon exports                                       | Automate with `GET /v1/images/:key` + React component generation |
| No CI sync workflow                                       | GitHub Actions cron + `create-pull-request` action               |
| Using expired image URLs                                  | Image export URLs expire in 14 days; re-fetch before use         |

## Libraries

| Package                | Purpose                                  |
| ---------------------- | ---------------------------------------- |
| `figma-api`            | Community Figma REST API client (typed)  |
| `@figma/rest-api-spec` | Official TypeScript types for Figma API  |
| `style-dictionary`     | Transform design tokens across platforms |
| `svgo`                 | Optimize exported SVGs before use        |
| `@svgr/core`           | Convert SVG files to React components    |

## Delegation

- **Design systems**: see `design-system` skill
- **Asset optimization**: see `asset-manager` skill

## References

- [Setup and Authentication](references/setup.md)
- [Design Tokens](references/design-tokens.md)
- [Asset Export](references/asset-export.md)
- [Component Generation](references/component-generation.md)
- [CI Automation](references/ci-automation.md)
- [Troubleshooting](references/troubleshooting.md)

© oakoss · MIT · oakoss/agent-skills

Similar skills

All skills for Frontend and UI →

From the same set106

The whole set →

Project sponsors

Companies that keep this analytics open