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 Code Connect 範本檔案,將 Figma 元件對應至程式碼片段。當使用者提及 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
此技能幫助代理在簡報(Slides)情境中使用 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伺服器連線,以及已發布於Organization或Enterprise方案的組件。自動識別Figma選取中未對應的組件,接著掃描您的程式碼庫,依名稱、結構和props比對相符的程式碼組件。在建立對應前,將比對到的組件呈現給您審閱,允許選擇性接受或拒絕。支援多個...