decantr.ai

AI Frontend Governance

for production codebases.

When AI coding agents edit your UI, Decantr keeps every change inside your product standards.

Not a component library. Not a code generator. Typed contracts, route-scoped context, and evidence the agent can repair against.

How are you starting?

AI edits create frontend drift

The first AI pass can look good. The tenth pass is where teams lose coherence: duplicated components, inconsistent shells, route drift, stale docs, and visual decisions no one can audit.

Without Decantr · drift compounds

Prompt 1
Prompt 5
Prompt 10

With Decantr · same contract, any theme

luminarum
terminal
carbon
Zero drift · 3 themes · one essence

One governance loop. Repeat it every edit.

Adopt the app, load typed route context, let the agent edit, then verify with evidence before the change lands.

1

Attach

$ npx @decantr/cli adopt --yes
2

Prepare the task

Use Decantr route context before editing this UI. Load .decantr/graph/contract-capsule.json when present. Use .decantr/graph/snapshots for replayable graph history when debugging drift. Run decantr task /feed "add saved recipe actions". Preserve existing app authority, accepted local law, and style bridge mappings. Use Project Health findings as repair instructions. Make the smallest coherent change, then rerun decantr verify.
3

What the AI receives

Contract
Essence · Local law · Style bridge · Typed graph
Context
Route subgraph · Task authority · Page packs · Changed-file impact
Evidence
Stable codes · Repair IDs · Graph anchors · Evidence Bundles
Verified UI
Agent edits stay inside product standards and are auditable after the fact

Contract / Context / Evidence

Decantr gives agents a typed model of the frontend they are editing, scoped context for the current route, and findings they can repair without parsing prose.

Contract
  • Essence V4
  • Typed graph snapshot
  • Route topology
  • Local UI law
  • Style bridge
  • Design tokens
  • Component vocabulary
Context
  • Contract capsule
  • Route-scoped subgraph
  • Task-time authority
  • Changed-file impact
  • Accepted local patterns
  • Visual evidence references
Evidence
  • Stable diagnostic codes
  • Typed repair IDs
  • Graph anchors
  • Evidence Bundles
  • Component reuse findings
  • CI health artifacts
  • Repair prompts

Typed graph context -- not prompt soup

Markdown remains readable for humans. Agents get graph snapshots, contract capsules, and route-scoped context that point to the exact pages, shells, patterns, rules, and evidence in play.

## Quick Start # From section-agent-orchestrator.md: Shell: SidebarMainLayout (sidebar 260px, main fluid) Sidebar: fixed, dark bg, 60px header zone, nav groups with icons Tokens: import tokens.css -- surfaces, borders, text, accents Treatments: import treatments.css -- cards, code blocks, data rows ## Pattern: Agent Timeline Visual brief: Vertical feed of agent execution events. Each node shows timestamp, agent name, action type, and status badge. Connected by a thin vertical line (border-left on the timeline track). Composition: timeline-track > timeline-node[] > { icon, meta, detail } Spacing: gap-4 between nodes, p-4 inside cards Motion: nodes fade-in staggered 50ms on mount Responsive: single-column, full-width at all breakpoints
## Topology # From scaffold.md — the full app overview Zones: public → marketing-core (home, pricing, about) gateway → auth-full (/login, /register) app → agent-orchestrator (/chat, /settings) Transitions: public → gateway via CTA clicks (Sign up, Sign in) gateway → app via successful auth (redirect /chat) app → gateway via logout (redirect /login) ## Voice & Copy Tone: confident, technical, warm CTA verbs: Start, Build, Compose — never "Click here" Empty: "No agents yet. Compose your first one." Errors: one sentence, cause + next action ## Development Mode Dev auth: the generated auth flag bypasses gateway Mock data: every page ships with realistic seeded fixtures
## Pattern: split-feature # Resolved via decantr_resolve_pattern Visual brief: Two-column feature block. Left column holds a tight code snippet or terminal capture; right column carries the headline, body copy, and a single CTA. Asymmetric alignment — text is top-aligned, media floats. Slots: - media (code-sample · terminal · image) - eyebrow (optional uppercase label) - headline - body - cta-primary Composition: split-container > [ split-media > { slot: media }, split-content > { eyebrow, headline, body, cta-primary } ] Motion: media slides in 80px → 0 on scroll. content fades. Responsive: stacks under 720px — media on top, content below A11y: media is decorative unless media.role = "demo"

