← ClaudeAtlas

writing-testslisted

Use when adding or changing a test in this repo — the tier map (where a new guard goes), the scenario-first rule, the no-prose-presence-guards and no-mirror-harnesses rules, the mjs-seam grep exception, and the mutation-catalog anchoring obligations.
manoldonev/second-shift · ★ 2 · Testing & QA · score 68
Install: claude install-skill manoldonev/second-shift
# What to write when you add a test **Scenario-first.** A new per-tool fixture case must name the invariant it guards and why no scenario in `plugins/dev-pipeline/skills/build-lean/scenario-liveness-selftest.sh` covers it. The since-retired stacked-PR path died with all 42 selftests green because every one of them checked a component against itself. **No prose-presence guards.** Grepping a literal out of a markdown file asserts only that prose contains words — it cannot fail for a reason a reader of the diff would not already see. Wrap the two copies in `LOCKSTEP-BEGIN <anchor>` markers instead — `scripts/check-lockstep-pairs.sh` discovers them and compares the blocks, and an anchor with only ONE site fails. When a coupling is real but not byte-anchorable, record it in [`docs/testing.md`](docs/testing.md)'s *Couplings considered and declined* with the reasoning, so the decision is visible rather than forgotten. **No mirror harnesses.** Never test a hand-maintained *copy* of production logic. A copy cannot fail on a production edit, so it converges on green while the real code drifts away underneath it — and it reads as coverage the whole time. Two `.mjs` suites did exactly this: they modelled the pre-#169 StructuredOutput transport for months after production replaced it, and while they were green `design-sync.mjs`'s gate path was throwing `ReferenceError` on every dispatch. The sanctioned replacement is `workflows/runtime-shim-lib.mjs`, which strips the `export const meta