Spec 01
Getting started
Getting started
Install the CLI, register it with your coding agent and run a first reconstruction.
01.1Install
UI DNA is one npm package with two commands, uidna and uidna-mcp. It drives a local Chromium that Playwright installs.
$ npm install -g uidna-mcp $ npx playwright install chromium
No global install
Every command also runs through npx, for example npx uidna-mcp doctor.
01.2Register with your agents
uidna setup adds the MCP server to Claude Code, Codex and Cursor. It prints the planned changes, asks before writing and backs up every file it touches.
$ uidna setup| Option | Effect |
|---|---|
--targets <list> | comma-separated: claude-code,codex,cursor (default all) |
--scope <scope> | user (default) or project |
--local | register this checkout (node dist/cli.js serve) instead of npx -y uidna-mcp@latest serve |
--yes | apply without asking |
--no-backup | do not back up existing config files |
Manual configuration
{
"mcpServers": {
"uidna": { "type": "stdio", "command": "npx", "args": ["-y", "uidna-mcp@latest", "serve"] }
}
}Windows
The registered command is wrapped in cmd /c.
01.3Check the setup
Browser availability, Chrome DevTools reachability and where the server is registered.
$ uidna doctor01.4First run
Without an agent, uidna reconstruct runs the whole loop on one page: scan, explore, tokens, generate, verify and report.
$ uidna reconstruct https://example.com ./example-clone --viewports 1280,768,390A small site you own
Up to five same-origin pages, JSON responses captured as data, forms exercised with synthetic values.
$ uidna reconstruct http://localhost:3000 ./my-site \
--crawl '{"maxPages":5}' --capture-bodies json --policy formsAuthorized use
Scan interfaces you own or are allowed to analyze. Every non-GET request is blocked while exploring. More
What you get
- 1
./.uidna/<scan-id>/Captures, screenshots and the UI DNA document. - 2
./example-clone/A React, TypeScript, Tailwind and Vite project, installed and built. - 3The DiffReportOne finding per difference, with regressions and resolved findings per attempt.
- 4
report.htmlA static report of the evidence, next to the scan.
01.5Teach your agent
The shipped skill teaches the agent the loop. Copy skills/uidna/SKILL.md into your agent’s skills directory; for Claude Code that is ~/.claude/skills/uidna/. Then ask:
Reconstruct http://localhost:3000 at 1280, 768 and 390 px with UI DNA. Repair until no regressions remain.