32 tools for your AI assistant

MCP-native governance: agents can read the contract graph, prepare route-scoped work, verify findings, and request repair prompts.

Add the MCP server
$ claude mcp add decantr -- npx -y @decantr/mcp-server
# ~/.cursor/mcp.json { "mcpServers": { "decantr": { "command": "npx", "args": ["-y", "@decantr/mcp-server"] } } }
# ~/.codeium/windsurf/mcp_config.json { "mcpServers": { "decantr": { "command": "npx", "args": ["-y", "@decantr/mcp-server"] } } }
$ npm i -g @decantr/mcp-server && decantr-mcp # Then register the binary in your editor's MCP config
Read Surface the contract and context the AI needs to work
decantr_read_essence

Read the current design spec

decantr_get_project_state

Compact project readiness, pack, graph, and local-authority state

decantr_get_contract_capsule

Load the cache-friendly typed Contract capsule for an agent session

decantr_get_graph_snapshot

Read graph metadata, route subgraphs, history snapshots, or typed snapshot diffs

decantr_query_graph

Query current or historical typed graph nodes, relations, and endpoints

decantr_traverse_graph

Traverse current or historical graph relationships from route, token, component, or rule nodes

decantr_get_scaffold_context

Top-level scaffold context for the whole app

decantr_get_section_context

Scoped context for a specific app section

decantr_get_page_context

Page-scoped context for one route or page id

decantr_get_execution_pack

Read compiled scaffold, page, section, review, or mutation packs

decantr_get_showcase_benchmarks

Inspect shortlist, manifest, and showcase verification metadata

decantr_get_registry_intelligence_summary

Hosted aggregate intelligence coverage without crawling the registry

Vocabulary Resolve certified vocabulary when the project asks for it
decantr_search_registry

Search patterns, archetypes, themes, starter kits, shells

decantr_resolve_pattern

Full pattern details with layout specs

decantr_resolve_archetype

App templates with page maps

decantr_resolve_blueprint

Composed templates with topology, zones, and transitions

decantr_suggest_patterns

Pattern recommendations for any page description

Mutate Write structured changes back into the contract
decantr_create_essence

Generate a design spec from a description

decantr_update_essence

Apply structured updates to DNA or Blueprint

decantr_accept_drift

Resolve violations by accepting, scoping, rejecting, or deferring

decantr_compile_execution_packs

Compile a hosted execution-pack bundle from an essence

Verify Score, audit, and repair generated UI against the contract
decantr_validate

Validate an Essence against the schema

decantr_check_drift

Detect design-spec violations in code changes

decantr_critique

Score generated code on treatments, decorators, motion, a11y, responsive

decantr_audit_project

Schema-backed project audit against packs, guards, and drift

decantr_get_findings

Typed findings with stable codes, repair IDs, graph anchors, and optional prompts

decantr_get_repair_plan

Structured repair plan with action payload, evidence, read targets, constraints, and rerun commands

decantr_get_evidence_bundle

Local evidence bundle for AI repair loops and CI artifacts

decantr_get_repair_prompt

Scoped repair prompt with exact finding evidence and rerun commands

decantr_workspace_health

Aggregate health for many attached Decantr projects in a monorepo

decantr_run_health_loop

Run health, evidence, and the next repair prompt in one local loop

decantr_prepare_task_context

