MIT · npm mutantgate@1.0.0 · Node 20.11+

Mutation-test only the lines
a pull request changed.

Coverage tells you a line ran. MutantGate tells you whether a test would fail if that logic changed — by injecting small bugs into the exact lines of the diff, running your own test suite, and reporting the ones nobody caught.

Works as a CLI, a GitHub Action, or an MCP server for Claude Code, Cursor and Codex. TypeScript/JavaScript today, built on StrykerJS.

npx mutantgate --base origin/main --threshold 70
# PR #111 changed 19 lines in src/defu.ts
scope   src/defu.ts:10-10,src/defu.ts:33-33,src/defu.ts:48-64
mutants 34 in the changed lines

MutantGate — diff mutation score: 52.9% ❌ below threshold 70

18 of 34 injected bugs in the changed lines were caught by the test suite.

| # | Location        | Mutation              | Status   |
|--:|-----------------|-----------------------|----------|
| 1 | src/defu.ts:52  | ConditionalExpression | Survived |
| 2 | src/defu.ts:55  | BlockStatement        | Survived |
| 3 | src/defu.ts:61  | EqualityOperator      | Survived |
| … |                 | 13 more survivors     |          |

→ write 6 tests against the survivors listed above

MutantGate — diff mutation score: 91.2% ✅ pass
exit 0   19 s cold · 10 s warm incremental

The number a reviewer actually needs

Stryker reports the package score. On the same commit of a real PR, the lines the PR touched scored far worse. That gap is the whole product.

Package score
70.21%
94 mutants · Stryker alone
Diff score
52.9%
19 changed lines · 16 survived
After 6 tests
91.2%
3 survivors left · exit 0
Runtime
19 s
10 s warm · PR-sized diff

Measured, not projected: unjs/defu PR #111 · Node 22.20.0 · Stryker 10.1.1 · vitest 4 · every command and raw log in that file.

What it catches

A surviving mutant is a behaviour no test asserts. Six tests aimed at the survivors on that PR took the diff from 52.9% to 91.2%.

Bugs a green suite misses

  • > → >= on a fee boundary: no test noticed
  • return value → return 0: nothing asserted the result
  • if (x) → if (true): the false branch never ran
  • A new helper validated by one happy-path test only

And tells you where to fix it

  • Score for this diff's changed lines, not the package
  • Survivor list with file, line, mutator and replacement
  • Exit code that fails a PR gate below your threshold
  • JSON or markdown output for the next step, human or agent

Three commands to a real score

MutantGate orchestrates the Stryker already in your repository. Nothing to host, no account, no source code leaves your runner.

terminal
# 1. once per repo: Stryker + a JSON report
npm i -D @stryker-mutator/core @stryker-mutator/vitest-runner && npx stryker init

# 2. score the lines this branch changed
npx mutantgate --base origin/main --threshold 70

# 3. (optional) let your agent call it directly
claude mcp add mutantgate -- npx -y mutantgate mcp
.github/workflows/mutation-gate.yml
- uses: actions/checkout@v4
  with: { fetch-depth: 0 }        # the merge base is required
- uses: luckystore1/mutantgate@v1
  with:
    threshold: '70'
    mode: block                   # exit 1 below threshold

Free tier is a working gate: score, exit code and the survivor list. The built-in PR comment and the per-survivor fix prompt are a separately licensed feature, not part of the free tier. Full input reference →

Agent skills and template packs

If you work through Claude Code, Cursor or Codex, the workflow also ships as an agent skill. The two paid items are template packs (prompts, workflows, configs) — no software license is included; everything in them runs on the free CLI.

Free

MutantGate: Diff Mutation Testing for PRs

$0

The skill that teaches your agent when to scan, how to read the diff score, and how to turn each survivor into the missing test.

Get the free skill →

Also on GitHub: npx skills add luckystore1/mutantgate

MutantGate Survivor Pack: Test-Gen Prompts & PR Gate Kit

$12

16 mutator recipes (the test that kills each mutant, and the trap that makes the test useless), a survivor-kill agent playbook, a ready-made GitHub Actions gate workflow, PR comment and approval templates, a monorepo preset.

Get the Survivor Pack →

Template pack, not a software license. Works with the free CLI.

MCP Security Audit & PR Gate: Claude Code & Cursor

$9

Audits the MCP config a PR can change — pasted secrets, risky server flags, over-broad permissions — and gates the diff in GitHub Actions. Python 3 + gh on the runner.

Get the MCP pack →

Template pack and workflow. No software license.

MutantGate Complete: PR Mutation Gate + MCP Security Audit

$16 $21

Both packs at 24% off, for the team that reviews agent-written PRs and also lets agents touch MCP config. The free skill is separate and installed first.

Get the bundle →

Two template packs. No license keys, nothing to activate.

Listings are on Agensi, which handles checkout and delivery. The free CLI and the source are always available on GitHub and npm — inspect before you buy.

How it works

  1. Diff. git diff -U0 against the merge base gives the changed line spans — src/defu.ts:48-64, not the whole file.
  2. Mutate. Stryker runs with --mutate scoped to exactly those spans, plus --incremental for speed.
  3. Filter. The JSON report is re-read and only mutants whose whole location falls inside a span are kept, so the score is the diff's, not the package's.
  4. Report. Score, verdict, survivor list, non-zero exit below threshold — on the console, as JSON/markdown, in a GitHub Actions step summary, or over MCP.

Honest limitations

  • Evidence, not proof. Equivalent mutants survive forever; read the survivor list instead of chasing 100%.
  • Only changed lines. Untouched weak tests stay weak — pair it with a nightly whole-package run.
  • TypeScript/JavaScript. It drives StrykerJS today; other languages are not shipped.
  • Speed is your suite's speed. A 20-line diff still runs the tests covering those lines.
  • Not a diff reviewer. CodeRabbit, Greptile and Copilot read the code; MutantGate measures whether the tests would notice a bug in it.
  • Your code stays home. The only network call is license validation; no source, report or mutant detail is uploaded.