Claude
Skills
Sign in
โ† Back

figma-integration

Included with Lifetime
$97 forever

Guides design-to-code workflow using Figma integration. Helps extract designs, analyze components, and generate implementation specs. Auto-activates when users mention Figma URLs, design implementation, component conversion, or design-to-code workflows. Works with /ccpm:plan, design-approve, design-refine, and /ccpm:figma-refresh commands.

Ads & Marketing

What this skill does


# Figma Integration Skill

Transform Figma designs into implementation-ready specifications with CCPM's design-to-code workflow.

## When This Skill Activates

This skill auto-activates when:

- User mentions **"Figma"** or **"design"** in implementation context
- User asks about **"component"**, **"design system"**, or **"design tokens"**
- Running **`/ccpm:plan`** (starts design process)
- Running **`/ccpm:plan`** (refine designs)
- Running **`/ccpm:plan`** (generate specs)
- Running **`/ccpm:figma-refresh`** (refresh cached designs)
- User mentions **"design-to-code"**, **"design file"**, or **"Figma component"**

## The Figma Workflow

### Phase 1: Design Phase

**Command**: `/ccpm:plan ISSUE-ID`

Start the design process by attaching Figma links to your Linear issue:

```
1. Create/update Linear issue with task description
2. Attach Figma design link in issue description
3. Run /ccpm:plan TASK-123
4. CCPM extracts design metadata and creates options
```

**What happens**:
- Detects Figma links from issue and related documents
- Analyzes design file metadata (frames, components, assets)
- Extracts design tokens (colors, typography, spacing)
- Creates visual options or wireframes
- Caches design data for instant access

**Example**:
```
/ccpm:plan PSN-123

โœ… Detected Figma link: https://figma.com/file/ABC123/UserDashboard
๐Ÿ“ฆ Design Analysis:
   - 12 frames found
   - 15 components detected
   - Color palette: 8 colors
   - Typography: 4 font families
   - Spacing pattern: 4px, 8px, 16px grid

Ready for design review. Run: /ccpm:plan PSN-123
```

### Phase 2: Refinement Phase

**Command**: `/ccpm:plan ISSUE-ID [OPTION] [FEEDBACK]`

Iterate on designs based on feedback:

```
1. Review design options from Phase 1
2. Provide feedback or request changes
3. Run /ccpm:plan TASK-123 "feedback"
4. CCPM creates refined design options
```

**What happens**:
- Analyzes your feedback
- Generates refined design variations
- Adjusts colors, layout, or components
- Updates design cache with new versions
- Shows side-by-side comparisons

**Example**:
```
/ccpm:plan PSN-123 1 "Make the buttons larger, use primary color"

๐ŸŽจ Refining Design Option 1...

Changes applied:
- Button height: 36px โ†’ 44px
- Button color: #6366F1 โ†’ primary color
- Button spacing: 12px โ†’ 16px

Preview: [design-option-1-v2]

Ready for approval? Run: /ccpm:plan PSN-123 1
```

### Phase 3: Approval & Spec Generation

**Command**: `/ccpm:plan ISSUE-ID OPTION-NUMBER`

Approve final design and generate implementation specifications:

```
1. Review refined design options
2. Choose best option
3. Run /ccpm:plan TASK-123 1
4. CCPM generates comprehensive specs
```

**What happens**:
- Locks design as final reference
- Extracts component specifications
- Generates implementation specs with:
  - Component breakdown
  - Props and state recommendations
  - Styling specifications
  - Accessibility guidelines
  - Responsive design rules
- Creates Linear Document with specs
- Updates issue description with spec link

**Example**:
```
/ccpm:plan PSN-123 1

โœ… Design Approved!

Generated Implementation Specs:
๐Ÿ“„ Component Specifications
๐Ÿ“„ Styling Guidelines
๐Ÿ“„ Responsive Rules
๐Ÿ“„ Accessibility Checklist

Specs saved to: https://linear.app/doc/ABC123
Ready for implementation!
```

### Phase 4: Cache Management

**Command**: `/ccpm:figma-refresh ISSUE-ID`

Refresh cached design data when designs change:

```
1. Update Figma designs
2. Run /ccpm:figma-refresh TASK-123
3. CCPM re-extracts design data
4. Cache is updated with latest designs
```

**When to refresh**:
- Design significantly changed
- New components added to Figma
- Colors or typography updated
- Design tokens modified
- Last refresh was >1 hour ago (cache TTL)

## Design Analysis Deep Dive

### What CCPM Extracts From Figma

**Component Structure**:
```
Dashboard
โ”œโ”€โ”€ Header
โ”‚   โ”œโ”€โ”€ Logo
โ”‚   โ”œโ”€โ”€ Navigation
โ”‚   โ””โ”€โ”€ UserMenu
โ”œโ”€โ”€ Sidebar
โ”‚   โ”œโ”€โ”€ NavItems
โ”‚   โ””โ”€โ”€ UserProfile
โ””โ”€โ”€ MainContent
    โ”œโ”€โ”€ Cards
    โ””โ”€โ”€ Charts
```

**Design Tokens**:
- Color palette with hex/RGB values
- Typography: font families, sizes, weights
- Spacing: margin, padding, gap values
- Shadows and effects
- Border radius patterns

**Component Metadata**:
- Frame dimensions (width, height)
- Layout type (flex, grid, auto)
- Constraints and responsive behavior
- Text content and styles
- Image assets and sizing

### Component Detection

CCPM automatically identifies:

1. **UI Components**: Buttons, inputs, cards, modals, etc.
2. **Layout Components**: Headers, sidebars, grids, etc.
3. **Screens/Pages**: Full page layouts with multiple components
4. **Variants**: Different states (hover, active, disabled)
5. **Assets**: Icons, images, and design patterns

**Example detection**:
```
Frame: "Button / Primary / Large"
โ”œโ”€โ”€ Detection: UI Component (Button)
โ”œโ”€โ”€ Style: Primary (blue)
โ”œโ”€โ”€ Size: Large (44px height)
โ”œโ”€โ”€ State: Default
โ””โ”€โ”€ Variations: [Hover, Active, Disabled]
```

## Implementation Specification Generation

### What Gets Generated

When you approve a design, CCPM creates specs including:

**1. Component Definition**
```
Component: PrimaryButton
Props:
  - label: string (required)
  - size: "sm" | "md" | "lg" (default: "md")
  - disabled: boolean (default: false)
  - onClick: () => void
  - icon?: React.ReactNode

State:
  - loading: boolean
  - hover: boolean
  - focus: boolean
```

**2. Visual Specifications**
```
Sizing:
  - Small: 32px height
  - Medium: 40px height
  - Large: 44px height

Spacing:
  - Horizontal padding: 16px
  - Vertical padding: 8px

Typography:
  - Font: Inter
  - Weight: 600 (semibold)
  - Size: 14px

Colors:
  - Background: #6366F1
  - Text: #FFFFFF
  - Hover: #4F46E5
```

**3. Responsive Rules**
```
Breakpoints:
  - Mobile (< 768px): Single column
  - Tablet (768px - 1024px): Two columns
  - Desktop (> 1024px): Three columns

Mobile adjustments:
  - Button height: 40px โ†’ 36px
  - Padding: 16px โ†’ 12px
  - Font size: 14px โ†’ 12px
```

**4. Accessibility Checklist**
```
WCAG 2.1 AA Compliance:
- [ ] Color contrast ratio โ‰ฅ 4.5:1 for text
- [ ] Button hit target โ‰ฅ 44x44px
- [ ] Focus indicators visible
- [ ] ARIA labels for icons
- [ ] Keyboard navigation support
```

## Practical Examples

### Example 1: Simple Button Component

**Start the workflow**:
```
1. Create Linear issue: PSN-100 "Design primary button"
2. Add Figma link to issue description:
   https://figma.com/file/ABC123/Components?node-id=15:2
3. Run: /ccpm:plan PSN-100
```

**Design phase output**:
```
โœ… Design Analysis Complete

Component: Button / Primary
โ”œโ”€โ”€ Size: 44px height
โ”œโ”€โ”€ Color: #6366F1
โ”œโ”€โ”€ Typography: Inter, 600, 14px
โ””โ”€โ”€ States: Default, Hover, Active, Disabled

Generated specs location: [Linear Document]
Ready for implementation.
```

**Developer implements**:
```tsx
export function PrimaryButton({ label, onClick }) {
  return (
    <button
      onClick={onClick}
      className="h-11 px-4 bg-indigo-600 text-white font-semibold
                 rounded hover:bg-indigo-700 focus:outline-none
                 focus:ring-2 focus:ring-indigo-500"
    >
      {label}
    </button>
  );
}
```

### Example 2: Dashboard Page

**Complex multi-component design**:
```
1. Create issue: PSN-200 "Design dashboard page"
2. Add Figma file: https://figma.com/file/XYZ789/Dashboard
3. Run: /ccpm:plan PSN-200
```

**Analysis reveals**:
```
โœ… Design Analysis Complete

Components detected: 12
โ”œโ”€โ”€ Header (1)
โ”œโ”€โ”€ Sidebar (1)
โ”œโ”€โ”€ Cards (5)
โ”œโ”€โ”€ Charts (3)
โ””โ”€โ”€ Tables (2)

Color palette:
โ”œโ”€โ”€ Primary: #6366F1
โ”œโ”€โ”€ Secondary: #EC4899
โ”œโ”€โ”€ Neutral: #F3F4F6 - #1F2937
โ””โ”€โ”€ Success: #10B981

Typography:
โ”œโ”€โ”€ Display: Space Mono
โ”œโ”€โ”€ Body: Inter
โ””โ”€โ”€ Code: Monaco

Generated breakdown: [Linear Document]

Recommended approach:
1. Build layout shell (Header + Sidebar)
2. Implement card components
3. Add data visualization
4. Connect to API
```

**Design refinement**:
```
/ccpm:plan PSN-200 1 "Increase sidebar width to 280px,
make cards taller"

โœ… Refined Design Option 1

Adjustments:
- Sidebar width: 240px โ†’ 280px
Files: 1
Size: 16.2 KB
Complexity: 22/100
Category: Ads & Marketing

Related in Ads & Marketing