mutation-testing

Runs StrykerJS mutation testing on changed source files to find unchecked assertions.

7|12|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/OpenRouterTeam/docs --skill mutation-testing-openrouterteam
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mutation-testing
Source: https://github.com/OpenRouterTeam/docs/tree/main/.agents/skills/mutation-testing
Command: npx skills add https://github.com/OpenRouterTeam/docs --skill mutation-testing-openrouterteam

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code coverage only proves a line executed, not that a test would catch it being wrong. This Skill runs StrykerJS mutation testing against the source files you changed, surfacing mutants that survive your test suite so you can find assertions the suite executes but never actually checks. ## Core Features & Use Cases - Scoped mutation runs: Execute one bounded run per session against explicitly named changed source files using the repository harness with --in-place and a time cap. - Survivor triage: Classify survivors as missing assertions, equivalent mutants, wrong-level tests, or harness false positives, then fix only the first kind in a single batch. - CI report interpretation: Read the sticky CI mutation comment and downloadable JSON artifact to triage only the survivors in your diff's line ranges, including stacked-PR edge cases. - Use Case: After adding tests for a parser, run the harness once before opening the PR, kill the top surviving mutants with targeted assertions, and record the remaining survivors by file and line in the PR body. ## Quick Start Ask the AI to run mutation testing on the source files you just changed and triage the surviving mutants before opening your pull request.

Frequently Asked Questions about mutation-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run StrykerJS mutation testing on changed files?▼

Run the harness once per session with `bun run test:mutation --in-place --max-minutes 5` followed by the explicitly named changed source files. The run is a report, not a gate, so do not rerun, narrow the scope, or raise the time cap if it fails.

What is the difference between code coverage and mutation testing?▼

Coverage proves a line of code ran during tests, while mutation testing proves a test notices when that line is wrong. Stryker edits the source, such as flipping a comparison or dropping a call, and reports every mutant no test killed.

Why does mutation testing fail in a monorepo without --in-place?▼

Without `--in-place`, Stryker mutates a sandbox copy that loses the workspace links the tests import. The flag edits your actual checkout and restores it afterwards, so commit or stash your work first.

Why does the mutation run report no mutable source files?▼

The harness only accepts mutable sources inside workspace package directories, and it refuses targets whose test script cannot be narrowed when the suite exceeds 100 test files. Refused or unmeasurable targets are recorded as not measured.

When should I skip running mutation testing?▼

Skip the run when the diff touches only tooling such as scripts, lint rules, or CI config, when no source file changed, or when no changed source file has a colocated test. Record the result as not measured in those cases.

How do I classify surviving mutants from Stryker?▼

Classify each survivor as a missing assertion, an equivalent mutant that cannot change behavior, a wrong-level case needing integration tests, or a harness false positive. Fix only missing assertions, and never change production code or weaken tests to raise the score.