Setup

From melodic-software/claude-code-plugins · View interactive version

Setup is an AI agent skill from the GitHub repository melodic-software/claude-code-plugins. Verify and configure the mutation-testing plugin for this repository. check inspects the ecosystem's mutation tool (installed, runnable, supported test runner), the baseline suite's health, and the tracked docs/conventions/mutation-testing.yaml config across its merge layers, read-only; apply detect

How to use this skill

Skill file

Purpose

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 (CODE2 by layer).

The config merge model

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_PROJECT_DIR}/docs/conventions/mutation-testing.local.yaml, the same keys, gitignored),

later layers overriding scalars and unioning lists. Both files sit where

config locations puts the team and personal layers.

The old personal file is still read for now. .claude/mutation-testing.local.md, the personal

override of earlier releases, holds the same keys in a yaml block. While it exists:

values apply as before.

the old file sets is named: overridden when the YAML file sets it too, else not applied, so

no setting in it is dropped silently.

location and the command that moves it:

WARN: old personal override .claude/mutation-testing.local.md; move it to docs/conventions/mutation-testing.local.yaml with /mutation-testing:setup apply local.

With both present, the line ends with a space and (docs/conventions/mutation-testing.local.yaml won)

after apply local, so it also says the YAML file won.

Moving the old personal file is the one way to clear the warning.

Dropping the old-path read is a later change, made once no run reports the old file.

This plugin still reports as retired, or reads, the other .claude/ paths named here; keep config where this page says it is read.

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:

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

CODE0.

`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.

  1. Ecosystem and tool resolved. The configured tool key (probe 6) is this choice's record;

read it first. With none, resolve the ecosystem and its mutation tool by steps 3, 4 and 7 of

the plugin's ecosystem-resolution copy, asking and

recording nothing here. Report the tool and the file it came from. Nothing resolves → INFO

naming the manual path in the principles skill's tooling.md, not FAIL.

  1. 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. A configured tool

id with no shipped adapter (probe 6) has no version command or install line to offer, and the

audit refuses to run it even once installed: report this probe and probe 3 as not run, pointing

to probe 6, rather than guessing a command or naming an install.

  1. 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 has no

audit --exercised and no /testing:cleanup (if enabled) mutation gate, while the diff, --full and

--paths scopes still work.

  1. 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. 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.

  1. 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.

  1. 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. A tool id with no shipped adapter (any id but manual and

the six the audit's config-fallback.md lists) → INFO naming the id and saying the audit offers

tool: manual instead of running it; the layer still counts. 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. The old personal file

.claude/mutation-testing.local.md present → INFO, which gates nothing, naming the values it

supplied or, with the YAML personal file present, each of its keys as overridden or `not

applied`, as the merge model says; print the merge model's warning line above the table.

  1. 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.

  1. 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

CODE0, not a subset of it.

Grade the entries with the lint rather than deriving anything by hand, passing every layer that

exists:

```bash

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:

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.

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.

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.

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.

continue, never fail the whole read.

  1. 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 personal files

(docs/conventions/mutation-testing.local.yaml, the old .claude/mutation-testing.local.md

and a personal arid draft) 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.

  1. Read the effective config first, across all layers, and summarize it before proposing

changes. Nothing is dropped without the user confirming.

  1. Resolve and propose the tool. Resolve it by the steps in

the plugin's ecosystem-resolution copy; the configured

tool key is its record, written in step 7. Name the tool and the install command its own

documentation gives for this repository, and ask before installing anything. With nothing

resolved, propose tool: manual. Installing a dependency into the consumer's project is the

user's decision, not this skill's. Propose, never install unprompted. In the same message, before

any later question, name the detected test runner and what it supports, so the user can stop

here; read its kind from the audit skill's

CODE0 "test-command filter

forms". A path-list runner or dotnet test supports audit --exercised and the mutation gate of

/testing:cleanup (if enabled), which runs through it. A name-filter-only runner, or one whose kind that section

leaves unknown, 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.

  1. Settle the diff target. Default to the repository's own default branch as resolved from

origin/HEAD, not a hardcoded main or master. Confirm it resolves.

  1. Settle the operator set. Default to the tool's defaults, and say why: optional and

experimental operators raise the mutant count and the unproductive rate together. Offer the

narrowed set only if the user asks for a cheaper run.

  1. Settle the timeout from the measured baseline suite time in check, not from a guess.
  2. Settle the mutate paths and the test command. Propose source roots, excluding generated

code, vendored directories, and test code itself. Mutating tests measures nothing. Then propose

test-command when the repository's runner takes test file paths: the command the repository

already runs its tests with, resolved by the steps in

the plugin's ecosystem-resolution copy, with {tests}

where the paths go. 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; step 2 already said what that costs. The runner kinds and the dotnet test form are in the

audit skill's CODE0.

  1. Write the config to docs/conventions/mutation-testing.yaml, the template's YAML block

without its Markdown, following

CODE0.

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.

  1. Create the suppression record empty, with its header comment and an empty 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.

  1. Get both files tracked and committed, and say so. They are team-shared surfaces; leaving them

untracked is the failure probe 9 exists to catch, and 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.

  1. Verify after remediation. Re-run the 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 docs/conventions/mutation-testing.local.yaml, and recommend the recursive

docs/conventions/**/*.local.* line in .gitignore if not already covered, keeping

.claude/**/*.local.* for the old personal file and a personal arid draft. 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 layer

Steps 1 to 10 are the team flow. The other two layers change what is written:

user wants to override, as plain YAML without the template's team-shared header. When the old

.claude/mutation-testing.local.md exists, it first runs

Moving the old personal file. When that move is declined, or

the run is unattended, apply local stops there and writes nothing: a new YAML file beside the

old one would become the personal layer, and every old key it left out would stop applying. 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 docs/conventions/mutation-testing.local.yaml;

when nothing ignores it, offer the docs/conventions/**/*.local.* line in .gitignore and write it only on

the user's acceptance.

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.

when a saved value applies, fetch

plugin CLI reference § plugin configure

live.

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.

Moving the old personal file

apply at the team or local layer runs this before its own writes whenever

.claude/mutation-testing.local.md exists. apply user writes no file, so it names

/mutation-testing:setup apply local as the move instead. The move ends with one personal file,

never two:

  1. Name and preview. Name the old file and show the YAML the move would write to

docs/conventions/mutation-testing.local.yaml: every key of the old file's yaml block with its

value unchanged. When the YAML file already exists, it keeps its own values: the preview lists

each old key it also sets as overridden, with both values, and each old key it lacks as one

that would start to apply, and lets the user pick which of those to carry over.

  1. Ask. Write nothing until the user says yes. On no, or in an unattended run, change nothing:

the old file stays, and so does the warning. apply local then ends without writing; `apply

team` goes on to its own writes, which leave the personal layer as it was.

  1. Write, at either layer only after running

git check-ignore -v docs/conventions/mutation-testing.local.yaml and the ignore-line offer the

local bullet describes, so the new file is never left exposed to the index.

  1. Check it resolves the same. Read the personal layer back from the new file and compare each

carried key's value with the preview. On any difference, stop, leave the old file in place and

name the key, the expected value and the value read.

  1. Delete the old file, then re-run probe 6 and confirm the warning line is gone.

Output

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.

What this skill does NOT do

once to establish the baseline, and nothing more.

userConfig, which Claude Code stores; apply user names /plugin configure for it.

Configuration lives in the consumer's repository files, never in the plugin directory or the

plugin data directory.

skill's scaling-and-suppression.md for why gating on the score inverts the incentive.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.