figma-swiftui

bởi figma

SwiftUI ↔ Figma translation. Sử dụng bất cứ khi nào người dùng đề cập đến Swift, SwiftUI, iOS, iPhone hoặc iPad — theo cả hai hướng — dịch một thiết kế Figma thành…

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

Thêm skills từ figma

video-interaction-mapper
figma
Kỹ năng này nên được sử dụng khi người dùng yêu cầu phân tích bản ghi màn hình giao diện người dùng và ánh xạ các trạng thái tương tác vào Figma. Kích hoạt cho các yêu cầu như "đưa video…
figma-code-connect
figma
Tạo và duy trì các tệp mẫu Figma Code Connect để ánh xạ các thành phần Figma với đoạn mã. Sử dụng khi người dùng đề cập đến Code Connect, thành phần Figma…
create-design-system-rules
figma
Quy tắc hệ thống thiết kế tùy chỉnh để triển khai Figma-to-code nhất quán trên toàn dự án của bạn. Tạo ra các quy ước cụ thể cho dự án về tổ chức thành phần, kiểu dáng, token thiết kế và xử lý tài sản, hướng dẫn các tác nhân AI tạo mã nhất quán. Hỗ trợ ba định dạng tệp quy tắc: CLAUDE.md cho Claude Code, AGENTS.md cho Codex CLI và .cursor/rules/figma-design-system.mdc cho Cursor. Yêu cầu kết nối máy chủ MCP Figma và phân tích cơ sở mã để khám phá các mẫu hiện có trước khi đưa ra quy tắc...
figma-implement-motion
figma
Dịch chuyển động và hoạt ảnh từ Figma thành mã ứng dụng sẵn sàng cho sản xuất. Sử dụng khi triển khai hoạt ảnh/chuyển động từ thiết kế Figma — người dùng đề cập…
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
Kỹ năng này giúp agent sử dụng công cụ MCP use_figma của Figma trong ngữ cảnh Slides. Có thể được sử dụng cùng với figma-use, công cụ có ngữ cảnh nền tảng để sử dụng…
figma-use-figjam
figma
Kỹ năng này giúp các tác nhân sử dụng công cụ MCP use_figma của Figma trong bối cảnh FigJam. Có thể được sử dụng cùng với figma-use, công cụ có ngữ cảnh nền tảng để sử dụng…
code-connect-components
figma
Thiết lập liên kết hai chiều giữa các thành phần thiết kế Figma và triển khai mã bằng Code Connect. Yêu cầu kết nối máy chủ Figma MCP và các thành phần đã xuất bản trên gói Organization hoặc Enterprise. Tự động xác định các thành phần chưa được ánh xạ trong lựa chọn Figma, sau đó quét cơ sở mã của bạn để tìm các thành phần mã khớp theo tên, cấu trúc và props. Trình bày các thành phần khớp để bạn xem xét trước khi tạo ánh xạ, cho phép chấp nhận hoặc từ chối có chọn lọc. Hỗ trợ nhiều...