wangzhiming

Design To Code

Developmentv1.0.1
By wangzhimingUpdated 2026-05-112 versions · latest released 2026-04-20design-to-code@clawhub_wangzhiming1999/design-to-code
Frontend

According to AlphaMoat, as of 2026-10, Design To Code has 15,049 downloads and 1 stars — ranked by downloads #1,856 among 10,914 AI skills in this ranking, and #130 of 1,069 in Development.

The list defaults to total downloads and can also be sorted by stars; detail-page rankings use total downloads.

Downloads
15.0K
Stars
1
Overall download rank
#1,856
Top 18% overall · Top 13% in Development
PlatformDownloadsStarsComments
ClawHub ↗3.1K1-
SkillHub ↗15.0K1—

Platforms count differently and update at different times.

What this skill does

Extracts layout, spacing, typography, colors and states, then uses the project’s existing stack. Confirm access and unclear measurements or tokens; do not invent unspecified motion. Compare the UI with the design, check responsiveness and accessibility, and disclose differences rather than guaranteeing exact fidelity.

Profile published 2026-10-27

What you can do with it

  • frontend implementation from a design reference

When to use it

  • When you need frontend implementation from a design reference.

Example prompts

Generated from the skill’s documentation as examples; not results of actual runs.

Implement this accessible mockup using the existing stack and flag any unclear dimensions.

Monthly Trend

Downloads15.0K
5208.3K16.1K2026-03 · Downloads 1.6K2026-05 · Downloads 3.3K2026-06 · Downloads 4.4K2026-07 · Downloads 6.4K2026-08 · Downloads 8.0K2026-09 · Downloads 10.5K2026-10 · Downloads 15.0K26-0326-0926-10
Stars1
0122026-03 · Stars -2026-05 · Stars -2026-06 · Stars -2026-07 · Stars 12026-08 · Stars 12026-09 · Stars 22026-10 · Stars 126-0326-0926-10

The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change. Other skills share this name; figures from before the change are attributed to this one, which currently has the most downloads.

MonthDownloadsMoMStars
2026-1015.0K—1
2026-0910.5K—2
2026-088.0K+26.2%1
2026-076.4K+43.5%1
2026-064.4K+35.8%-
2026-053.3K—-
2026-031.6K—-

SKILL.md (original)

The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.

4.3 KB · ClawHub v1.0.1
---
name: design-to-code
description: Implements UI from design mockups (Figma, Sketch, or image) with pixel-accurate layout, responsive behavior, and design tokens. Use when 还原设计图, implementing designs, 切图, 设计稿转代码, or converting mockups to frontend code.
---

# 还原设计图(Design to Code)

将设计稿(Figma/Sketch/图片)高保真还原为前端代码,保证布局、间距、字体、颜色与交互一致。

## 触发场景
Show all (105 lines)
- 用户说「还原设计图」「按设计稿实现」「切图」「设计转代码」
- 提供 Figma/Sketch 链接、设计图截图或标注
- 需要实现某个页面/组件的 UI

## 执行流程

### 1. 先确认用户给了什么

| 用户给的 | 第一步 |
|---------|-------|
| Figma 链接 | 问:有没有 Figma 访问权限?如果没有,让用户截图或导出标注 |
| 设计图截图 | 直接分析,提取尺寸/颜色/字体/间距,列出关键标注 |
| 只有描述,没有设计图 | 问:「有没有设计稿?如果没有,我可以按常见 UI 规范实现,但可能和你预期有出入」 |
| 有设计图 + 现有代码 | 先读现有代码,了解技术栈和已有组件,再还原设计 |

### 2. 分析设计稿,提取关键信息

读设计图时,按这个顺序提取(不要跳过):

**布局结构**
- 整体是几列?用 Flex 还是 Grid?
- 各区块的宽度是固定的还是弹性的?
- 有没有响应式断点?

**间距与尺寸**(精确到 px)
- 容器的 padding
- 元素之间的 gap/margin
- 组件的宽高(固定值还是百分比)

**字体**
- 字号、字重、行高、字间距
- 颜色(含透明度)

**颜色**
- 背景色、文字色、边框色、阴影
- 是否能映射到项目已有的 design token 或 Tailwind 颜色

**交互状态**(设计稿里有没有标注)
- hover、focus、active、disabled
- 没有标注的,按项目现有规范处理,不要自己发明

### 3. 实现顺序,不要乱

按这个顺序写代码,不要一上来就写细节:

1. **HTML 骨架**:先把语义化结构搭出来,不加任何样式
2. **布局**:Flex/Grid 定位,保证对齐和间距
3. **字体排版**:字号、字重、行高、颜色
4. **视觉装饰**:背景、边框、圆角、阴影
5. **交互状态**:hover/focus/disabled
6. **响应式**:断点适配
7. **动效**:最后加,设计稿有说明才加

### 4. 遇到这些情况,按以下方式处理

**设计稿里的颜色/字号在项目 token 里没有**
→ 先问用户:「这个颜色 `#3B82F6` 是不是对应 `blue-500`?」不要直接写魔法值
→ 如果确认没有对应 token,用 CSS 变量命名(`--color-brand-primary`),便于后续统一

**设计稿标注不清晰,看不出具体数值**
→ 说明哪里看不清,给出合理推测值,让用户确认:「这里间距看起来是 16px,对吗?」

**设计稿有动效但没有说明**
→ 不要自己发明动效,问用户:「这里有过渡动画吗?如果有,持续时间和缓动函数是什么?」

