/mutation-testing:setup [check|apply [team|local|user]]from mutation-testing
Verifies and configures mutation testing for a repository. Checks the ecosystem's mutation tool, test runner, and config across merge layers. Applies by detecting the ecosystem, installing the tool, and writing config with diff target and operator set.
Ships in mutation-testing. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Establish the four things /mutation-testing:audit cannot infer repeatably at run time: which tool,
which diff target, which operators, and where arid-node suppressions live.
Configuration is optional: with none at any layer, the audit falls back to tool: manual, the diff
target from origin/HEAD, the changed source files and the effort cap, and asks the user for the
test command, which it never guesses. Configure anyway for a repeatable run. A mutation run drives
the project's own test runner against deliberately broken source; a guessed tool or diff target
either does nothing or does something expensive, and the config records the answers once.
Check-centric per the uniform setup contract (docs/plugin-philosophy.md
"Setup is explicit and repeatable" in the marketplace repository): check inspects read-only;
apply interviews and writes, then re-runs check. No argument or check runs the check; apply
runs the check first, then the write flow. apply takes the target layer as its next word: team
(the default), local or user (apply by layer).
The config resolves across three layers, lowest first: the user layer (userConfig) → team
(${CLAUDE_PROJECT_DIR}/docs/conventions/mutation-testing.yaml, a YAML file validated by
${CLAUDE_PLUGIN_ROOT}/schemas/mutation-testing.schema.json) → personal override
(.claude/mutation-testing.local.md), later layers overriding scalars and unioning lists.
The team file of earlier releases, .claude/mutation-testing.md, is retired and never read as a
layer. While it exists, check probe 6 reports it as INFO, which gates nothing, naming apply as the move, or, once
the YAML file exists, deleting it; apply step 7 carries its keys over.
There is no user-global file, and ~/.claude/mutation-testing.md is never read: a per-person
value lives in this plugin's userConfig, which Claude Code prompts for and stores. It carries two keys that mean the same thing in every repository,
operators and max_mutants (the config's max-mutants); their rendered values are:
operators: ${user_config.operators}max_mutants: ${user_config.max_mutants}An empty value or a surviving literal ${user_config.…} token is unset. A value outside the key's
range (operators other than default or narrow, max_mutants not a whole number of at least 1)
is reported with its key and value and dropped. The other keys are per repository, test-command
above all, so they are never read from userConfig. Report explicitly when a personal override changes the
team file's effect, and warn when a layer cannot be read, rather than silently presenting the team
file as effective.
The arid-node suppression record is a separate surface, .claude/mutation-testing-arid.md,
shaped by the finding-suppression convention. Keeping it separate from the config keeps the config
reviewable: a config diff is a policy change, a suppression diff is an accepted finding.
Its layering is not the config's, and the difference is the whole point. The config's later
layers override; the suppression record sits in the cascade's policy-floor precedence-inversion
class, so on a conflict for the same finding_id the team layer wins, and a personal-layer
entry for an id the team layer does not carry does not suppress at all. It is reported
personal-only, not applied. A personal layer is a draft surface here. Treating it as "layered the
same way" would let one developer silently hide a finding the team never accepted. The full
contract, including id derivation and the four dispositions, is owned by the audit skill's
${CLAUDE_PLUGIN_ROOT}/skills/audit/context/suppression.md.
check (read-only)Report a PASS / FAIL / INFO table with one remediation line per FAIL. Modify nothing, and do not
run a mutation analysis. That is /mutation-testing:audit.
Ecosystem detected. Identify the stack from manifests that actually exist (package.json,
*.csproj/*.sln, pom.xml/build.gradle, composer.json, pyproject.toml). Report what was
found and which mutation tool it implies. No recognized ecosystem → INFO naming the manual path
in the principles skill's tooling.md, not FAIL.
Tool present and runnable. Invoke the tool's own version command. Absent → FAIL with the install line for this ecosystem. Present but erroring → FAIL quoting the error; a tool that installs but cannot start is the common case and is worth distinguishing.
Test runner supported. Confirm the project's runner is one the tool drives. Report the
detected runner and the tool's support status. Unsupported → FAIL; this blocks every later step,
so report it before anything about scores. A supported runner also gets an INFO row naming what
it supports, decided as apply step 2 decides it: a name-filter-only runner (Maven -Dtest,
Gradle --tests) has no audit --exercised and no /testing:cleanup mutation gate, while the
diff, --full and --paths scopes still work.
Baseline suite is green. Run the project's test command once, unmutated, and report the
result. Red → FAIL. A red baseline kills every mutant and reports a perfect score, so no mutation
result is meaningful until this passes. Record the wall-clock; it is the input to the timeout
setting and to whether diff-scoping is sufficient. For dotnet test, run it once per test
project, naming the project, never over a solution or a directory. With no configured
test-command, ask the user for the command, or propose one and wait for their confirmation,
before running anything; an unattended run reports this probe as not run.
Known flakiness. Ask, and check for a documented flaky-test list or retry configuration. Flakiness present → INFO with the consequence stated plainly: mutants killed by a flaky failure inflate the score by an unknown margin.
Config presence (effective, across layers). Report the merged result and which layer
contributes what: tool, diff target, operator set, timeout, paths to mutate, with a value from
the user layer named userConfig and an invalid one reported as FAIL naming the key, the value
and /plugin configure as the fix. Nothing readable →
INFO naming the audit's fallback: tool: manual, the diff target from origin/HEAD, the
changed source files, the effort cap, and a test command the user supplies or confirms at run
time. apply writes a config that replaces it. The retired .claude/mutation-testing.md
present → INFO, as the merge model says; it never counts as a layer here.
Diff target resolves, the configured target must resolve in this repository
(git rev-parse --verify <target>). Unresolvable → FAIL naming it; a stale default here silently
scopes a run to nothing or to everything. A test-command without {tests} as a standalone
word (whitespace or the end of the string on both sides, unquoted) → FAIL: audit --exercised
replaces that word with the test paths, one argument each. Without it every mutant would run
against the whole suite; inside quotes ("{tests}") or a larger word (--files={tests}) the
paths would merge into one argument or split wrongly. Absent test-command → INFO; only the exercised scope
under the manual protocol needs it.
Suppression record. Report presence and entry count of .claude/mutation-testing-arid.md
across layers. Absent is a valid state (no suppressions) → INFO. Present → validate every
entry against the full contract in
${CLAUDE_PLUGIN_ROOT}/skills/audit/context/suppression.md, not a subset of it.
Grade the entries with the lint rather than deriving anything by hand, passing every layer that exists:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/suppression-lint.sh" .claude/mutation-testing-arid.md
It prints record <path> and then one line per entry, and exits 0 when every entry passes, 1
when any entry fails, and 2 when it cannot grade a record at all: no top-level suppressions:
mapping, an unreadable node-kind table, or no digest tool. An absent record and an empty
suppressions: mapping are both exit 0. Its three failure verdicts are FAIL conditions here; the
two items after them are the probe's own, and the lint decides neither:
malformed <id>. A required key is missing (check, claim, sites with a surface and
an anchor/v<N>, reason, date), date is present but is not a real calendar day written YYYY-MM-DD,
or claim is not the canonical form. FAIL, naming the entry and the key the lint names. A partial parse is not offered: an entry with sites,
reason, and date but no check or claim is malformed and must not be reported as usable,
because the audit would otherwise suppress a mutant on a location match the contract never
authorized.mismatch <id>. The entry's (check, claim, sites) do not hash to the key it is filed
under, and the line names the id they do hash to. FAIL. This is the case a hand-edited
constituent beside a stale key produces, and it silently stops suppressing if unchecked.unknown-kind <id>. claim binds arid(kind=<node-kind>) with a kind that is not a
member of the enumerated table in
${CLAUDE_PLUGIN_ROOT}/skills/principles/reference/scaling-and-suppression.md
("The node-kind vocabulary"), which the lint reads at run time. FAIL, reporting the accepted
kinds the lint prints beneath the failing entries. Membership is the test, not shape: a
single-word kind that is not in the table is indistinguishable from prose that happens to be
one word, and passing it would make every suppression self-justifying..local.md layer but absent from the team layer
is reported personal-only, not applied, with promotion to the team layer named as the remedy.
This is INFO, not FAIL: the entry is legal, it simply does not suppress.Tracked, not ignored. Both the config and the suppression record must be committed to be
team-shared, and not ignored is only half of that. Run both probes per file:
git ls-files --error-unmatch <path> (is it tracked?) and git check-ignore -v <path>
(is it ignored?). Untracked → FAIL, naming the git add that fixes it; ignored → FAIL with the
matching pattern. Checking only check-ignore is the trap: immediately after apply writes them
the files are untracked but not ignored, so check-ignore is silent and the probe would report
success on two files no teammate will ever receive. The .local.md personal overrides are expected to be
both untracked and ignored. INFO, not FAIL. A file that does not exist is not probed: probe 6
already reports the missing config as INFO, and probe 8 the missing record.
apply (idempotent)Run check, then interview and write. Proceed non-interactively where the repository makes a value
unambiguous; ask only where the answer is genuinely the user's.
tool-test-restriction.md "test-command filter
forms". A path-list runner or dotnet test supports audit --exercised and /testing:cleanup's
mutation gate, which runs through it. A name-filter-only runner (Maven -Dtest, Gradle
--tests), or one that table does not list, supports neither: audit --exercised refuses
unless the tool's own restriction reads yes in that file, and cleanup's mutation runs always
need a path-list test-command, so it can offer only its cannot-fail-only mode. The diff,
--full and --paths scopes need no test-command and work for every runner the tool drives.origin/HEAD, not a hardcoded main or master. Confirm it resolves.check, not from a guess.test-command for the detected ecosystem when its runner takes test file paths, with {tests}
where the paths go: python -m pytest {tests}, python -m unittest {tests},
npx vitest run {tests}, npx jest --runTestsByPath {tests}, vendor/bin/phpunit {tests}. The
audit fills {tests} with each path quoted as its own argument. When the detected runner is
dotnet test, propose dotnet test {tests}: the audit runs it once per test project, with
{tests} replaced by that project and a name filter for the test files' classes. Propose nothing
for a runner that only filters by name (Maven -Dtest, Gradle --tests); step 2 already said
what that costs. The forms and their sources are in the
audit skill's tool-test-restriction.md.docs/conventions/mutation-testing.yaml, the template's YAML block
without its Markdown, following
${CLAUDE_PLUGIN_ROOT}/skills/setup/templates/config-template.md.
Keep every key name as the template spells it. When that file does not exist yet and the
retired .claude/mutation-testing.md does, this first write carries every key of the retired
file's yaml block with its value unchanged, a value settled in steps 2 to 6 replacing it; with
nothing to settle, the write is that move alone. Leave the retired file in place and tell the
user to delete it once the YAML file is committed, since the plugin does not read it.suppressions:
mapping, a mapping, never a list, since a list is taken whole and one personal entry would
discard the team's entire accepted set. An empty record makes the first suppression an edit to a
reviewed file rather than the creation of a new one.apply is where it is cheapest to fix.
Offer the git add and the commit that follows it, and run each only on the user's explicit
acceptance; never commit unasked. Do not stop at staging as a matter of course: staged and
unstaged both leave a dirty working tree, and a session-end gate that refuses a dirty tree holds
the session open until these two files are committed and pushed. Say so when the user declines,
so the tree they are left with is a choice rather than a surprise.check probes on what was written, including both
halves of probe 9, tracked and not-ignored, then offer the personal override convention: personal
config overrides in .claude/mutation-testing.local.md, and recommend the recursive
.claude/**/*.local.* line in .gitignore if not already covered. State plainly that the same personal override pattern does not
give personal suppressions effect: an arid entry in a .local.md is a draft until promoted to
the team layer.Re-running apply after everything passes changes nothing and reports "already configured".
apply by layerSteps 1 to 10 are the team flow. The other two layers change what is written:
local writes to .claude/mutation-testing.local.md only, and only the keys the user wants
to override, without the template's team-shared header. It skips step 8, since a personal
suppression entry would not suppress, and step 9, since the personal override is meant to stay untracked. Before writing, run git check-ignore -v .claude/mutation-testing.local.md;
when nothing ignores it, offer the .claude/**/*.local.* line in .gitignore and write it only on
the user's acceptance.
user writes no file and no setting, and of check it runs only probe 6, so it runs no
test command. It runs step 1, then settles only the two userConfig keys: operators as step 4
does, and max_mutants unset by default, so the effort cap applies, offering a cap only when the
user asks. When the rendered max_mutants above is already a valid saved cap and the user wants
the effort cap, do not say the effort cap now applies: say the saved cap stays in force, since
leaving the key out keeps it, and that clearing it is done in
/plugin configure mutation-testing@<marketplace>. When this repository's team or local file already sets operators or max-mutants,
say that file overrides the user value here. Then name how to save them through Claude Code's
native flow: interactively with /plugin configure mutation-testing@<marketplace>, or by a
headless route as the marketplace's plugin-reconfiguration convention gives them in
§ The routes
(it owns the verified-version record, and what a key left out does), with the scope and
failure-signal caveats in its
§ Caveats every setup skill's short form carries.
Read both sections and print what they give, the fallback route, its behavior on an
already-installed plugin and the scope to pass included, rather than only naming them, and
leave out the verified-version record.
Save only the keys the user settled: operators, plus max_mutants only when the user chose a
cap (never an empty or invented cap). Never uninstall to reconfigure; that section links what an
uninstall deletes. A check in a fresh session shows the saved value, since a same-session
check can still show the old one; report only an observed value, never an unobserved change.
Never write pluginConfigs or any settings file yourself.
Say that steps 7 to 10 were skipped
because nothing in the repository was written, so git status is unchanged, and that a
repository's tool, diff target, mutate paths and test command still come from its team or local
file or the audit's fallback.
For the team layer, a tracked docs/conventions/mutation-testing.yaml and
.claude/mutation-testing-arid.md in the consuming repo; for local, the untracked personal override; for user, no file and the
/plugin configure line. Each ends with a one-paragraph summary of what was written and how to
re-run this setup to reconfigure; team and local also give the measured baseline suite time.
/mutation-testing:audit. check runs the unmutated suite
once to establish the baseline, and nothing more.pluginConfigs. The user layer is
userConfig, which Claude Code stores; apply user names /plugin configure for it.apply local writes on request.
Configuration lives in the consumer's repository files, never in the plugin directory or the
plugin data directory.principles
skill's scaling-and-suppression.md for why gating on the score inverts the incentive.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
mutation-testing, test-quality, config-setup, test-automation
npx claudepluginhub melodic-software/claude-code-plugins --plugin mutation-testing3 skills in this plugin
/auditRepository context. Gather firstMutation analysis that reports surviving mutants, on the diff or, with `--exercised`, on the production code the changed tests call. Use when: the user asks to run mutation testing or for a mutation score on a change ('run mutation testing'), doubts a suite whose coverage looks healthy ('my coverage is high but I do not trust it'), asks whether the tests, including ones just written, actually check the code, asks to audit test quality, or wants the survivors persisted for the fix pass; after tests go green and before review./principlesMutation Testing Knowledge BaseMutation-testing theory from the primary literature: what a surviving mutant means and why. Use when: the user asks what mutation testing is or whether it is worth doing, how the score relates to coverage ('mutation score vs coverage', 'what is test strength'), what a mutant's state or disposition means ('equivalent mutant', 'what is an arid node'), which operators to use or why a score is low, whether to gate a build on the score, or names the theory ('coupling effect', 'competent programmer hypothesis').Other plugins' skills for the same job