Figma Implement (V2)
Use this skill after design handoff is complete and a finalized Figma component or page frame URL is available. This skill turns that Figma target into component-level or page-level UI code.
What changed in V2
- Responsive: accept multiple breakpoint frames for one target and merge them mobile-first into a single responsive implementation.
- shadcn/ui: reuse installed shadcn primitives, install missing standard shadcn components instead of hand-writing them, and respect customized shadcn (
do not regenerate).Everything else is identical to the original
figma-implementskill.
Role boundary:
design-md: establishes the design system, including tokens, theme artifacts, and component contracts.figma-implement: consumes a completed Figma component or page frame plus existing handoff artifacts to implement code.
Prerequisite Check
Before implementation, verify:
DESIGN.mdexists.COMPONENTS.mdexists.tailwind.theme.cssis imported by the app's global Tailwind entry stylesheet, usuallyglobals.css.
If DESIGN.md, COMPONENTS.md, or the tailwind.theme.css import is missing, stop implementation and ask the developer to run the design-md skill first.
V2 additional checks, when relevant:
- If the target is responsive, confirm the breakpoint values are documented in
DESIGN.md## Layout, and that custom--breakpoint-*(if any) are declared inglobals.css. Use those values; never hardcode arbitrary pixel breakpoints. - If
COMPONENTS.mdmarks a needed componentshadcn, confirm whether it is installed before reusing it.
Implementation Targets
This skill supports two targets:
- Component-level implementation: a File A Figma component URL, such as a pending
Pricing Card, implemented into a shared component file. - Page-level implementation: a File B page frame URL, implemented into a route or page file using registered components.
Required Inputs
The developer must provide:
- Figma URL with
node-id. For a responsive target, provide one URL per breakpoint (see Responsive Implementation). - Target component, route, or file path to implement.
- Paths for
DESIGN.mdandCOMPONENTS.md.
Example developer instruction (single frame):
Figma URL: <url>
Target: components/sections/PricingCard.tsx or app/page.tsx
Use DESIGN.md, tailwind.theme.css, COMPONENTS.md.
Do not create new shared components unless existing components cannot express the design.
Example developer instruction (responsive, multiple frames):
같은 화면의 breakpoint별 프레임이야. 하나로 병합해서 반응형으로 구현해줘.
mobile : <File B frame URL with node-id>
tablet : <File B frame URL with node-id>
desktop : <File B frame URL with node-id>
Target: app/[route]/page.tsx
base=mobile, md:=tablet, lg:=desktop 차이만 덮어써줘.
Use DESIGN.md, tailwind.theme.css, COMPONENTS.md. breakpoint 값은 globals.css의 --breakpoint-* 기준.
Responsive Implementation (V2)
A Figma frame is a single fixed-size snapshot. Layout reflow across breakpoints lives in separate frames, and the agent does not automatically know that several frames are the same screen. Responsive merging requires three conditions:
- Multiple frames provided together — one frame per breakpoint for the same target, in a single request.
- Identity signal — the frames use the same File A component instances (same component key/name) or consistent layer naming, so corresponding nodes can be matched across breakpoints.
- Merge instruction — the developer states these are breakpoint variants of one screen.
When these hold, merge mobile-first:
- Read each frame's node tree via Figma MCP.
- Match corresponding nodes across the frames using component instance identity / layer names.
- Diff per-node responsive properties: width, height,
layoutMode(flex direction), wrap, gap, padding, alignment, visibility. - Emit base styles from the smallest breakpoint, then override only the differences at larger breakpoints using Tailwind breakpoint prefixes.
layoutMode: VERTICAL→flex-col;HORIZONTAL→flex-row. Example diff: mobileVERTICAL, desktopHORIZONTAL→flex-col lg:flex-row.itemSpacing→gap-*; sizing modes →w-full/w-fit/ fixedw-*with breakpoint prefixes.
- Use only token-backed or breakpoint-prefixed utilities. Breakpoint widths/values must trace to
DESIGN.md## Layout/globals.css--breakpoint-*; no hardcodedmin-width: 900px-style values.
If only a single frame is provided for a clearly responsive screen, implement what is given and report that the result is fixed to that breakpoint and that additional breakpoint frames are needed for responsive behavior — do not invent breakpoint behavior.
shadcn/ui Handling (V2)
Follow COMPONENTS.md origin information (shadcn, shadcn (customized), custom) for each node.
-
shadcn, already installed → reuse the existingcomponents/uiprimitive. Configure it via props/variants; do not re-style from scratch. -
shadcn, not yet installed → install the canonical component rather than hand-writing it:npx shadcn@latest add <name>Then update
COMPONENTS.md(pending→components/ui/<name>.tsx,Origin: shadcn) and use it. Do not author a standard shadcn primitive by hand. -
shadcn (customized)→ respect thedo not regenerateflag. Never re-runnpx shadcn addover it. Use the existing customized component and its local variant/prop API as recorded inCOMPONENTS.md. If a new customization is required, edit the existing file and update itsCOMPONENTS.mdnotes. -
custom→ follow the normal Lookup Order: reuse/extend if it exists, implement ifpending, or create with a recorded reason only when nothing existing can express it.
A Figma component is a design spec, not importable code. "Using the designer's component" means reading its structure/variants and mapping to existing code or implementing code from it — never importing the Figma node directly.
Implementation Workflow
- Collect the frame structure and assets through Figma MCP. For a responsive target, collect all provided breakpoint frames.
- Follow the
COMPONENTS.mdLookup Order exactly, honoring each entry'sOrigin. - Prefer reusing or extending existing components before adding route-local or new components.
- For shadcn nodes, reuse if installed, install-then-register if a standard shadcn component is missing, and respect
do not regeneratefor customized shadcn. - For component-level implementation, update the matching
COMPONENTS.mdentry frompendingto the implemented path after code is created. - For page-level implementation, reuse components already mapped in
COMPONENTS.mdbefore creating route-local code. - For responsive targets, merge the breakpoint frames mobile-first per the Responsive Implementation section.
- If a new component is necessary, record the reason before creating it.
- Report the implemented path, any
COMPONENTS.mdupdates (including newly installed shadcn paths), responsive coverage (which breakpoints were merged), and any blockers.
Tailwind Utility Canonicalization
When translating Figma CSS-like properties to Tailwind classes, prefer Tailwind's canonical utility families over arbitrary CSS property syntax. Arbitrary properties like [line-height:1.45] compile, but Tailwind tooling reports suggestCanonicalClasses when a canonical utility exists. Treat those warnings as implementation defects.
Use this mapping before writing code:
| Figma/CSS property | Prefer | Avoid |
|---|---|---|
line-height: 1.45 | leading-[1.45] | [line-height:1.45] |
font-size: 18px | text-[18px] or a token class such as text-button | [font-size:18px] |
letter-spacing: -0.5% | tracking-[...] or a token class such as tracking-body-md | [letter-spacing:...] |
width: 360px | w-[360px], max-w-[360px], or token-backed width | [width:360px] |
height: 240px | h-[240px] | [height:240px] |
border-radius: 6px | rounded-[6px] or token class such as rounded-xs | [border-radius:6px] |
Prefer project token classes from tailwind.theme.css first (text-*, leading-*, tracking-*, rounded-*, p-*, gap-*, border-*, bg-*). Use arbitrary value utilities like leading-[1.45] only when the exact value is not represented by a token. Use arbitrary CSS properties ([property:value]) only when Tailwind has no utility family for that property.
Before reporting completion, run the skill-provided checker against the files changed by the implementation. Do not add this checker to the target project. Resolve FIGMA_IMPLEMENT_SKILL_DIR from the parent directory of this loaded SKILL.md on the current machine (for example, via dirname on its actual path); do not assume a Codex, Claude, or user-specific install path. Then run:
node "$FIGMA_IMPLEMENT_SKILL_DIR/scripts/check-tailwind-canonical.mjs" \
--root . \
--files components/ui/example.tsx app/example/page.tsx
Pass only the files changed in the current implementation. If it reports replacements such as [line-height:1.45] -> leading-[1.45], update the component code and rerun the checker. If the project does not use Tailwind v4 tooling or cannot load @tailwindcss/node, report that the canonicalization check could not run and fall back to the project's normal lint/build.
Component Lookup Rules
Always follow the COMPONENTS.md Lookup Order. If COMPONENTS.md defines a project-specific order, it overrides any general expectation in this skill.
Create a new component only when:
- The semantic role is different.
- The accessibility behavior is different.
- The interaction model is different.
- The design cannot be expressed through existing props, variants, slots, or composition.
If an existing component can express the Figma design through configuration or composition, reuse or extend that component instead of adding a new shared component.
Quality Bar
- Every token value applied in code traces back to
DESIGN.mdortailwind.theme.css. No hardcoded hex, pixel, or font values. - Tailwind classes use canonical utilities when available; changed files pass
scripts/check-tailwind-canonical.mjsfrom this skill, and nosuggestCanonicalClasseswarnings remain for generated component code. - Responsive output uses breakpoint-prefixed utilities tied to documented breakpoints; no hardcoded pixel breakpoints.
- shadcn primitives are reused or installed via the shadcn CLI, never hand-rewritten; customized shadcn is never regenerated.
- Every shared component in the output exists in
COMPONENTS.mdor includes a written justification for its creation.