figma-designer by charon-fan/agent-playbook
npx skills add https://github.com/charon-fan/agent-playbook --skill figma-designer"以像素级精度将 Figma 设计转化为可实施的规范"
此技能通过 Figma MCP 服务器分析 Figma 设计,并生成包含精确视觉规范的详细 PRD。它能提取设计令牌、组件规格和布局信息,供开发者直接实施。
确保 Figma MCP 服务器已连接并可访问:
# 检查 Figma MCP 是否可用
mcp-list
如果不可用,请从以下地址安装:https://github.com/modelcontextprotocol/servers
必需的 Figma MCP 工具:
figma_get_file - 获取文件元数据figma_get_nodes - 获取节点详情figma_get_components - 获取组件信息当您执行以下操作时触发:
https://www.figma.com/file/...)广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
Input: Figma URL or File Key
↓
Extract File Key from URL
↓
Call figma_get_file to get metadata
↓
Call figma_get_nodes to get design tree
↓
Parse frame, component, and text nodes
创建全面的设计令牌清单:
// Design Token Structure
interface DesignTokens {
colors: {
primary: string[];
secondary: string[];
neutral: string[];
semantic: {
success: string;
warning: string;
error: string;
info: string;
};
};
typography: {
fontFamilies: Record<string, string>;
fontSizes: Record<string, number>;
fontWeights: Record<string, number>;
lineHeights: Record<string, number>;
letterSpacing: Record<string, number>;
};
spacing: {
scale: number; // 4, 8, 12, 16, etc.
values: Record<string, number>;
};
borders: {
radii: Record<string, number>;
widths: Record<string, number>;
};
shadows: Array<{
name: string;
values: string[];
}>;
}
File
├── Frames (Pages/Screens)
│ ├── Component Instances
│ │ ├── Primary Button
│ │ ├── Input Field
│ │ └── Card
│ └── Text Layers
│ ├── Headings
│ ├── Body
│ └── Labels
对于每个组件,提取:
为每个屏幕使用此模板:
## Screen: [Screen Name]
### Layout Structure
┌─────────────────────────────────────────┐ │ [Header/Nav] │ ├─────────────────────────────────────────┤ │ │ │ [Main Content] │ │ ┌───────────┐ ┌───────────┐ │ │ │ Card 1 │ │ Card 2 │ │ │ └───────────┘ └───────────┘ │ │ │ ├─────────────────────────────────────────┤ │ [Footer] │ └─────────────────────────────────────────┘
### Design Specifications
#### Colors
| Token | Value | Usage |
|-------|-------|-------|
| Primary | `#007AFF` | Primary buttons, links |
| Background | `#FFFFFF` | Screen background |
| Surface | `#F5F5F7` | Cards, sections |
| Text Primary | `#1C1C1E` | Headings, body |
| Text Secondary | `#8E8E93` | Captions, labels |
#### Typography
| Style | Font | Size | Weight | Line Height | Letter Spacing |
|-------|------|------|--------|------------|---------------|
| Display Large | SF Pro Display | 28px | Bold (700) | 34px | -0.5px |
| Heading 1 | SF Pro Display | 24px | Bold (700) | 32px | -0.3px |
| Heading 2 | SF Pro Display | 20px | Semibold (600) | 28px | -0.2px |
| Body Large | SF Pro Text | 17px | Regular (400) | 24px | -0.4px |
| Body | SF Pro Text | 15px | Regular (400) | 22px | -0.3px |
| Caption | SF Pro Text | 13px | Regular (400) | 18px | -0.1px |
#### Spacing
| Token | Value | Usage |
|-------|-------|-------|
| xs | 4px | Icon padding |
| sm | 8px | Tight spacing |
| md | 12px | Card padding |
| lg | 16px | Section spacing |
| xl | 24px | Large gaps |
| 2xl | 32px | Page margins |
#### Component: Primary Button
```typescript
interface PrimaryButtonProps {
size?: 'small' | 'medium' | 'large';
variant?: 'primary' | 'secondary' | 'tertiary';
disabled?: boolean;
}
// Sizes
size.small = {
height: 32px,
paddingHorizontal: 12px,
fontSize: 15,
iconSize: 16,
}
size.medium = {
height: 40px,
paddingHorizontal: 16px,
fontSize: 15,
iconSize: 20,
}
size.large = {
height: 48px,
paddingHorizontal: 24px,
fontSize: 17,
iconSize: 24,
}
// Variants
variant.primary = {
backgroundColor: '#007AFF',
color: '#FFFFFF',
}
variant.secondary = {
backgroundColor: '#F5F5F7',
color: '#007AFF',
}
variant.tertiary = {
backgroundColor: 'transparent',
color: '#007AFF',
}
| Element | Constraints | Responsive Behavior |
|---|---|---|
| Header | Left, Right, Top | Sticky on scroll |
| Sidebar | Left, Top, Bottom | Collapses to drawer on mobile |
| Content | Left, Right (16px) | Full width on mobile |
| Element | Default | Hover | Pressed | Disabled |
|---|---|---|---|---|
| Primary Button | opacity: 1 | opacity: 0.8 | opacity: 0.6 | opacity: 0.4 |
| Icon Button | opacity: 1 | background: rgba(0,0,0,0.05) | background: rgba(0,0,0,0.1) | opacity: 0.3 |
| Card | shadow: sm | shadow: md | - | opacity: 0.6 |
## 输出格式
### 选项 1:完整 PRD(推荐)
生成完整的 4 文件 PRD:
- `docs/{feature}-notes.md` - 设计决策
- `docs/{feature}-task-plan.md` - 实施任务
- `docs/{feature}-prd.md` - 产品需求
- `docs/{feature}-tech.md` - 技术规范
### 选项 2:视觉规范文档
生成设计规范文档:
docs/{feature}-design-spec.md
### 选项 3:组件库
对于设计系统,生成:
src/components/ ├── Button/ │ ├── Button.tsx │ ├── Button.test.tsx │ └── Button.stories.tsx ├── Input/ ├── Card/ └── tokens.ts
## 快速参考:设计令牌类别
### 始终提取这些
| Category | What to Extract | Why |
|----------|----------------|-----|
| **Colors** | Hex/RGBA values | Theme consistency |
| **Typography** | Font family, size, weight, spacing | Text hierarchy |
| **Spacing** | Padding, margin, gap values | Layout alignment |
| **Borders** | Radius, width values | Shape consistency |
| **Shadows** | Offset, blur, spread, color | Depth perception |
| **Icons** | Name, size, color | Visual consistency |
| **Images** | URL, dimensions, fit mode | Asset management |
## 设计审查清单
在生成 PRD 之前,请验证:
- [ ] 所有屏幕都已考虑在内
- [ ] 设计令牌已提取
- [ ] 组件变体已记录
- [ ] 响应式行为已指定
- [ ] 交互状态已定义
- [ ] 可访问性(WCAG)已考虑
- [ ] 颜色对比度 ≥ 4.5:1
- [ ] 触摸目标 ≥ 44x44px
- [ ] 焦点指示器可见
## 框架分析模板
对于 Figma 文件中的每个框架/屏幕:
```markdown
## Frame: {Frame Name}
### Purpose
{What this screen does}
### Elements
| Element | Type | Styles | Props |
|---------|------|--------|-------|
| {Name} | {Component/Text/Vector} | {css} | {props} |
| {Name} | {Component/Text/Vector} | {css} | {props} |
### Layout
- Container: {width, height, fill}
- Position: {absolute/relative}
- Constraints: {left, right, top, bottom}
- Auto Layout: {direction, spacing, padding, alignment}
### Content Hierarchy
1. {Primary element}
2. {Secondary element}
3. {Tertiary element}
### Notes
{Any special considerations}
Figma URL → figma-designer → Visual Specs
↓
prd-planner → PRD
↓
implementation → Code
↓
code-reviewer → Quality Check
生成规范后:
## Developer Handoff
### Design Files
- Figma: {url}
- Design Spec: {link}
### Design Tokens
- Generated: `tokens.ts`
- Color palette: `colors.ts`
- Typography: `typography.ts`
### Component Library
- Storybook: {url}
- Component docs: {link}
### Assets
- Icons: {folder}
- Images: {folder}
- Exports: {format}
✅ 提取关键尺寸的精确像素值 ✅ 记录组件变体和状态 ✅ 包含响应式断点 ✅ 注意任何平台差异(iOS 与 Android) ✅ 包含可访问性考虑因素 ✅ 将设计令牌导出为常量
❌ 四舍五入间距值(使用精确的 4px/8px/12px) ❌ 忽略悬停/焦点状态 ❌ 跳过约束行为 ❌ 忘记空状态 ❌ 省略加载状态 ❌ 未经核实就假设平台默认值
有关完整示例输出和平台特定注意事项,请参阅 references/example-output.md。
每周安装次数
66
仓库
GitHub 星标数
12
首次出现
2026年1月22日
安全审计
安装于
codex58
gemini-cli58
opencode57
cursor54
github-copilot51
amp50
"Transform Figma designs into implementation-ready specifications with pixel-perfect accuracy"
This skill analyzes Figma designs through the Figma MCP server and generates detailed PRDs with precise visual specifications. It extracts design tokens, component specifications, and layout information that developers can implement directly.
Ensure the Figma MCP server is connected and accessible:
# Check if Figma MCP is available
mcp-list
If not available, install from: https://github.com/modelcontextprotocol/servers
Required Figma MCP tools:
figma_get_file - Get file metadatafigma_get_nodes - Get node detailsfigma_get_components - Get component informationActivates when you:
https://www.figma.com/file/...)Input: Figma URL or File Key
↓
Extract File Key from URL
↓
Call figma_get_file to get metadata
↓
Call figma_get_nodes to get design tree
↓
Parse frame, component, and text nodes
Create a comprehensive design token inventory:
// Design Token Structure
interface DesignTokens {
colors: {
primary: string[];
secondary: string[];
neutral: string[];
semantic: {
success: string;
warning: string;
error: string;
info: string;
};
};
typography: {
fontFamilies: Record<string, string>;
fontSizes: Record<string, number>;
fontWeights: Record<string, number>;
lineHeights: Record<string, number>;
letterSpacing: Record<string, number>;
};
spacing: {
scale: number; // 4, 8, 12, 16, etc.
values: Record<string, number>;
};
borders: {
radii: Record<string, number>;
widths: Record<string, number>;
};
shadows: Array<{
name: string;
values: string[];
}>;
}
File
├── Frames (Pages/Screens)
│ ├── Component Instances
│ │ ├── Primary Button
│ │ ├── Input Field
│ │ └── Card
│ └── Text Layers
│ ├── Headings
│ ├── Body
│ └── Labels
For each component, extract:
Use this template for each screen:
## Screen: [Screen Name]
### Layout Structure
┌─────────────────────────────────────────┐ │ [Header/Nav] │ ├─────────────────────────────────────────┤ │ │ │ [Main Content] │ │ ┌───────────┐ ┌───────────┐ │ │ │ Card 1 │ │ Card 2 │ │ │ └───────────┘ └───────────┘ │ │ │ ├─────────────────────────────────────────┤ │ [Footer] │ └─────────────────────────────────────────┘
### Design Specifications
#### Colors
| Token | Value | Usage |
|-------|-------|-------|
| Primary | `#007AFF` | Primary buttons, links |
| Background | `#FFFFFF` | Screen background |
| Surface | `#F5F5F7` | Cards, sections |
| Text Primary | `#1C1C1E` | Headings, body |
| Text Secondary | `#8E8E93` | Captions, labels |
#### Typography
| Style | Font | Size | Weight | Line Height | Letter Spacing |
|-------|------|------|--------|------------|---------------|
| Display Large | SF Pro Display | 28px | Bold (700) | 34px | -0.5px |
| Heading 1 | SF Pro Display | 24px | Bold (700) | 32px | -0.3px |
| Heading 2 | SF Pro Display | 20px | Semibold (600) | 28px | -0.2px |
| Body Large | SF Pro Text | 17px | Regular (400) | 24px | -0.4px |
| Body | SF Pro Text | 15px | Regular (400) | 22px | -0.3px |
| Caption | SF Pro Text | 13px | Regular (400) | 18px | -0.1px |
#### Spacing
| Token | Value | Usage |
|-------|-------|-------|
| xs | 4px | Icon padding |
| sm | 8px | Tight spacing |
| md | 12px | Card padding |
| lg | 16px | Section spacing |
| xl | 24px | Large gaps |
| 2xl | 32px | Page margins |
#### Component: Primary Button
```typescript
interface PrimaryButtonProps {
size?: 'small' | 'medium' | 'large';
variant?: 'primary' | 'secondary' | 'tertiary';
disabled?: boolean;
}
// Sizes
size.small = {
height: 32px,
paddingHorizontal: 12px,
fontSize: 15,
iconSize: 16,
}
size.medium = {
height: 40px,
paddingHorizontal: 16px,
fontSize: 15,
iconSize: 20,
}
size.large = {
height: 48px,
paddingHorizontal: 24px,
fontSize: 17,
iconSize: 24,
}
// Variants
variant.primary = {
backgroundColor: '#007AFF',
color: '#FFFFFF',
}
variant.secondary = {
backgroundColor: '#F5F5F7',
color: '#007AFF',
}
variant.tertiary = {
backgroundColor: 'transparent',
color: '#007AFF',
}
| Element | Constraints | Responsive Behavior |
|---|---|---|
| Header | Left, Right, Top | Sticky on scroll |
| Sidebar | Left, Top, Bottom | Collapses to drawer on mobile |
| Content | Left, Right (16px) | Full width on mobile |
| Element | Default | Hover | Pressed | Disabled |
|---|---|---|---|---|
| Primary Button | opacity: 1 | opacity: 0.8 | opacity: 0.6 | opacity: 0.4 |
| Icon Button | opacity: 1 | background: rgba(0,0,0,0.05) | background: rgba(0,0,0,0.1) | opacity: 0.3 |
| Card | shadow: sm | shadow: md | - | opacity: 0.6 |
## Output Formats
### Option 1: Full PRD (Recommended)
Generates a complete 4-file PRD:
- `docs/{feature}-notes.md` - Design decisions
- `docs/{feature}-task-plan.md` - Implementation tasks
- `docs/{feature}-prd.md` - Product requirements
- `docs/{feature}-tech.md` - Technical specifications
### Option 2: Visual Spec Document
Generates a design specification document:
docs/{feature}-design-spec.md
### Option 3: Component Library
For design systems, generates:
src/components/ ├── Button/ │ ├── Button.tsx │ ├── Button.test.tsx │ └── Button.stories.tsx ├── Input/ ├── Card/ └── tokens.ts
## Quick Reference: Design Token Categories
### Always Extract These
| Category | What to Extract | Why |
|----------|----------------|-----|
| **Colors** | Hex/RGBA values | Theme consistency |
| **Typography** | Font family, size, weight, spacing | Text hierarchy |
| **Spacing** | Padding, margin, gap values | Layout alignment |
| **Borders** | Radius, width values | Shape consistency |
| **Shadows** | Offset, blur, spread, color | Depth perception |
| **Icons** | Name, size, color | Visual consistency |
| **Images** | URL, dimensions, fit mode | Asset management |
## Design Review Checklist
Before generating PRD, verify:
- [ ] All screens are accounted for
- [ ] Design tokens are extracted
- [ ] Component variants are documented
- [ ] Responsive behavior is specified
- [ ] Interaction states are defined
- [ ] Accessibility (WCAG) is considered
- [ ] Color contrast ratio ≥ 4.5:1
- [ ] Touch targets ≥ 44x44px
- [ ] Focus indicators visible
## Frame Analysis Template
For each frame/screen in the Figma file:
```markdown
## Frame: {Frame Name}
### Purpose
{What this screen does}
### Elements
| Element | Type | Styles | Props |
|---------|------|--------|-------|
| {Name} | {Component/Text/Vector} | {css} | {props} |
| {Name} | {Component/Text/Vector} | {css} | {props} |
### Layout
- Container: {width, height, fill}
- Position: {absolute/relative}
- Constraints: {left, right, top, bottom}
- Auto Layout: {direction, spacing, padding, alignment}
### Content Hierarchy
1. {Primary element}
2. {Secondary element}
3. {Tertiary element}
### Notes
{Any special considerations}
Figma URL → figma-designer → Visual Specs
↓
prd-planner → PRD
↓
implementation → Code
↓
code-reviewer → Quality Check
After generating specifications:
## Developer Handoff
### Design Files
- Figma: {url}
- Design Spec: {link}
### Design Tokens
- Generated: `tokens.ts`
- Color palette: `colors.ts`
- Typography: `typography.ts`
### Component Library
- Storybook: {url}
- Component docs: {link}
### Assets
- Icons: {folder}
- Images: {folder}
- Exports: {format}
✅ Extract exact pixel values for critical dimensions ✅ Document component variants and states ✅ Include responsive breakpoints ✅ Note any platform differences (iOS vs Android) ✅ Include accessibility considerations ✅ Export design tokens as constants
❌ Round spacing values (use exact 4px/8px/12px) ❌ Ignore hover/focus states ❌ Skip constraint behavior ❌ Forget about empty states ❌ Omit loading states ❌ Assume platform defaults without verification
See references/example-output.md for a full sample output and platform-specific considerations.
Weekly Installs
66
Repository
GitHub Stars
12
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
codex58
gemini-cli58
opencode57
cursor54
github-copilot51
amp50
shadcn/ui 框架:React 组件库与 UI 设计系统,Tailwind CSS 最佳实践
59,100 周安装
Auto-Trigger 技能:AI Agent 工作流自动触发与钩子管理指南
177 周安装
付费广告优化指南:Google、Meta、LinkedIn等平台投放策略与文案框架
177 周安装
SolidJS 最佳实践与模式指南:解决状态耦合与UI卡顿问题
177 周安装
Sentry OTel 导出器设置教程:配置OpenTelemetry Collector发送追踪日志
177 周安装
漫画风格短剧生成器 - AI自动分镜图生视频工具,快速创作漫剧
177 周安装
Cloudflare D1数据库迁移指南 - Drizzle ORM工作流与问题解决方案
177 周安装