/code-slop:review-testsfrom code-slop
Review the tests of a whole repository for tests that cannot fail when the behavior breaks (tautological tests), tests that fail when only the implementation changes, tests that never run, and flaky tests. Use when the user asks to review, audit, or check the tests or the test quality of a repository, or runs `/code-slop:review-tests`. Runs the deterministic scanner first, then judges the candidates and the patterns that need judgment against the test catalog, confirms the strongest findings by changing the code in a scratch worktree, and writes `build/code-slop/review-tests.md`. Covers Kotlin, Go, TypeScript and JavaScript, Swift, and shell tests through the profiles of their frameworks.
Ships in code-slop. 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.
This skill finds tests that cannot fail when the behavior breaks and tests that fail when only the implementation changes, and it proposes the checks that keep such tests out of the build. The review is read-only: It changes the code only in a scratch worktree, to confirm a finding, and removes the worktree afterwards.
The skill works in Claude Code, Codex, and pi. <skill-dir> is the directory of this SKILL.md. The catalog is in the
first of <skill-dir>/../../code-slop/catalog/ (the shared copy that code-slop vendor wrote) and <skill-dir>/../../
(the plugin) that contains rules/tests.toml. Below, rules/, profiles/, and mutation/ mean the directories there.
rules/tests.toml holds the general rules, one [[rule]] per key, with the detection class, and
rules/references.toml the sources that the rules cite.profiles/<language>/<framework>/profile.toml shows how a rule appears in a framework, with a bad and a good
example. It also names the rules that do not apply there, the native tool that already checks a rule, and the
sources of the profile.mutation/<tool>/README.md tells how to run a mutation testing tool and read its report.The scanner is code-slop scan-tests. Run it as java -jar "$JAR" scan-tests, where $JAR is the file in
$CODE_SLOP_JAR, or the code-slop-cli-*.jar in it when it is a directory, or else the code-slop-cli-*.jar in the
directory that mise where http:code-slop-cli prints. Without a jar, tell the user and
apply the deterministic rules by reading the code, with the examples of the profiles as the guide.
Scope. Record the repository, git rev-parse HEAD, the parts that you review, and the test files and test
functions per language. Find the profiles that apply. A profile applies to a test file that contains one of its
markers, and to every test file of its language when it has none. It applies to all test files when a build file
matches its [[build]] entry. Read rules/tests.toml and those profiles, and only those.
Scanner. Run scan-tests --candidates at the root. It prints the errors on stderr and the candidates on stdout,
both as path:line: [key] message. Every error is a finding unless a test proves the scanner wrong. Report such an
error as a false positive with the reason. Each candidate needs judgment: Read the test and the production code, and
report it as a finding or as an accepted case. Note the exemption comments (code-slop: allow <key> <reason>) and
the baseline code-slop-baseline.tsv, and check whether each reason holds.
Mutation data. If the repository has a mutation testing tool with an adapter in mutation/, read its last report
or run it as the adapter describes, and run code-slop mutation --tool <tool> <report>. A test that kills no mutant
is a candidate for T, and a surviving mutant next to a test is a hint, not a finding. Do not add a tool or a
dependency to the repository. When the summary reports the tests that kill no mutant as unknown, do not infer them
from the report.
Judgment. Go through the test files, all of them in a small repository and the files with the most production
code behind them in a large one, and say which files you read. Apply the rules with the detection class judgment or
heuristic. For every finding, read the production code:
repeats-production-text finding, decide whether the text is a contract (a requirement, the API definition,
a document) or incidental, and whether the test and the production code take a contract text from one source.
Report a pattern once with all its locations and the count.Confirmation. Confirm the strongest findings, at least one per category with findings, by running them:
create a detached worktree in a scratch directory (git worktree add --detach <dir> HEAD), apply the change of the
finding there, run only the affected test, record whether it passed, and remove the worktree with
git worktree remove --force <dir>. Never change the checkout of the user.
Deterministic checks. For each pattern that you found, and for the patterns that a later change could easily add,
propose a check. The check is a detector of scan-tests, or the native tool that the profile names, such as a rule
of detekt, ESLint, or golangci-lint. State what it flags and its limits. State the findings and false positives on
the current code, measured or estimated, and say which. State the exemption that it accepts. Say plainly when a
pattern needs judgment.
Report. Write build/code-slop/review-tests.md below the root of the repository with the template of
references/report-template.md. Before you write, run git check-ignore -q on the path. If Git does not ignore it,
as in a repository that tracks a folder build/, tell the user that the report is an untracked file, or write it to
a path that the user names. Do not commit the report.
Stop. Do not fix the tests. Give the user the path of the report, the counts per category, the five most important findings, and the two most promising checks.
searches-source-text. List them under "Rule checks over the source".rules/references.toml and of the profiles.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub se-uhd/code-slop-skill --plugin code-slop9 skills in this plugin
/adversarial-reviewReview the code of a whole repository adversarially for defects of functional correctness, safety and security, robustness, maintainability and readability, architecture, and documentation, and for fixes that hide a defect instead of removing its cause, and report only the defects that a reproduction or the exact lines show. Use when the user asks for an adversarial, critical, deep, or security review of a repository or a code base, asks to find the bugs or the weak points of a project, wants an audit before a release, or runs `/code-slop:adversarial-review`. Runs the deterministic checks of code-slop first, gives each area to an independent reviewer (a subagent in Claude Code and Codex), lets a second pass try to disprove each finding, and writes `build/code-slop/adversarial-review.md`. Changes nothing in the repository. For a change, a branch, a commit range, or a pull request, use `/code-slop:adversarial-review-diff`./adversarial-review-diffReview one change adversarially for defects of functional correctness, safety and security, robustness, maintainability and readability, architecture, and documentation, and for fixes that hide a defect instead of removing its cause in the changed lines and the code that depends on them. The change is the diff from the merge base with the default branch to the working tree, a commit range, or a pull request or merge request by its number, which gh or glab read without changing it. Use when the user asks to review, break, or audit a change, a branch, a commit range, a PR, or an MR adversarially, asks what a change breaks, wants a critical review before a merge, or runs `/code-slop:adversarial-review-diff`. Runs the deterministic checks of code-slop on the change, gives each area to an independent reviewer, lets a second pass try to disprove each finding, and writes `build/code-slop/adversarial-review-diff.md`. Changes nothing in the repository.