
Design DNA
Skill把你喜欢的参考界面(截图、图片或网址)拆解成结构化的「设计 DNA」JSON,涵盖设计变量、整体风格与视觉特效三个维度,再按这份 DNA 把你的内容做成风格一致的新页面。安装需本机 Node.js,无需 API Key。
design-dna
English | 中文 | 日本語 | 한국어 | Español | 繁體中文
An agent skill for extracting, structuring, and applying visual design identity as machine-readable "Design DNA" across three dimensions: design tokens, qualitative style, and visual effects.
https://github.com/user-attachments/assets/00e0a28d-42ce-4a08-a0c0-1ecf8b9f7e97
Other cases
https://github.com/user-attachments/assets/80793608-930d-42ca-951f-eb21ac188d54
https://github.com/user-attachments/assets/cd4cba94-cd2c-480f-8efa-4ac86e00ae1f
Prerequisites
- Node.js environment installed
- Ability to run
npxcommands
Installation
Quick Install (Recommended)
npx skills add zanwei/design-dna
Install to Specific Agent
# Cursor only, non-interactive, global install
npx skills add zanwei/design-dna -a cursor -g -y
# Claude Code only
npx skills add zanwei/design-dna -a claude-code -g -y
Install from Local Clone
git clone https://github.com/zanwei/design-dna.git
npx skills add ./design-dna -y
List Available Skills
npx skills add zanwei/design-dna --list
What It Does
| Dimension | Role |
|---|---|
| Design System | Measurable tokens: color, typography, spacing, layout, shape, elevation, motion, components |
| Design Style | Qualitative perception: mood, visual language, composition, imagery, interaction feel, brand voice |
| Visual Effects | Beyond plain CSS: Canvas, WebGL, 3D, particles, shaders, scroll-driven motion, cursor effects, SVG animation, glassmorphism, etc. |
The skill drives a three-phase workflow:
- Structure — Surface the full schema and field meanings (see
references/schema.md). - Analyze — From screenshots, images, or URLs, produce a complete JSON profile (every field filled; conflicts noted).
- Generate — Given DNA JSON plus content, implement the design (default: self-contained HTML/CSS/JS), following
references/generation-guide.md.
Phases can be used alone or chained (e.g. Analyze → Generate).
How It Works
Pipeline at a glance (Mermaid renders on GitHub):
flowchart LR
A["Reference designs<br/>Screenshots · URLs · images<br/><br/>Any design you admire"]
B["Design DNA JSON<br/>Quantified spec<br/><br/>Structured profile"]
C["Final output<br/>Faithful implementation<br/><br/>Production-ready UI"]
A -->|"Analyze — extract every visual property"| B
B -->|"Generate — apply DNA to your content"| C
B -.-> D["Save · reuse · version control"]
Step 1 — Curate references. Collect screenshots, images, or live URLs of designs whose visual identity you want to capture. Multiple references can be combined; the skill identifies dominant patterns and notes variants.
Step 2 — Extract DNA. Feed the references to the agent. It inspects every visual property across all three dimensions and outputs a complete, quantified Design DNA JSON — no empty fields, no guesswork. This JSON becomes a portable, reusable design specification.
Step 3 — Generate from DNA. Provide the DNA JSON together with your own content. The agent produces implementations that faithfully reproduce the original design language while adapting to your material.
The DNA JSON is the key artifact. Once extracted, it can be committed to version control, shared across teams, reused across projects, and iteratively refined — turning subjective "make it look like that site" into a precise, reproducible specification that any agent can consume.
[!TIP] Refining visual richness. If the first pass still feels visually thin or under-detailed next to your references, run a deliberate polish iteration: re-attach the same URLs or screenshots. This narrows the gap between a workable draft and a reference-faithful, visually rich result without starting over.
Prompt: Against the reference, audit hierarchy, ornamentation, typographic rhythm, motion, materiality, and overall UI—then merge your conclusions back into the current implementation.
Deterministic Measurement (optional)
LLM color perception drifts toward familiar palette defaults — a brand pink like #ff90e8 gets "seen" as #ec4899 (ΔE ≈ 29). Two optional scripts make the Analyze and Generate phases measurable:
The manual commands below are for a local clone of this repository. Run them from the clone's root:
npm install --prefix ./scripts
# Analyze: measure the exact palette from a reference screenshot
node scripts/measure-colors.mjs reference.png > measured-colors.json
# Generate: score the implementation screenshot against the reference
node scripts/verify.mjs implementation.png measured-colors.json
When installed as an agent skill via Quick Install, the agent must resolve these scripts from the absolute directory containing the loaded SKILL.md; users do not need a scripts/ directory in their project root.
measure-colors.mjs runs deterministic k-means clustering over the actual pixels (with perceptual ΔE merging of anti-aliasing noise) and outputs exact hexes, coverage as 0..1 fractions, background/text/accent roles, and the clustering k. verify.mjs reuses the recorded k, re-measures the generated output, and reports per-color ΔE and coverage drift with PASS/FAIL thresholds, giving the agent a self-correction loop instead of relying on the user's eye. The skill instructs agents to use both automatically when references are image files; no API keys required.
Same reference (bun.sh's hero), same agent — perceived rebuild vs measured rebuild:

Compatibility
Follows the Agent Skills specification. Installable via skills CLI to all supported agents including Cursor, Claude Code, Codex, GitHub Copilot, and 39 more.
Contributing
Issues and pull requests are welcome. For substantive behavior changes, update SKILL.md and any affected files under references/ so the skill stays internally consistent.
License
MIT
Star History
相關資源

Taste Skill
Skill让 agent 生成的前端摆脱模板感:先判断设计方向,再用布局变化、动效强度、信息密度三个参数调节效果;另含改版审计、极简与粗野主义风格及设计参考图生成等技能。
Leonxlnx/taste-skill118k
Stitch Design Skills
SkillGoogle Stitch 配套技能合集:由文字或图片生成界面、从代码提取 DESIGN.md,并把设计稿转成 React 或 React Native 组件。Google Labs 出品但非 Google 正式支持产品,需先配置 Stitch MCP。
google-labs-code/stitch-skills10.2k
Figma Skills (mcp-server-guide)
SkillFigma 官方技能合集:把设计稿还原成代码、用 Code Connect 映射组件、从代码生成设计系统组件库、在画布上搭建页面和 FigJam 图表。需连接 Figma MCP 服务器;写入画布目前处于 Beta 阶段,暂时免费。
figma/mcp-server-guide2.2k
Figma (Codex)
PluginFigma 出品、收录于 OpenAI 官方市场的 Codex 插件:按设计稿实现界面、生成 Code Connect 映射,还能在 Figma 里创建或更新页面、组件库、FigJam 图表和幻灯片。需要连接 Figma 账号。
openai/plugins8k
designlang
CLI用无头浏览器读取任意网站的设计系统,一条命令导出颜色、字体、间距等设计令牌(DTCG)、Tailwind 配置、Figma 变量和品牌规范手册,还能给配色对比度与多页一致性打分;也可作为 MCP 服务或 Claude Code 插件使用。需要 Node.js,首次要下载 Chromium(也可改用已安装的 Chrome)。
Manavarya09/design-extract5.2k
Figma MCP Server Guide
PluginFigma 官方插件:接入 Figma 远程 MCP 服务器,附带设计稿转代码、Code Connect、生成设计与组件库等技能,可读取设计上下文并写入画布。需要 Figma 账号,Starter 版与查看、协作席位每月仅 6 次调用。
figma/mcp-server-guide2.2k