Token导航 LogoToken导航TokenDH.com
前端设计敏感数据github未标认证来源可访问许可证需确认审计异常

design-to-code设计到代码

Agent Skill

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

总安装

2,815

周安装

115

GitHub Stars

26,386

下载量

902
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:design-to-code(设计到代码)
来源仓库:https://github.com/davila7/claude-code-templates
仓库路径:skills/design-to-code
安装命令:
npx skills add https://github.com/davila7/claude-code-templates --skill design-to-code
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/davila7/claude-code-templates --skill design-to-code

简介

design-to-code 将 Figma 设计稿转换为像素级精确的 React + TypeScript 组件。

  • 通过协议生成、资产提取与样式映射实现高保真还原,减少手动对齐误差。
  • 依赖 Figma API Token 与本地渲染工具链,确保交付物可直接投入生产。
  • 复杂动效应配合额外动画库实现,纯静态组件优先保证结构与样式正确性。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Design to Code

High-fidelity UI restoration from Figma designs to production-ready React + TypeScript components. This SKILL uses a robust helper script to minimize manual errors and ensure pixel-perfect results.

Prerequisites

  1. Figma API Token: Get from Figma → Settings → Personal Access Tokens
  2. Node.js: Version 18+
  3. coderio: Installed in scripts/ folder (handled by Setup phase)

Workflow Overview

Phase 0: SETUP    → Create helper script and script environment
Phase 1: PROTOCOL → Generate design protocol (Structure & Props)
Phase 2: CODE     → Generate components and assets

Phase 0: Setup

Step 0.1: Initialize Helper Script

User Action: Run these commands to create the execution helper and isolate its dependencies.

mkdir -p scripts

# 1. Copy script files
# Note: Ensure you have the 'skills/design-to-code/scripts' directory available
cp skills/design-to-code/scripts/package.json scripts/package.json
cp skills/design-to-code/scripts/coderio-skill.mjs scripts/coderio-skill.mjs

# 2. Install coderio in scripts directory (adjust version if needed)
cd scripts && pnpm install && cd ..

Step 0.2: Scaffold Project (Optional)

If starting a new project:

  1. Run: node scripts/coderio-skill.mjs scaffold-prompt "MyApp"
  2. AI Task: Follow the instructions output by the command to create files.

Phase 1: Protocol Generation

Step 1.1: Fetch Data

# Replace with your URL and Token
node scripts/coderio-skill.mjs fetch-figma "https://figma.com/file/..." "figd_..."

Verify: process/thumbnail.png should exist.

Step 1.2: Generate Structure

  1. Generate Prompt: node scripts/coderio-skill.mjs structure-prompt > scripts/structure-prompt.md
  2. AI Task (Structure):

- ATTACH: process/thumbnail.png (MANDATORY) - READ: scripts/structure-prompt.md - INSTRUCTION: "Generate the component structure JSON based on the prompt and the attached thumbnail. Focus on visual grouping. Use text content to name components accurately (e.g. 'SafeProducts', not 'FAQ')." - SAVE: Paste the JSON result into scripts/structure-output.json.

  1. Process Result: node scripts/coderio-skill.mjs save-structure

Step 1.3: Extract Props (Iterative)

  1. List Components: node scripts/coderio-skill.mjs list-components
  2. For EACH component in the list: a. Generate Prompt: node scripts/coderio-skill.mjs props-prompt "ComponentName" > scripts/current-props-prompt.md b. AI Task (Props): c. Save & Validate: node scripts/coderio-skill.mjs save-props "ComponentName" # If this fails, re-do step 'b' with better attention to the thumbnail

- ATTACH: process/thumbnail.png (MANDATORY) - READ: scripts/current-props-prompt.md - INSTRUCTION: "Extract props and state data. Be pixel-perfect with text and image paths." - SAVE: Paste the JSON result into scripts/ComponentName-props.json.


Phase 2: Code Generation

Step 2.1: Plan Tasks

node scripts/coderio-skill.mjs list-gen-tasks

This outputs a list of tasks with indices (0, 1, 2...).

Step 2.2: Generate Components (Iterative)

For EACH task index (starting from 0):

  1. Generate Prompt: node scripts/coderio-skill.mjs code-prompt 0 > scripts/code-prompt.md # Replace '0' with current task index
  2. AI Task (Code):

- ATTACH: process/thumbnail.png (MANDATORY) - READ: scripts/code-prompt.md - INSTRUCTION: "Generate the React component code. Match the thumbnail EXACTLY. Use STRICT text content from input data, do not hallucinate." - SAVE: Paste the code block into scripts/code-output.txt.

  1. Save Code: node scripts/coderio-skill.mjs save-code 0 # Replace '0' with current task index

Step 2.3: Final Integration

Inject the root component into App.tsx. Use the path found in the last task of Phase 2.1.


Troubleshooting

  • "Props validation failed": The AI generated empty props. Check if process/thumbnail.png was attached and visible to the AI. Retry the props generation step.
  • "Module not found": Ensure node scripts/coderio-skill.mjs save-code was run for the child component before the parent component. Phase 2 must be done in order (0, 1, 2...).
  • "Visuals don't match": Did you attach the thumbnail? The AI relies on it for spacing and layout nuances not present in the raw data.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.69%
按下载量换算313

Claude

29.22%
按下载量换算264

Cursor

18.98%
按下载量换算171

Gemini CLI

8.51%
按下载量换算77

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills