scaffolding-from-figma

Generates token-mapped Vue or React frontend scaffolds from Figma node metadata via REST API.

1|Updated Feb 16, 2026
One-click install
npx skills add https://github.com/codepresso-dev/codepresso-ai-plugin --skill scaffolding-from-figma-codepresso-dev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: scaffolding-from-figma
Source: https://github.com/codepresso-dev/codepresso-ai-plugin/tree/main/skills/scaffolding-from-figma
Command: npx skills add https://github.com/codepresso-dev/codepresso-ai-plugin --skill scaffolding-from-figma-codepresso-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires puppeteer, pixelmatch, pngjs, dotenv, sass, cheerio, esbuild, and includes scripts (resource) and references (resource) components.

What problem does it solve? Manually translating Figma designs into frontend code is slow and error-prone, often producing hardcoded hex values and inconsistent spacing that ignore the project's design system. This Skill automates the Figma-to-scaffold pipeline so a publisher refines a 70-95% ready draft in 1-2 hours instead of building from scratch over 1-2 days. ## Core Features & Use Cases - Figma metadata extraction: Pulls node trees and rendered PNGs via the Figma REST API using a Personal Access Token. - Automatic token mapping: The figma-to-spec.mjs script converts Figma colors, spacing, radii, and typography into the project's SCSS/CSS variables (e.g. $color-main, $space-4), guaranteeing zero hardcoded hex values. - Designer agent dispatch: Feeds the generated spec.md, design system docs, and render PNG to a designer agent that produces the scaffold, then verifies it with pixel-diff tooling (86-97% pixel match measured). - Use Case: Given a Figma URL with a node-id for an evaluation detail page, the pipeline outputs Vue single-file components mapped to the project's design tokens, plus a CHECKLIST.md of remaining publisher refinement items. ## Quick Start Give the AI a Figma file URL with node-id and your Figma PAT, and ask it to generate a frontend scaffold for your project using this skill.

Frequently Asked Questions about scaffolding-from-figma

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate frontend code from a Figma design automatically?▼

Provide a Figma file URL with node-id and a Personal Access Token. The pipeline extracts node metadata via the Figma REST API, maps values to your project's design tokens in a spec.md file, then dispatches a designer agent to generate Vue or React scaffold components.

How to convert Figma designs to Vue or React components with design tokens?▼

The figma-to-spec.mjs script walks the Figma node tree and maps colors, spacing, radii, and font sizes to your SCSS variables like $color-main or $space-4. You adapt the COLOR_MAP and related maps to your project's _variables.scss file before running.

Does Figma scaffold generation work without a design token system?▼

No. The skill explicitly requires a documented SCSS or CSS variables file and design system documentation. If the target project only uses inline hex values, you should establish tokens first, since the pipeline's core value is token-mapped output with zero hardcoded colors.

What Figma API access is needed for design-to-code automation?▼

You need a Figma Personal Access Token with file_content:read and file_variables:read scopes, generated at figma.com/settings/security. The token is stored in a gitignored .env file and used for REST API calls to fetch node JSON and rendered PNGs.

Why does AI-generated code from Figma hallucinate design tokens?▼

Hallucination occurs when a monolithic design system document exceeds what the agent can reliably process. Splitting documentation into roughly 14 focused files (index, tokens, components) reduced invented tokens to zero and cut pixel drift from about 10% to 2.5% in measured experiments.

What are the limitations of Figma-to-code scaffold generation?▼

The output is a scaffold, not production code: expect 86-97% pixel match requiring 1-2 hours of publisher refinement. It does not handle complex interactive features like drag-and-drop, real-time updates, or charts, and is unsuitable for one-off prototypes where manual coding is faster.