figma-swiftui

作者: figma

SwiftUI ↔ Figma 翻译。当用户提到 Swift、SwiftUI、iOS、iPhone 或 iPad 时使用——无论是哪个方向——将 Figma 设计翻译成……

npx skills add https://github.com/figma/mcp-server-guide --skill figma-swiftui

Figma ↔ SwiftUI

Translation between Figma designs and SwiftUI code, both directions. This file is a router — actual guidance lives in the references below.

Pick the direction

DirectionTriggerReference
Design → codeUser wants SwiftUI in their iOS project from a Figma file/framereferences/design-to-code.md
Code → designUser wants to push SwiftUI views / screens / tokens into a Figma filereferences/code-to-design.md

If the request is ambiguous — a Figma URL and .swift files both present, no verb makes it clear — ask the user which direction before loading a reference.

Shared context (applies to both directions)

These points hold regardless of direction; the direction-specific references assume them.

  1. get_design_context is the read tool for Figma. Pass clientLanguages: "swift" and clientFrameworks: "swiftui" so the response is framed as Swift. URL → tool args: figma.com/design/:fileKey/:fileName?node-id=:nodeId → use fileKey, replace - with : in nodeId. For figma.com/design/:fileKey/branch/:branchKey/:fileName, use branchKey as fileKey.
  2. The React+Tailwind in get_design_context output is a structural reference, not a literal source. It approximates the visual. Never transliterate position: absolute / pixel frames / mix-blend-mode stacks into SwiftUI or into Figma — the screenshot is the source of truth in both directions.
  3. iOS HIG semantic colors are tokens, not hex. var(--backgrounds/primary, …), var(--labels/secondary, …), var(--separators/non-opaque, …) etc. map to Color(.systemBackground), Color.secondary, Color(.separator) in SwiftUI, and to variables in a semantic collection in Figma. Keep the mapping; drop the literal RGBA.
  4. SF Symbols round-trip by name in both directions — never by codepoint. Design → code: get_design_context substitutes Figma's SF Symbol glyph runs back into <SFSymbol>{Image(systemName: "...")}</SFSymbol> wrappers in the response. Use those names verbatim. Code → design: call figma.util.getSfSymbolCharacter(name) inside use_figma to convert a symbol name to the matching character — never look up codepoints by hand.
  5. Recognize the underlying iOS pattern, not the literal node / view name. The same patterns recur in both directions: large title + back chevron + trailing action = NavigationStack chrome; bottom row of icon+label pairs = TabView; repeating same-height rows with leading/trailing chrome = List. Match those system patterns rather than rebuilding them from primitives.
  6. For code → design, use_figma is the API. Always load figma-use before any use_figma call. If the task involves building a full screen, also load figma-generate-design; if it involves building components or a design system, also load figma-generate-library.

References

DocWhen to load
references/design-to-code.mdTranslating a Figma design / frame into SwiftUI
references/code-to-design.mdPushing SwiftUI views / screens / tokens into Figma

来自 figma 的更多技能

video-interaction-mapper
figma
当用户要求分析UI屏幕录制并将交互状态映射到Figma时,应使用此技能。触发请求如“将视频…
figma-code-connect
figma
创建并维护将Figma组件映射到代码片段的Figma Code Connect模板文件。当用户提及Code Connect、Figma组件…时使用。
create-design-system-rules
figma
为你的项目定制设计系统规则,确保Figma到代码实现的一致性。生成项目特定的组件组织、样式、设计令牌和资源处理约定,指导AI代理生成一致的代码。支持三种规则文件格式:适用于Claude Code的CLAUDE.md、适用于Codex CLI的AGENTS.md,以及适用于Cursor的.cursor/rules/figma-design-system.mdc。需要连接Figma MCP服务器并进行代码库分析,以在规则生成前发现现有模式...
figma-implement-motion
figma
将Figma中的动效和动画转化为可用于生产的应用代码。在实现Figma设计中的动画/动效时使用——用户提及…
figma-use-motion
figma
Motion / animation context for the `use_figma` MCP tool — animating Figma nodes via manual keyframes, animation styles, easing, and timeline duration. Load…
figma-use-slides
figma
该技能帮助智能体在幻灯片场景中使用Figma的use_figma MCP工具。可与figma-use配合使用,后者提供了使用该工具的基础上下文…
figma-use-figjam
figma
该技能帮助智能体在 FigJam 环境中使用 Figma 的 use_figma MCP 工具。可与 figma-use 配合使用,后者提供了使用该工具的基础上下文……
code-connect-components
figma
使用Code Connect在Figma设计组件与代码实现之间建立双向链接。需要Figma MCP服务器连接,以及组织版或企业版计划中已发布的组件。自动识别Figma选中内容中未映射的组件,然后按名称、结构和属性扫描代码库以查找匹配的代码组件。在创建映射前将匹配的组件呈现给您审阅,允许选择性接受或拒绝。支持多个...