Loading...
Loading...
Compare original and translation side by side
"Transform Figma designs into implementation-ready specifications with pixel-perfect accuracy"
"将Figma设计精准转换为可直接用于开发的规范,实现像素级精度"
undefinedundefined
If not available, install from: https://github.com/modelcontextprotocol/servers
Required Figma MCP tools:
- `figma_get_file` - Get file metadata
- `figma_get_nodes` - Get node details
- `figma_get_components` - Get component information
如果未安装,请从以下地址获取:https://github.com/modelcontextprotocol/servers
所需的Figma MCP工具:
- `figma_get_file` - 获取文件元数据
- `figma_get_nodes` - 获取节点详情
- `figma_get_components` - 获取组件信息https://www.figma.com/file/...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 nodesInput: 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[];
}>;
}// 设计令牌结构
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等
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文件
├── 框架(页面/屏幕)
│ ├── 组件实例
│ │ ├── 主按钮
│ │ ├── 输入框
│ │ └── 卡片
│ └── 文本图层
│ ├── 标题
│ ├── 正文
│ └── 标签undefinedundefined┌─────────────────────────────────────────┐
│ [Header/Nav] │
├─────────────────────────────────────────┤
│ │
│ [Main Content] │
│ ┌───────────┐ ┌───────────┐ │
│ │ Card 1 │ │ Card 2 │ │
│ └───────────┘ └───────────┘ │
│ │
├─────────────────────────────────────────┤
│ [Footer] │
└─────────────────────────────────────────┘┌─────────────────────────────────────────┐
│ [头部/导航栏] │
├─────────────────────────────────────────┤
│ │
│ [主要内容区] │
│ ┌───────────┐ ┌───────────┐ │
│ │ 卡片1 │ │ 卡片2 │ │
│ └───────────┘ └───────────┘ │
│ │
├─────────────────────────────────────────┤
│ [页脚] │
└─────────────────────────────────────────┘| Token | Value | Usage |
|---|---|---|
| Primary | | Primary buttons, links |
| Background | | Screen background |
| Surface | | Cards, sections |
| Text Primary | | Headings, body |
| Text Secondary | | Captions, labels |
| 令牌 | 取值 | 用途 |
|---|---|---|
| Primary | | 主按钮、链接 |
| Background | | 页面背景 |
| Surface | | 卡片、区块 |
| Text Primary | | 标题、正文 |
| Text Secondary | | 说明文字、标签 |
| 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 |
| 样式 | 字体 | 尺寸 | 字重 | 行高 | 字间距 |
|---|---|---|---|---|---|
| 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 |
| 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 |
| 令牌 | 取值 | 用途 |
|---|---|---|
| xs | 4px | 图标内边距 |
| sm | 8px | 紧凑间距 |
| md | 12px | 卡片内边距 |
| lg | 16px | 区块间距 |
| xl | 24px | 大间距 |
| 2xl | 32px | 页面边距 |
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',
}interface PrimaryButtonProps {
size?: 'small' | 'medium' | 'large';
variant?: 'primary' | 'secondary' | 'tertiary';
disabled?: boolean;
}
// 尺寸
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,
}
// 变体
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 |
| 元素 | 约束条件 | 响应式表现 |
|---|---|---|
| 头部 | 左、右、顶部固定 | 滚动时固定 |
| 侧边栏 | 左、上、下固定 | 在移动端折叠为抽屉 |
| 内容区 | 左右边距16px | 移动端全屏显示 |
| 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 |
undefined| 元素 | 默认状态 | 悬停状态 | 点击状态 | 禁用状态 |
|---|---|---|---|---|
| 主按钮 | 透明度:1 | 透明度:0.8 | 透明度:0.6 | 透明度:0.4 |
| 图标按钮 | 透明度:1 | 背景:rgba(0,0,0,0.05) | 背景:rgba(0,0,0,0.1) | 透明度:0.3 |
| 卡片 | 阴影:sm | 阴影:md | - | 透明度:0.6 |
undefineddocs/{feature}-notes.mddocs/{feature}-task-plan.mddocs/{feature}-prd.mddocs/{feature}-tech.mddocs/{feature}-notes.mddocs/{feature}-task-plan.mddocs/{feature}-prd.mddocs/{feature}-tech.mddocs/{feature}-design-spec.mddocs/{feature}-design-spec.mdsrc/components/
├── Button/
│ ├── Button.tsx
│ ├── Button.test.tsx
│ └── Button.stories.tsx
├── Input/
├── Card/
└── tokens.tssrc/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 |
| 分类 | 提取内容 | 原因 |
|---|---|---|
| 颜色 | Hex/RGBA值 | 保证主题一致性 |
| 排版 | 字体、尺寸、字重、间距 | 构建文本层级 |
| 间距 | 内边距、外边距、间隙值 | 保证布局对齐 |
| 边框 | 圆角、宽度值 | 保证形状一致性 |
| 阴影 | 偏移、模糊、扩散、颜色 | 营造层次感 |
| 图标 | 名称、尺寸、颜色 | 保证视觉一致性 |
| 图片 | 链接、尺寸、适配模式 | 资产管理 |
undefinedundefined| Element | Type | Styles | Props |
|---|---|---|---|
| {Name} | {Component/Text/Vector} | {css} | {props} |
| {Name} | {Component/Text/Vector} | {css} | {props} |
| 元素名称 | 类型 | 样式 | 属性 |
|---|---|---|---|
| {名称} | {组件/文本/矢量图} | {css样式} | {属性} |
| {名称} | {组件/文本/矢量图} | {css样式} | {属性} |
undefinedundefinedFigma URL → figma-designer → Visual Specs
↓
prd-planner → PRD
↓
implementation → Code
↓
code-reviewer → Quality CheckFigma链接 → figma-designer → 视觉规范
↓
prd-planner → PRD
↓
implementation → 代码开发
↓
code-reviewer → 质量检查undefinedundefinedtokens.tscolors.tstypography.tstokens.tscolors.tstypography.tsundefinedundefinedreferences/example-output.mdreferences/example-output.md