**实现后和设计稿有出入**
→ 主动说明差异和原因,不要假装没有:「这里字体用了系统字体代替,因为项目没有引入 Inter」

### 5. 还原度自检(提交前必做)

- [ ] 关键尺寸与设计稿一致(容忍 1-2px 差异)
- [ ] 字体、颜色与设计一致
- [ ] 主要断点下布局正常,无错位
- [ ] 可交互元素有明确的状态反馈(hover/focus/disabled)
- [ ] 语义化 HTML(按钮用 `<button>`,链接用 `<a>`,不用 `<div>` 代替)
- [ ] 图片有 `alt` 属性

## 输出约定

- 使用项目现有技术栈(如 Next.js、Tailwind、SCSS、组件库)
- 组件化:可复用部分拆成组件并命名清晰
- 语义化 HTML + 合理 ARIA(按钮、链接、表单)
- 必要时注明:某处与设计稿差异及原因(如兼容性、可访问性)

## 常用对照

| 设计稿 | 实现方式 |
|--------|----------|
| 8px 栅格 | 间距用 8 的倍数(8/16/24/32) |
| 字体层级 | 对应 heading/body/caption 等语义类或 design token |
| 模糊/毛玻璃 | backdrop-filter + 半透明背景 |
| 多行截断 | line-clamp 或 -webkit-line-clamp |
| 安全区域 | padding 配合 env(safe-area-inset-*) |

Popular in Development

编程大神.SkillDevelopment

【全栈能力】编程大神.Skill:面向复杂真实项目的高阶全栈编程助手。不止生成代码,而是从一句目标接手陌生代码库,拆解需求、补齐实现、追到根因、完成重构、联调前后端,并把结果推进到能运行、能验证、能交付。覆盖 Web、后端、脚本、iOS、安卓、鸿蒙 ArkUI、微信小程序及其他技术栈,支持中英文工程、疑难 Bug、跨模块任务和长任务续做;用构建、日志、真实入口、设备或接口证据说明结果。仅问概念时直接回答,要求落地时持续推进到验收或明确阻塞。

↓ 11.3M★ 82u_42bbb65f
编程专家Pro.SkillDevelopment

编程专家 Pro:融合编程专家 2.0.3 工程专题与编程大神的鸿蒙 ArkTS/ArkUI、微信小程序和小游戏开发资料。用于项目实现、根因调试、审查、重构、测试、架构性能分析及多端开发验证。支持自然语言和 @专题标识,按任务读取包内知识;只问概念时直接回答。

↓ 6.3M★ 32user_47d655f0
编程专家.SkillDevelopment

编程专家.Skill P8级编程助手,25年实战经验技能Skill,全栈:Java/Php网站/软件项目、API设计、Bug诊断、代码生成、代码审查、重构、测试用例、性能基准、技术选型、文档生成、任务拆解、Spec驱动、Karpathy规范、CMS二次开发、前端设计、MySQL/Mariadb、项目知识图谱,以及工程纪律层(根因调试硬闭环、阶段导航、事故复盘/SLO、威胁建模/供应链安全、生产就绪/渐进式发布、AI编码治理、面向Agent代码可读性、LLM应用安全)。支持 @标识 显式调用跳过路由。

↓ 6.0M★ 378user_741dc82b
dev-expertDevelopment

编程专家.Skill P8级编程助手,25年实战经验技能Skill,全栈:Java/Php网站/软件项目、API设计、Bug诊断、代码生成、代码审查、重构、测试用例、性能基准、技术选型、文档生成、任务拆解、Spec驱动、Karpathy规范、CMS二次开发、前端设计、MySQL/Mariadb、项目知识图谱,以及工程纪律层(根因调试硬闭环、阶段导航、事故复盘/SLO、威胁建模/供应链安全、生产就绪/渐进式发布、AI编码治理、面向Agent代码可读性、LLM应用安全)。支持 @标识 显式调用跳过路由。

↓ 5.3M★ 32user_814dbe54
dev-expert-proDevelopment

工程专题、鸿蒙与微信小程序开发的集成派生版

↓ 1.0M★ -user_814dbe54
编程专家 ProDevelopment

编程专家 Pro:融合编程专家 2.0.3 工程专题与编程大神的鸿蒙 ArkTS/ArkUI、微信小程序和小游戏开发资料。用于项目实现、根因调试、审查、重构、测试、架构性能分析及多端开发验证。支持自然语言和 @专题标识,按任务读取包内知识;只问概念时直接回答。

↓ 981.8K★ 1user_28275a78
编程专家.SkillDevelopment

适用场景:全栈编程助手。接到需求先读现有代码和约束,再动手:Java/PHP 开发、接口设计、缺陷定位、代码评审、重构、测试用例、性能排查、技术选型与文档产出,也做 CMS 二次开发、前端页面和 MySQL 调优。每次改动先给方案和影响范围,改完必须跑验证,交付附交接说明。适合要把代码真正跑通、而不是只要片段的场景。写完代码常要配套的造价、法律、工程文档,站内已有现成技能,用「查找技能」按需求找即可。

↓ 701.1K★ 6user_613b33ea
GithubDevelopment

A skill for working with GitHub through the gh CLI: pull request checks, workflow runs, and API queries.

↓ 479.6K★ 714Peter Steinberger

Data as of 2026-10. Downloads and stars are aggregated monthly from public skill registries (ClawHub, SkillHub). See data methodology.