/stepwise-core:mutation-testingfrom stepwise-core
Identifies weak or missing tests by checking whether small code changes (mutants) would be caught by the test suite. Supports mental mode (manual analysis) and tool mode (Stryker, mutmut, PIT/pitest).
Ships in stepwise-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Answers one question: "If I introduced a bug here, would a test fail?" Coverage tells you a line was executed; mutation testing tells you a change to that line would be detected.
Attribution: Adapted from eferro's skill-factory (Apache-2.0), itself based on Paul Hammond's mutation-testing skill.
/mutation-testing <file> # whole module
/mutation-testing # branch diff: git diff main...HEAD plus uncommitted changes
/mutation-testing --changed <files...> # only changed hunks: git diff HEAD -- <files>; untracked files whole
/mutation-testing --tool [...] # force the project's mutation tool (see Modes)
Only production code is mutated. Skip test files, generated code and pure configuration.
--tool is passed or the project already configures one (stryker.config.*/stryker.conf.*, [tool.mutmut] in pyproject.toml/setup.cfg, the pitest plugin in pom.xml/build.gradle*). See the tool reference for the scoped command.Never install a mutation tool or add its configuration. If --tool is passed and no tool is set up, say so and continue in mental mode.
Resolve scope. List the production files and, for diff modes, the changed line ranges.
Check the baseline. Run the tests that cover the scope. If they fail, stop and report: mutation results are meaningless on a red suite.
Generate mutants. For each function in scope, apply the operators in operators.md plus the language reference: python.md, javascript.md (JS/TS), java.md, kotlin.md. Favor the high-yield operators listed there; skip mutants that would not compile. In tool mode, run the tool instead: mutmut.md, stryker.md, pitest.md.
Evaluate each mutant. Find the tests that exercise the line and trace a concrete input: would an assertion produce a different result? Count a mutant as killed only when you can name the test and the input that kills it. When unsure, check empirically (see Applying Mutants).
Classify each survivor:
| Class | Meaning | Action |
|---|---|---|
| Missing test | No test exercises the input that distinguishes the mutant | Behavior for tdd |
| Weak test | A test runs the line but its assertion or inputs cannot tell the difference (identity values, toBeTruthy, "does not throw") | Behavior for tdd |
| Superfluous code | The mutated code does not affect observable behavior: duplicate branches, unreachable defensive checks, redundant calls | Refactor candidate for tdd |
| Equivalent | The mutant is semantically identical to the original (x + 0 vs x - 0) | Drop it |
A survivor never proves the business logic is wrong — only that no test distinguishes the two versions.
If the plan you're implementing explicitly asks for code that looks superfluous (a signature, a default, a defensive check), don't hand it over as a refactor candidate. Report it as still alive and give that as the reason.
Hand off to tdd. Invoke /stepwise-core:tdd with the Skill tool, using the handoff format below. Describe behaviors, not mutants: tdd writes tests through the public interface and does not need to know how the gap was found.
Verify each kill. For every test tdd added, apply its mutant, run that test, confirm it fails, and revert. If the mutant still survives, send tdd one sharper behavior (a more distinguishing input); after that retry, report it as still alive.
- BUG cannot kill anything: list them under Bugs found instead of verifying them.Report using the format below.
Empirical checks edit production code temporarily. After each check, the file must be byte-for-byte what it was before the mutant; confirm it with a checksum. These files usually hold uncommitted work that git can't restore, so keep your own copy before mutating. If you can't get the file back, stop and report. One mutant at a time, running only the tests that cover it; never commit or stage.
These behaviors already exist in the code, but no test pins them down.
Expect each test to pass on its first run; do not change production code to make it fail.
Behaviors:
1. <public entry point>: given <input>, <expected result> (<file>:<line>)
2. ...
Refactor candidates (keep tests green before and after):
- <file>:<line> — <why the code has no observable effect>
Pick inputs that distinguish the original from the mutant: values on the boundary, non-identity operands, mixed booleans, null/None where the code guards against it.
## Mutation Testing Summary
Mode: mental | tool (<name>) Scope: <files / diff> Score: <tool mode only>
### Still alive
| Location | Mutant | Why it survived |
|---|---|---|
| src/pricing.py:42 | `>=` → `>` | No public entry point reaches qty == 10 |
### Bugs found
- <file>:<line> — <expected vs actual>, documented as skipped test `<name>` | fixed (covered by plan)
If nothing is left: No surviving mutants. Do not list killed or equivalent mutants.
references/java.md (opens in a new tab)references/javascript.md (opens in a new tab)references/kotlin.md (opens in a new tab)references/mutmut.md (opens in a new tab)references/operators.md (opens in a new tab)references/pitest.md (opens in a new tab)references/python.md (opens in a new tab)references/stryker.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
15 skills in this plugin
/bugmagnetLightweight bug discovery and test coverage analysis for a code module. Use when the user asks to find bugs, analyze test coverage, write edge case tests, or do exploratory testing on a file. Triggers on "bugmagnet", "find bugs in", "test coverage gaps", "edge cases for", or "exploratory testing on <file>"./create-planCreate detailed implementation plans through interactive research and iteration/create-plan-liteCreate a short implementation plan (under 80 lines) from a ticket or a description, after researching the codebase. Experimental lighter alternative to create-plan/grill-meInterview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me"./hamburger-methodSlices features into vertical deliverable pieces using the Hamburger Method. Generates 4-5 implementation options per layer and composes minimal end-to-end slices. Use when slicing work, breaking down features into layers, or delivering incrementally./implement-planImplement technical plans from thoughts/shared/plans with verificationnpx claudepluginhub nikeyes/stepwise-dev --plugin stepwise-coreOther plugins' skills for the same job