Skip to content
Back to search

design-dna

Extract, define, and apply design DNA across three dimensions: design system (tokens), design style (qualitative feel), and visual effects (Canvas, WebGL, 3D, particles, shaders, scroll effects, etc.). Use this skill when: (1) a user wants to see the full 3-dimension design structure/schema, (2) a user provides images, screenshots, or URLs of reference designs and wants them analyzed into a structured JSON profile covering all three dimensions, (3) a user has a Design DNA JSON and content and wants a design generated from it, or (4) any combination of these phases. Triggers on "design DNA", "extract design style", "analyze design", "design tokens from reference", "generate design from JSON", "design system from screenshot", "design profile", "style guide JSON", "visual effects analysis", "design with effects", "3d design analysis".

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/zanwei-design-dna/badge.svg)](/listings/zanwei-design-dna)

HTML

<a href="/listings/zanwei-design-dna"><img src="/api/listings/zanwei-design-dna/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

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 was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 114 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. ---
  2. name: design-dna
  3. description: >-
  4. Extract, define, and apply design DNA across three dimensions: design system
  5. (tokens), design style (qualitative feel), and visual effects (Canvas, WebGL,
  6. 3D, particles, shaders, scroll effects, etc.). Use this skill when: (1) a user
  7. wants to see the full 3-dimension design structure/schema, (2) a user provides
  8. images, screenshots, or URLs of reference designs and wants them analyzed into
  9. a structured JSON profile covering all three dimensions, (3) a user has a
  10. Design DNA JSON and content and wants a design generated from it, or (4) any
  11. combination of these phases. Triggers on "design DNA", "extract design style",
  12. "analyze design", "design tokens from reference", "generate design from JSON",
  13. "design system from screenshot", "design profile", "style guide JSON",
  14. "visual effects analysis", "design with effects", "3d design analysis".
  15. ---
  16. # Design DNA
  17. A 3-phase workflow for extracting, structuring, and applying design identity across three dimensions:
  18. 1. **Design System** — measurable tokens (color, typography, spacing, layout, shape, elevation, motion, components)
  19. 2. **Design Style** — qualitative perception (mood, visual language, composition, imagery, interaction feel, brand voice)
  20. 3. **Visual Effects** — special rendering (Canvas, WebGL, 3D, particles, shaders, scroll effects, cursor effects, SVG animations, glassmorphism, etc.)
  21. ## Phases
  22. ### Phase 1: Structure — Output the Schema
  23. When the user asks for the structural dimensions or schema:
  24. 1. Read [references/schema.md](references/schema.md)
  25. 2. Present the full schema with field descriptions
  26. 3. Explain the three dimensions and their roles:
  27. - **design_system**: What you can measure — exact hex values, pixel sizes, rem scales
  28. - **design_style**: What you can feel — mood, personality, composition strategy
  29. - **visual_effects**: What you can see but can't express in CSS alone — WebGL scenes, particle systems, shader distortions, scroll-driven animations
  30. 4. Ask if the user wants to customize or extend any dimensions
  31. ### Phase 2: Analyze — Extract DNA from References
  32. When the user provides images, screenshots, or links representing a target design style:
  33. 1. Read [references/schema.md](references/schema.md) for the full field list
  34. 2. For each reference provided:
  35. - If image/screenshot: **first run the deterministic color measurement** (see below), then analyze the remaining visual properties directly
  36. - If URL: fetch and analyze the page's visual design
  37. 3. For every field in the schema, extract or infer a value from the references
  38. 4. When multiple references conflict, note the dominant pattern and mention variants
  39. 5. Output a complete Design DNA JSON — every field populated, no empty strings
  40. 6. After output, ask: "Want to adjust any values before using this for generation?"
  41. **Analysis approach per dimension:**
  42. #### Dimension 1: design_system
  43. - **color**: Do not estimate hex values by eye — perceived colors drift toward familiar palette defaults (often by a ΔE of 10+). When the reference is an image file, measure instead. Resolve `SKILL_ROOT` to the absolute directory containing this `SKILL.md`; never assume the current project directory contains the skill's `scripts/` folder. Use absolute paths for the reference and output, and keep one uniquely named measurement file per reference:
  44. ```bash
  45. npm install --prefix "$SKILL_ROOT/scripts" --silent
  46. node "$SKILL_ROOT/scripts/measure-colors.mjs" "$REFERENCE_IMAGE" > "$MEASUREMENT_JSON"
  47. ```
  48. Use the measured hexes verbatim in the DNA JSON: map the `background` role to `surface.background`; map `text` to the end of `neutral.scale` that contrasts with the measured background and document that foreground use in `neutral.usage`; and map `accent` to `accent.hex`. Keep both the measured palette and its `measurement` configuration in `design_system.color.measured_palette` and `design_system.color.measurement` so verification can reuse the same clustering configuration. Coverage values are fractions from `0` to `1`. Only fall back to visual sampling when measurement is impossible (for example, a URL-only reference that cannot be screenshotted). Choose primary and secondary colors by semantic role, use accent for CTA emphasis, and order the neutral scale from lightest to darkest regardless of theme.
  49. - **typography**: Identify font families by visual characteristics (geometric, humanist, serif class). Estimate scale ratios from heading/body size relationships.
  50. - **spacing**: Assess density by element proximity. Measure rhythm by section gap consistency.
  51. - **layout**: Identify grid by content alignment patterns. Note max-width, column count, asymmetry.
  52. - **shape**: Measure border-radius by comparing to element height. Note border and divider presence.
  53. - **elevation**: Classify shadow softness, spread, and layering approach.
  54. - **motion**: If observable (video/interactive), note easing curves and duration feel.
  55. #### Dimension 2: design_style
  56. - Synthesize holistic impressions — mood, personality, composition strategy
  57. - Compare against genre archetypes (SaaS, editorial, brutalist, etc.)
  58. - Note ornamentation level and whitespace philosophy
  59. #### Dimension 3: visual_effects
  60. - **From code**: Scan for `<canvas>`, WebGL contexts, Three.js/Pixi.js imports, GSAP/Lottie usage, custom shaders, IntersectionObserver scroll triggers, SVG `<animate>` elements
  61. - **From screenshots**: Describe visible effects that go beyond standard CSS — glowing particles, 3D object renders, noise textures, gradient animations, parallax depth, cursor trails, text distortions, glassmorphic surfaces. Note these in `composite_notes` when exact implementation can't be determined.
  62. - **From video/interaction demos**: Note scroll behaviors, hover distortions, transition choreography, loading sequences
  63. - Set `enabled: false` for any effect category not present in the reference
  64. - Rate `overview.effect_intensity` and `overview.performance_tier` based on what's observed
  65. ### Phase 3: Generate — Apply DNA to Content
  66. When the user provides DNA JSON + content to design:
  67. 1. Read [references/generation-guide.md](references/generation-guide.md)
  68. 2. Parse the DNA JSON and extract all tokens across three dimensions
  69. 3. Build CSS custom properties from `design_system` values
  70. 4. Apply `design_style` qualitative fields to guide subjective design decisions
  71. 5. When the design needs assets or source materials, fetch them from the original source whenever possible. If the user provided a URL, retrieve the real asset from that URL instead of recreating, approximating, or substituting it.
  72. 6. Implement `visual_effects` using appropriate technologies:
  73. - Lightweight effects → CSS animations, SVG, vanilla JS
  74. - Medium effects → Canvas 2D, GSAP, Lottie
  75. - Heavy effects → Three.js, custom GLSL shaders, Pixi.js
  76. 7. Generate the design output (default: self-contained HTML with inline CSS/JS)
  77. 8. Run quality checks from the generation guide
  78. 9. **Verify (when the DNA contains a measured palette)**: save the current Design DNA JSON if it is not already a file, screenshot the generated output, then score it against that DNA file. Resolve `SKILL_ROOT` from this `SKILL.md` and use absolute paths; do not assume a temporary file named `measured-colors.json` exists:
  79. ```bash
  80. node "$SKILL_ROOT/scripts/verify.mjs" "$IMPLEMENTATION_SCREENSHOT" "$DESIGN_DNA_JSON"
  81. ```
  82. A standalone measurement JSON may be used instead of the DNA file when that is the only persisted artifact. For multiple image references, verify against each reference's measurement separately. The report gives per-color ΔE and coverage drift with PASS/FAIL thresholds. If it fails, fix the offending colors and re-verify instead of asking the user to judge fidelity by eye.
  83. **If the user provides only content without DNA JSON**, ask whether to:
  84. - Analyze a reference first (go to Phase 2)
  85. - Use a described style (extract DNA from description, then generate)
  86. ## Phase Combinations
  87. Users may invoke any combination:
  88. - **Phase 1 only**: "Show me the design structure/schema"
  89. - **Phase 2 only**: "Analyze this design" (with images/links)
  90. - **Phase 2 → 3**: "Analyze this design and build me a landing page in the same style"
  91. - **Phase 1 → 2 → 3**: Full pipeline
  92. - **Phase 3 only**: User already has DNA JSON
  93. Detect which phase(s) are needed from context and execute accordingly.
