Build with AI
The endpoints and prompts on this page derive from the same generated manifest as the human-readable docs, so an agent and a person read the same thing.
Machine-readable endpoints
| Endpoint | What an agent gets |
|---|---|
| /llms.txt | The index: what the system is, how to install it, and every component and hook with its import subpath and one-line purpose. |
| /llms-full.txt | The full corpus: all 196 tokens with values, the machine-checkable constraints, every component with its complete prop table and page prose, the hooks, and the patterns. One file an agent can be handed wholesale. |
/r/<slug>.json (e.g. /r/button.json) | One component's structured record — import path, stylesheets, props, sub-components, constraints, extraction notes — for agents that fetch precisely instead of wholesale. |
These aren't hand-written: a build-time extraction walks the component source and emits
one manifest that feeds the props tables on this site, the search index, and these
endpoints. A prop renamed in packages/react propagates to all three on the next build —
the AI surface cannot silently drift from the code.
The contracts
@elirobinson/ai-patterns/contracts carries the system's rules in machine-checkable form:
the scoped touch-target policy, the forwardRef requirement, the tier boundary, the
no-barrel-files import convention, and the WCAG AA floor. Agents should cite these
constraint ids when auditing or generating code:
import contracts from '@elirobinson/ai-patterns/contracts';
// contracts.componentConstraints['touch-target-primary'].summary
// contracts.componentConstraints['no-barrel-imports'].checkPrompt templates
Three templates ship in the published @elirobinson/ai-patterns package under prompts/, so
they move with the version you installed. Each states intent, constraints, and a verification
checklist. Copy one, fill in the brackets, hand it to your agent.
Add a component to the system
For expanding @elirobinson/react — carries the tier rule, the touch-target policy, and
the definition of done.
Prompt: add a new component to the design system
Fill in the bracketed fields, then hand this whole file to the agent.
Add a [ComponentName] component to @elirobinson/react.
What it should do: [one paragraph — the job this component does and the states it has. If it maps to a shadcn/ui component, name it.]
Intent
The component must feel native to the Miltinson system: token-styled, keyboard-complete, and documented. shadcn/ui is the reference for API shape and accessibility patterns only — never its styles and never a Tailwind dependency.
Context to load first
docs/agents/components.md— tier boundary rule, touch-target policy, shadcn adoption policy, FormField-vs-Input precedent.@elirobinson/ai-patterns/contracts(componentConstraints) — the machine-checkable rules you are subject to.design-system-docs/preview/in this repo, or the packed brand skill in a consuming one (.claude/skills/miltinson-design/) — the canonical look of buttons, fields, cards, and tags.pnpm --package=@elirobinson/ai-patterns dlx ds-resync artifacts --writeputs it there.- Two existing components in the target tier, read end to end, as the pattern to match.
Constraints
- Place it by the tier boundary rule, asking the domain question first: no meaning outside
an assistant surface →
ai/; otherwise portal/focus-trap/multi-element open state →organisms/; assembled from 2+ atoms without that →molecules/; elseatoms/.ai/is the only tier keyed to what a component is for rather than how much it assembles, and it buys a directory and nothing else — every other constraint below still applies. forwardRefto the outermost interactive element it owns.- Touch targets by role: 44×44px minimum for primary controls; shadcn/MUI dense scale for inline affordances; an expanded hit area must never overlap sibling content.
- Styles in a sibling
<Name>.cssusing only--*tokens viads-*classes; add its@importtopackages/react/src/styles.cssat the end of the cascade — never reorder existing lines. - Keyboard behavior via the shared hooks (
useRovingFocus,useActiveDescendant,useEscapeKey,useClickOutside,useAnchoredPosition) before writing new key handlers. - No barrel files: the component is consumed as
@elirobinson/react/components/<tier>/<Name>. - No new runtime dependencies without explicit sign-off.
Verification checklist
-
pnpm build && pnpm lint && pnpm typecheck && pnpm testpass from the repo root. - Tests cover the keyboard contract the component claims (arrows/Escape/Home/End as applicable) — the test file is the contract's source of truth.
- A Storybook story exists in
apps/storybookshowing realistic usage. -
pnpm buildpicks the component up in@elirobinson/react'sdist/manifest.json(generated, not committed) with no extraction gaps, and a docs page exists at/components/<slug>following the Button page's structure. - Every color pairing introduced passes WCAG AA (compute it — don't eyeball it).
- Focus is visible on every interactive element;
prefers-reduced-motionis not overridden.
Adopt the system in an existing app
The three-step migration (primitives → tokens → keyboard pass) as an agent task with verifiable exit criteria.
Prompt: adopt the design system in an existing app
Fill in the bracketed fields, then hand this whole file to the agent.
Bring [app name / path] onto the Miltinson Design System (@elirobinson/tokens +
@elirobinson/react).
Scope for this pass: [which routes/screens to migrate now; anything explicitly out of scope.]
Intent
Replace ad-hoc primitives and hardcoded style values with the system, without a big-bang rewrite — each step should leave the app shippable.
Context to load first
Do not work from a remembered or documented inventory — ask the installed packages:
pnpm ds # components, exports, variants, hooks, typography, token groups
pnpm ds props <Name> # props, variant unions, and the exact import line to copy
pnpm ds tokens [filter] # tokens and values
pnpm ds contracts # the machine-checkable rules to enforce, and what verifies each
pnpm ds patterns # working principles and the definition of donepnpm exec elirobinson-ds works before the ds script exists.
Step 0 — wire up the tooling
Before migrating any screen, install the things that keep this from drifting back:
-
pnpm add @elirobinson/react@latest @elirobinson/tokens@latestandpnpm add -D @elirobinson/ai-patterns@latest @elirobinson/eslint-config@latest. -
Add
"ds": "elirobinson-ds"toscripts, so every instruction above resolves. -
Extend the flat ESLint config with
@elirobinson/eslint-config(and@elirobinson/eslint-config/cssif the app has its own stylesheets). This is what makes the import bans and the no-hardcoded-values rule fail the build rather than depend on review. -
pnpm ds init --agents— installs the Claude Code skill, the Cursor rule, the Copilot instructions, and anAGENTS.mdblock. Coverage matters: teammates drive different tools, and an agent only follows what it actually loads. -
pnpm exec ds-resync artifacts --write— writes the brand skill and a version-stamped component reference (llms.txt,llms-full.txt) into.claude/skills/. Re-run it after any upgrade; it refreshes what it wrote and leaves anything you edited alone. -
On Tailwind v4, add
@import '@elirobinson/tokens/tailwind.css'after the tokens import. Without it,bg-backgroundand friends resolve to nothing. -
If the framework supplies the fonts —
next/fontand friends — re-point the families at its variables, or the app silently renders in the system font::root { --ds-font-sans-override: var(--font-geist-sans); --ds-font-mono-override: var(--font-geist-mono); }The font's class goes on
<html>, not<body>: the tokens resolve at:root. -
If the app has a theme switcher, point it at
data-theme(next-themes:attribute="data-theme"). -
Drop
expectDesignSystemContractsfrom@elirobinson/ai-patterns/testing/playwrightinto the E2E suite for the routes in scope.
Constraints
- Work in the documented order: (1) swap primitive buttons/inputs/cards for system
components, (2) move style values onto
--*tokens, (3) keyboard and focus pass. - Imports use package subpaths only —
@elirobinson/react/components/<tier>/<Name>— a bare@elirobinson/reactimport does not resolve. @elirobinson/tokens/tokens.cssand@elirobinson/react/styles.cssare imported once, in the app shell, in that order.Input/Textarea/Selectrequire alabelprop; do not wrap them inFormField(double labels).FormFieldis for controls without their own wiring.- Reference semantic tokens (
--fg,--surface,--accent) — never raw scale values (--ink-500) in app code. - Any token override goes in an unlayered
:rootblock.tokens.cssis unlayered, and unlayered declarations beat layered ones whatever the order, so an override inside@layer base— the conventional place in a Next.jsglobals.css— will not apply, and nothing will say so. - Spacing values snap to the
--space-*scale; radii to--radius-*; no magic numbers survive the pass. - Delete
outline: noneon focus wherever found — the token stylesheet's focus ring is non-negotiable. - Do not restyle system components with overrides that fight the tokens; if a component can't do the job as shipped, report the gap instead of forking its styles.
Verification checklist
- The app builds and its existing tests pass after each of the three steps, not just at the end.
-
pnpm lintpasses with@elirobinson/eslint-configenabled — that is the check for hardcoded values and stray imports, rather than a grep whose exceptions nobody revisits. - The Playwright contract check passes on every migrated route: touch targets, visible focus, and WCAG AA contrast.
- Every migrated screen is fully operable with the keyboard alone.
- Every migrated screen renders correctly under
data-theme="dark". - The full checklist in
pnpm ds patterns— Definition of Done for UI work — holds. - A short migration report: what was swapped, what was left, and any place the system was missing a component the app needed.
Audit a page for compliance
Point it at a route; get findings with constraint ids, computed contrast ratios, and a ranked fix list.
Prompt: audit a page for token and accessibility compliance
Fill in the bracketed fields, then hand this whole file to the agent.
Audit [route or file path] in [app] against the Miltinson Design System's contracts.
Report findings; fix only what's listed under "fix directly" below.
Intent
A page that uses the system should be provably on-system: token-clean, AA-contrast, keyboard-complete. This audit produces a findings list a maintainer can act on — honest about severity, free of nitpicks dressed up as blockers.
Context to load first
@elirobinson/ai-patterns/contracts—uiContractsandcomponentConstraintsare the rulebook; cite the constraint id in every finding.pnpm ds tokensandpnpm ds props <Name>— token names/values and each component's documented accessibility contract, read from the installed package. For a bulk read,.claude/skills/design-system-reference/llms-full.txt, whichpnpm --package=@elirobinson/ai-patterns dlx ds-resync artifacts --writewrites and refreshes.
What to check
- Imports — every
@elirobinson/*import names a subpath (no-barrel-imports); flag any deep import into package internals. - Tokens — hardcoded colors, px spacing, radii, shadows, or durations that have a
token equivalent; raw scale tokens (
--ink-500) where a semantic token belongs. - Contrast — compute WCAG ratios for text/background pairings introduced by the page; AA is the floor (4.5:1 normal text, 3:1 large).
- Touch targets —
touch-target-primary(44×44px) for buttons/pagination/nav items;touch-target-dense(24×24px, WCAG 2.2 AA SC 2.5.8) for chip-remove/clear/stars/day-cells,size="sm"buttons and chip controls — a floor, not an exemption, so measure them too;hit-area-no-overlapeverywhere (check computed geometry, not intent). - Keyboard and focus — tab reach and order, visible
:focus-visibleon every control, Escape/arrow behavior matching each component's documented contract, focus return on overlay close, nooutline: none. - Semantics — labels on every control (
aria-labelon icon-only buttons), oneh1, sane heading order,alton images, live regions only where the system provides them. - Functional copy (
ui-copy) — errors, empty states, helper and hint text, toasts, labels, button text, tooltips, confirmations, validation: fact, then consequence, then action, then stop. Flag frequency claims, blame attribution, filler pacing, unprompted reassurance or apology, unasked escalation, and exclamation marks. Editorial content is out of scope — marketing prose, conversational surfaces, and written deliverables carry the product's deliberate voice; do not report them.
Constraints
- Fix directly: token substitutions with identical rendered results, missing
aria-labels,outline: nonedeletions. - Report, don't fix: layout changes, color changes that alter the design, component swaps, anything touching behavior, and every wording change — quote the padded copy and the replacement, and let the author take the call on which side of the line it sits.
- Every finding cites the file/line, the constraint id, and the concrete fix.
- No hype, no padding — if the page is clean, say it's clean.
Verification checklist
- Findings each carry: location, constraint id, severity (blocker / should-fix / note), and a concrete remedy.
- Contrast claims include the computed ratio, not an adjective.
- The app builds and tests pass after the direct fixes.
- The report ends with the three most valuable fixes, ranked.
Rules of engagement for agents
- Import via subpaths only —
@elirobinson/react/components/atoms/Button. A bare@elirobinson/reactimport doesn't resolve; if you generate one, the code is wrong. - Prefer semantic tokens over raw scale values, and the
--space-*scale over pixel values. - Don't invent props. The prop tables here are extracted from source; if a prop isn't in the table or the inherited HTML attributes, it doesn't exist.
- The keyboard contracts on component pages are backed by tests — match them, don't approximate them.