- Home
- Skills
- DevOps & Cloud
- MutantGate Survivor Pack: Mutation Testing Prompts & PR Gate
Works with the AI Agents you already use
MutantGate Survivor Pack: Mutation Testing Prompts & PR Gate
by luckystore1
A coding agent writes three assertions on the happy path, CI turns green, coverage goes up, and the boundary at subtotal > 20 is still untested.
$12
What it does
- Turn each surviving mutant into one focused regression test, with a recipe per mutator type
- Give your coding agent a survivor-to-test playbook with triage rules and a definition of done
- Block merges on weak diffs with a ready-made GitHub Actions gate workflow and threshold
- Include a monorepo preset template (per-package profiles, thresholds, report paths) plus policy settings
- Review with a ready-to-post PR comment template, waiver table and approval checklist
Who it's for
TypeScript developers shipping with AI coding agents
Stop accepting agent-written tests that pass but assert nothing.
Try asking: “My scan shows four survivors in src/cart.ts. Write the tests that kill them and show the before and after score.”
Platform and DevOps engineers
Add a mutation gate that blocks weak PRs without adding thirty minutes to CI.
Try asking: “Add the MutantGate PR gate to this repo, make it a required check, and keep the run under ten minutes.”
QA and test engineers
Prove the suite catches real bugs, then give reviewers a checklist they can run.
Try asking: “Which of these surviving mutants are real gaps and which are equivalent? Then write the missing tests.”
MutantGate Survivor Pack: Mutation Testing Prompts & PR Gate
Example session with this skill installed
Take a real green PR and prove its tests: run the diff gate on unjs/defu#111, triage the survivors, write the tests that kill them, and show the before and after score with the reviewer comment.
- Read your context and instructions
- Compiled the mutantgate survivor
Summary
Measured on a real pull request
unjs/defu #111 ("fix: only merge plain objects"). CI was green and the new tests passed, but the 19 lines the PR changed scored
52.9%. Six tests written against the survivors took the same command on the same commit to
91.2% — no production change, no threshold change.
| Metric | Before | After |
|---|---|---|
| Diff mutation score | 52.9% (exit 1) | 91.2% (exit 0) |
| Mutants in the changed lines | 34 | 34 |
| Detected / undetected | 18 / 16 | 31 / 3 |
| Tests written | none | 6 (test file only) |
1. Gate output (before)
npx -y mutantgate --base 59d0f6a367e3 --head HEAD --threshold 70
Scope: 1 file(s), 3 range(s), 19 changed line(s)
Score: 52.9% (threshold 70%, mode block) FAIL
Mutants: 18 detected, 16 undetected, 34 in scope — Killed 6, Timeout 12, Survived 16
2. Triage — 16 survivors, six behaviours
| Test written | Survivors it targets | Recipe |
|---|---|---|
ignores non-plain defaults (null, 42, 'str', [1,2]) | :10 conditional → false | ConditionalExpression |
requires both sides plain before recursing (Date, nested object) | :33 logical operator | LogicalOperator |
| null-prototype objects are plain | :57 prototype === null | EqualityOperator |
| class instances are non-plain | :58 prototype === Object.prototype | EqualityOperator |
objects with Symbol.toStringTag are non-plain | :59 !(Symbol.toStringTag in value) | UnaryOperator |
| iterables are non-plain | :59 !(Symbol.iterator in value) | UnaryOperator |
3. Tests added (test/defu.test.ts)
it('ignores non-plain-object defaults', () => {
// kills ConditionalExpression -> false at src/defu.ts:10
const date = new Date();
expect(defu({ a: 1 }, date)).toBe(date);
expect(defu({ a: 1 }, 42)).toBe(42);
});
it('requires both sides to be plain before recursing', () => {
// kills LogicalOperator -> || at src/defu.ts:33
const date = new Date();
expect(defu({ a: { b: 1 } }, { a: date })).toEqual({ a: date });
});
4. Same command, same commit
Score: 91.2% (threshold 70%, mode block) PASS
Mutants: 31 detected, 3 undetected, 34 in scope — Killed 24, Timeout 7, Survived 3
5. Reviewer comment (from templates/pr-comment.md)
Mutation gate — 91.2% (threshold 70%) · pass
31 caught / 3 missed · scopesrc/defu.ts:10-64
Tests added: non-plain defaults, both-sides-plain recursion, null prototype, class instance,Symbol.toStringTag, iterables.
Accepted survivors::33(equivalent),:58and:59(branch unreachable with a value that satisfies the rest of the check).
Re-scan:npx -y mutantgate --base 59d0f6a367e3 --head HEAD --threshold 70
Next steps
- Copy
workflows/mutantgate-pr-gate.ymland mark themutantgatejob as a required status check. - Keep the three accepted survivors in the waiver table with their reasons; do not chase them.
- Add
templates/mutantgate.monorepo.ymlwhen the package split lands.
Measured on a real repository (unjs/defu PR #111). Every number comes from a command that was run; the commands and raw output are in
examples/unjs-defu-pr111-fixes.md, included in this pack.
Connects securely to your tools. The creator never sees your data.
About this skill
Your agent's tests pass. That is not the same as testing.
A coding agent writes three assertions on the happy path, CI turns green, coverage goes up, and the boundary at subtotal > 20 is still untested. The free MutantGate skill finds exactly those gaps: it mutation-tests only the lines a PR changed and returns the surviving mutants, each one a behaviour no test asserts.
Then what? The survivor list is where most teams stall: deciding which mutants matter, writing a test that actually kills each one, and making the check blocking without turning the score into something people game. This pack does that part.
This is a template pack, not a software license. It ships the recipes, the playbook, the workflow and the templates. The CLI's built-in --comment-out and --fix-prompt-out (and the MCP mutantgate_fix_prompt tool) need a separate MutantGate software license. That license is not included in this pack, and nothing described below needs it.
How it works
- Scan.
npx -y mutantgate --base origin/main --threshold 70returns the diff score and the survivor list: file, line, mutator, replacement. - Triage. The playbook classifies every survivor as a real gap, an equivalent mutant (with the sentence that proves it), or needs-review, before any test is written.
- Fix. One recipe per mutator type.
>vs>=needs the input at exactly the boundary.iftotrueneeds the case where the condition is false and the outcome differs.&&vs||needs one operand true and the other false. - Prove. Re-run the same command on the same commit. Those are the numbers that go in the PR.
- Gate.
workflows/mutantgate-pr-gate.ymlblocks merge below the threshold on the free CLI's exit code and keeps a readable step summary; the reviewer comment comes fromtemplates/pr-comment.md.
What is in the pack
| File | What it does |
|---|---|
references/mutator-recipes.md | 16 mutators: the test that kills each one, and the trap that makes a test look right while the mutant survives |
prompts/mutant-kill-playbook.md | survivor list to finished tests, with triage rules, a definition of done and forbidden shortcuts |
workflows/mutantgate-pr-gate.yml | block mode, incremental cache, fork-PR handling, step summary and artifacts |
templates/mutantgate.monorepo.yml | monorepo preset template: per-package profiles with their own thresholds and report paths, plus a policy block (minThreshold, requireBlockMode). The profiles, reportPath and --report-path-prefix keys it sets are free-CLI features; policy is enforced only on the Team plan, and the file says so |
templates/pr-comment.md | review comment, waiver table, approval checklist and red flags in agent-written tests |
examples/unjs-defu-pr111-fixes.md | a real PR taken from 52.9% to 91.2% with six tests |
Frameworks and tools
TypeScript/JavaScript through StrykerJS (Vitest, Jest, Mocha, node:test), the free mutantgate CLI or MCP server, and GitHub Actions. The pack is Markdown, YAML and two config files: nothing executes on install, no code is uploaded, and no credentials are read. No license key is required.
Why not just prompt your agent?
"Write tests for these mutants" produces happy-path assertions, or an agent that lowers the threshold to make the number move. The playbook encodes what a careful reviewer does instead: triage first, one survivor per test, prove the test fails under the mutation, never edit the gate, and report before and after numbers from a command.
The templates also carry two traps that cost hours in real repositories: report keys are relative to the package Stryker ran in (MUTANTGATE_REPORT_PATH_PREFIX), and fork pull requests get a read-only token, so the comment step needs its own handling.
Use cases
- Reviewing agent-written PRs without reading every test file
- Adding a mutation gate to a repository that already has coverage
- Rolling the gate out package by package in a monorepo
- Teaching a team what "tested" means with a checklist they can run
Known limitations
- JavaScript/TypeScript only (StrykerJS). Python, Go, Java and Rust are not covered.
- Only changed lines are mutated; untouched weak tests stay weak.
- Equivalent mutants survive forever. The pack tells you to explain them, not chase them.
- The gate's latency is your suite's latency for the changed lines.
policy.minThresholdandpolicy.requireBlockModeare enforced by the CLI only on its Team plan; the preset ships them as settings the CLI ignores, with a warning, on other plans.- The CLI's built-in PR comment (
--comment-out) and fix prompt (--fix-prompt-out), and the MCPmutantgate_fix_prompttool, need a separate MutantGate software license. This pack does not include that license; the gate, the templates and every test workflow above work on the free CLI.
Related skills
- MutantGate: Diff Mutation Testing for PRs (free) - the scan this pack builds on. Install it first.
- MCP Security Audit & PR Gate: Claude Code & Cursor ($9) - the same keep-it-from-regressing idea for MCP config and agent settings.
Source code & package
The pack drives the open-source mutantgate CLI (MIT). The same engine is published on npm as mutantgate (npx -y mutantgate, Node.js 20.11+) and its source is on GitHub as luckystore1/mutantgate, so you can inspect it before you buy.
Files: SKILL.md; prompts/mutant-kill-playbook.md; workflows/mutantgate-pr-gate.yml; templates/stryker.conf.diff.mjs, templates/mutantgate.monorepo.yml, templates/pr-comment.md; references/mutator-recipes.md; examples/unjs-defu-pr111-fixes.md. Setup: Node.js 20.11+, Stryker installed in the project (npm i -D @stryker-mutator/core @stryker-mutator/vitest-runner), a JSON reporter in stryker.conf, then npx -y mutantgate --base origin/main --threshold 70. CLI flags used: --base, --head, --mutate-args, --threshold, --mode block|warning, --profile, --include, --exclude, --report-path-prefix, --format json, --json-out, --comment-out (needs a separate license), --fix-prompt-out (needs a separate license), --fail-on-error, --fail-on-no-mutants. Config keys in .mutantgate.yml: version, threshold, mode, include, exclude, strykerConfig, strykerTimeoutSeconds, incremental, defaultBranch, reportPath, failOnError, failOnNoMutants, profiles (paths, threshold, mode, include, exclude, reportPath), policy (Team plan only). GitHub Action inputs: fetch-depth 0, threshold, mode, comment (needs a separate license), format, fix-prompt-out (needs a separate license), license-key, fail-on-error, fail-on-no-mutants, stryker-timeout-seconds, working-directory, config. MCP tools: mutantgate_scope and mutantgate_scan (free), mutantgate_fix_prompt (needs a paid license key; not included in this pack).
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed today
- Software
- mutantgate
Node.js 20.11+Stryker (with stryker.conf.json)
Git
- Optional
- MutantGate software license key
No license key is needed for anything in this pack: the scan, the tests, the gate workflow and the templates all run on the free CLI. The built-in PR comment and fix-prompt output need a separate MutantGate software license, which this pack does not include.
Permissions
File Scopes
Everything here runs locally or on your CI runner; nothing is uploaded. Test files are written next to the code they cover, and the workflow file goes in .github/workflows. The PR comment is a template you post yourself; the CLI's built-in comment output is not part of this pack.
What's inside
Frequently Asked Questions
New in DevOps & Cloud
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for DevOps & Cloud.