@ai-created/ui
Design-system overview

AI-native design system

Design once. Agents build without drift.

AI-Created UI gives coding agents the same component contracts, design tokens, accessibility rules, page patterns, and governance used by human teams. Agents query the system instead of guessing from screenshots, documentation, or model memory.

Versioned contract
v1.3.5
Policy validation
6 rules
Approved templates
6 page templates
Drift detection
8 blocking checks

One system. Three consumers.

The interface contract stays consistent regardless of who is building. Designers, engineers, and coding agents read different projections of one reviewed decision set, never three independent interpretations of it.

Designer

Works from reviewed intent rather than redrawing decided problems.

Consumes

  • semantic design decisions
  • component anatomy
  • variants
  • composition rules
  • responsive behavior
  • accessibility guidance

Design contract

Engineer

Works from the shipped implementation rather than a redrawn approximation.

Consumes

  • React components
  • TypeScript APIs
  • semantic tokens
  • interaction behavior
  • accessibility implementation
  • test contracts

Runtime contract

Agent

Works from queryable contracts rather than screenshots or model memory.

Consumes

  • design-system manifest
  • approved component APIs
  • semantic tokens
  • page templates
  • design policies
  • machine-readable context

Machine contract

One interface contract

22 documented component families, 96 verified public exports, 7 principal guideline chapters, and 6 approved page templates, published as one versioned release.

How an agent builds with the system

A worked example, using the settings archetype that ships in templates/agent. Every command below exists in package.json today.

  1. Step 1. Receive the task

    Product intent arrives in prose. Nothing about the design system is decided yet.

    Build the account settings screen with profile information, notification preferences, and destructive account actions.
  2. Step 2. Query the system

    The agent reads canonical context instead of inferring APIs. Every source below ships inside the package and the published release.

    • design-system.manifest.json
    • llms.txt
    • llms-full.txt
    • AGENTS.md
    • templates/agent/manifest.json
    Canonical context queries
    bash
    npm run agent:query -- context
    npm run agent:query -- templates
    npm run agent:query -- component toggle
    npm run agent:query -- guideline accessibility
  3. Step 3. Select approved building blocks

    The settings brief matches one reviewed archetype. The template names its slots, its required states, and the primitives it composes.

    • archetype: workspace, subtype settings
    • components: Button, Notice, Surface, Toggle
    • states: ready, saving, saved, error, forbidden
    • semantic tokens through the shared Tailwind preset
    Approved template lookup
    bash
    npm run agent:query -- template settings
  4. Step 4. Implement

    Composition happens against public exports and documented props. Local reinvention of a shared primitive is not an implementation detail; it is drift.

    Uses

    • public components from @ai-created/ui
    • documented props and variants
    • semantic tokens and utilities
    • approved composition patterns

    Rejected by validation

    • locally recreated design-system components
    • raw color values
    • undocumented variants
    • arbitrary radius, shadow, and palette utilities
    • guessed component APIs
  5. Step 5. Validate

    The same commands run for an agent, a contributor, and continuous integration. None of them are advisory.

    Blocking validation commands
    bash
    npm run agent:check
    npm run typecheck
    npm run validate
  6. Step 6. Pass or fail loudly

    There is no third outcome where a departure quietly ships. A justified departure is written down, scoped, owned, and given an expiry date.

    Contract satisfied

    Every blocking check exits zero and the work is publishable.

    Design policy violation

    The validator prints the rule, file, line, and required correction.

The system should never silently accept design-system drift. An agent either follows the contract, fails a blocking check, or records a narrowly scoped exception for human review.

Drift becomes a build-time problem

Both examples below were run through scripts/validate-design-policy.mjs. The diagnostics are the validator's real output, not an illustration of it.

Invalid

Fails policy validation
Implementation that bypasses the system
tsx
import Button from './ui/Button';

export function AccountActions() {
  return (
    <div className="rounded-xl bg-slate-800 p-[13px]">
      <button
        style={{ background: '#6633ff', borderRadius: 11 }}
        className="text-white"
      >
        Save changes
      </button>
      <Button tone="danger">Delete account</Button>
    </div>
  );
}

npm run policy:check output

  • no-local-primitiveline 1:1

    Import Button from @ai-created/ui; local primitive imports can drift from the canonical implementation.

  • no-arbitrary-style-valueline 5:21

    Replace unapproved radius utility "rounded-xl" with rounded-none, rounded-sm, rounded-md, rounded-lg, or rounded-full.

  • no-theme-paletteline 5:32

    Replace stock palette utility "bg-slate-800" with a semantic utility that resolves through design-system tokens.

  • no-raw-colorline 7:31

    Replace the raw color with a semantic design-system token or utility.

  • no-theme-paletteline 8:20

    Replace stock palette utility "text-white" with a semantic utility that resolves through design-system tokens.

The undocumented tone prop is not a policy rule. It fails separately, and just as loudly, in npm run typecheck.

Valid

Contract satisfied
Implementation composed from public primitives
tsx
import { Button, Notice, Surface, Toggle } from '@ai-created/ui';

interface Props {
  status: 'ready' | 'saving' | 'error';
  productUpdates: boolean;
  onChange: (next: boolean) => void;
  onSave: () => void;
}

