# The QA gate World of ClaudeCraft uses multiple coding-agent runtimes, but one repository QA contract. Every layer does one job at the cheapest useful boundary. Claude Code and Codex have different entry points and share the same deterministic scripts and commands. ## Layers | Layer | What runs | When | Blocks? | |---|---|---|---| | Instant copy gate | `.claude/hooks/qa-stop.sh` through each runtime's Stop hook | End of an agent turn | Yes, on a hard-invariant hit | | Deterministic floor | `.githooks/pre-push` | Before a push | Yes | | Full local gate | `npm run gate` through `scripts/gate.mjs` | Before implementation is called ready | Yes | | Judgment review | Claude `/qa` or Codex `$woc-qa`, plus scoped reviewers | End of a contribution | Advisory locally | ### Instant copy gate The Stop gate scans the uncommitted added lines (the unstaged tracked diff plus untracked text files) for an em dash, en dash, emoji, focused `.only(` test, or leftover `debugger`. It takes milliseconds and never runs TypeScript, Vitest, Biome, browser work, or an agent. `.claude/settings.json` and `.codex/hooks.json` share the Claude implementation; the Codex adapter (`.codex/hooks/qa-stop.sh`) delegates to it, then additionally scans TOML and `.mts`/`.cts` TypeScript module files that the shared extension filter omits. ### Deterministic floor `.githooks/pre-push` runs the heavier fast checks at the push boundary: TypeScript, determinism and purity guards, i18n matcher guards, Biome on changed files, and copy checks over the push diff. The shared `.claude/hooks/ensure-hooks.sh` idempotently points `core.hooksPath` at `.githooks`; both agent runtimes call it at session start. `git push --no-verify` remains an emergency bypass, not a substitute for reporting and fixing a red gate. ### Full local gate `npm run gate` mirrors the CI contract: generated i18n freshness, malware scanning, changed-file formatting, the SFX conformance check, the full test suite, the browser regression suite (`npm run test:browser`, which drives Chromium through Playwright), the typecheck, and env, server, and client builds. Release branches use the release i18n tier. It stops at the first failure and bounds Vitest workers to avoid load flakes on shared machines. It resolves FFmpeg (`ffmpeg` and `ffprobe`) from the bundled `ffmpeg-static`/`ffprobe-static` npm packages, falling back to PATH, and refuses to run when neither source yields a working binary. Use this command instead of an ad hoc shell pipeline. Piping a test run can hide its exit status, and unconstrained full-suite parallelism can make healthy heavy sim tests flake. ### Judgment review Reasoning is required for determinism, host parity, server authority, persistence, localization, rendering and UI seams, mobile behavior, graphics fairness, content fidelity, security, performance, and decisive coverage. - Claude Code uses `/qa` (`.claude/skills/qa/`), `qa-checklist`, and `.claude/agents/`. - Codex uses `$woc-qa` (`.agents/skills/woc-qa/`) and `.codex/agents/`. The coordinator establishes one diff and runs commands once. It dispatches only relevant read-only reviewers, gives them the shared evidence, and verifies consequential findings before reporting readiness. ## Reviewer coverage | Concern | Claude role | Codex role | |---|---|---| | Simulation architecture | `architecture-reviewer` | `woc_sim_architecture` | | Cross-host parity | `cross-platform-sync` | `woc_cross_platform` | | Persistence and migrations | `migration-safety` | `woc_persistence` | | Database performance | `database-performance-reviewer` | `woc_database_performance` | | Privacy and security | `privacy-security-review` | `woc_security` | | Decisive tests | `test-coverage-auditor` | `woc_test_coverage` | | Frontend and graphics | `frontend-seam-reviewer` | `woc_frontend` | | Release malware | `release-malware-audit` | `woc_release_malware` | These roles encode non-obvious review heuristics. Canonical architecture stays in root and local `CLAUDE.md` files. Persistence review owns compatibility, save/load shape, and rollback safety. Database-performance review owns query cadence, cardinality, plans, indexes, pool pressure, locks, timeout scope, write amplification, driver/dependency upgrades, PostgreSQL engine/resource/configuration/topology changes, and production-scale observability. Dispatch both when both sets of risk apply. ## Keep the gate current When architecture changes, update the applicable reviewer and tests in the same change. Anchor guidance on stable paths, symbols, seams, and gate names, not line counts. Add a new specialist only when a concern is large enough to need focused judgment and is not already protected by a deterministic test. ## Trust Project hooks execute local shell with the user's permissions. Review changes before trusting them. Each runtime snapshots only the hook registration at startup; the scripts themselves are read when a hook fires, so review script edits like any other executable change. The scripts are small, local, and non-networked; CI and the release malware audit remain the enforcement layer. To disable the clone's pre-push floor, use `git config --unset core.hooksPath`. Claude Code can additionally use its local hook setting. Codex hook trust is managed with `/hooks`.