agentleFS
CaduS0uzaCaduS0uza/qa-supreme/skills/mutation-proof/SKILL.md

mutation-proof

Skill1 starsChanged 2 months agoMITView on GitHub

Prove that a test detects the bug it claims to prevent by deliberately breaking the production code and confirming the test goes red. Use before merging any new test, after fixing a bug, or when asked whether a suite is trustworthy. Includes running real mutation testing tools (Stryker, mutmut, go-mutesting).

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run only that test. Record the result.

    line 26
  2. Distinctive:

    Never leave a mutation behind.

    line 31

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Mutation Proof

Coverage says the line ran. Mutation says the test would have noticed. Only the second is quality.

Level 1 — Targeted proof (always, per test, seconds)

For each new or suspect test:

  1. Identify the exact production line the test exists to defend.
  2. Apply one mutation to it:
OriginalMutation
if (a > b)if (a >= b)
return totalreturn 0
if (!user.isAdmin) throwdelete the guard
status = 402status = 200
items.filter(x => !x.refunded)drop the filter
  1. Run only that test. Record the result.
  2. Red -> restore the code, the test is proven, note the mutation in the commit message. Green -> the test is a false positive. Fix the assertion, do not fix the mutation.
  3. Restore the file and re-run to confirm you are back to a clean tree (git diff --exit-code).

Never leave a mutation behind. Verify with git status before finishing — a forgotten mutation shipped to production is the one way this skill can hurt you.

Level 2 — Tool-driven mutation testing (per module, minutes)

StackToolCommand
JS/TSStrykernpx stryker run --mutate 'src/checkout/**/*.ts'
Pythonmutmutmutmut run --paths-to-mutate src/checkout
Gogo-mutestinggo-mutesting ./checkout/...
JavaPITmvn org.pitest:pitest-maven:mutationCoverage

Scope it to P0 code only. Whole-repo mutation runs are slow, noisy, and get switched off within a week. Set a threshold on the P0 module and let the rest report without gating:

// stryker.conf.json
{ "mutate": ["src/checkout/**/*.ts"], "thresholds": { "high": 90, "low": 80, "break": 75 } }

Reading the survivors

Each surviving mutant is a sentence: "we can change this behavior and nobody complains". Triage into three buckets:

  • Real gap -> write the missing assertion.
  • Equivalent mutant (behaviorally identical, e.g. a swapped order in a commutative op) -> annotate and exclude with a comment naming why.
  • Dead code -> the mutation survives because nothing depends on the line. Delete the line.

Interaction with other skills

unit-test-authoring, api-contract-testing and e2e-authoring all end here. A test that has not been through Level 1 does not count as done, and the orchestrator will not report it as coverage.

Output

PROVEN  tests/checkout.spec.ts:42  <- mutated charge.ts:88 (`>=` -> `>`)  -> 1 failed  ✓
UNPROVEN tests/cart.spec.ts:10     <- mutated cart.ts:31 (return 0)       -> 0 failed  ✗ false positive
Tree restored: git diff --exit-code -> clean

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.