跳到正文
Skillpedia
界面(UI/UX)33k · #8689

figma

它能做什么

这个技能教你的智能体如何通过 Figma 连接读取设计,并在你的项目中构建相匹配的页面。适合希望把设计转为代码、并保证准确性的设计师和开发者。

适用场景

  • ✓当你分享一个 Figma 链接,并希望将其构建为页面或组件时。
  • ✓当你需要把 Figma 文件中的颜色、间距或文字样式复用到代码中时。
  • ✓当 Figma 连接不工作,你需要帮助设置时。

技能链接

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/creative-design/figma/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/creative-design/figma/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请在我的应用中,完全按照我发给你的 Figma 链接来构建这个页面。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体首先读取所选 Figma 元素的结构,并截取屏幕截图以便对照。然后它会使用你项目现有的风格和组件编写代码,并对照设计检查结果。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Figma MCP

Use the Figma MCP server for Figma-driven implementation. For setup and debugging details (env vars, config, verification), see references/figma-mcp-config.md.

Figma MCP Integration Rules

These rules define how to translate Figma inputs into code for this project and must be followed for every Figma-driven change.

Required flow (do not skip)

  1. Run get_design_context first to fetch the structured representation for the exact node(s).
  2. If the response is too large or truncated, run get_metadata to get the high-level node map and then re-fetch only the required node(s) with get_design_context.
  3. Run get_screenshot for a visual reference of the node variant being implemented.
  4. Only after you have both get_design_context and get_screenshot, download any assets needed and start implementation.
  5. Translate the output (usually React + Tailwind) into this project's conventions, styles and framework. Reuse the project's color tokens, components, and typography wherever possible.
  6. Validate against Figma for 1:1 look and behavior before marking complete.

Implementation rules

  • Treat the Figma MCP output (React + Tailwind) as a representation of design and behavior, not as final code style.
  • Replace Tailwind utility classes with the project's preferred utilities/design-system tokens when applicable.
  • Reuse existing components (e.g., buttons, inputs, typography, icon wrappers) instead of duplicating functionality.
  • Use the project's color system, typography scale, and spacing tokens consistently.
  • Respect existing routing, state management, and data-fetch patterns already adopted in the repo.
  • Strive for 1:1 visual parity with the Figma design. When conflicts arise, prefer design-system tokens and adjust spacing or sizes minimally to match visuals.
  • Validate the final UI against the Figma screenshot for both look and behavior.

Asset handling

  • The Figma MCP Server provides an assets endpoint which can serve image and SVG assets.
  • IMPORTANT: If the Figma MCP Server returns a localhost source for an image or an SVG, use that image or SVG source directly.
  • IMPORTANT: DO NOT import/add new icon packages, all the assets should be in the Figma payload.
  • IMPORTANT: do NOT use or create placeholders if a localhost source is provided.

Link-based prompting

  • The server is link-based: copy the Figma frame/layer link and give that URL to the MCP client when asking for implementation help.
  • The client cannot browse the URL but extracts the node ID from the link; always ensure the link points to the exact node/variant you want.

References

  • references/figma-mcp-config.md — setup, verification, troubleshooting, and link-based usage reminders.
  • references/figma-tools-and-prompts.md — tool catalog and prompt patterns for selecting frameworks/components and fetching metadata.
常见问题

我需要有 Figma 文件的访问权限吗?

需要。智能体需要文件的访问权限,以及可用的 Figma 连接,才能读取设计。

代码会和 Figma 文件完全一样吗?

该技能力求接近,并复用你项目的颜色和组件,因此仍可能存在细微差别。

如果设计太大,无法一次读取怎么办?

智能体会先查看设计的高层结构图,然后只读取所需的部分。

详情

作者的原始描述

Use the Figma MCP server to fetch design context, screenshots, variables, and assets from Figma, and to translate Figma nodes into production code. Trigger when a task involves Figma URLs, node IDs, design-to-code implementation, or Figma MCP setup and troubleshooting.

repo: davila7/claude-code-templates

热度

GitHub 星标
33k
排名
#8689
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能