figma-to-code
БесплатноБез исполняемых скриптовНе проверенConverts Figma designs into production-ready frontend code. Use when someone shares a Figma URL, design screenshot, or exported design tokens and needs…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Figma to Code
Overview
This skill converts Figma designs into production-ready frontend components. It extracts layout structure, spacing, typography, colors, and interactive states from designs and generates clean, responsive code using the team's existing tech stack and design system.
Instructions
Getting Design Information
There are three ways to receive design input:
Figma URL — A link such as
https://www.figma.com/design/Kp7dRw2xLm9QeTz4uVn8Ys/Billing-Dashboard?node-id=1289-4127carries the file key (Kp7dRw2xLm9QeTz4uVn8Ys) and the node id (1289-4127, written1289:4127in the API). Read it one of two ways:Figma MCP server (preferred; only clients in Figma's MCP catalog, such as Claude Code, Codex, Cursor and VS Code, can connect). Add the server once, authorize it in the browser (in Claude Code: run
/mcp, selectfigma, then Authenticate), then pass the link to its tools:claude mcp add --transport http figma https://mcp.figma.com/mcp # Claude Code codex mcp add figma --url https://mcp.figma.com/mcp # Codex CLIget_design_context— layout, styles, and reference code for the node (React + Tailwind unless the prompt names another stack)get_variable_defs— the variables and styles the node uses, for design tokensget_screenshot— an image of the node to check the result againstget_metadata— a sparse XML outline, for frames too large to fetch whole
Figma REST API. Use a personal access token (Figma Settings → Security) with the
file_content:readscope, kept inFIGMA_TOKEN:curl -s -H "X-Figma-Token: $FIGMA_TOKEN" \ "https://api.figma.com/v1/files/Kp7dRw2xLm9QeTz4uVn8Ys/nodes?ids=1289:4127" \ | jq '.nodes["1289:4127"].document' # Export icons and illustrations as SVG (returns temporary download URLs) curl -s -H "X-Figma-Token: $FIGMA_TOKEN" \ "https://api.figma.com/v1/images/Kp7dRw2xLm9QeTz4uVn8Ys?ids=1301:88,1301:92&format=svg"Parse the node JSON for layout (
layoutMode,itemSpacing,paddingLeft,absoluteBoundingBox), styles (fills,effects,cornerRadius, textstyle.fontFamily/fontSize/fontWeight/lineHeightPx), and component structure (children,componentId).Screenshot/Image — Analyze the image visually to identify:
- Layout grid (columns, gutters, margins)
- Component hierarchy (cards, headers, lists, forms)
- Typography scale (headings, body, captions)
- Color palette and spacing patterns
Exported Design Tokens — Parse JSON/CSS design tokens directly.
Generating Components
Identify the component tree — Break the design into a hierarchy:
- Page → Sections → Components → Elements
- Map each to a React/Vue component or HTML section
Extract design tokens:
- Colors: Map to CSS custom properties or theme variables
- Typography: Font family, size, weight, line-height, letter-spacing
- Spacing: Padding, margin, gap values — normalize to a spacing scale (4px base)
- Border radius, shadows, opacity
Generate the code following these rules:
- Use semantic HTML (
<nav>,<main>,<article>,<section>) - Use CSS Grid or Flexbox for layout — never absolute positioning for flow content
- Make it responsive: mobile-first, use
clamp()for fluid typography - Use the team's existing component library if specified (e.g., Tailwind, shadcn/ui, MUI)
- Extract repeated patterns into reusable components
- Add proper ARIA attributes for accessibility
- Use semantic HTML (
Handle responsive breakpoints:
- If the design shows multiple viewport sizes, implement all of them
- If only desktop is shown, create sensible mobile breakpoints:
- Stack horizontal layouts vertically below 768px
- Collapse navigation to a hamburger menu
- Adjust font sizes with
clamp()
Handle interactive states:
- Hover, focus, active, disabled states
- Loading skeletons where data is dynamic
- Empty states and error states if visible in the design
Output Structure
Deliver code as individual files:
components/
ComponentName/
ComponentName.tsx # Component code
ComponentName.module.css # Styles (omit when styling with Tailwind classes)
index.ts # Re-export
Examples
Example 1: Pricing Card from Figma Screenshot
User provides: Screenshot of a pricing card with three tiers
Agent output:
// components/PricingCard/PricingCard.tsx
import { CheckIcon } from "../icons/CheckIcon";
import styles from "./PricingCard.module.css";
interface PricingCardProps {
name: string;
price: number;
period: "monthly" | "yearly";
features: string[];
ctaLabel: string;
highlighted?: boolean;
onSelect: () => void;
}
export function PricingCard({ name, price, period, features, ctaLabel, highlighted, onSelect }: PricingCardProps) {
return (
<article className={`${styl
Установить figma-to-code в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл figma-to-code?
Converts Figma designs into production-ready frontend code. Use when someone shares a Figma URL, design screenshot, or exported design tokens and needs React/Vue/HTML components, responsive layouts, or design system code. Trigger words: Figma, design to code, mockup, wireframe, UI implementation, pixel perfect, design handoff, component from design.
Как установить скилл figma-to-code?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл figma-to-code запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic