figma-to-code

A design-to-code workflow that turns Figma designs into React and TypeScript code using Emotion, a styling library. It extracts layout, colours, typography, and component structure from the design.

In plain words
What is it for?
Use it when implementing React components from Figma URLs, including their layout, styles, component structure, and state-based styling.
Why use it?
It reduces the effort of manually measuring a design and recreating its visual details in code. It is intended to keep the implementation closely matched to the Figma design.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ggombee/code-forge/figma-to-code
Any agent
npx skills add ggombee/code-forge --skill figma-to-code
Clone the repo
git clone --depth 1 https://github.com/ggombee/code-forge

Made for: Claude Code, Codex.

Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 878 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00020 $0.00878
Opus 5 $0.00010 $0.00439
Sonnet 5 $0.00004 $0.00176
Haiku 4.5 $0.00002 $0.00088

Measured yesterday against content hash 9273db466ad4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

figma-to-code scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/figma-to-code/SKILL.md · 144 lines

How it starts

The opening of the file, as written. The whole thing — 144 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Figma to Code Skill

Figma 디자인을 Emotion styled 기반 코드로 변환


트리거 조건

트리거 반응
Figma URL 제공 즉시 실행
"Figma 변환", "디자인 구현" 스킬 활성화
/start 커맨드 내 Figma 분석 자동 연계

워크플로우

Phase 1: 디자인 추출

// Figma MCP 도구로 디자인 컨텍스트 추출
mcp__figma__get_design_context({
  fileKey: '{file_key}',
  nodeId: '{node_id}',
  clientLanguages: 'typescript',
  clientFrameworks: 'react',
});

추출 항목:

  • 레이아웃 구조 (flex, gap, padding)
  • 색상 값 (hex → semantic color 매핑)
  • 타이포그래피 (font-size, weight, line-height)
  • 컴포넌트 계층 구조

Phase 2: 컴포넌트 매핑

파일 구조:

{컴포넌트}/
├── index.tsx      # 컴포넌트 로직
└── styled.ts      # Emotion styled 정의

styled.ts 템플릿:

import styled from '@emotion/styled';

export const Container = styled.div`
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
`;

// 상태별 스타일 (transient props: $접두사)
export const FilterButton = styled.button<{ $isSelected: boolean }>`
  padding: 8px 16px;
`;

index.tsx 템플릿:

import { FC } from 'react';

import { Container, Title, FilterButton } from './styled';

interface Props {
  // props 정의
}

export const Component: FC<Props> = ({ ...props }) => {
  return (
    <Container>
      {/* styled 컴포넌트 직접 사용 */}
    </Container>
  );
};

Phase 3: Agent Teams 병렬 구현 (Claude Max)

여러 컴포넌트를 동시에 생성할 때:

TeamCreate({ team_name: 'figma-team', description: 'Figma to Code 변환' });
Task(subagent_type='implementor', team_name='figma-team', name='component-1', model='sonnet',
  prompt='FilterButton 컴포넌트 구현');
Task(subagent_type='implementor', team_name='figma-team', name='component-2', model='sonnet',
  prompt='DateControls 컴포넌트 구현');
// 완료 후 → shutdown_request → TeamDelete

Agent Teams 미가용 시 Task 병렬 호출로 폴백


Phase 4: 검증

Pixel-perfect 체크리스트:

  • 레이아웃 (flex-direction, gap, padding) 일치
  • 색상 (semantic color 매핑) 일치
  • 폰트 (size, weight, line-height) 일치
  • 상태별 스타일 (hover, active, disabled) 일치
  • 반응형 동작 (있는 경우)

Read the full file on GitHub · 144 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 144 lines · 20 tokens per session scan A 9273db466ad4

Subscribe to this mod's changes

figma-to-code is a skill published in the GitHub repository ggombee/code-forge (13 stars, last pushed 2mo ago), licensed MIT. It adds 20 tokens to every session and 878 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.