← ClaudeAtlas

mutation-proof-harnesslisted

Use when about to prove that newly added guards can fail: a checker, a lint, a CI script, a validation function, and more than one needs proving. Fires on "prove the check can fail", "mutation proof", "watch it go red", and whenever a PR test plan is about to claim a guard was proved. Owns the SCRIPT: the baseline that stops a typo'd filter reading as a pass, the diff that stops a no-op mutation reading as a working guard, and the restore. Do NOT fire for a single ad-hoc mutation, or to decide WHETHER a guard is worth proving: prove-the-check-can-fail owns that.
damson/hard-won-skills · ★ 1 · Code & Development · score 67
Install: claude install-skill damson/hard-won-skills
# Mutation proof harness `prove-the-check-can-fail` says an assertion never watched to fail is decoration. This is the loop that watches, for more than one guard at a time. The reason it is a script and not a habit: hand-driving it produces two failure modes that both **look like success**. A test filter matching nothing reports a pass. A mutation that edits the file without changing behaviour reports a pass. Both are silent, so the tally reads the same either way. ## Procedure ### 1. Commit first `git checkout -- <file>` restores from the **index**, not from HEAD. So work that was staged but never committed survives the restore and stays staged, and step 6's clean-tree check then reads as a failed restore when nothing failed; work that was never staged is simply gone. Commit or stash pending work before mutating anything, and the question does not arise. ### 2. Define the two things the rest depends on One command that runs the suite filtered to a single test name, and the list of names. Everything below is written against these two. ```bash W=/abs/path/to/worktree # absolute: cwd resets between calls cd "$W" || exit 1 pass=0; bad=0 # The one line to adapt per project. Must exit non-zero when the test fails. # Use the repo's own pinned test command. A bare `npx <runner>` resolves from # the registry when no local binary exists, which downloads and executes a # package this script never chose. run_filter () { (cd "$W/scripts" && npm test --silent -- -