figma-developer — скилл для Claude Code: Figma в код и установка
Скилл figma-developer для Claude Code получает из Figma цвета, шрифты и иконки через REST API и собирает CSS-переменные и React-компоненты. Автоматизирует перенос изменений макета в код.
MIT 114 установок ★ 29 обновлён 2026-08-17
npx skills add oakoss/agent-skills --skill figma-developer -a claude-codeЧто делает figma-developer
Скилл выгружает данные из Figma через REST API: токены цветов, типографики и отступов уходят в CSS-переменные и JSON, иконки превращаются в SVG-компоненты React, из узлов макета генерируются заготовки компонентов. Отдельно описана синхронизация в CI: GitHub Actions по расписанию вместе с peter-evans/create-pull-request открывает пул-реквест с обновлениями.
Внутри — таблица эндпоинтов (GET /v1/files/:key, /v1/files/:key/styles, /v1/files/:key/variables/local и другие), список библиотек (figma-api, @figma/rest-api-spec, style-dictionary, svgo, @svgr/core) и разбор частых ошибок. Готового эндпоинта для токенов у Figma нет, поэтому стили придётся разбирать из ответа GET /v1/files/:key самостоятельно. Цвета приходят в диапазоне 0–1: перед переводом в hex их умножают на 255.
Разовые правки макета проще перенести руками. Для доступа нужна аутентификация в Figma API — в скилле есть отдельный справочник по её настройке. Ссылки на изображения живут 14 дней, так что CI-задание, которое держит их в кэше дольше, упрётся в пустой ответ и иконки придётся запрашивать заново.
Какие задачи решает
- выгрузить токены Figma в CSS-переменные и JSON
- экспортировать набор иконок как SVG-компоненты React
- сгенерировать заготовки компонентов из вариантов в макете
- настроить синхронизацию макета с репозиторием через GitHub Actions
- разобрать стили из ответа
GET /v1/files/:keyбез выдуманных методов API
Примеры запросов агенту
- Выгрузи цветовые и текстовые стили из моего файла Figma в CSS-переменные и JSON
- Собери все иконки из фрейма Icons в SVG-компоненты React и прогони их через
svgo - Настрой GitHub Actions, чтобы токены из Figma приезжали пул-реквестом по расписанию
Как установить figma-developer
1Через Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill figma-developer -a claude-code2Вручную: положить файлы
~/.claude/skills/figma-developer/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/figma-developer/
1Через Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill figma-developer -a codex2Вручную: положить файлы
.agents/skills/figma-developer/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill figma-developer -a cursor2Вручную: положить файлы
.cursor/skills/figma-developer/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install oakoss/agent-skills skills/figma-developer2Вручную: положить файлы
.github/skills/figma-developer/SKILL.md1Через Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill figma-developer -a gemini-cli2Командой платформы
gemini skills install https://github.com/oakoss/agent-skills --path skills/figma-developerВручную: положить файлы
.devin/skills/figma-developer/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill figma-developer -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о figma-developer
Как установить figma-developer в Claude Code?
Выполните npx skills add oakoss/agent-skills --skill figma-developer -a claude-code. Файл скилла появится по пути ~/.claude/skills/figma-developer/SKILL.md.
Что делает figma-developer?
Забирает стили, компоненты и иконки из файла Figma по REST API и переводит их в код: CSS-переменные, SVG-компоненты React, заготовки компонентов из вариантов.
Почему токены нельзя выгрузить одной командой?
В Figma нет эндпоинта, который отдаёт токены. Стили и переменные скилл собирает из ответа GET /v1/files/:key и /v1/files/:key/variables/local.
Исходный текст
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