design-to-code
將 Figma 設計轉換為 React 程式碼
將 Figma 設計轉換為可直接用於生產環境的 React TypeScript 元件,確保像素級精準度。此技能運用 AI 自動化設計到程式碼的工作流程,產生乾淨且結構化的程式碼。
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
測試它
正在使用「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
安全審計
安全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.
高風險問題 (5)
風險因素
🌐 網路存取 (3)
⚙️ 外部命令 (48)
📁 檔案系統存取 (19)
品質評分
你能建構什麼
前端開發者工作流程
快速將 Figma 模型的轉換為可運作的 React 元件,用於原型設計或正式開發。
快速原型製作
從設計檔案產生 React 程式碼範本,加速 MVP 開發。
設計系統實作
從 Figma 設計系統中擷取個別元件,轉換為可重複使用的 React 程式碼。
試試這些提示
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 設計嗎?
這會產生什麼程式碼?
為什麼需要附加縮圖?
如果步驟失敗會怎麼樣?
開發者詳情
檔案結構