技能 design-to-code
🎨

design-to-code

安全 🌐 網路存取⚙️ 外部命令📁 檔案系統存取

將 Figma 設計轉換為 React 程式碼

將 Figma 設計轉換為可直接用於生產環境的 React TypeScript 元件,確保像素級精準度。此技能運用 AI 自動化設計到程式碼的工作流程,產生乾淨且結構化的程式碼。

支援: Claude Codex Code(CC)
⚠️ 68
1

下載技能 ZIP

2

在 Claude 中上傳

前往 設定 → 功能 → 技能 → 上傳技能

3

開啟並開始使用

測試它

正在使用「design-to-code」。 node scripts/coderio-skill.mjs fetch-figma https://figma.com/file/xxx figd_xxx

預期結果:

Figma data processed. Thumbnail saved to process/thumbnail.png

正在使用「design-to-code」。 node scripts/coderio-skill.mjs structure-prompt > structure.md

預期結果:

Generates detailed prompt for AI to analyze thumbnail and produce component hierarchy JSON

正在使用「design-to-code」。 AI analyzes thumbnail.png and generates component structure

預期結果:

JSON structure with frames, groups, and component hierarchy ready for props extraction

安全審計

安全
v1 • 2/13/2026

All 121 static findings are false positives. The skill is a legitimate Figma-to-React conversion tool that uses network (Figma API), filesystem (read/write project files), and external commands (Node.js scripts) as expected for its purpose. No credential exfiltration, no malicious code, no prompt injection attempts detected.

4
已掃描檔案
671
分析行數
8
發現項
1
審計總數

高風險問題 (5)

False Positive: Weak Cryptographic Algorithm
Static scanner detected 'weak crypto' patterns in LICENSE.txt and code. These are false positives - pattern matches on license text words like 'sha' and 'hash', and code comments. No actual cryptographic operations in the skill.
False Positive: Windows SAM Database Access
Static scanner detected 'SAM database' patterns. These are false positives - pattern matches on 'SYSTEM' in 'INITIAL_AGENT_SYSTEM_PROMPT' variable name.
False Positive: Certificate/Key Files Access
Static scanner detected 'certificate/key' patterns. This is a false positive - pattern match on component 'groups' variable which groups UI components, not certificates.
False Positive: Ruby/Shell Backtick Execution
Static scanner detected backtick usage as shell execution. These are false positives - backticks in SKILL.md are markdown code block delimiters, and in coderio-skill.mjs are string template literals for prompt generation.
False Positive: System Reconnaissance
Static scanner detected reconnaissance patterns. These are false positives - pattern matches on license text words.

風險因素

🌐 網路存取 (3)
⚙️ 外部命令 (48)
📁 檔案系統存取 (19)
審計者: claude

品質評分

45
架構
100
可維護性
87
內容
50
社群
55
安全
91
規範符合性

你能建構什麼

前端開發者工作流程

快速將 Figma 模型的轉換為可運作的 React 元件,用於原型設計或正式開發。

快速原型製作

從設計檔案產生 React 程式碼範本,加速 MVP 開發。

設計系統實作

從 Figma 設計系統中擷取個別元件,轉換為可重複使用的 React 程式碼。

試試這些提示

簡易 Figma 擷取
Use the design-to-code skill to fetch my Figma design. The Figma file URL is [FIGMA_URL] and my access token is [TOKEN].
元件結構產生
Run the structure-prompt command, then analyze the attached thumbnail.png to generate the component structure JSON. Save the result to scripts/structure-output.json.
屬性擷取
Run list-components to see available components. Then for each component, run props-prompt [COMPONENT_NAME], analyze the thumbnail, and save the props to scripts/[COMPONENT_NAME]-props.json.
完整設計到程式碼管線
Execute the full design-to-code pipeline: 1) fetch-figma with my token, 2) generate structure and process, 3) extract props for all components, 4) generate code for each task using code-prompt and save-code.

最佳實務

  • 在請求 AI 分析或產生程式碼時,務必附加 Figma thumbnail.png
  • 依序執行各個階段:設定 → 通訊協定 → 程式碼
  • 在進入下一個階段前,確認檢查點檔案(processed.json、protocol.json)存在

避免

  • 在 AI 分析步驟中跳過縮圖附加
  • 在屬性擷取完成前執行程式碼產生
  • 使用無效或過期的 Figma API 權杖

常見問題

使用此技能需要什麼?
您需要 Figma 帳戶、Figma 個人存取權杖,以及安裝 Node.js 18+。此技能使用 coderio npm 套件進行 Figma 操作。
Figma 權杖如何運作?
權杖會在執行 fetch-figma 時由您提供。它僅用於存取您指定 的特定 Figma 檔案。技能不會儲存任何權杖。
我可以轉換任何 Figma 設計嗎?
大多數靜態 Figma 設計都能良好轉換。複雜的互動元件、動畫和巢狀原型可能需要在轉換後手動調整。
這會產生什麼程式碼?
此技能會產生使用 Vite 專案結構和 TailwindCSS V4 樣式的 React TypeScript 元件。
為什麼需要附加縮圖?
AI 使用視覺縮圖來理解間距、版面配置的細節,以及可能在原始 Figma JSON 資料中無法完全擷取的文字內容。
如果步驟失敗會怎麼樣?
此技能會提供錯誤訊息指出問題所在。常見問題包括:無效的權杖、缺少縮圖、AI 回應為空,或步驟執行順序錯誤。

開發者詳情

檔案結構