README.md · README · 139 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. <h1 align="center">design-dna</h1>
  2. <p align="center">
  3. English | <a href="README.zh-CN.md">中文</a> | <a href="README.ja.md">日本語</a> | <a href="README.ko.md">한국어</a> | <a href="README.es.md">Español</a> | <a href="README.zh-TW.md">繁體中文</a>
  4. </p>
  5. 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.
  6. ![example](https://github.com/user-attachments/assets/77e9e02e-35a4-4d65-a402-dc6f9b35ed6e)
  7. https://github.com/user-attachments/assets/00e0a28d-42ce-4a08-a0c0-1ecf8b9f7e97
  8. <h3 align="center">Other cases</h3>
  9. https://github.com/user-attachments/assets/80793608-930d-42ca-951f-eb21ac188d54
  10. https://github.com/user-attachments/assets/cd4cba94-cd2c-480f-8efa-4ac86e00ae1f
  11. ## Prerequisites
  12. - [Node.js](https://nodejs.org/) environment installed
  13. - Ability to run `npx` commands
  14. ## Installation
  15. ### Quick Install (Recommended)
  16. ```bash
  17. npx skills add zanwei/design-dna
  18. ```
  19. ### Install to Specific Agent
  20. ```bash
  21. # Cursor only, non-interactive, global install
  22. npx skills add zanwei/design-dna -a cursor -g -y
  23. # Claude Code only
  24. npx skills add zanwei/design-dna -a claude-code -g -y
  25. ```
  26. ### Install from Local Clone
  27. ```bash
  28. git clone https://github.com/zanwei/design-dna.git
  29. npx skills add ./design-dna -y
  30. ```
  31. ### List Available Skills
  32. ```bash
  33. npx skills add zanwei/design-dna --list
  34. ```
  35. ## What It Does
  36. | Dimension | Role |
  37. |-----------|------|
  38. | **Design System** | Measurable tokens: color, typography, spacing, layout, shape, elevation, motion, components |
  39. | **Design Style** | Qualitative perception: mood, visual language, composition, imagery, interaction feel, brand voice |
  40. | **Visual Effects** | Beyond plain CSS: Canvas, WebGL, 3D, particles, shaders, scroll-driven motion, cursor effects, SVG animation, glassmorphism, etc. |
  41. The skill drives a **three-phase** workflow:
  42. 1. **Structure** — Surface the full schema and field meanings (see `references/schema.md`).
  43. 2. **Analyze** — From screenshots, images, or URLs, produce a complete JSON profile (every field filled; conflicts noted).
  44. 3. **Generate** — Given DNA JSON plus content, implement the design (default: self-contained HTML/CSS/JS), following `references/generation-guide.md`.
  45. Phases can be used alone or chained (e.g. Analyze → Generate).
  46. ## How It Works
  47. Pipeline at a glance ([Mermaid](https://github.blog/news-insights/product-news/github-now-supports-mermaid-diagrams-in-markdown/) renders on GitHub):
  48. ```mermaid
  49. flowchart LR
  50. A["Reference designs<br/>Screenshots · URLs · images<br/><br/>Any design you admire"]
  51. B["Design DNA JSON<br/>Quantified spec<br/><br/>Structured profile"]
  52. C["Final output<br/>Faithful implementation<br/><br/>Production-ready UI"]
  53. A -->|"Analyze — extract every visual property"| B
  54. B -->|"Generate — apply DNA to your content"| C
  55. B -.-> D["Save · reuse · version control"]
  56. ```
  57. **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.
  58. **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.
  59. **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.
  60. 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.
  61. > [!TIP]
  62. > **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.
  63. >
  64. > **Prompt:** **Against the reference, audit hierarchy, ornamentation, typographic rhythm, motion, materiality, and overall UI—then merge your conclusions back into the current implementation.**
  65. ## Deterministic Measurement (optional)
  66. 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:
  67. The manual commands below are for a local clone of this repository. Run them from the clone's root:
  68. ```bash
  69. npm install --prefix ./scripts
  70. # Analyze: measure the exact palette from a reference screenshot
  71. node scripts/measure-colors.mjs reference.png > measured-colors.json
  72. # Generate: score the implementation screenshot against the reference
  73. node scripts/verify.mjs implementation.png measured-colors.json
  74. ```
  75. 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.
  76. `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.
  77. Same reference (bun.sh's hero), same agent — perceived rebuild vs measured rebuild:
  78. ![Example: rebuilding the bun.sh hero from perceived style vs measured tokens. The measured rebuild reproduces every token (verify PASS, mean ΔE 0.87); the perceived rebuild drifts the near-black background to #000000 and the brand pink to the familiar #ec4899 (FAIL, mean ΔE 9.54).](docs/example-deterministic-measurement.png)
  79. ## Compatibility
  80. Follows the [Agent Skills specification](https://agentskills.io). Installable via [`skills` CLI](https://github.com/vercel-labs/skills) to all [supported agents](https://github.com/vercel-labs/skills#supported-agents) including Cursor, Claude Code, Codex, GitHub Copilot, and [39 more](https://github.com/vercel-labs/skills#supported-agents).
  81. ## Contributing
  82. 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.
  83. ## License
  84. MIT
  85. ## Star History
  86. [![Star History Chart](https://api.star-history.com/svg?repos=zanwei/design-dna&type=Date)](https://star-history.com/#zanwei/design-dna&Date)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.