codify-design-to-code

将设计稿转换为可用于业务的 UI 代码。精准还原视觉效果, 同时生成结构合理、数据驱动的代码。适用于任意 UI 框架。

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "codify-design-to-code" with this command: npx skills add chenaey/codify-dev-skill/chenaey-codify-dev-skill-codify-design-to-code

Codify Dev - 设计转代码

核心原则

截图看布局,骨架定边界,JSON 取样式。三者协同,缺一不可。

数据源告诉你什么不告诉你什么
截图视觉效果、颜色感知、间距比例、整体氛围精确数值、层级结构、节点 ID
骨架组件边界、布局方向、重复模式、节点层级具体样式、颜色、字体大小
JSON精确 CSS 值、节点属性、资源 ID视觉上下文、设计意图

协同:截图 + 骨架 → 理解意图、规划拆分;骨架 + JSON → 精确实现;截图 + JSON → 验证还原。


工作流程

Step 1. 分析设计结构

获取骨架,理解结构和组件边界:

curl -s -X POST http://127.0.0.1:13580/get_design \
  -H "Content-Type: application/json" \
  -d '{"node_id": "节点ID", "mode": "skeleton"}'

如果具备图片读取能力,同时获取截图辅助理解设计意图和视觉主次:

node $SKILL_DIR/scripts/download-screenshot.cjs --output "$TMPDIR/design-screenshot.jpg"

根据骨架(+ 截图)规划组件拆分和实现顺序。骨架标记见 design-schema.md,拆分规则见 codegen-rules.md。骨架太大时,按子节点 ID 分步获取 JSON 并逐个实现。

Step 2. 获取 JSON 并生成代码

curl -s -X POST http://127.0.0.1:13580/get_design \
  -H "Content-Type: application/json" \
  -d '{"node_id": "节点ID"}'

生成代码前阅读 codegen-rules.md

Step 3. 下载资源

所有图标和图片通过脚本下载,不使用占位符。 资源识别规则见 codegen-rules.md,下载命令见 api.md


完成前回顾

生成代码后,内部检查:

  • 骨架中的关键节点是否都已实现
  • 业务数据是否通过 Props 传入(非硬编码)
  • 重复结构是否使用数组循环
  • 所有资源是否已下载,路径真实
  • 资源引用方式是否与项目已有代码一致

参考文档

文档何时读取
codegen-rules.md生成代码前
design-schema.md理解 JSON 结构时
api.md调用 API 或下载资源时

错误处理

api.md 错误格式与错误码。

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated
Coding

ai-dating

This skill enables dating and matchmaking workflows. Use it when a user asks to make friends, find a partner, run matchmaking, or provide dating preferences/profile updates. The skill should execute `dating-cli` commands to complete profile setup, task creation/update, match checking, contact reveal, and review.

Archived SourceRecently Updated
Coding

clawhub-rate-limited-publisher

Queue and publish local skills to ClawHub with a strict 5-per-hour cap using the local clawhub CLI and host scheduler.

Archived SourceRecently Updated