Design · July 5, 2026

Component Contracts Are Replacing Design System Documentation in 2026

By Arthur Jenkins · Technical Writer

Abstract geometric diagram showing interconnected design system contract layers flowing into AI agent, MCP, and CI enforcement nodes

Photo by GuerrillaBuzz on Unsplash

Design System Documentation Was Written for Humans — And That Is the Problem

Your design system’s Storybook, Notion pages, and Figma component descriptions are a liability in the age of AI coding agents. Not because they are wrong — but because they are written in a format no machine can enforce.

The 2025 Stack Overflow Developer Survey captured the tension: 84% of developers use or plan to use AI tools, but 46% actively distrust the output. There is a direct line between those two numbers. AI agents generate UI without reading your design system docs — not because they are lazy, but because your docs are structurally invisible to them. A Storybook story describes intent. A free-form string prop named variant says nothing about what values are valid. An AI agent samples from its training distribution and invents variant="danger" when your system only defines destructive.

This is not a model quality problem. It is an architecture problem — and the fix is a structural shift that is quietly remaking how design systems work in 2026.

As Murphy Trueman puts it:

“Your design system is already making promises. The question is whether those promises are written down clearly enough that something other than you can read them and get the right answer.”

The answer in 2026 is a new layer of infrastructure: machine-readable component contracts — enforceable specifications that agents read before they write code, that CI validates on every commit, and that replace the fragile assumption that a human will catch every mistake in review.

What a Component Contract Actually Is — And Why It Is Not Documentation

A component contract and component documentation serve fundamentally different purposes, though teams routinely conflate them.

Documentation describes. It says “use the destructive variant for irreversible actions like deleting data.” A human reads it, understands the intent, and applies judgment. An AI agent parses the same text and has no semantic anchor — it either ignores the instruction or pattern-matches from its training data.

A contract specifies. It defines a finite, checkable set of rules: which tokens a component may reference, which states it must implement, which props it accepts and with what values. A contract is enforceable by tooling. A documentation page is not.

The difference lives in three layers, per the analysis at reopt handbook:

LayerDocumentation (fragile)Contract (enforceable)
Props / types”Use variant for different visual styles”`type ButtonVariant = ‘primary'
Token naming”Use our blue for primary actions”--color-action-primary (semantic, intent-based)
Component relationships”Always include a ModalFooter”Compound components: Dialog.Footer only exists inside Dialog

A concrete example makes this tangible. Consider a Button component in two states:

// ❌ Documentation only — fragile with AI agents
interface ButtonProps {
  /** The visual variant of the button */
  variant: string;  // free-form → agent invents "danger"
  children: React.ReactNode;
}

// ✅ Enforceable contract — AI-safe
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'destructive';

interface ButtonProps {
  /**
   * 'destructive' only for irreversible actions: deleting data,
   * removing access, cancelling orders. Not for warnings or errors.
   */
  variant: ButtonVariant;  // closed union → compile-time rejection
  children: React.ReactNode;
  onClick: () => void;
  disabled?: boolean;
}

The first version passes code review every time. The second version causes a build failure when an agent generates <Button variant="danger">. That is the difference between hoping an agent follows your rules and ensuring it cannot break them.

Token naming carries the same distinction. A color named blue-600 tells an agent nothing about when to apply it. A color named --color-action-primary — following the DTCG semantic tier — communicates intent in a way both humans and machines can resolve. Nadiia Abrosymova, writing in Design Systems Collective, calls this the core of AI-generated UI consistency: “The more compact and structured your system, the more reliable the results.”

The 2026 Tooling Landscape: From agentic-spec to Meta’s Astryx

The shift from documentation to contracts is not theoretical. Four independently developed approaches shipped in the first half of 2026, each proving the pattern works at different scales.

agentic-spec (Tina Singh / Clementine DS)

agentic-spec is the most accessible entry point. It defines a YAML-based contract format that gives every component a closed, checkable specification: which tokens it may reference, which ARIA attributes it requires, which interaction states it must implement. The contract is enforced in two places:

  • In CI, via npx agentic-spec validate — fails the build when code drifts from the contract.
  • In the editor, via an MCP server that hands the contract to the agent before it generates code.

The accompanying benchmark seeds the mistakes AI agents actually make — invented tokens, code drift from spec, raw value access — and runs the validator against them. Seven out of seven errors caught. Five fail the build outright; two return as warnings. Clean components pass silently.

Meta’s Astryx (June 27, 2026)

Meta open-sourced Astryx — a React design system that has powered over 13,000 internal applications across Facebook, Instagram, and Threads for eight years. Its key innovation is a astryx manifest CLI command that returns a self-describing JSON payload listing every command, argument, flag, and allowable value — an “OpenAPI spec for the CLI” — that any AI agent can consume in a single request.

Astryx ships 90+ React components with StyleX compile-time CSS (documented 80% CSS size reduction at Meta scale), 10 themes, full TypeScript, and an MCP server compatible with Cursor, Claude Code, and GitHub Copilot. Components carry JSDoc annotations with composition hints. The message to the industry is unambiguous: the largest consumer-facing engineering organization on the planet now expects design systems to be machine-readable by default.

Primitiv (AI by Design)

Primitiv takes a different approach: it sits above your design sources — Figma, codebase, Storybook, token files — and reconciles them into a single authoritative contract. Its pipeline is scan → reconcile → infer → contract → MCP. It surfaces conflicts between sources (e.g., a token named differently in Figma vs. code), extracts design rules from actual codebase patterns, and serves the resolved contract via MCP tools like get_design_context. It is local-first and read-only — your code never leaves your machine.

Evinced’s Production MCP Server

The accessibility tools company Evinced documented their production MCP server for their internal design system ui-common, which spans 7–8 products. Their server exposes five tools — list_components, get_component_api, get_component_guide, get_design_system_rules, list_design_tokens — all reading directly from TypeScript source and Storybook stories. New components become available immediately, with no rule file updates. The result: AI agents generate code that uses actual design system components instead of raw <div> elements and hardcoded colors.

ApproachScaleKey InnovationEntry Cost
agentic-specSingle system (121-component Clementine DS)Closed YAML contracts + MCP20 minutes per the docs
Meta Astryx13,000+ internal appsOpenAPI-style JSON manifestClone the repo, install CLI
PrimitivMulti-source reconciliationScan → reconcile → contract pipelineLocal install, configure sources
Evinced MCP7–8 products, single libraryDynamic source-parsed toolingBuild MCP server against your lib

Why Contracts Fix What Documentation Cannot

The existing article on this site, “AI Is Breaking Your Design System,” documented the problem: a 10-point collapse in design system buy-in satisfaction (42% → 32%, per zeroheight’s 2026 report), a 14% conversion drop from AI-generated UI, and 59% average code rewrite rates across 20 production engagements (per Appycodes’ 2026 benchmark).

Component contracts solve the structural root cause of each of those failures:

Token drift prevention. When an agent reads a component’s contract before writing code, it knows the exact set of allowed tokens. A button cannot reference a raw hex value because the contract specifies --color-action-primary as the only permitted background token. The “visual debt at machine speed” that Nadiia Abrosymova describes — one hardcoded value becoming forty instances before anyone reviews — becomes structurally impossible.

Aesthetic mirage elimination. The XQA team’s post-mortem revealed an AI-generated dropdown that looked correct but was a stack of <div> tags with no ARIA roles, no keyboard handlers, and no focus management. A component contract that lists required ARIA attributes and interaction states makes that failure detectable at generation time rather than production time. The AI Guild Blue analysis makes this explicit: “The features that make [design systems] powerful for designers are precisely what causes agents to generate wrong-variant, inconsistent UI. This is not a model quality problem — it is an architecture problem.”

Compliance by constraint, not review. The most dangerous design system violation, as UXPin’s Andrew Martin observed, “isn’t the one that looks wrong. It’s the one that looks right but isn’t built with your components.” Contracts eliminate this class of failure by constraining generation to a closed choice space — not by catching violations after the fact, but by making them impossible to produce.

The Architecture of an Agent-Readable Design System

A design system that survives the AI generation era has four structural layers, each feeding into the next:

1. Standardized Token Architecture (DTCG / W3C)

Tokens must follow the Design Tokens Community Group format or an equivalent layered spec: primitive → semantic → component. Third-tier tokens (component-level) belong in code, not Figma — co-located with their component, derivable via formulas, and validatable programmatically. Nadiia Abrosymova demonstrates this with OKLCH lightness deltas for state colors:

{
  "state.lDelta.hover": { "$value": 0.06 },
  "state.lDelta.pressed": { "$value": -0.03 }
}

Implemented in CSS:

.dls-button[data-intent="primary"]:hover:not(:disabled) {
  background: oklch(from var(--dls-color-intent-primary-bg) calc(l + 0.06) c h);
}

A small, math-driven token system that lives in code is what makes AI-generated UI consistency possible.

2. Component Contracts (Closed, Checkable)

Every component ships a contract that enumerates:

  • Token contract: exhaustive list of allowed tokens
  • Semantic parts: every region a token can target
  • Required ARIA: role, aria-expanded, aria-busy, focus ring
  • Interaction states: default, hover, focus-visible, disabled, loading, error, empty, selected
  • Composition rules: what nests where (via accepts declarations or compound components)

The reopt handbook’s component spec provides a reference schema. The key rule: anything not in the contract is a lint failure.

3. MCP Surface for Dynamic Queries

Static context files (CLAUDE.md, Cursor Rules) set a baseline. MCP servers provide dynamic, parameterized access. The minimum viable surface, per DesignSystems.one, is four tools:

ToolWhen an Agent Calls It
list_tokens”Give me all background colors”
find_component”Which component implements a combobox?”
get_pattern”Show me the canonical form pattern”
get_decision”What did we decide about modal footer rules?”

MCP config for a design system server:

{
  "mcpServers": {
    "design-system": {
      "command": "npx",
      "args": ["-y", "agentic-spec-mcp", "./specs"]
    }
  }
}

4. CI/CD Enforcement

The final layer is automated enforcement. Every PR that touches UI code runs a validation pass:

  • eslint-plugin-jsx-a11y and axe-core for accessibility
  • agentic-spec validate or equivalent for contract compliance
  • A custom rule that flags hardcoded values where semantic tokens should be used
  • UISpec for Tree-sitter-based component usage validation in CI

Adi Carmel at Evinced describes the operational model: “Rules are still used for workflow guidance, best practices, and anti-patterns. The component data comes directly from the MCP.” Enforcement is not about banning AI — it is about making the right path the only path.

The Honest Trade-offs

Component contracts are not free. Tina Singh is direct about the cost: “This is slower right now, and I’m still proving it earns its keep. Writing a tight contract for every component is real overhead, and some weeks the work is mostly me finding what I got wrong.”

The AI Guild Blue analysis flags another trade-off: flattening variant axes into distinct component names increases component count. A single Button with 32 variants becomes 5–8 named components. Designers must navigate a longer list. The gain — agent-assembled UIs that are correct on the first attempt — must exceed this navigation cost.

And not every team needs this today. A three-person startup building an internal tool with a single developer and no design system has a different risk profile than an enterprise with 7 products sharing one component library. The Appycodes benchmark confirms this: simple internal tools averaged 27% rebuild rates, while complex marketplace and regulated projects averaged 76–85%. Invest in contracts at the complexity inflection point, not before.

But the cost of waiting is also real. As the AI Guild warns: “Teams that wait for agent output to get bad enough to force the issue will rebuild under pressure, at scale, with AI-generated UI already shipped to users.”

Where to Start This Quarter

The shift from documentation to contracts is not an all-or-nothing rebuild. The incremental path is straightforward:

  1. Audit your five most-used components. Are their props typed as free-form strings or closed unions? The first is documentation; the second is a contract. Fix the free-form strings first.

  2. Rename tokens from presentational to semantic. If your token file contains blue-600 instead of --color-action-primary, rename it. This single change makes your token layer readable to both humans and machines.

  3. Add one MCP tool for component discovery. Pick your most-used component library and expose a list_components and get_component_api tool. agentic-spec’s “Make your design system agent-safe in 20 minutes” guide provides a worked example with a non-Clementine system.

  4. Add a CI gate that fails on hardcoded values. Use the @layoutdesign/context compliance checker or write a simple ESLint rule that flags hex values where CSS custom properties should be used. Enforcement turns a guideline into a contract.

  5. Surface undocumented compositional constraints. For every component that has an unwritten rule (“Modal must contain a footer,” “Table must not appear inside Tooltip”), encode it. In TypeScript, use compound components that enforce the relationship structurally. In Figma, use component properties and nesting. Then verify they match.

The Design System That Wins in 2027

The teams that will thrive in the next twelve months are not the ones with the most components. They are the ones whose design systems are legible to the agents that generate a growing share of production UI. Meta’s Astryx, Google Labs’ DESIGN.md, Primitiv, agentic-spec, and the MCP ecosystem are not competing visions — they are converging on the same architectural truth: a design system’s value in the age of AI is proportional to its enforceability, not its documentation.

One component contract, one CI gate, one MCP tool. Start this week. The alternative — waiting until AI-generated UI has accumulated enough machine-speed debt to force a rebuild under pressure — is the more expensive path by every measure.

Ready To Scale
Your Ecommerce?

Let Decipher Tech handle your ecommerce operations end-to-end. Our ECOMAS model means you get a full team of specialists without the overhead of hiring in-house.