Resolve route-local Brownfield or Hybrid authority, local law, visual evidence, and theme inventory before editing

CLI Commands

Manage your project from the terminal

new <name> --blueprint=X

Scaffold a new project from a blueprint

refresh

Regenerate context files from the essence

graph

Generate the typed Contract graph, graph diff, manifest, and contract capsule

add page

Add a new page to a section

remove page

Remove a page from a section

theme switch

Switch to a different theme

verify

Run the local reliability gate for humans, CI, and agents

verify --evidence

Write a privacy-redacted Evidence Bundle for AI repair and CI artifacts

suggest --route --from-code

Rank patterns against route, file, source-code evidence, and accepted local law

magic "prompt"

Scaffold greenfield apps from natural language; attached apps are steered into task context

adopt

Analyze, attach, verify, baseline, and show the Brownfield operating loop

doctor

Explain app/workspace state, adoption lane, stale artifacts, local law, CI wiring, and the ordered next-step queue

task <route>

Prepare route context, authority, local law, evidence, and changed-file impact before an LLM edits code

ci

Run the non-mutating required automation gate with schema-backed artifacts

codify --from-audit

Turn local buttons, cards, forms, themes, evidence, variants, and starter rules into project-owned UI law

search <query>

Search certified vocabulary across patterns, themes, shells, and starter kits

audit

Full project audit — drift, packs, guard, critique

verify --workspace

Aggregate Project Health across many Decantr projects

export --to figma-tokens

Bridge Decantr tokens into Tokens Studio-compatible JSON

Get started

Attach Decantr to the app you already have, give the agent route-scoped context, then verify the change before it lands.

Step 1: Adopt

$ npx @decantr/cli adopt --yes

Decantr inventories routes, framework, style signals, local docs, and existing UI patterns, then writes an observed contract you own.

Step 2: Activate context

$ decantr graph && decantr task /feed "add saved recipe actions"

Step 3: Verify

$ decantr verify --evidence

Project Health emits stable codes, typed repair IDs, graph anchors, and evidence bundles; graph snapshots give the assistant replayable history to fix drift.

The verifier turns drift into repair work.

Project Health and MCP tools emit stable codes, typed repair IDs, graph anchors, and source evidence. The agent gets a precise finding instead of a vague review comment.

First pass
42/100
  • Treatments
    COMP001: local Button reimplemented instead of importing the project-owned primitive.
  • Context
    CTX002: execution packs are missing, so agent context may be stale.
  • Route
    ROUTE001: observed route is not represented in the contract.
  • Accessibility
    WCAG AA focus rings, skip nav present.
one iteration
After AI re-reads section context
94/100
  • Component reuse
    Repair imports the canonical Button and removes the duplicate local primitive.
  • Context
    Packs are regenerated and the Contract capsule points at the current graph snapshot.
  • Route
    Observed route is reconciled into Essence and can receive route-scoped task context.
  • Accessibility
    WCAG AA · focus visible · skip nav · keyboard nav verified.

Already have a project? Adopt Decantr without a rewrite.

Brownfield adoption is a first-class path. Decantr inventories what you have, drafts an observed contract proposal, keeps existing code and styling authoritative, and gives your LLM a repeatable route context before it edits.

1

Adopt

$ decantr adopt --yes

Runs the adoption workflow: analysis, observed contract proposal, deterministic acceptance or merge, hosted pack hydration when online, Project Health, and baseline. In monorepos, install at the workspace root and pass --project apps/web; app primitives keep that scope instead of falling back to the root. Visual evidence is an optional follow-up when the app is running.

2

Activate

$ decantr task /feed "add saved recipe actions"

Surfaces route-local context, page and section packs, screenshot references, Brownfield intelligence, theme inventory, accepted local patterns, accepted local rules, changed-file impact, and the active authority lane before the assistant edits code.

3

Diagnose and gate

$ decantr doctor && decantr ci

