figma-implement-design
它能做什么
这个技能引导你的 AI 把 Figma 画框或组件转换为代码。适合需要所构建的界面与 Figma 中的设计保持一致的开发者。
适用场景
- ✓当你分享一个 Figma 链接,并希望将设计构建为生产代码时。
- ✓当你需要一个组件与 Figma 规格一致,包括准确的间距和设计令牌时。
- ✓当你希望实现方式遵循项目设计系统的约定时。
技能链接
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/creative-design/figma-implement-design/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“这是我们价格卡片的 Figma 链接。你能把它构建成一个与设计一致的 React 组件吗?”
每周 5 个新技能,1 分钟读完。
工作原理
该技能首先连接到 Figma MCP 服务器,然后读取所选节点的设计上下文、截图和资源。它会把这些转换为遵循你项目约定的代码,并对照设计检查结果。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Implement Design
Overview
This skill provides a structured workflow for translating Figma designs into production-ready code with pixel-perfect accuracy. It ensures consistent integration with the Figma MCP server, proper use of design tokens, and 1:1 visual parity with designs.
Prerequisites
- Figma MCP server must be connected and accessible
- User must provide a Figma URL in the format:
https://figma.com/design/:fileKey/:fileName?node-id=1-2:fileKeyis the file key1-2is the node ID (the specific component or frame to implement)
- OR when using
figma-desktopMCP: User can select a node directly in the Figma desktop app (no URL required) - Project should have an established design system or component library (preferred)
Required Workflow
Follow these steps in order. Do not skip steps.
Step 0: Set up Figma MCP (if not already configured)
If any MCP call fails because Figma MCP is not connected, pause and set it up:
- Add the Figma MCP:
codex mcp add figma --url https://mcp.figma.com/mcp
- Enable remote MCP client:
- Set
[features].rmcp_client = trueinconfig.tomlor runcodex --enable rmcp_client
- Set
- Log in with OAuth:
codex mcp login figma
After successful login, the user will have to restart codex. You should finish your answer and tell them so when they try again they can continue with Step 1.
Step 1: Get Node ID
Option A: Parse from Figma URL
When the user provides a Figma URL, extract the file key and node ID to pass as arguments to MCP tools.
URL format: https://figma.com/design/:fileKey/:fileName?node-id=1-2
Extract:
- File key:
:fileKey(the segment after/design/) - Node ID:
1-2(the value of thenode-idquery parameter)
Note: When using the local desktop MCP (figma-desktop), fileKey is not passed as a parameter to tool calls. The server automatically uses the currently open file, so only nodeId is needed.
Example:
- URL:
https://figma.com/design/kL9xQn2VwM8pYrTb4ZcHjF/DesignSystem?node-id=42-15 - File key:
kL9xQn2VwM8pYrTb4ZcHjF - Node ID:
42-15
Option B: Use Current Selection from Figma Desktop App (figma-desktop MCP only)
When using the figma-desktop MCP and the user has NOT provided a URL, the tools automatically use the currently selected node from the open Figma file in the desktop app.
Note: Selection-based prompting only works with the figma-desktop MCP server. The remote server requires a link to a frame or layer to extract context. The user must have the Figma desktop app open with a node selected.
Step 2: Fetch Design Context
Run get_design_context with the extracted file key and node ID.
get_design_context(fileKey=":fileKey", nodeId="1-2")
This provides the structured data including:
- Layout properties (Auto Layout, constraints, sizing)
- Typography specifications
- Color values and design tokens
- Component structure and variants
- Spacing and padding values
If the response is too large or truncated:
- Run
get_metadata(fileKey=":fileKey", nodeId="1-2")to get the high-level node map - Identify the specific child nodes needed from the metadata
- Fetch individual child nodes with
get_design_context(fileKey=":fileKey", nodeId=":childNodeId")
Step 3: Capture Visual Reference
Run get_screenshot with the same file key and node ID for a visual reference.
get_screenshot(fileKey=":fileKey", nodeId="1-2")
This screenshot serves as the source of truth for visual validation. Keep it accessible throughout implementation.
Step 4: Download Required Assets
Download any assets (images, icons, SVGs) returned by the Figma MCP server.
IMPORTANT: Follow these asset rules:
- If the Figma MCP server returns a
localhostsource for an image or SVG, use that source directly - DO NOT import or add new icon packages - all assets should come from the Figma payload
- DO NOT use or create placeholders if a
localhostsource is provided - Assets are served through the Figma MCP server's built-in assets endpoint
Step 5: Translate to Project Conventions
Translate the Figma output into this project's framework, styles, and conventions.
Key principles:
- Treat the Figma MCP output (typically React + Tailwind) as a representation of design and behavior, not as final code style
- Replace Tailwind utility classes with the project's preferred utilities or design system tokens
- Reuse existing compone
常见问题
使用它之前我需要什么?
你需要连接好 Figma MCP 服务器,并提供带有节点 ID 的 Figma 链接。
它能在桌面应用中选择节点吗?
可以。使用 figma-desktop MCP 时,你可以在应用中直接选择节点,而无需 URL。
它会使用我的设计系统吗?
指南优先使用现有的设计系统或组件库,并尽可能使用其中的令牌。
详情
作者的原始描述
Translate Figma nodes into production-ready code with 1:1 visual fidelity using the Figma MCP workflow (design context, screenshots, assets, and project-convention translation). Trigger when the user provides Figma URLs or node IDs, or asks to implement designs or components that must match Figma specs. Requires a working Figma MCP server connection.
热度
- GitHub 星标
- 33k
- 排名
- #8688
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
owasp-security
33k教你的智能体掌握面向网页应用、API、移动端、容器和 AI 智能体的 OWASP 安全指南,以便发现常见弱点并提出修复建议。
agent-management
33k让你的智能体使用 AI Maestro 命令行工具创建、列出、休眠、唤醒、重命名和删除 AI 智能体,管理每个智能体的生命周期。
agent-messaging
33k让你的智能体使用智能体消息协议,在 AI 智能体之间发送、接收和回复带签名的消息,大部分在你自己的电脑上完成。
docs-search
33k让你的智能体搜索自动生成的代码文档,查找函数签名、类定义和注释,从而在修改代码之前核对真实的 API。