Purpose
/testing:audit and the opt-in test-weaken hook find tests by the shipped adapters' filename globs
and judge them by the shipped rule levels. This skill shows what a repository changed about that
through the testing config, and writes it. check changes nothing; apply runs check,
asks, writes, and runs check again. No argument means check.
It never edits CLAUDE.md or AGENTS.md. The instruction line is printed for you to paste.
The config
The testing config resolves across the config-cascade layers, in order: ~/.claude/testing.yaml,
the team layer and <root>/.claude/testing.local.yaml, where <root> is the scanned file's git
toplevel, else ${CLAUDE_PROJECT_DIR}. The team layer is <root>/docs/conventions/testing.yaml.
Without it, the team layer is the yaml config block in <root>/docs/conventions/testing.md
(read for one more release), else <root>/.claude/testing.yaml; the first present wins and the
resolver prints a warning naming each one it ignores. Lists concatenate across layers; a later
layer's scalar overrides. The format is the adapters' YAML subset in every file; a glob that starts
with * must be single-quoted. docs/conventions/testing.yaml also holds /testing:run-e2e's
e2e_driver, reuse_running_instance and browser_driver, and /testing:write's
tdd_refactor_step and first_test, which the scan ignores.
The keys:
adapters:
disable: [py-unittest] # wins over enable; a non-empty enable list is an allowlist
paths:
exclude: ['legacy/**'] # relative to the repo root; ** crosses /, * does not
include: ['build/**/*.test.ts'] # reaches pruned folders; an adapter must still claim the file
adapter_dirs: [tools/test-adapters] # consumer adapters, same schema as the shipped ones
extend:
js-vitest:
files: ['*.it.ts'] # appended to that adapter's list field
rules:
rule-weak-oracle: off # off drops, warn reports without gating, error gates --check
test-weaken-block: error # test-weaken hook: deny an added skip or a removed test
The opt-in test-weaken hook runs before a Write or Edit to a test file and names what it removes:
test blocks, assertions, a changed expected value, or an added skip. By default it only tells the
agent. With test-weaken-block: error, an added skip or a removed test block is
denied until the edit carries a test-change: <reason> comment; removed assertions and changed
expected values are never denied. The agent can write that marker itself: it makes the reason
visible to reviewers, it does not prove the reason.
Removals (adapters.disable, paths.exclude, rules ... off) apply inside the scanner, so the
audit goes quiet with no plugin change; an excluded path or a disabled adapter silences
test-weaken too. Additions reach the audit at once; test-weaken covers only the shipped globs.
The test judge
The judge that asks where each changed test's expected value came from runs on demand, as
/testing:audit --judge, and in /source-control:pull-request prep. It has no plugin option and
no hook.
check (read-only)
Run the script and show its output as it prints:
bash "${CLAUDE_PLUGIN_ROOT}/skills/setup/scripts/setup.sh" check
It exits 0 with no finding, 1 when a test-lint rule is missing, 2 when a layer does not resolve
(the file and line are on stderr). Its four sections:
- config: the resolved records, or the note that no layer exists.
- lint: one row per rule for each language the repository's tracked test files use. The script
reads the lint config as text: a rule named there, or its plugin referenced beside a recommended
config, reads as present. Treat a
PRESENT row from the recommended-config path as likely rather
than proven, and say so. A FINDING is a gap to report, not a neutral absence. The rules:
- JS/TS:
jest/valid-expect (eslint-plugin-jest), vitest/valid-expect (@vitest/eslint-plugin),
playwright/missing-playwright-await and playwright/no-focused-test (eslint-plugin-playwright).
Which config each sits in is its rule page's to state:
jest/valid-expect,
vitest/valid-expect,
playwright/missing-playwright-await,
playwright/no-focused-test.
As of 2026-11-10; recheck when a plugin release note moves one of these rules out of its
recommended config or renames it.
- C#:
xUnit2021 (xunit.analyzers, which the check counts as present through an xunit or
xunit.v3 reference) and NUnit2009 (NUnit.Analyzers, which the check requires as its own
reference). Packaging: xUnit2021 and
NUnit2009. As of 2026-11-10;
recheck when an xunit or NUnit release note changes how the analyzers are packaged.
- Python: ruff
PLR0124, PT011 and F631. The check counts PLR0124 and F631 as on with no
select, PT011 as off, and a select as replacing the defaults with prefix matching
(setup.sh ruff_rule). Pointer: ruff settings § lint.select
and the rule pages for PLR0124,
PT011 and
F631. As of 2026-11-10; recheck when a ruff
release note changes the default rule set.
- Bash, PowerShell and Go: no maintained rule.
- instruction: the optional line, naming the one file Claude Code loads at the repository
root:
CLAUDE.md, else .claude/CLAUDE.md, else CLAUDE.local.md, else AGENTS.md, else CLAUDE.md in
${CLAUDE_CONFIG_DIR:-~/.claude} (the script's order). Which files load, and when AGENTS.md is
read: memory § When Claude Code reads AGENTS.md.
As of 2026-11-10; recheck when a Claude Code release note changes the Project instructions
default or which files count. Offer it; do not paste it anywhere.
- hook-entry: a
none: line saying test-quality findings come from /testing:audit, not a
per-edit hook, then, when a consumer glob matches no shipped test-weaken row, a line naming
those globs: the audit scans them, test-weaken skips them. No settings entry is printed.
Then probe the hook launcher, which the script does not: run command -v node via Bash and report
node as a FAIL row when it is absent. Every hook row launches through node hooks/exec-bash.mjs,
so a missing node is a hook launch error, not a skip notice, and a hook cannot report its own
missing launcher.
apply
Run check and summarize the effective config before proposing a change. Nothing already
configured is dropped without the user confirming.
Ask only what the repository cannot answer: folders or files to leave out, test files the
shipped globs miss (and which adapter reads them), adapters to turn off, rule levels.
Write the team layer with the answers. The script writes the team file in use:
docs/conventions/testing.yaml whole (keeping its e2e_driver, reuse_running_instance, browser_driver,
tdd_refactor_step and first_test lines), else the body of the yaml config block in docs/conventions/testing.md (the rest of
that file stays), else .claude/testing.yaml whole; with none, it creates
docs/conventions/testing.yaml. It keeps the result only when it resolves and writes nothing
else; pass every value the team layer should hold, the existing ones included:
bash "${CLAUDE_PLUGIN_ROOT}/skills/setup/scripts/setup.sh" apply \
--exclude 'legacy/**' --extend js-vitest.files='*.it.ts' --rule weak-oracle=warn
Flags: --include, --exclude, --enable, --disable, --adapter-dir,
--extend <id>.<field>=<value>, --rule <rule>=off|warn|error, each repeatable.
Run check again. Offer git add for the file
apply printed and a commit, and run each only when the user accepts. Personal overrides go in
.claude/testing.local.yaml, which should be gitignored. check also prints the optional line
to paste into CLAUDE.md or AGENTS.md that points at docs/conventions/testing.md when that
file exists.
Next
/testing:audit
Runs the scan with the config this skill wrote.
What this skill does NOT do
- Edit
CLAUDE.md, AGENTS.md, .claude/settings.json, or any lint config. It prints what to add.
- Install a lint plugin or analyzer.
- Run the audit. That is
/testing:audit.
1---2name: setup-573description: "Configure the testing plugin's can't-fail checks for this repository. check prints the resolved testing config cascade, which test-lint rules the repo's lint config turns on per language (a missing one is a finding), an optional instruction line to paste, and any test glob the shipped test-weaken hook skips; apply writes your answers to docs/conventions/testing.yaml (or to the docs/conventions/testing.md block or .claude/testing.yaml when that is the team file in use). Use when: 'set up testing', 'configure the test scan', 'exclude these tests from the audit', 'add a test glob', 'which test lint rules are missing', 'testing setup'. Re-runnable."4argument-hint: "[check|apply]"5user-invocable: true6disable-model-invocation: true7metadata:8 source: https://skillmd.com/skills/melodic-software/setup-579---1011## Purpose1213`/testing:audit` and the opt-in `test-weaken` hook find tests by the shipped adapters' filename globs14and judge them by the shipped rule levels. This skill shows what a repository changed about that15through the testing config, and writes it. `check` changes nothing; `apply` runs `check`,16asks, writes, and runs `check` again. No argument means `check`.1718It never edits `CLAUDE.md` or `AGENTS.md`. The instruction line is printed for you to paste.1920## The config2122The testing config resolves across the config-cascade layers, in order: `~/.claude/testing.yaml`,23the team layer and `<root>/.claude/testing.local.yaml`, where `<root>` is the scanned file's git24toplevel, else `${CLAUDE_PROJECT_DIR}`. The team layer is `<root>/docs/conventions/testing.yaml`.25Without it, the team layer is the `yaml config` block in `<root>/docs/conventions/testing.md`26(read for one more release), else `<root>/.claude/testing.yaml`; the first present wins and the27resolver prints a warning naming each one it ignores. Lists concatenate across layers; a later28layer's scalar overrides. The format is the adapters' YAML subset in every file; a glob that starts29with `*` must be single-quoted. `docs/conventions/testing.yaml` also holds `/testing:run-e2e`'s30`e2e_driver`, `reuse_running_instance` and `browser_driver`, and `/testing:write`'s31`tdd_refactor_step` and `first_test`, which the scan ignores.3233The keys:3435```yaml36adapters:37 disable: [py-unittest] # wins over enable; a non-empty enable list is an allowlist38paths:39 exclude: ['legacy/**'] # relative to the repo root; ** crosses /, * does not40 include: ['build/**/*.test.ts'] # reaches pruned folders; an adapter must still claim the file41adapter_dirs: [tools/test-adapters] # consumer adapters, same schema as the shipped ones42extend:43 js-vitest:44 files: ['*.it.ts'] # appended to that adapter's list field45rules:46 rule-weak-oracle: off # off drops, warn reports without gating, error gates --check47 test-weaken-block: error # test-weaken hook: deny an added skip or a removed test48```4950The opt-in `test-weaken` hook runs before a Write or Edit to a test file and names what it removes:51test blocks, assertions, a changed expected value, or an added skip. By default it only tells the52agent. With `test-weaken-block: error`, an added skip or a removed test block is53denied until the edit carries a `test-change: <reason>` comment; removed assertions and changed54expected values are never denied. The agent can write that marker itself: it makes the reason55visible to reviewers, it does not prove the reason.5657Removals (`adapters.disable`, `paths.exclude`, `rules ... off`) apply inside the scanner, so the58audit goes quiet with no plugin change; an excluded path or a disabled adapter silences59`test-weaken` too. Additions reach the audit at once; `test-weaken` covers only the shipped globs.6061## The test judge6263The judge that asks where each changed test's expected value came from runs on demand, as64`/testing:audit --judge`, and in `/source-control:pull-request` prep. It has no plugin option and65no hook.6667## `check` (read-only)6869Run the script and show its output as it prints:7071```bash72bash "${CLAUDE_PLUGIN_ROOT}/skills/setup/scripts/setup.sh" check73```7475It exits 0 with no finding, 1 when a test-lint rule is missing, 2 when a layer does not resolve76(the file and line are on stderr). Its four sections:77781. **config**: the resolved records, or the note that no layer exists.792. **lint**: one row per rule for each language the repository's tracked test files use. The script80 reads the lint config as text: a rule named there, or its plugin referenced beside a recommended81 config, reads as present. Treat a `PRESENT` row from the recommended-config path as likely rather82 than proven, and say so. A `FINDING` is a gap to report, not a neutral absence. The rules:83 - JS/TS: `jest/valid-expect` (eslint-plugin-jest), `vitest/valid-expect` (`@vitest/eslint-plugin`),84 `playwright/missing-playwright-await` and `playwright/no-focused-test` (eslint-plugin-playwright).85 Which config each sits in is its rule page's to state:86 [jest/valid-expect](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/valid-expect.md),87 [vitest/valid-expect](https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-expect.md),88 [playwright/missing-playwright-await](https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/missing-playwright-await.md),89 [playwright/no-focused-test](https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-focused-test.md).90 As of 2026-11-10; recheck when a plugin release note moves one of these rules out of its91 recommended config or renames it.92 - C#: `xUnit2021` (xunit.analyzers, which the check counts as present through an `xunit` or93 `xunit.v3` reference) and `NUnit2009` (NUnit.Analyzers, which the check requires as its own94 reference). Packaging: [xUnit2021](https://xunit.net/xunit.analyzers/rules/xUnit2021) and95 [NUnit2009](https://docs.nunit.org/articles/nunit-analyzers/NUnit2009.html). As of 2026-11-10;96 recheck when an xunit or NUnit release note changes how the analyzers are packaged.97 - Python: ruff `PLR0124`, `PT011` and `F631`. The check counts `PLR0124` and `F631` as on with no98 `select`, `PT011` as off, and a `select` as replacing the defaults with prefix matching99 (`setup.sh` `ruff_rule`). Pointer: [ruff settings § lint.select](https://docs.astral.sh/ruff/settings/#lint_select)100 and the rule pages for [PLR0124](https://docs.astral.sh/ruff/rules/comparison-with-itself/),101 [PT011](https://docs.astral.sh/ruff/rules/pytest-raises-too-broad/) and102 [F631](https://docs.astral.sh/ruff/rules/assert-tuple/). As of 2026-11-10; recheck when a ruff103 release note changes the default rule set.104 - Bash, PowerShell and Go: no maintained rule.1053. **instruction**: the optional line, naming the one file Claude Code loads at the repository106 root: `CLAUDE.md`, else `.claude/CLAUDE.md`, else `CLAUDE.local.md`, else `AGENTS.md`, else `CLAUDE.md` in107 `${CLAUDE_CONFIG_DIR:-~/.claude}` (the script's order). Which files load, and when `AGENTS.md` is108 read: [memory § When Claude Code reads AGENTS.md](https://code.claude.com/docs/en/memory#when-claude-code-reads-agents-md).109 As of 2026-11-10; recheck when a Claude Code release note changes the Project instructions110 default or which files count. Offer it; do not paste it anywhere.1114. **hook-entry**: a `none:` line saying test-quality findings come from `/testing:audit`, not a112 per-edit hook, then, when a consumer glob matches no shipped `test-weaken` row, a line naming113 those globs: the audit scans them, `test-weaken` skips them. No settings entry is printed.114115Then probe the hook launcher, which the script does not: run `command -v node` via Bash and report116`node` as a FAIL row when it is absent. Every hook row launches through `node hooks/exec-bash.mjs`,117so a missing `node` is a hook launch error, not a skip notice, and a hook cannot report its own118missing launcher.119120## `apply`1211221. Run `check` and summarize the effective config before proposing a change. Nothing already123 configured is dropped without the user confirming.1242. Ask only what the repository cannot answer: folders or files to leave out, test files the125 shipped globs miss (and which adapter reads them), adapters to turn off, rule levels.1263. Write the team layer with the answers. The script writes the team file in use:127 `docs/conventions/testing.yaml` whole (keeping its `e2e_driver`, `reuse_running_instance`, `browser_driver`,128 `tdd_refactor_step` and `first_test` lines), else the body of the `yaml config` block in `docs/conventions/testing.md` (the rest of129 that file stays), else `.claude/testing.yaml` whole; with none, it creates130 `docs/conventions/testing.yaml`. It keeps the result only when it resolves and writes nothing131 else; pass every value the team layer should hold, the existing ones included:132133 ```bash134 bash "${CLAUDE_PLUGIN_ROOT}/skills/setup/scripts/setup.sh" apply \135 --exclude 'legacy/**' --extend js-vitest.files='*.it.ts' --rule weak-oracle=warn136 ```137138 Flags: `--include`, `--exclude`, `--enable`, `--disable`, `--adapter-dir`,139 `--extend <id>.<field>=<value>`, `--rule <rule>=off|warn|error`, each repeatable.1404. Run `check` again. Offer `git add` for the file141 `apply` printed and a commit, and run each only when the user accepts. Personal overrides go in142 `.claude/testing.local.yaml`, which should be gitignored. `check` also prints the optional line143 to paste into `CLAUDE.md` or `AGENTS.md` that points at `docs/conventions/testing.md` when that144 file exists.145146## Next147148/testing:audit149Runs the scan with the config this skill wrote.150151## What this skill does NOT do152153- Edit `CLAUDE.md`, `AGENTS.md`, `.claude/settings.json`, or any lint config. It prints what to add.154- Install a lint plugin or analyzer.155- Run the audit. That is `/testing:audit`.