This skill converts Figma designs into production-ready Next.js components with pixel-perfect accuracy and automated visual validation.
npx playbooks add skill corlab-tech/skills --skill pixel-perfect-ui
Autonomous workflow for converting Figma designs to production-ready, pixel-perfect React/Next.js implementations with visual validation.
This skill MUST be invoked automatically when the user requests ANY of:
---
CRITICAL: Before ANY implementation, you MUST:
First, get the full page/component from Figma and identify ALL sections:
mcp0_get_design_context --nodeId <page-node-id>
mcp0_get_metadata --nodeId <page-node-id>
List all sections/blocks in the design (e.g., Header, Hero, Features, CTA, Footer).
Create a markdown checklist file at .windsurf/implementation-checklist.md:
# Implementation Checklist: [Component/Page Name]
**Created**: [Date]
**Figma Source**: [URL or Node ID]
**Target Path**: [e.g., src/app/page.tsx or src/components/MyComponent.tsx]
**Status**: 🟡 Pending Approval
---
## 📋 Sections to Implement
[List each section identified from Figma]
1. **Section Name 1** (node-id: xxx)
2. **Section Name 2** (node-id: xxx)
3. **Section Name 3** (node-id: xxx)
...
---
## 🔄 SECTION-BY-SECTION IMPLEMENTATION
> ⚠️ **CRITICAL RULE**: For EACH section below:
> 1. First EXTRACT fresh Figma data for that specific section
> 2. Then IMPLEMENT based on that fresh extraction
> 3. Mark section complete
> 4. Move to next section
>
> **NEVER rely on old/cached Figma data. Always re-extract before implementing!**
---
### Section 1: [Section Name]
**Node ID**: [figma-node-id]
**Status**: ⬜ Not Started
#### 1.1 Extract from Figma
- [ ] mcp0_get_design_context for this section
- [ ] mcp0_get_screenshot for visual reference
- [ ] Export any images/assets needed
- [ ] Note typography, colors, spacing
#### 1.2 Implement
- [ ] Create/update component structure
- [ ] Implement desktop layout (1440px)
- [ ] Implement tablet layout (768px)
- [ ] Implement mobile layout (375px)
- [ ] Add images with Next.js Image
- [ ] Apply styles (typography, colors, spacing)
#### 1.3 Validate
- [ ] Visual check matches Figma
- [ ] Responsive on all viewports
- [ ] No horizontal scroll
✅ **Section 1 Complete**: [ ]
---
### Section 2: [Section Name]
**Node ID**: [figma-node-id]
**Status**: ⬜ Not Started
#### 2.1 Extract from Figma
- [ ] mcp0_get_design_context for this section
- [ ] mcp0_get_screenshot for visual reference
- [ ] Export any images/assets needed
- [ ] Note typography, colors, spacing
#### 2.2 Implement
- [ ] Create/update component structure
- [ ] Implement desktop layout (1440px)
- [ ] Implement tablet layout (768px)
- [ ] Implement mobile layout (375px)
- [ ] Add images with Next.js Image
- [ ] Apply styles (typography, colors, spacing)
#### 2.3 Validate
- [ ] Visual check matches Figma
- [ ] Responsive on all viewports
- [ ] No horizontal scroll
✅ **Section 2 Complete**: [ ]
---
[Repeat for each section...]
---
## 🏁 Final Validation
- [ ] All sections implemented
- [ ] Full page visual comparison
- [ ] Resource validation passed (no broken links/images)
- [ ] Production checklist complete
---
## 📝 Notes
[Add any specific notes here]
---
## ✅ Completion Summary
**Completed**: [Date when finished]
**Final Status**: [Pending/Complete]
After creating the checklist, ALWAYS:
.windsurf/implementation-checklist.md with X sections. Should I proceed?"FOR EACH SECTION (in order):
┌─────────────────────────────────────────────────────┐
│ SECTION WORKFLOW (repeat for each section) │
├─────────────────────────────────────────────────────┤
│ 1. 📥 EXTRACT: Get fresh Figma data for section │
│ - mcp0_get_design_context --nodeId <section-id> │
│ - mcp0_get_screenshot --nodeId <section-id> │
│ - Export images if needed │
│ │
│ 2. 🔨 IMPLEMENT: Build based on fresh extraction │
│ - Use the data you JUST extracted │
│ - Do NOT use old/cached data │
│ - Implement responsive (desktop→tablet→mobile) │
│ │
│ 3. ✅ VALIDATE: Check section matches Figma │
│ │
│ 4. 📝 UPDATE CHECKLIST: Mark items [x] complete │
│ │
│ 5. ➡️ MOVE TO NEXT SECTION │
└─────────────────────────────────────────────────────┘
CRITICAL:
As you complete each section:
- [ ] to - [x] for completed items---
w-[1728px], width: 1728px)max-w-7xl, percentages, or viewport unitsoverflow-x-hidden on body if neededmax-w-[size] mx-auto px-4 sm:px-6 lg:px-8> ⚠️ REMINDER: Always complete Phase 0 (Checklist Creation) before starting these steps!
Extract comprehensive design data from Figma:
# Get design context and code
mcp0_get_design_context --nodeId <node-id>
mcp0_get_variable_defs --nodeId <node-id>
mcp0_get_screenshot --nodeId <node-id>
Parse extracted data for:
Detect project configuration:
Map Figma tokens to existing project tokens.
Generate component with extracted values:
// For complex layouts, use references/layout-patterns.md
// For component patterns, use references/component-patterns.md
// For responsive patterns, use references/responsive-patterns.md
STRICT Implementation Rules:
w-[1728px], width: 1728pxmax-w-7xl mx-auto px-4sm:, md:, lg:, xl:Image Handling:
// 1. Export from Figma
mcp0_get_screenshot --nodeId <id> --filename "hero-image.png"
// 2. Save to public/assets/
// 3. Use with Next Image
<Image src="/assets/hero-image.png" alt="..." width={...} height={...} />
Mandatory: Run validation on ALL viewports:
# Desktop validation
python scripts/visual-compare.py --viewport 1440x900
# Tablet validation
python scripts/visual-compare.py --viewport 768x1024
# Mobile validation (CRITICAL)
python scripts/visual-compare.py --viewport 375x667
# Responsive issues check
python scripts/responsive-validation.py --url <url>
# Resource validation (CRITICAL - Run before deployment)
python scripts/resource-validator.py --directory src/app --strict
Validation Requirements:
Common Failures to Fix:
Extract breakpoint variations from Figma:
Apply responsive rules using project's breakpoint system.
python scripts/extract-and-implement.py --figma-url <url> --output-path <path>
python scripts/extract-component.py --node-id <id> --component-name <name>
python scripts/visual-compare.py --implementation-url <url> --figma-node <id>
# Validate single file
python scripts/resource-validator.py --file src/app/page.tsx
# Validate entire app (REQUIRED before production)
python scripts/resource-validator.py --directory src/app --strict --report validation-report.txt
app/[route]/page.tsxpages/[route].tsxcomponents/ui/[component].tsxpublic/assets/ or src/assets/styles/See references/token-mapping.md for:
See references/component-patterns.md for:
Acceptable differences:
Must match exactly:
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.