Use doctor when the next step is unclear, codify project-owned button/card/form/shell/theme law when you are ready for Hybrid, and run ci as the non-mutating pull-request gate. Accepted local-rule findings show up in CI with file and line evidence. Setup, task paths, health prompts, refresh summaries, token exports, custom themes, and suggestions remain app-scoped in monorepos.

Layer in what you need, when you need it.

Hybrid lets an attached app adopt selected Decantr or project-owned authority without handing Decantr the whole source tree. Start with local law, map hosted ideas into your own components, then tighten verification only where the team agrees.

Codify local law

$ decantr codify --from-audit --style-bridge

Turn observed buttons, cards, forms, shells, theme variants, source evidence, confidence tiers, and token/class mappings into project-owned law before enforcing them. Suggest and CI surface those accepted laws as active authority.

See the active lane

$ decantr doctor

Doctor says whether the app is contract-only, Hybrid local law, style bridge, Decantr CSS, or composition mode.

Activate route context

$ decantr task /feed "standardize cards"

Task context includes source authority, style authority, active laws, style bridge mappings, and runtime boundary warnings before the LLM edits.

Map hosted ideas

$ decantr codify --map-pattern hero

Bring registry guidance into local law as advisory context first. Add project-owned components, token/class recipes, variants, and exceptions before treating it as enforceable.

Certified vocabulary, not a marketplace dependency.

The public registry is a vocabulary source for patterns, themes, shells, archetypes, and starter kits. Your repo-owned Contract decides what applies; registry content never overrides local law.

Open source. MIT licensed.

Eight packages, one mission: make AI-edited frontend code reliable enough to govern.

Foundation
@decantr/essence-spec

Schema, validator, guard rules, and TypeScript types for the Essence format

v3.0.0-next.0
@decantr/registry

Certified vocabulary contracts and discovery helpers for patterns, archetypes, themes, starter kits, and shells

v3.0.0-next.0
@decantr/css

Optional framework-agnostic CSS atoms runtime for starter kits and Decantr CSS adoption lanes

v3.0.0-next.0
@decantr/core

Execution-pack compiler primitives, typed Contract graph builders, graph diffs, and Contract capsules

v3.0.0-next.0
@decantr/telemetry

Privacy-preserving event contracts, clients, and analytics sinks

v3.0.0-next.0
Delivery
@decantr/cli

Workflow commands, project scaffolding, Brownfield activation, Hybrid authority lanes, doctor, CI, local law, style bridges, visual evidence, baselines, workspace health, and registry sync

v3.0.0-next.0
@decantr/mcp-server

MCP server exposing typed graph context, Brownfield/Hybrid authority, local law, style bridges, Evidence Bundles, and repair prompts to AI assistants

v3.0.0-next.0
@decantr/verifier

Project Health, structured diagnostics, graph-anchored findings, component reuse drift, Evidence Bundles, CI schemas, and repair payloads

v3.0.0-next.0

Security reviews should inspect the installed npm surface, not internal release scripts or showcase fixtures. See the security and permissions matrix for filesystem, network, process, telemetry, hosted upload, and MCP write-tool behavior.

Deep where verification matters

Decantr stays useful across web stacks, but the governance path is getting deepest first for React, TypeScript, Tailwind, and shadcn-style component systems.

AI assistants
Claude CodeMCP · tested
CursorMCP · tested
WindsurfMCP · tested
Any MCP clientstdio · compatible
Frameworks
React + Vitestarter adapter
Next.jsstarter adapter
Native HTML/CSSstarter adapter
Vuestarter adapter
SvelteKitstarter adapter
Angularstarter adapter
Solidstarter adapter
Styling
CSS tokensgenerated per theme
@decantr/css atomsframework-agnostic
Tailwindcoexists

runnable adapter · generic-web contract-only fallback — your AI writes the runtime

Put governance in the agent loop.

Adopt a project, load route context, verify the edit, and keep the evidence.

Get Started