0003. Language, build, lint and test tooling
- Status: Accepted
- Date: 2026-11-26
- Phase: 1
Context
Section titled “Context”Everything must be typed and discoverable so an AI can write correct code. Games need a dev server with hot reload; packages must be tree-shakeable with measured bundle size.
Decision
Section titled “Decision”- TypeScript, strict mode plus
noUncheckedIndexedAccess,exactOptionalPropertyTypes. ESM only. - Vite for the dev server, hot module replacement and game builds. Library packages are built with
tsdown (or Vite library mode) to ESM +
.d.ts,"sideEffects": false. - Biome for linting and formatting (one fast tool, one config).
- Vitest for unit tests (same transform pipeline as Vite). Playwright for end-to-end tests, headless game runs and screenshots.
- size-limit in CI records and caps the gzip size of each package and of the sample game’s runtime.
- TypeDoc (+ markdown plugin) generates the API reference; a custom script generates
llms.txt/llms-full.txtfrom TypeDoc output and recipes (Phase 2). - Zod as the schema source of truth, emitting JSON Schema 2020-12 (see ADR 0007).
Alternatives considered
Section titled “Alternatives considered”- ESLint + Prettier (+ typescript-eslint type-checked rules): richest rule set, slower and two configs. Kept as a fallback if Biome lacks a rule we need (we can run typescript-eslint for a few type-aware rules only).
- Jest: slower, separate transform pipeline from Vite.
- Webpack/Rollup directly: more config for no gain at our scale.
- Plain JavaScript + JSDoc: weaker guarantees for AI-generated code.
Consequences
Section titled “Consequences”Exact versions are pinned at the start of Phase 1 (check current majors then). Strict flags make some
AI-generated code fail to compile at first — that is the point; type errors are surfaced to the AI by the
MCP validate/run tools.