mcpField
F
figma-developer

figma-developer

github.com/oakossDesign & UI20108 installsUpdated 11w ago
Repository

About figma-developer

Figma Developer uses the Figma REST API to turn design data into code assets for teams maintaining design systems and front-end projects. It extracts design tokens, exports React icons and components, and supports CI-based synchronization.

Key features

  1. 01Extract color, typography, and spacing tokens
  2. 02Export SVGs as React icons
  3. 03Generate React components from Figma nodes
  4. 04Set up CI design synchronization
  5. 05Retrieve styles, components, and variables

Use cases

  1. 01Sync Figma design tokens as CSS variables or JSON
  2. 02Export icon sets as React components
  3. 03Scaffold components from Figma variants
  4. 04Automate Figma file updates through CI

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/oakoss/agent-skills --skill figma-developer

After installing, type/figma-developerin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
asset-export.md
ci-automation.md
component-generation.md
design-tokens.md
setup.md
troubleshooting.md

Details

From the project README

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

PatternAPI / ApproachKey Points
Get file dataGET /v1/files/:keyReturns full document tree with styles and fills
Get specific nodesGET /v1/files/:key/nodes?ids=...Fetch only the nodes you need to reduce payload
Export imagesGET /v1/images/:key?ids=...&format=svgRenders nodes as SVG/PNG/PDF; URLs expire in 14 days
Get stylesGET /v1/files/:key/stylesLists all published color, text, and effect styles
Get componentsGET /v1/files/:key/componentsLists all published components with metadata
Get component setsGET /v1/files/:key/component_setsReturns variant groupings for components
Get variablesGET /v1/files/:key/variables/localExtracts Figma Variables (colors, spacing, etc.)
Publish variablesPOST /v1/variablesPublishes local variables organization-wide
Token extractionParse styles from file response, transform to CSS/JSONNo built-in "extract tokens" endpoint exists
CI syncGitHub Actions cron + peter-evans/create-pull-requestAuto-sync PRs on Figma file changes

Figma File Organization

SectionContents
ColorsAll color styles with / hierarchy (Primary/500)
TypographyText styles (Heading/Large, Body/Regular)
SpacingSpacing guide values
ComponentsVariant groups (Button/Primary, Card/Default)
IconsAll icons in one exportable frame

Common Mistakes

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

Libraries

PackagePurpose
figma-apiCommunity Figma REST API client (typed)
@figma/rest-api-specOfficial TypeScript types for Figma API
style-dictionaryTransform design tokens across platforms
svgoOptimize exported SVGs before use
@svgr/coreConvert SVG files to React components

Delegation

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

References

Comments

Markdown supported