testing-policylisted
Install: claude install-skill austinmao/feature-fix-swarm
# testing-policy — one home for how FFS tests
## Host dispatch contract
- Codex: `$skill`, Codex collaboration roles, and GPT-5.6 tiers.
- Claude: `/skill`, Agent/Skill tools, and Claude aliases.
- A bare `/skill` in this shared source denotes the Claude form; Codex dispatches the same named skill as `$skill`.
## When to invoke
- Referenced by `/feature-spec`, `/spec-decompose`, `/feature-implement`, `/code-uplift`,
`/fix` when writing or judging tests. Load it before authoring any test plan.
- Directly: "what's our testing policy", "how should this be mocked", "what does the
browser gate require".
## Why this exists
The recurring failure is *green tests, broken browser*: manual testing keeps catching
issues automated tests should have caught. Root causes, in observed order: over-mocked
modules whose fake shapes drift from reality; jsdom silently dropping layout/CSS/
navigation; no real-browser gate in the agent loop; the agent that wrote the code also
grading it. Every rule below exists to close one of those.
## 1. Mock-minimization ladder (stop at the first rung that holds)
1. **Real thing.** Real DB (testcontainers / local Postgres / SQLite where the dialect
allows), real filesystem in a tmpdir, real clock unless the test is about time.
2. **Own adapter over anything you don't own.** Third-party API/SDK → wrap in a thin
adapter; tests mock YOUR adapter interface; a separate contract test exercises the
adapter against the real service (or its sandbox) —