On this page
These pages state how code is written, tested, reviewed and released in this repository, for an engineer joining from another team. Each page says the standard in plain words, points to the numbered rule that owns it, and names the check that enforces it. Where nothing enforces a standard, the page says "no guard, review only".
In short#
- Rules are numbered
§N. A number is stable: never renumbered, owned by exactly one rule pack in.claude/rules/. - Enforcement is layered: type and schema first, then a behavioural test, then a static audit script, then review.
- Nothing is accepted on a status line. A change is done when the gate commands pass on the exact tree you are shipping.
| Page | Read it for |
|---|---|
| Coding | TypeScript, package boundaries, tenancy, copy, performance, comments |
| Testing | Which test kind to write, where it lives, how to run it |
| Code review | What a reviewer checks, severity, the security and tenancy checklist |
| Definition of done | The checklist and exact commands before a change counts as finished |
| Commits and releases | Commit format, who pushes where, how a release is cut |
How the rules are enforced#
| Stage | What runs | Defined in |
|---|---|---|
| Editor and local | pnpm run typecheck, pnpm run lint, pnpm test |
package. (turbo runs each per workspace) |
git commit |
Prettier on staged files; the rulebook size check when a rule file changed; security:scan |
. |
git push |
security:scan, format:check, ESLint and tsgo on changed packages, pnpm audit (high and above), typecheck, lint, test, then audit:all:parallel |
. |
| Full local gate | pnpm run verify: format, typecheck, lint, test, build, route budgets, security scan, prod-compose check, verify:data, verify:rls, audit:all, dependency audit |
package. script verify |
Pull request and main |
The same checks on a fresh Postgres, plus production image builds, a Playwright smoke and the docs site check | . |
| Weekly | Dependency and security audit | . |
The pre-push hook is a fast subset. It skips the production build and the two database gates, so a green push is not a green verify. On the shared build host the full gate runs through scripts/dev/mso-run.sh gate, which records the result against a fingerprint of the working tree; the hook reuses it when the tree is unchanged.
Never bypass a hook (--no-verify, HUSKY=0). Fix the cause. An audit may be suppressed only with its own // audit-ok-* token on the line plus an entry in docs/SECURITY.md.
audit:all#
audit:all in package.json is the single list of static audits (Python and TypeScript scripts under scripts/audit/). Pre-push and CI both run it, so they cannot drift. A new audit is added there, never inline in a hook or workflow. Most audits take --self-test. A ratchet audit compares against a baseline that may only shrink and writes it only with --update-baseline.
Look up a rule#
- A failing audit prints the rule it cites, for example
§83. grep -l '§83' .claude/rules/names the pack. The rule map lists every§N, its pack and the paths the pack covers.- The rule ends with
Enforcement:, the file or layer that checks it. A rule marked "judgment" has no automated guard and is checked in review.
Two files outside the packs matter: AGENTS.md (the contract, boundaries and Definition of Done) and the nearest CLAUDE.md above a directory (a map of that area). Where they conflict, AGENTS.md wins.
Who owns what#
.github/CODEOWNERS lists required reviewers. Authentication, RLS, encryption, credentials, the schema package, workflows and the production start script need the listed owner.