Figma Design Analyzer
Overview
Systematically analyze Figma designs and extract structured design specifications. This skill focuses on understanding design intent, extracting accurate properties, and creating comprehensive design specification documents that serve as blueprints for implementation.
Use this skill when:
- Analyzing Figma designs to understand structure and properties
- Extracting design tokens and component specifications
- Classifying components according to Atomic Design principles
- Creating design specification documents for developers
- Comparing existing implementations with Figma designs
Core Workflow
Step 1: Extract Figma Design Information
When given a Figma URL or node ID, use Figma MCP tools to extract design data:
Parse the Figma URL to extract node ID:
URL: https://figma.com/design/fileKey/fileName?node-id=1-2
Node ID: 1:2 (replace - with :)
Extract node design context:
mcp__figma-dev__get_design_context(
nodeId: "1:2",
dirForAssetWrites: "/absolute/path/to/project/public/assets",
clientLanguages: "typescript",
clientFrameworks: "react,nextjs"
)
This returns the design code, including HTML structure and CSS properties.
Get component metadata for structure overview:
mcp__figma-dev__get_metadata(
nodeId: "1:2",
clientLanguages: "typescript",
clientFrameworks: "react,nextjs"
)
Use this to understand the component hierarchy before detailed analysis.
Check for Figma variables (design tokens):
mcp__figma-dev__get_variable_defs(
nodeId: "1:2",
clientLanguages: "typescript",
clientFrameworks: "react,nextjs"
)
Extract design system tokens for colors, typography, spacing, etc.
Verify Code Connect mappings:
mcp__figma-dev__get_code_connect_map(
nodeId: "1:2",
clientLanguages: "typescript",
clientFrameworks: "react,nextjs"
)
Check if the component is already mapped to existing code.
Step 2: Handle Component Instances and Variants
Important: When the node is a component instance:
Identify if it's an instance:
- Check metadata for "component instance" type
- Note the main component ID
Get the main component:
- Use
get_design_context on the main component node
- Extract the base structure and properties
Extract instance-specific properties:
- Get the instance's specific size, device, and variant settings
- Note any overrides (text, images, colors, etc.)
Handle variants:
- If the main component uses variants, identify the variant mode
- Extract the correct variant values for the instance
- Document variant properties for props mapping
Step 3: Classify the Component
Use Atomic Design principles to classify the component:
Read the classification guide:
Read references/atomic-design-classification.md
Apply the decision tree:
- Atom: Indivisible, single purpose (button, input, icon, text label)
- Molecule: 2-5 atoms, simple combination (search bar, form field)
- Organism: Complex, multiple molecules/atoms (header, card, form)
Determine the component category:
- Document:
atomicCategory: Atom | Molecule | Organism
Step 4: Analyze Layout and Spacing
Extract accurate layout information:
Read layout analysis guide:
Read references/layout-analysis-guide.md
Determine layout method:
- Auto Layout → Flexbox
- Check: direction (row/column), justify-content, align-items
- Grid structure → CSS Grid
- Check: grid-template-columns, grid-template-rows, gap
- Overlapping elements → Absolute positioning
- Check: position, top, left, z-index
Extract spacing values:
Read references/spacing-extraction-guide.md
- Padding: Internal spacing (px, py, pt, pr, pb, pl)
- Gap: Spacing between flex/grid items
- Margin: External spacing (rarely used, prefer gap)
Map to Tailwind classes:
- Use standard Tailwind scale when possible (p-4, gap-6, etc.)
- Use arbitrary values
[value] for custom sizes (p-[18px])
Document in specification:
## Layout
- Method: Flexbox
- Direction: row
- Justify: center
- Align: center
## Spacing
- Padding: px-6 py-3
- Gap: gap-2
- Border Radius: rounded-lg
Step 5: Extract Typography
Extract accurate text styling:
Read typography guide:
Read references/typography-extraction-guide.md
Extract font properties:
- Font family (font-sans, font-serif, custom)
- Font size (text-sm, text-base, text-lg, etc.)
- Font weight (font-normal, font-semibold, font-bold)
- Line height (leading-tight, leading-normal, etc.)
- Letter spacing (tracking-tight, tracking-wide, etc.)
- Text color (text-gray-900, text-white, etc.)
- Text alignment (text-left, text-center, text-right)
- Text decoration (underline, line-through)
- Text transform (uppercase, lowercase, capitalize)
Map to Tailwind classes:
- Use standard Tailwind typography classes
- Check for design tokens in Figma variables
- Use arbitrary values for custom sizes
Document in specification:
## Typography
- Font: text-base font-semibold
- Color: text-white
- Line Height: leading-normal
- Alignment: text-center
Step 6: Choose Semantic HTML
Select appropriate HTML elements:
Read semantic HTML guide:
Read references/semantic-html-guide.md
Apply semantic rules:
- Sections:
<header>, <nav>, <main>, <aside>, <footer>
- Headings:
<h1> to <h6> (respect hierarchy)
- Interactive:
<button> for actions, <a> for navigation
- Content:
<article>, <section> for grouping
- Forms:
<form>, <input>, <label>, <select>, <textarea>
- Lists:
<ul>, <ol>, <li> for lists
- Media:
<img>, <video>, <audio>, <figure>, <figcaption>
Consider accessibility:
- Add ARIA attributes when semantic HTML is insufficient
- Ensure keyboard accessibility
- Verify color contrast ratios
Document in specification:
## Semantic HTML
- Root Element: button
- ARIA: role="button" aria-label="Submit"
Step 7: Extract Colors and Visual Properties
Extract color and visual styling:
Extract color properties:
- Background color (bg-blue-500, bg-gradient-to-r, etc.)
- Text color (text-white, text-gray-900, etc.)
- Border color (border-gray-300, etc.)
Extract visual properties:
- Border radius (rounded, rounded-lg, rounded-full, etc.)
- Border width (border, border-2, etc.)
- Box shadow (shadow, shadow-md, shadow-lg, etc.)
- Opacity (opacity-50, opacity-100, etc.)
Check Figma variables:
- Look for design token mappings
- Use semantic color names when available
Document in specification:
## Colors
- Background: bg-blue-500
- Hover: hover:bg-blue-600
- Text: text-white
- Border: border-transparent
## Visual Properties
- Border Radius: rounded-lg
- Shadow: shadow-md
Step 8: Handle Responsive Designs
When multiple Figma nodes represent different device sizes:
Extract all node IDs from provided URLs
- Desktop node
- Tablet node
- Mobile node
Analyze each node:
- Layout changes (grid columns, flex direction)
- Spacing changes
- Typography changes (font size, line height)
- Hidden/shown elements
Document responsive variations:
## Responsive Behavior
- Mobile (default): flex-col gap-4 text-sm
- Tablet (md): md:flex-row md:gap-6 md:text-base
- Desktop (lg): lg:gap-8 lg:text-lg
Step 9: Generate Design Specification Document
Create a comprehensive design specification:
Use Markdown format with front matter:
---
componentName: Button
atomicCategory: Atom
semanticElement: button
figmaNodeId: "123:456"
figmaUrl: "https://figma.com/design/..."
---
# Button Component Specification
## Overview
A primary action button component.
## Atomic Design Classification
- Category: Atom
- Reason: Single, indivisible interactive element
## Layout
- Method: Flexbox
- Direction: row
- Justify: center
- Align: center
## Spacing
- Padding: px-6 py-3
- Gap: gap-2
- Border Radius: rounded-lg
## Typography
- Font: text-base font-semibold
- Color: text-white
- Line Height: leading-normal
- Alignment: text-center
## Colors
- Background: bg-blue-500
- Hover: hover:bg-blue-600
- Active: active:bg-blue-700
- Disabled: disabled:bg-gray-300
## Visual Properties
- Border: border-transparent
- Shadow: shadow-md
- Transition: transition-colors duration-200
## Semantic HTML
- Root Element: button
- ARIA: aria-label when no text content
## Variants
- variant: primary | secondary | tertiary
- primary: bg-blue-500 text-white
- secondary: bg-white text-blue-500 border-blue-500
- tertiary: bg-transparent text-blue-500
- size: small | medium | large
- small: px-4 py-2 text-sm
- medium: px-6 py-3 text-base
- large: px-8 py-4 text-lg
## States
- Default: As specified above
- Hover: Darker background
- Active: Even darker background
- Disabled: Gray background, reduced opacity
- Focus: Ring outline for keyboard navigation
## Responsive Behavior
- Mobile: Full width, smaller padding
- Tablet: Inline, medium padding
- Desktop: Inline, larger padding
## Accessibility
- Keyboard: Focusable, Enter/Space to activate
- Screen Reader: Announced as "button"
- Color Contrast: WCAG AA compliant
## Assets
- Icons: /public/assets/icon-arrow.svg (if any)
- Images: None
## Notes
- Always use semantic <button> element
- Avoid using <a> styled as button
- Include loading state if used for async actions
Save the specification:
- Filename:
{ComponentName}.design.md
- Location:
/design-specs/ or project-specific location
Special Workflows
Comparing Design with Implementation
When asked to compare an existing component with Figma:
- Read the existing component code
- Extract Figma design properties using MCP tools
- Compare systematically:
- Layout method (Flexbox, Grid, etc.)
- Spacing values (padding, gap, margin)
- Typography (font size, weight, line height, color)
- Colors and backgrounds
- Border radius, shadows, etc.
- Generate a diff report:
## Design Differences Report
### Component: Button
#### Spacing
- Design: px-6 py-3 gap-2
- Implementation: px-4 py-2 gap-3
- Status: ❌ Mismatch
- Impact: Button appears smaller and less comfortable
#### Typography
- Design: text-base font-semibold
- Implementation: text-base font-semibold
- Status: ✅ Match
#### Colors
- Design: bg-blue-500 hover:bg-blue-600
- Implementation: bg-blue-600 hover:bg-blue-700
- Status: ❌ Mismatch
- Impact: Button is darker than intended
### Recommendations
1. Update padding to px-6 py-3
2. Update gap to gap-2
3. Update background colors to match design
- Document required changes in the specification
Breaking Down a Full Page
When given a full page Figma node:
Get page metadata to understand structure
Identify major sections:
- Header
- Hero
- Content sections
- Footer
For each section:
- Classify as Organism
- Identify child Molecules and Atoms
- Extract design properties
- Create individual specifications
Create component tree:
Page (Template)
├─ Header (Organism)
│ ├─ Logo (Atom)
│ ├─ Navigation (Molecule)
│ └─ UserMenu (Molecule)
├─ Hero (Organism)
│ ├─ Heading (Atom)
│ ├─ Paragraph (Atom)
│ └─ CTAButton (Atom)
├─ Features (Organism)
│ └─ FeatureCard (Molecule) × 3
│ ├─ Icon (Atom)
│ ├─ Title (Atom)
│ └─ Description (Atom)
└─ Footer (Organism)
├─ Logo (Atom)
└─ Links (Molecule)
Generate specifications from bottom-up:
- Create Atom specifications first
- Build Molecule specifications
- Assemble Organism specifications
- Compose Page specification with assembly instructions
Best Practices
Always read guides before starting:
- Layout analysis guide for layout decisions
- Spacing guide for accurate spacing extraction
- Typography guide for text styling
- Atomic Design guide for classification
- Semantic HTML guide for element selection
Prioritize pixel-perfect accuracy:
- Use exact spacing values from Figma
- Match typography precisely
- Verify colors match design tokens
Document thoroughly:
- Include all variants and states
- Document responsive behavior
- Note accessibility considerations
- Include designer notes if available
Consider implementation:
- Map to Tailwind classes for easy implementation
- Document component hierarchy
- Note any complex interactions
Maintain consistency:
- Use consistent naming conventions
- Follow project-specific patterns
- Align with design system when available
Resources
This skill includes comprehensive guides:
references/
- layout-analysis-guide.md: Criteria for choosing Flexbox, Grid, absolute positioning
- spacing-extraction-guide.md: Methods for extracting padding, gap, margin values
- typography-extraction-guide.md: Guide for extracting font properties
- atomic-design-classification.md: Classification criteria for Atoms, Molecules, Organisms
- semantic-html-guide.md: Recommendations for choosing appropriate HTML elements
Usage: Always read relevant guides before starting analysis to ensure accuracy.
Common Pitfalls
Not handling component instances properly:
- Always get the main component when working with instances
- Extract instance-specific properties separately
Ignoring variants:
- Check for variant properties in Figma
- Document all variant options
Using wrong layout method:
- Read the layout guide
- Don't default to Flexbox for everything
Skipping semantic HTML:
- Don't use
<div> for everything
- Consider accessibility and SEO
Forgetting responsive behavior:
- Check for responsive variants in Figma
- Document breakpoint changes
Not checking existing code:
- Always check Code Connect mappings
- Avoid duplicating existing specifications
Output Format
The final output should be a Markdown document with:
- Front matter with metadata
- Overview section
- Design properties organized by category
- Variants and states documentation
- Responsive behavior notes
- Accessibility considerations
- Assets references
- Implementation notes
This specification document will be used by the nextjs-react-implementation skill to generate actual code.
This skill systematically analyzes Figma designs and creates structured specifications for accurate implementation.
1---2name: figma-design-analyzer3description: Extract and analyze Figma designs to create structured design specifications. Use this skill when you need to analyze Figma nodes, extract design properties (layout, spacing, typography), classify components using Atomic Design principles, and generate design specification documents that can be used for implementation.4---5
6# Figma Design Analyzer
7
8## Overview
9
10Systematically analyze Figma designs and extract structured design specifications. This skill focuses on understanding design intent, extracting accurate properties, and creating comprehensive design specification documents that serve as blueprints for implementation.
11
12**Use this skill when:**
13- Analyzing Figma designs to understand structure and properties
14- Extracting design tokens and component specifications
15- Classifying components according to Atomic Design principles
16- Creating design specification documents for developers
17- Comparing existing implementations with Figma designs
18
19## Core Workflow
20
21### Step 1: Extract Figma Design Information
22
23When given a Figma URL or node ID, use Figma MCP tools to extract design data:
24
251. **Parse the Figma URL to extract node ID:**
26 ```
27 URL: https://figma.com/design/fileKey/fileName?node-id=1-2
28 Node ID: 1:2 (replace - with :)
29 ```
30
312. **Extract node design context:**
32 ```
33 mcp__figma-dev__get_design_context(
34 nodeId: "1:2",
35 dirForAssetWrites: "/absolute/path/to/project/public/assets",
36 clientLanguages: "typescript",
37 clientFrameworks: "react,nextjs"
38 )
39 ```
40 This returns the design code, including HTML structure and CSS properties.
41
423. **Get component metadata for structure overview:**
43 ```
44 mcp__figma-dev__get_metadata(
45 nodeId: "1:2",
46 clientLanguages: "typescript",
47 clientFrameworks: "react,nextjs"
48 )
49 ```
50 Use this to understand the component hierarchy before detailed analysis.
51
524. **Check for Figma variables (design tokens):**
53 ```
54 mcp__figma-dev__get_variable_defs(
55 nodeId: "1:2",
56 clientLanguages: "typescript",
57 clientFrameworks: "react,nextjs"
58 )
59 ```
60 Extract design system tokens for colors, typography, spacing, etc.
61
625. **Verify Code Connect mappings:**
63 ```
64 mcp__figma-dev__get_code_connect_map(
65 nodeId: "1:2",
66 clientLanguages: "typescript",
67 clientFrameworks: "react,nextjs"
68 )
69 ```
70 Check if the component is already mapped to existing code.
71
72### Step 2: Handle Component Instances and Variants
73
74**Important:** When the node is a component instance:
75
761. **Identify if it's an instance:**
77 - Check metadata for "component instance" type
78 - Note the main component ID
79
802. **Get the main component:**
81 - Use `get_design_context` on the main component node
82 - Extract the base structure and properties
83
843. **Extract instance-specific properties:**
85 - Get the instance's specific size, device, and variant settings
86 - Note any overrides (text, images, colors, etc.)
87
884. **Handle variants:**
89 - If the main component uses variants, identify the variant mode
90 - Extract the correct variant values for the instance
91 - Document variant properties for props mapping
92
93### Step 3: Classify the Component
94
95Use Atomic Design principles to classify the component:
96
971. **Read the classification guide:**
98 ```
99 Read references/atomic-design-classification.md
100 ```
101
1022. **Apply the decision tree:**
103 - **Atom**: Indivisible, single purpose (button, input, icon, text label)
104 - **Molecule**: 2-5 atoms, simple combination (search bar, form field)
105 - **Organism**: Complex, multiple molecules/atoms (header, card, form)
106
1073. **Determine the component category:**
108 - Document: `atomicCategory: Atom | Molecule | Organism`
109
110### Step 4: Analyze Layout and Spacing
111
112Extract accurate layout information:
113
1141. **Read layout analysis guide:**
115 ```
116 Read references/layout-analysis-guide.md
117 ```
118
1192. **Determine layout method:**
120 - **Auto Layout** → Flexbox
121 - Check: direction (row/column), justify-content, align-items
122 - **Grid structure** → CSS Grid
123 - Check: grid-template-columns, grid-template-rows, gap
124 - **Overlapping elements** → Absolute positioning
125 - Check: position, top, left, z-index
126
1273. **Extract spacing values:**
128 ```
129 Read references/spacing-extraction-guide.md
130 ```
131 - **Padding**: Internal spacing (px, py, pt, pr, pb, pl)
132 - **Gap**: Spacing between flex/grid items
133 - **Margin**: External spacing (rarely used, prefer gap)
134
1354. **Map to Tailwind classes:**
136 - Use standard Tailwind scale when possible (p-4, gap-6, etc.)
137 - Use arbitrary values `[value]` for custom sizes (p-[18px])
138
1395. **Document in specification:**
140 ```markdown
141 ## Layout
142 - Method: Flexbox
143 - Direction: row
144 - Justify: center
145 - Align: center
146
147 ## Spacing
148 - Padding: px-6 py-3
149 - Gap: gap-2
150 - Border Radius: rounded-lg
151 ```
152
153### Step 5: Extract Typography
154
155Extract accurate text styling:
156
1571. **Read typography guide:**
158 ```
159 Read references/typography-extraction-guide.md
160 ```
161
1622. **Extract font properties:**
163 - Font family (font-sans, font-serif, custom)
164 - Font size (text-sm, text-base, text-lg, etc.)
165 - Font weight (font-normal, font-semibold, font-bold)
166 - Line height (leading-tight, leading-normal, etc.)
167 - Letter spacing (tracking-tight, tracking-wide, etc.)
168 - Text color (text-gray-900, text-white, etc.)
169 - Text alignment (text-left, text-center, text-right)
170 - Text decoration (underline, line-through)
171 - Text transform (uppercase, lowercase, capitalize)
172
1733. **Map to Tailwind classes:**
174 - Use standard Tailwind typography classes
175 - Check for design tokens in Figma variables
176 - Use arbitrary values for custom sizes
177
1784. **Document in specification:**
179 ```markdown
180 ## Typography
181 - Font: text-base font-semibold
182 - Color: text-white
183 - Line Height: leading-normal
184 - Alignment: text-center
185 ```
186
187### Step 6: Choose Semantic HTML
188
189Select appropriate HTML elements:
190
1911. **Read semantic HTML guide:**
192 ```
193 Read references/semantic-html-guide.md
194 ```
195
1962. **Apply semantic rules:**
197 - **Sections**: `<header>`, `<nav>`, `<main>`, `<aside>`, `<footer>`
198 - **Headings**: `<h1>` to `<h6>` (respect hierarchy)
199 - **Interactive**: `<button>` for actions, `<a>` for navigation
200 - **Content**: `<article>`, `<section>` for grouping
201 - **Forms**: `<form>`, `<input>`, `<label>`, `<select>`, `<textarea>`
202 - **Lists**: `<ul>`, `<ol>`, `<li>` for lists
203 - **Media**: `<img>`, `<video>`, `<audio>`, `<figure>`, `<figcaption>`
204
2053. **Consider accessibility:**
206 - Add ARIA attributes when semantic HTML is insufficient
207 - Ensure keyboard accessibility
208 - Verify color contrast ratios
209
2104. **Document in specification:**
211 ```markdown
212 ## Semantic HTML
213 - Root Element: button
214 - ARIA: role="button" aria-label="Submit"
215 ```
216
217### Step 7: Extract Colors and Visual Properties
218
219Extract color and visual styling:
220
2211. **Extract color properties:**
222 - Background color (bg-blue-500, bg-gradient-to-r, etc.)
223 - Text color (text-white, text-gray-900, etc.)
224 - Border color (border-gray-300, etc.)
225
2262. **Extract visual properties:**
227 - Border radius (rounded, rounded-lg, rounded-full, etc.)
228 - Border width (border, border-2, etc.)
229 - Box shadow (shadow, shadow-md, shadow-lg, etc.)
230 - Opacity (opacity-50, opacity-100, etc.)
231
2323. **Check Figma variables:**
233 - Look for design token mappings
234 - Use semantic color names when available
235
2364. **Document in specification:**
237 ```markdown
238 ## Colors
239 - Background: bg-blue-500
240 - Hover: hover:bg-blue-600
241 - Text: text-white
242 - Border: border-transparent
243
244 ## Visual Properties
245 - Border Radius: rounded-lg
246 - Shadow: shadow-md
247 ```
248
249### Step 8: Handle Responsive Designs
250
251When multiple Figma nodes represent different device sizes:
252
2531. **Extract all node IDs** from provided URLs
254 - Desktop node
255 - Tablet node
256 - Mobile node
257
2582. **Analyze each node:**
259 - Layout changes (grid columns, flex direction)
260 - Spacing changes
261 - Typography changes (font size, line height)
262 - Hidden/shown elements
263
2643. **Document responsive variations:**
265 ```markdown
266 ## Responsive Behavior
267 - Mobile (default): flex-col gap-4 text-sm
268 - Tablet (md): md:flex-row md:gap-6 md:text-base
269 - Desktop (lg): lg:gap-8 lg:text-lg
270 ```
271
272### Step 9: Generate Design Specification Document
273
274Create a comprehensive design specification:
275
2761. **Use Markdown format with front matter:**
277 ```markdown
278 ---
279 componentName: Button
280 atomicCategory: Atom
281 semanticElement: button
282 figmaNodeId: "123:456"
283 figmaUrl: "https://figma.com/design/..."
284 ---
285
286 # Button Component Specification
287
288 ## Overview
289 A primary action button component.
290
291 ## Atomic Design Classification
292 - Category: Atom
293 - Reason: Single, indivisible interactive element
294
295 ## Layout
296 - Method: Flexbox
297 - Direction: row
298 - Justify: center
299 - Align: center
300
301 ## Spacing
302 - Padding: px-6 py-3
303 - Gap: gap-2
304 - Border Radius: rounded-lg
305
306 ## Typography
307 - Font: text-base font-semibold
308 - Color: text-white
309 - Line Height: leading-normal
310 - Alignment: text-center
311
312 ## Colors
313 - Background: bg-blue-500
314 - Hover: hover:bg-blue-600
315 - Active: active:bg-blue-700
316 - Disabled: disabled:bg-gray-300
317
318 ## Visual Properties
319 - Border: border-transparent
320 - Shadow: shadow-md
321 - Transition: transition-colors duration-200
322
323 ## Semantic HTML
324 - Root Element: button
325 - ARIA: aria-label when no text content
326
327 ## Variants
328 - variant: primary | secondary | tertiary
329 - primary: bg-blue-500 text-white
330 - secondary: bg-white text-blue-500 border-blue-500
331 - tertiary: bg-transparent text-blue-500
332 - size: small | medium | large
333 - small: px-4 py-2 text-sm
334 - medium: px-6 py-3 text-base
335 - large: px-8 py-4 text-lg
336
337 ## States
338 - Default: As specified above
339 - Hover: Darker background
340 - Active: Even darker background
341 - Disabled: Gray background, reduced opacity
342 - Focus: Ring outline for keyboard navigation
343
344 ## Responsive Behavior
345 - Mobile: Full width, smaller padding
346 - Tablet: Inline, medium padding
347 - Desktop: Inline, larger padding
348
349 ## Accessibility
350 - Keyboard: Focusable, Enter/Space to activate
351 - Screen Reader: Announced as "button"
352 - Color Contrast: WCAG AA compliant
353
354 ## Assets
355 - Icons: /public/assets/icon-arrow.svg (if any)
356 - Images: None
357
358 ## Notes
359 - Always use semantic <button> element
360 - Avoid using <a> styled as button
361 - Include loading state if used for async actions
362 ```
363
3642. **Save the specification:**
365 - Filename: `{ComponentName}.design.md`
366 - Location: `/design-specs/` or project-specific location
367
368## Special Workflows
369
370### Comparing Design with Implementation
371
372When asked to compare an existing component with Figma:
373
3741. **Read the existing component code**
3752. **Extract Figma design properties** using MCP tools
3763. **Compare systematically:**
377 - Layout method (Flexbox, Grid, etc.)
378 - Spacing values (padding, gap, margin)
379 - Typography (font size, weight, line height, color)
380 - Colors and backgrounds
381 - Border radius, shadows, etc.
3824. **Generate a diff report:**
383 ```markdown
384 ## Design Differences Report
385
386 ### Component: Button
387
388 #### Spacing
389 - Design: px-6 py-3 gap-2
390 - Implementation: px-4 py-2 gap-3
391 - Status: ❌ Mismatch
392 - Impact: Button appears smaller and less comfortable
393
394 #### Typography
395 - Design: text-base font-semibold
396 - Implementation: text-base font-semibold
397 - Status: ✅ Match
398
399 #### Colors
400 - Design: bg-blue-500 hover:bg-blue-600
401 - Implementation: bg-blue-600 hover:bg-blue-700
402 - Status: ❌ Mismatch
403 - Impact: Button is darker than intended
404
405 ### Recommendations
406 1. Update padding to px-6 py-3
407 2. Update gap to gap-2
408 3. Update background colors to match design
409 ```
4105. **Document required changes** in the specification
411
412### Breaking Down a Full Page
413
414When given a full page Figma node:
415
4161. **Get page metadata** to understand structure
4172. **Identify major sections:**
418 - Header
419 - Hero
420 - Content sections
421 - Footer
422
4233. **For each section:**
424 - Classify as Organism
425 - Identify child Molecules and Atoms
426 - Extract design properties
427 - Create individual specifications
428
4294. **Create component tree:**
430 ```
431 Page (Template)
432 ├─ Header (Organism)
433 │ ├─ Logo (Atom)
434 │ ├─ Navigation (Molecule)
435 │ └─ UserMenu (Molecule)
436 ├─ Hero (Organism)
437 │ ├─ Heading (Atom)
438 │ ├─ Paragraph (Atom)
439 │ └─ CTAButton (Atom)
440 ├─ Features (Organism)
441 │ └─ FeatureCard (Molecule) × 3
442 │ ├─ Icon (Atom)
443 │ ├─ Title (Atom)
444 │ └─ Description (Atom)
445 └─ Footer (Organism)
446 ├─ Logo (Atom)
447 └─ Links (Molecule)
448 ```
449
4505. **Generate specifications from bottom-up:**
451 - Create Atom specifications first
452 - Build Molecule specifications
453 - Assemble Organism specifications
454 - Compose Page specification with assembly instructions
455
456## Best Practices
457
4581. **Always read guides before starting:**
459 - Layout analysis guide for layout decisions
460 - Spacing guide for accurate spacing extraction
461 - Typography guide for text styling
462 - Atomic Design guide for classification
463 - Semantic HTML guide for element selection
464
4652. **Prioritize pixel-perfect accuracy:**
466 - Use exact spacing values from Figma
467 - Match typography precisely
468 - Verify colors match design tokens
469
4703. **Document thoroughly:**
471 - Include all variants and states
472 - Document responsive behavior
473 - Note accessibility considerations
474 - Include designer notes if available
475
4764. **Consider implementation:**
477 - Map to Tailwind classes for easy implementation
478 - Document component hierarchy
479 - Note any complex interactions
480
4815. **Maintain consistency:**
482 - Use consistent naming conventions
483 - Follow project-specific patterns
484 - Align with design system when available
485
486## Resources
487
488This skill includes comprehensive guides:
489
490### references/
491
492- **layout-analysis-guide.md**: Criteria for choosing Flexbox, Grid, absolute positioning
493- **spacing-extraction-guide.md**: Methods for extracting padding, gap, margin values
494- **typography-extraction-guide.md**: Guide for extracting font properties
495- **atomic-design-classification.md**: Classification criteria for Atoms, Molecules, Organisms
496- **semantic-html-guide.md**: Recommendations for choosing appropriate HTML elements
497
498**Usage:** Always read relevant guides before starting analysis to ensure accuracy.
499
500## Common Pitfalls
501
5021. **Not handling component instances properly:**
503 - Always get the main component when working with instances
504 - Extract instance-specific properties separately
505
5062. **Ignoring variants:**
507 - Check for variant properties in Figma
508 - Document all variant options
509
5103. **Using wrong layout method:**
511 - Read the layout guide
512 - Don't default to Flexbox for everything
513
5144. **Skipping semantic HTML:**
515 - Don't use `<div>` for everything
516 - Consider accessibility and SEO
517
5185. **Forgetting responsive behavior:**
519 - Check for responsive variants in Figma
520 - Document breakpoint changes
521
5226. **Not checking existing code:**
523 - Always check Code Connect mappings
524 - Avoid duplicating existing specifications
525
526## Output Format
527
528The final output should be a Markdown document with:
529
5301. **Front matter** with metadata
5312. **Overview** section
5323. **Design properties** organized by category
5334. **Variants and states** documentation
5345. **Responsive behavior** notes
5356. **Accessibility** considerations
5367. **Assets** references
5378. **Implementation notes**
538
539This specification document will be used by the `nextjs-react-implementation` skill to generate actual code.
540
541---
542
543**This skill systematically analyzes Figma designs and creates structured specifications for accurate implementation.**