Your codealready knows itsidentity.
dna extracts the palette, type scale, and spacing grid your codebase already believes — records where every value came from — and gates every change against it. Nothing imposed. Nothing invented.
npm install -g @calibrate-ds/dnaDrift doesn't need a handoff.
It happens inside the codebase — one raw literal, one off-grid pixel, one rebuilt component at a time. Faster now that AI writes most of the UI.
background: #b68e41;→ one digit off var(--brand)Invisible in code review. Visible in production.
gap: 7px;→ nearest on-grid: 8pxThe 4px grid dies one arbitrary pixel at a time.
color: var(--accent-muted);→ no such token in identity.yamlRenamed six months ago. Still referenced in 9 files.
<div className="card-wrap">…→ 0.92 match with <Card />An AI rebuilt it because it never checked the inventory.
Extract. Gate. Cooperate.
Extract
dna start reads what your codebase already believes.
Palette with tiers inferred from the token resolution graph, type scale, spacing grid, radius idioms — written to .dna/identity.yaml with per-value provenance: { value, from, at }. Nothing invented: observed values are surfaced for review, never silently dropped, never imposed.
$ dna start
✔ identity.yaml — 12 tokens
brand:
value: "#B68D42"
from: code
at: 2026-08-12Gate
dna check holds every change to that identity.
Diff-default — it checks what you changed, not what you inherited. Four layers: source lint, cn-merge guard, rendered conformance in headless Chrome, structural manifests. Tri-state and honest: pass, nothing-to-check, or fail — a no-op never renders as a green tick.
$ dna check # changed lines $ dna check --audit # whole tree $ dna hook install # pre-commit gate
Cooperate
Your AI IDE calls dna on its own initiative.
dna mcp exposes five detector-only tools, and dna start writes the convention into your CLAUDE.md / AGENTS.md: check the inventory before building, resolve values before writing literals, check after every design-relevant edit. The pre-commit hook stays the backstop.
$ claude mcp add dna -- dna mcp you: "add a hover state" AI: [dna_resolve #B68D42 → --brand] AI: "using var(--brand)"
Opinionated about honesty.
Neutral about your choices.
dna resolve
The proactive counterpart to check: reverse-lookup any raw value to its identity token before the literal is ever written. A value on multiple scales reports all of them.
dna allow
Deliberate exceptions, adopted with provenance and a required --why into decisions.jsonl. An exception with a reason is a decision. One without is drift.
dna similar
Catches hand-rebuilds of existing components and net-new shapes cloned across files with no backing component. Advisory, never gating.
Tri-state honesty
Every check answers pass, nothing-to-check, or fail. Nothing-to-check never renders as a green tick — silence is never sold as success.
Isolation by design
Owns .dna/ and writes nowhere else. No network calls, no credentials, no telemetry. Every MCP tool is detector-only: it reports, your tools edit.
Speaks shadcn / Tailwind
HSL-channel tokens (--primary: 142 71% 29%) are recognized when real usage corroborates them — full extraction and resolve for the dominant modern token architecture.
Your AI IDE, conformance-aware.
One command wires them in. None of them ever write source — they report, and the agent edits with its own tools.
dna_checkConformance findings as structured data — rule, severity, file, line, hint.
dna_resolveRaw value → identity token, before the literal gets written.
dna_inventoryThe component vocabulary — name, props, use-when, path.
dna_similarRebuild and clone findings, tagged by kind, with scores.
dna_start_previewWhat dna start would extract — without writing anything.
$ claude mcp add dna -- dna mcpMCP docs Your identity is already
in the code. Enforce it.
npm install -g @calibrate-ds/dna