figma-to-code
Skill1 starsChanged 9 months agoMITView on GitHub
Figma 디자인을 코드로 변환. Figma URL과 빈 컴포넌트 파일 경로를 받아 UI 구현. "/figma-to-code", "피그마 구현" 등의 요청 시 사용
18 other projects use a version of this.
Adopted by
Most recently taken up by
- NoatToan/claude-code-pluginstheir own version, first seen Nov 1, 2026
- sushi-killer/sushiAItheir own version, first seen Oct 20, 2026
- pedroab0/skillstheir own version, first seen Oct 15, 2026
- t4sh/skills4shtheir own version, first seen Sep 28, 2026
- shivams07/figma-to-codetheir own version, first seen Aug 14, 2026
- sueryue/Claude-Skilllstheir own version, first seen Jul 28, 2026
Used with
Projects with it also use systematic-debugging, mcp-builder and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
OpenAISkillsystematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Also in 3 projects that use this
MicrosoftSkillmcp-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 building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Also in 3 projects that use this
GoogleSkilltdd
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
Also in 3 projects that use this
Other versions18 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 18
- shibit-net/xuanji-community★ 90same name
- scoobynko/claude-code-design-skills★ 39same name
- ggombee/code-forge★ 18same name
- t4sh/skills4sh★ 5same name
- kevinaimonster/skill-hub★ 4same name
- kyuhyi/BSD_claude_skills★ 2same name
- sushi-killer/sushiAI★ 2same name
- bedomax/webdesigner-agent★ 1same name
- gauravv-g/claude-skills-collection★ 1same name
- mintorain/minto_claude_skills★ 1same name
8 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- frontend-designSkill
- rust-async-patternsSkill
- rust-best-practicesSkill
- tauri-v2Skill
- clean-code-inspectorSkill
- unused-code-cleanerSkill
- commitSkill
- complexity-refactorSkill
- component-screenshotSkill
- deep-thinkSkill
- design-checkSkill
- figma-design-pipelineSkill
- issue-startSkill
- issue-updateSkill
- milestone-executeSkill
- milestoneSkill
- milestone-updateSkill
- plannerSkill
- react-refactoringSkill
- specSkill
- story-generatorSkill
- surveySkill
- testSkill
The file
Files
argument: $ARGUMENTS
Claude Command: Figma to Code
이 커맨드는 Figma 디자인 데이터를 기반으로 React 컴포넌트 코드를 생성합니다.
워크플로우 (6단계)
Phase 1. 입력 파싱
$ARGUMENTS에서 Figma URL과 컴포넌트 파일 경로를 추출합니다.
Figma URL 처리:
- URL에서
node-id=(\d+-\d+)패턴 추출 -를:로 치환하여 MCP 호출용 nodeId 생성 (예:node-id=1-2→1:2)- URL이
https://figma.com/design/:fileKey/branch/:branchKey/:fileName형식이면branchKey를fileKey로 사용
컴포넌트 경로 처리:
- 파일명에서 컴포넌트 이름 추출:
MyComponent.tsx→MyComponent - FSD 레이어 추출:
src/shared/...→Shared,src/features/...→Features등 - 대상 파일이 비어있지 않으면 사용자에게 덮어쓸지 확인
Phase 2. Figma 디자인 데이터 수집
3개 MCP 도구를 병렬 호출합니다:
mcp__figma-desktop__get_screenshot(nodeId)— 시각적 참조 이미지mcp__figma-desktop__get_design_context(nodeId)— 레이아웃, 색상, 타이포, 크기, 자식 노드 구조mcp__figma-desktop__get_variable_defs(nodeId)— 바인딩된 디자인 토큰 변수명
clientLanguages: typescript
clientFrameworks: react
에러 처리:
- MCP 도구 호출 실패 시: "Figma Desktop 앱을 실행하고 해당 파일을 열어주세요." 안내
Phase 3. 참조 패턴 탐색
프로젝트의 기존 패턴을 파악합니다:
src/shared/ui/내 유사 컴포넌트 패턴 확인:cn()유틸리티 사용 방식forwardRef패턴- named export 패턴
- Props 타입 정의 방식
- 대상 디렉토리의
index.ts, 형제 파일 확인하여 일관된 패턴 파악
Phase 4. Figma → 디자인 토큰 매핑 분석
이 프로젝트는 @exem-fe/tailwindcss-plugin을 통해 디자인 토큰을 Tailwind 클래스로 사용합니다.
주의: 기본 Tailwind 토큰이 전부 교체(override)되어 있으므로 반드시 아래 토큰만 사용해야 합니다.
색상 매핑 전략 (우선순위 순):
- Figma 변수 바인딩이 있으면 그 이름을 직접 사용 (예:
color/gray-05→text-gray-05) - 시맨틱 토큰 우선 사용:
- 텍스트:
text-text-primary,text-text-secondary,text-text-tertiary,text-text-disabled,text-text-accent,text-text-critical등 - 배경/면:
bg-surface-primary-default,bg-elevation-elevation-0등 - 보더:
border-border-primary,border-border-secondary등 - 아이콘:
text-icon-primary,text-icon-secondary등
- 텍스트:
- 원시 색상 스케일:
gray-00~10,red-00~10,blue-00~10등 +mono-white,mono-black - 매칭 불가 시 가장 가까운 토큰 +
/* TODO: exact color #XXXXXX */코멘트
타이포그래피:
| Figma 크기 | Tailwind 클래스 |
| 28px/140% | text-header-1 |
| 24px/140% | text-header-2 |
| 20px/140% | text-title-1 |
| 18px/140% | text-title-2 |
| 16px/140% | text-body-1 |
| 14px/140% | text-body-2 |
| 12px/140% | text-body-3 |
| 11px/140% | text-caption |
폰트 두께: font-regular(400), font-medium(500), font-semibold(600), font-bold(700)
Border Radius: rounded-weak(4px), rounded-medium(6px), rounded-strong(8px), rounded-circle(999px)
Box Shadow: shadow-weak(16px), shadow-medium(20px), shadow-strong(24px), shadow-preview
레이아웃 매핑:
- Figma auto-layout direction →
flex flex-row/flex flex-col - gap, padding → Tailwind spacing (4px=1 단위) 또는 arbitrary
[Npx] - child sizing: fill →
flex-1, fixed →w-[Npx], hug →w-fit
컴포넌트 인식:
- Figma 내 컴포넌트 인스턴스 →
@exem-fe/react매핑 (Button, TextField, Select, Table, Tabs, Modal, Tooltip, Badge, Tag, Checkbox, Radio, Switch 등) - 프로젝트 커스텀 UI →
src/shared/ui/참조 (Card, Form, DropdownMenu, Sheet, Popover, Skeleton 등) - 아이콘 →
@exem-fe/icon({Name}{Variant}Icon패턴,iconSizes또는className="size-{n}")
Phase 5. 코드 생성
Phase 2~4의 분석 결과를 기반으로 컴포넌트 코드를 생성합니다.
생성 규칙:
- import 순서: 외부 패키지 →
@exem-fe/*→@/프로젝트 → 상대 경로 cn()유틸리티 (@/shared/util) 사용하여 className 합성- Tailwind 클래스만 사용 — 인라인 스타일 지양, 동적 값만 예외
- 디자인 토큰 전용 — hex 하드코딩 금지
@exem-fe/react컴포넌트 우선 사용 (Button ><button>, TextField ><input>)@/alias 사용- 루트 요소에
classNameprop 전달 (합성 가능) - named export (default export 아님)
- Tailwind arbitrary values
[Npx]는 표준 spacing에 없을 때만 사용
Props 추론:
- 텍스트 노드 → string props
- 반복 요소 → array/children props
- 항상
className?: string포함
코드 구조 예시:
import { cn } from '@/shared/util'
interface MyComponentProps {
className?: string
title: string
}
export function MyComponent({ className, title }: MyComponentProps) {
return (
<div
className={cn(
'flex flex-col gap-2 p-4 bg-surface-primary-default rounded-strong',
className
)}
>
<span className="text-body-1 font-medium text-text-primary">{title}</span>
</div>
)
}Phase 6. 검증 및 출력
생성된 코드를 검증합니다:
- 모든 색상이 토큰 기반 Tailwind 클래스인지 확인 (hex 하드코딩 없음)
- import 경로가
@/alias를 사용하는지 확인 cn()사용 확인- named export 확인
@exem-fe/react컴포넌트가 적절히 사용되었는지 확인
결과 요약 출력:
Figma → Code 완료: {ComponentName}
사용된 디자인 토큰:
- 색상: {사용된 색상 토큰 목록}
- 타이포: {사용된 타이포 클래스 목록}
- 기타: {radius, shadow 등}
사용된 컴포넌트:
- @exem-fe/react: {Button, TextField, ...}
- @exem-fe/icon: {SearchIcon, ...}
- @/shared/ui: {Card, ...}
생성된 파일: {컴포넌트 경로}에러 처리
| 상황 | 대응 |
| Figma URL 형식 오류 | URL에서 node-id 파라미터를 찾을 수 없다고 안내, 올바른 URL 형식 예시 제공 |
| MCP 도구 호출 실패 | "Figma Desktop 앱을 실행하고 해당 파일을 열어주세요." 안내 |
| 대상 파일이 비어있지 않음 | 사용자에게 덮어쓸지 확인 |
| 매핑 불가 색상 | 가장 가까운 토큰 사용 + /* TODO: exact color #XXXXXX */ 코멘트 |
예시
입력
/figma-to-code https://figma.com/design/abc123/MyProject?node-id=1-2 src/features/widget-builder/ui/ColumnHeader.tsx실행 과정
- 입력 파싱: nodeId=
1:2, Name=ColumnHeader, Layer=Features - Figma 수집: get_screenshot, get_design_context, get_variable_defs 병렬 호출
- 참조 패턴:
src/shared/ui/및 형제 파일 패턴 확인 - 토큰 매핑: Figma 속성 → Tailwind 토큰 클래스 변환
- 코드 생성:
ColumnHeader.tsx에 컴포넌트 코드 작성 - 검증: 토큰 사용, import 경로, named export 확인
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

