# component-contracts
One JSON contract per component generates an [Equinor Design System](https://eds.equinor.com)
component in both CSS and Figma, and a parity harness proves the two
surfaces agree. An agent authors the contract; deterministic emitters
build the components; no agent runs in the build path.
Born as the proof of concept behind the talk "Teach AI your design
system" (Into Design Systems, Oslo, September 2026).
## The map
| Path | What it is |
| --- | --- |
| `packages/eds-contracts` | The contracts, the emitters (CSS, Figma plan, Figma builder, ledger, DESIGN.md), and the parity harness |
| `packages/eds-tokens` | The token build: DTCG sources, formulas, CSS output, Figma variable payload |
| `packages/eds-cli` | `eds` — a read-only CLI lens (proof of concept); answers are computed live from the contracts and tokens, with provenance |
| `apps/storefront` | The Component Storefront, a component browser built from the components themselves |
| `apps/demos/building-the-button` | One request, three attempts: a document, the skills, the contract |
| `DESIGN.md` / `DESIGN.verbose.md` | The fourth renderer's output: the system described for agents, thin and in full |
| `.claude/skills`, `.agents/skills` | Skills: the principles as runnable algorithms (`optical-padding` is generated by the token build) |
## Quickstart
```sh
pnpm install
pnpm build # tokens, then contracts — regenerates build/ and the DESIGN docs
pnpm test # formulas, parity harness (1,800+ checks), CLI checks
pnpm a11y # axe-core sweep over every published surface
pnpm preview # serve the repo root; open /apps/storefront/
```
Ask the system questions through the CLI (`pnpm exec eds --help` inside
`packages/eds-cli`); change the system through the sources. The CLI is a
projection; only the sources can be edited, and `build/` directories are
generated — never edit them by hand.
## Licences
Code is MIT. Inter and CommitMono are vendored under the SIL Open Font
License. The Equinor typeface is proprietary to Equinor ASA and is
loaded from `cdn.eds.equinor.com` at runtime, never vendored.