The second audience

Your agent reads garn natively.

garn's judgment layer — when to use what, do/don'ts, 104 accessibility contracts, and composition recipes for all 84 components — is structured data, not prose. An agent queries it over MCP instead of guessing from training data, and audits its own output before you ever see it.

Wire up the MCP server

garn-mcp is a standalone package — no clone, no build. It bundles a metadata snapshot, so it runs straight from npx. Register it in your AI client:

Claude Code
claude mcp add garn -- npx -y garn-mcp

Cursor and other clients take the same command as a JSON entry (in .cursor/mcp.json, or your client's MCP config):

.cursor/mcp.json
{ "mcpServers": { "garn": { "command": "npx", "args": ["-y", "garn-mcp"] } } }

Six tools cover the judgment layer:

  • garn_searchFind components by keyword + pattern/category filters. Ranked. Start here.
  • garn_viewFull reference for one component; `sections` slices it to save tokens.
  • garn_get_examplesType-checked example code, filterable by role (e.g. canonical).
  • garn_match_recipeMap an intent → best-fit compositions, each with its a11y contract.
  • garn_relationsWhat pairs with, composes with, or replaces what.
  • garn_auditLint a composition against a11y contracts, token discipline, and do/don'ts.

Developing garn itself? Inside this repo, Claude Code picks the server up from the root .mcp.json automatically — it serves the live in-repo data layer via pnpm -s --filter garn-mcp start, so run pnpm info:build once first to generate it.

No MCP? Read the corpus

The same metadata is served flat for tools that just read text: /llms.txt (the index) and /llms-full.txt (the full corpus — every component's usage, props, contracts, and recipes). Copy-in consumers also get a generated AI rules file in their repo via garn init.

Why it can't lie

One authored source

Every component ships a *.info.ts — usage judgment, axes, recipes, a11y contracts — reviewed like code.

Everything else is generated

Docs pages, llms.txt, the MCP server's data, the registry payload, and every number on the landing page are built from that source.

Drift-gated in CI

CI regenerates every derived file and fails on any diff — stale docs are a build error, not a maintenance chore.

See the enforced half on Foundations → Accessibility contracts.