implement-design by figma/mcp-server-guide
npx skills add https://github.com/figma/mcp-server-guide --skill implement-design此技能提供了一个结构化工作流,用于将 Figma 设计转化为生产就绪的代码,实现像素级精确度。它确保与 Figma MCP 服务器的一致性集成、设计令牌的正确使用,以及与设计的 1:1 视觉匹配。
get_design_context)是否可用,来验证 Figma MCP 服务器是否已连接。https://figma.com/design/:fileKey/:fileName?node-id=1-2 的 Figma URL
:fileKey 是文件密钥1-2 是节点 ID(要实施的具体组件或框架)按顺序执行以下步骤。不要跳过任何步骤。
当用户提供 Figma URL 时,提取文件密钥和节点 ID 以作为参数传递给 MCP 工具。
URL 格式: https://figma.com/design/:fileKey/:fileName?node-id=1-2
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
提取:
:fileKey(/design/ 之后的片段)1-2(node-id 查询参数的值)示例:
https://figma.com/design/kL9xQn2VwM8pYrTb4ZcHjF/DesignSystem?node-id=42-15kL9xQn2VwM8pYrTb4ZcHjF42-15使用提取的文件密钥和节点 ID 运行 get_design_context。
get_design_context(fileKey=":fileKey", nodeId="1-2")
这将提供结构化数据,包括:
如果响应过大或被截断:
get_metadata(fileKey=":fileKey", nodeId="1-2") 以获取高层级节点映射get_design_context(fileKey=":fileKey", nodeId=":childNodeId") 单独获取各个子节点使用相同的文件密钥和节点 ID 运行 get_screenshot 以获取视觉参考。
get_screenshot(fileKey=":fileKey", nodeId="1-2")
此截图作为视觉验证的真相来源。在整个实施过程中保持其可访问性。
下载 Figma MCP 服务器返回的任何资源(图像、图标、SVG)。
重要: 遵循以下资源规则:
localhost 源,请直接使用该源localhost 源,不要使用或创建占位符将 Figma 输出转换为此项目的框架、样式和约定。
关键原则:
努力实现与 Figma 设计的像素级完美视觉匹配。
指南:
在标记为完成之前,对照 Figma 截图验证最终 UI。
验证清单:
用户说:"实施这个 Figma 按钮组件:https://figma.com/design/kL9xQn2VwM8pYrTb4ZcHjF/DesignSystem?node-id=42-15"
操作:
kL9xQn2VwM8pYrTb4ZcHjF 和 nodeId=42-15get_design_context(fileKey="kL9xQn2VwM8pYrTb4ZcHjF", nodeId="42-15")get_screenshot(fileKey="kL9xQn2VwM8pYrTb4ZcHjF", nodeId="42-15") 以获取视觉参考primary-500、primary-hover)结果: 与 Figma 设计匹配的按钮组件,并集成到项目设计系统中。
操作:
pR8mNv5KqXzGwY2JtCfL4D 和 nodeId=10-5get_metadata(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId="10-5") 以了解页面结构get_design_context(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId=":childNodeId")get_screenshot(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId="10-5") 以获取完整页面截图结果: 与 Figma 设计匹配的完整仪表板,具有响应式布局。
切勿基于假设进行实施。始终先获取 get_design_context 和 get_screenshot。
在实施过程中频繁验证,而不仅仅是在最后。这样可以及早发现问题。
如果必须偏离 Figma 设计(例如,出于可访问性或技术限制),请在代码注释中记录原因。
在创建新组件之前,始终检查是否存在现有组件。整个代码库的一致性比精确复制 Figma 更重要。
当有疑问时,优先选择项目的设计系统模式,而不是字面翻译 Figma。
原因: 设计过于复杂或嵌套层太多,无法在单个响应中返回。解决方案: 使用 get_metadata 获取节点结构,然后使用 get_design_context 单独获取特定节点。
原因: 实施代码与原始 Figma 设计之间存在视觉差异。解决方案: 与步骤 3 中的截图进行并排比较。检查设计上下文数据中的间距、颜色和排版值。
原因: Figma MCP 服务器的资源端点无法访问或 URL 被修改。解决方案: 验证 Figma MCP 服务器的资源端点是否可访问。服务器通过 localhost URL 提供资源。直接使用这些 URL,不要修改。
原因: 项目的设计系统令牌值与 Figma 设计中指定的值不同。解决方案: 当项目令牌与 Figma 值不同时,为了保持一致性,优先使用项目令牌,但调整间距/尺寸以保持视觉保真度。
Figma 实施工作流建立了一个可靠的过程,用于将设计转化为代码:
对于设计师: 确信实施将与其设计实现像素级精确匹配。对于开发者: 一种结构化的方法,消除了猜测并减少了来回修订。对于团队: 一致、高质量的实施,维护了设计系统的完整性。
通过遵循此工作流,您可以确保每个 Figma 设计都能以同样的细心和关注细节来实施。
每周安装数
5.9K
仓库
GitHub 星标数
639
首次出现
2026年1月20日
安全审计
安装于
opencode5.4K
codex5.3K
gemini-cli5.2K
github-copilot5.1K
kimi-cli4.8K
amp4.7K
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.
get_design_context) are available.https://figma.com/design/:fileKey/:fileName?node-id=1-2
:fileKey is the file key1-2 is the node ID (the specific component or frame to implement)Follow these steps in order. Do not skip steps.
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:
:fileKey (the segment after /design/)1-2 (the value of the node-id query parameter)Example:
https://figma.com/design/kL9xQn2VwM8pYrTb4ZcHjF/DesignSystem?node-id=42-15kL9xQn2VwM8pYrTb4ZcHjF42-15Run 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:
If the response is too large or truncated:
get_metadata(fileKey=":fileKey", nodeId="1-2") to get the high-level node mapget_design_context(fileKey=":fileKey", nodeId=":childNodeId")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.
Download any assets (images, icons, SVGs) returned by the Figma MCP server.
IMPORTANT: Follow these asset rules:
localhost source for an image or SVG, use that source directlylocalhost source is providedTranslate the Figma output into this project's framework, styles, and conventions.
Key principles:
Strive for pixel-perfect visual parity with the Figma design.
Guidelines:
Before marking complete, validate the final UI against the Figma screenshot.
Validation checklist:
User says: "Implement this Figma button component: https://figma.com/design/kL9xQn2VwM8pYrTb4ZcHjF/DesignSystem?node-id=42-15"
Actions:
kL9xQn2VwM8pYrTb4ZcHjF and nodeId=42-15get_design_context(fileKey="kL9xQn2VwM8pYrTb4ZcHjF", nodeId="42-15")get_screenshot(fileKey="kL9xQn2VwM8pYrTb4ZcHjF", nodeId="42-15") for visual referenceprimary-500, primary-hover)Result: Button component matching Figma design, integrated with project design system.
User says: "Build this dashboard: https://figma.com/design/pR8mNv5KqXzGwY2JtCfL4D/Dashboard?node-id=10-5"
Actions:
pR8mNv5KqXzGwY2JtCfL4D and nodeId=10-5get_metadata(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId="10-5") to understand the page structureget_design_context(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId=":childNodeId") for each major sectionget_screenshot(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId="10-5") for the full pageResult: Complete dashboard matching Figma design with responsive layout.
Never implement based on assumptions. Always fetch get_design_context and get_screenshot first.
Validate frequently during implementation, not just at the end. This catches issues early.
If you must deviate from the Figma design (e.g., for accessibility or technical constraints), document why in code comments.
Always check for existing components before creating new ones. Consistency across the codebase is more important than exact Figma replication.
When in doubt, prefer the project's design system patterns over literal Figma translation.
Cause: The design is too complex or has too many nested layers to return in a single response. Solution: Use get_metadata to get the node structure, then fetch specific nodes individually with get_design_context.
Cause: Visual discrepancies between the implemented code and the original Figma design. Solution: Compare side-by-side with the screenshot from Step 3. Check spacing, colors, and typography values in the design context data.
Cause: The Figma MCP server's assets endpoint is not accessible or the URLs are being modified. Solution: Verify the Figma MCP server's assets endpoint is accessible. The server serves assets at localhost URLs. Use these directly without modification.
Cause: The project's design system tokens have different values than those specified in the Figma design. Solution: When project tokens differ from Figma values, prefer project tokens for consistency but adjust spacing/sizing to maintain visual fidelity.
The Figma implementation workflow establishes a reliable process for translating designs to code:
For designers: Confidence that implementations will match their designs with pixel-perfect accuracy. For developers: A structured approach that eliminates guesswork and reduces back-and-forth revisions. For teams: Consistent, high-quality implementations that maintain design system integrity.
By following this workflow, you ensure that every Figma design is implemented with the same level of care and attention to detail.
Weekly Installs
5.9K
Repository
GitHub Stars
639
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketWarnSnykWarn
Installed on
opencode5.4K
codex5.3K
gemini-cli5.2K
github-copilot5.1K
kimi-cli4.8K
amp4.7K
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装