Generate compact, agent-ready Figma specs for Claude Code and OpenAI Codex without burning too many tokens.
- Website:
figmaspecs.dev - GitHub:
https://github.com/antivirusakash/figma-ui-specs-generator - Figma Plugin:
https://www.figma.com/community/plugins(listing refresh in progress)
Design handoff usually sends too much raw context to coding agents. That increases retries, prompt churn, and cost.
Figma Specs turns selected UI into:
- visual spec frames on the canvas for humans
- compact structured YAML for agents
- cleaner prompts that preserve intent and reduce noise
Common team outcome: moving from large raw payloads (often 80k+ tokens) toward compact specs around ~20k depending on screen complexity.
| Output | What you get |
|---|---|
| Anatomy | Tree of elements and relationships |
| Layout | Auto-layout direction, spacing, alignment, sizing |
| Properties & Variants | Variant dimensions and behavior deltas |
| Inventory | Colors, typography, effects used across selection |
| Variables / Tokens | Resolved Figma variables and token values |
| Agent Payload | Chunked YAML (resolved_tokens, repeats, compact schema) |
| Agent Rules Snippet | Ready instructions for CLAUDE.md / AGENTS.md |
- Select a frame/component in Figma.
- Run Figma Specs to generate on-canvas specs + YAML.
- Add project rules snippet to:
CLAUDE.mdfor Claude CodeAGENTS.mdfor Codex and other coding agents
- Paste prompt + YAML into your coding agent.
- Build and compare to reference screenshot.
This creates a cleaner handoff loop for both designers and coders.
src/code.tsorchestrates plugin flow and dependency wiring.src/plugin/limits.tsis the single configuration page for tunables:- base caps/truncation limits
- complexity tier thresholds (
standard/large/enterprise) - per-tier runtime override profiles
- artwork export auto-scale plans and area thresholds
- Complexity-aware runtime budgets auto-scale anatomy/layout/data limits per selection (
standard/large/enterprise) without exposing manual UI controls. - Artwork preview export is stress-safe: auto scale fallback (
2x/1x/0.5x/0.25x) retries only when Figma hits image-size limits, so large landing pages still finish spec generation. src/plugin/helpers/anatomy-collector.tshandles repeat fingerprinting and diff logic.src/plugin/sections/data-section.tsbuilds chunked agent payload YAML.src/ui-app.tsxprovides the plugin UI, includingCLAUDE.md / AGENTS.mdhelper tab.src/ui.cssmaps plugin theme tokens to the same light palette used bylanding-page/src/app/globals.css.
- Full Handoff and Quick Check force visual anatomy mode (
tabularAnatomy: false) so UI previews remain visible. - Compact mode only skips artwork when Data + Agent Pack + Compact are all enabled.
- Agent YAML summary includes
runtime_budgetand truncation metadata to make stress behavior observable in generated specs. - Operational checklist for repeatable validation:
benchmark/stress-sanity-todo.md.
git clone https://github.com/antivirusakash/figma-ui-specs-generator.git
cd figma-ui-specs-generator
npm install
npm run buildIn Figma: Plugins -> Development -> Import plugin from manifest... and select manifest.json.
cd landing-page
npm install
npm run devnpm run build
npm run watch
npm run typecheck
npm run test:unit
npm run test:ui
npm run testcd landing-page
npm run dev
npm run lint
npm run buildsrc/
code.ts
ui-app.tsx
plugin/
helpers/
sections/
landing-page/
src/app/page.tsx
src/app/globals.css
benchmark/
blog/specs.md
Issues and PRs are welcome.
- Keep changes focused and testable.
- Follow module injection patterns in section generators.
- Preserve schema compatibility unless intentionally versioning.
MIT

