Official installation · Skill instructions · Colour measurement · Download source (ZIP)
Design DNA helps analyse an authorised reference and save its design in JSON: colours, dimensions, composition and visible effects. Codex can then apply the agreed rules to your text and images.
What it is useful for
For example, you like a reference catalogue's density but need your own text, brand colours and booking form. First analyse content width, spacing increments, heading sizes and buttons. Then choose which principles to use in your interface.
The skill offers three stages: profile structure, reference analysis and interface creation from the profile. You can run them separately. An analysis alone does not require building a site.
A screenshot shows one state's appearance. It does not establish the font, server implementation, form behaviour or animation speed. Ask the assistant to record measurements, assumptions and details still needing agreement separately. Analysing a design does not grant rights to another party's logo or images.
How to connect it to Codex
This is an agent skill with instruction files and optional scripts, rather than a separate editor or MCP. Check any existing connection first.
- Ask the assistant to find the current project and skills. Read the official README and relevant
SKILL.md; installation needs Node.js withnpx. - After approval, use the command below. Select Codex and the required scope in the installer; avoid unnecessary global copies.
- Ask it to show the installed folder and read
references/schema.md. If the skill is absent, check the selected project and open a new session.
npx skills add zanwei/design-dna
Work needs project materials and appropriate viewing tools. Without a connected skill, the official instructions can serve as a reference, but reading them does not install it. See the skill installation guide.
How to analyse a reference and test its use
For a first trial, use one screenshot of your own and one page with known content. Save the reference viewport size: different widths produce different wrapping and spacing in the same layout.
- Ask Codex to find the reference file and confirm that it shows the right screen. For an accessible site, use authorised viewing and actual styles; record measurement limitations for an image.
- Get a JSON profile following the skill's schema. The assistant should cite sources and separate measured properties from proposals for your version. Leave unseen form states and motion as questions rather than reference properties.
- Agree on rules and apply them to one screen with your content and brand. The skill can produce standalone HTML/CSS/JS by default; tell it to preserve the existing project's technology and components.
- Open the interface and compare it with the reference at the same width. Then check a phone layout, long text, keyboard navigation and the main action.
The author's image scripts are measure-colors.mjs and verify.mjs. The first measures the palette from pixels; the second compares it with an image of the result. They need dependencies but no API key. The assistant should locate them relative to the actual SKILL.md and ask before installing missing dependencies.
Example for the assistant with prepared scripts and your files:
node "$DNA_SKILL_ROOT/scripts/measure-colors.mjs" "$REFERENCE_IMAGE" > "$MEASUREMENT_JSON"
node "$DNA_SKILL_ROOT/scripts/verify.mjs" "$IMPLEMENTATION_IMAGE" "$MEASUREMENT_JSON"
The assistant determines paths and an unused report filename, saves measurement settings and compares matching image regions. These commands check the palette; they do not verify the text, behaviour or entire interface.
Where it is used
In the site or app design plan, analysing references, Design DNA turns a reference into clear rules. Apply them to the same content when choosing a composition.
Google DESIGN.md can store accepted rules over time. Its format differs from Design DNA JSON: the assistant must map values, not simply rename the file. Next, build a local prototype.
How to check results and fix errors
If colours differ noticeably, check the source image, measured palette and matching comparison crop first. Resizing or changing the number of images changes colour proportions and can explain a report discrepancy even when shades match.
If a script is missing, check the installed skill folder. Its scripts directory need not be in your project. Save separate measurements for different references to avoid comparing against the wrong palette.
A screenshot alone cannot confirm an exact font name by resemblance. If authorised page viewing is unavailable, say so and work from the supplied image. Check the main action separately; a colour report does not test it.
The repository uses the MIT licence; model use and third-party services cost extra. A first analysis can use your files without external image storage. Save the profile, reference, measurements and agreed differences. To undo design changes, restore the code version; removing the skill does not revert the design.
The task is complete when the profile is understandable, accepted values appear on screen, and measurements and real actions have been checked. Use the design system plan if other screens need these rules.
Prompt for Codex
Paste into Codex or Work with access to your project and an authorised reference.
Analyse an authorised design reference with Design DNA and apply selected rules to one screen of my project. Find the project, reference, my text and brand materials yourself. Check the existing skill and https://github.com/zanwei/design-dna. Ask before adding missing connections or dependencies. Read SKILL.md and references/schema.md from the actual skill folder.
Start with analysis without automatically creating a new site. Save a JSON profile and sources. Separate pixel or style measurements, assumptions and unseen states. For an image file, use the available measure-colors.mjs and find its path relative to SKILL.md. Do not invent an exact font, form behaviour or animation from one screenshot. After my choice, apply rules to my content while preserving the project's technology, brand and functions. Open the result at the same width, then at 390 pixels, and check long Russian text, keyboard navigation and the main action. If a measured palette is available, compare the result screenshot using verify.mjs with the correct reference measurement and explain discrepancies. Do not describe a colour check as a complete interface check. Save the profile, measurements, screenshots and editable result. State unavailable checks and the next step.