export function NotificationSettings({
  status,
  productUpdates,
  onChange,
  onSave,
}: Props) {
  return (
    <Surface padding="none" className="divide-y divide-border">
      {status === 'error' ? (
        <Notice variant="error" title="Settings were not saved">
          Check your connection and try again.
        </Notice>
      ) : null}

      <div className="flex items-center justify-between gap-4 p-5">
        <p className="text-sm text-text">Product updates</p>
        <Toggle
          label="Product updates"
          checked={productUpdates}
          onChange={onChange}
        />
      </div>

      <div className="flex justify-end p-5">
        <Button
          variant="primary"
          disabled={status === 'saving'}
          onClick={onSave}
        >
          Save settings
        </Button>
      </div>
    </Surface>
  );
}

What the contract carries

  • Public component API, verified against src/index.ts by npm run api:check.
  • Semantic tokens inherited from styles/tokens.css through the shared preset.
  • Accessibility behavior inherited from the Toggle, Notice, and Button contracts.
  • Light, dark, and all nine accent schemes inherited without local overrides.
  • Future system releases stay compatible because nothing was forked locally.

Built for machines without compromising humans

The human documentation and the machine contract describe the same system from different angles. Both are generated from, or verified against, the same canonical sources.

The contract is enforced

AI-written implementation enters the same engineering quality system as human-written implementation. Most of these gates are not agent features at all; they are ordinary package validation that agent output must also survive.

General system quality gates

These exist whether or not an agent is involved. They are the reason agent output cannot ship on a design-system technicality alone.

npm run typecheck
Package and portal TypeScript, including every documented prop.
npm run lint
Source, script, test, and portal conventions.
npm run test
Component behavior, contract, and accessibility tests.
npm run build:playground
Production build of the specification portal.
npm run package:check
The distributable package contract.

Agent-specific contract checks

These 8 checks are the machine contract itself. Together they run as npm run agent:check.

npm run tokens:check
Rejects a generated token artifact that drifted from canonical CSS.
npm run manifest:check
Rejects a stale or incomplete machine manifest.
npm run tailwind:check
Rejects framework mappings that drifted from canonical tokens.
npm run api:check
Rejects documented props, controls, or imports that drifted from the public TypeScript API.
npm run policy:check
Rejects prohibited styling, imports, tokens, and local primitive copies.
npm run templates:check
Compiles and verifies every approved page template.
npm run docs:check
Rejects stale public counts, routes, and workflow guidance.
npm run agent-context:check
Rejects stale concise or full agent context artifacts.

npm run validate runs typecheck, lint, tests, the full agent contract, the portal build, and the package check in one command. Browser and visual coverage runs through npm run test:browser. Both are required on every pull request.

Agents compose. They don't invent the system.

The boundary is not creativity versus obedience. It is product work, which stays flexible, versus system decisions, which stay governed.

Agents can

  • compose approved components
  • select documented variants
  • combine existing patterns
  • create product-specific layouts
  • write product-specific content
  • implement unique domain behavior

Agents cannot do silently

  • create a new design-system primitive
  • introduce a new token
  • add an arbitrary variant
  • duplicate an existing component
  • redefine accessibility behavior
  • invent an undocumented component API

Product work stays flexible. System decisions stay governed.

Exceptions stay explicit

When a legitimate product requirement falls outside the current system, the correct outcome is not silent local divergence. It is a recorded decision with a name on it and a date attached.

  1. Product requirement

    A real, specific need appears in product work.

  2. No approved system solution

    Composition and every approved template were tried first.

  3. Document exception

    One rule, narrow file globs, a concrete reason, an owner, and a review date.

  4. Human review

    A person decides. The validator only enforces the shape and the expiry.

Local approved exception

The departure stays product-local and expires. An expired entry fails the build with rule exception-expired.

Promote into design system

Repeated evidence becomes a contribution through the governance workflow, and the exception is removed.

ai-created-ui.config.json exception shape
json
{
  "exceptions": [
    {
      "rule": "no-raw-color",
      "files": ["src/product/legacy-chart-theme.ts"],
      "reason": "The charting vendor needs literal hex until the token adapter lands.",
      "owner": "Design Systems",
      "reviewBy": "2026-12-01"
    }
  ]
}

The schema at contracts/design-policy.schema.json requires all five fields, rejects catch-all globs, and limits the rule to one of the 6 policy rules. Read the full policy in the governance guideline.

Give an agent the contract

Point a coding agent at the query interface before it writes a line of UI. The same JSON interface ships inside every installed release.

Inside this repository
bash
# Point an agent at the contract
npm run agent:query -- context

# Select an approved page archetype
npm run agent:query -- templates
npm run agent:query -- template settings

# Read one component contract before using it
npm run agent:query -- component button

# Run the blocking anti-drift contract
npm run agent:check
Inside a consumer application
bash
# The same interface ships with the installed release
npx ai-created-ui-agent context
npx ai-created-ui-agent templates
npx ai-created-ui-agent template settings

# Report when the consumer falls behind a reviewed release
npx ai-created-ui-agent consumer-status

Design-system compliance shouldn't depend on who wrote the code.

Humans and agents should build against the same decisions, APIs, and constraints. AI-Created UI turns those decisions into a versioned contract that can be read, implemented, and validated by both.