/code-slop:adversarial-reviewfrom code-slop
Review 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`.
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.
With this skill, the agent tries to break the code of a repository and reports only the defects that it can show. One reviewer per area looks for defects without the findings of the other reviewers. Disprovers then try to disprove each finding, and the report lists the findings that survive, the most severe first. Each finding names the cause of its defect, and its fix removes that cause where it starts. The reviewers report a workaround, a shortcut, or a weakened check as a defect, and they never propose one as a fix. The agent changes nothing in the repository. It writes its report and works in scratch copies outside the repository.
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/review.toml.
rules/review.toml holds one group per area, with the evidence that a finding of the area needs, and the rules that
the reviewer of the area checks.profiles/<language>/ holds what the general rules leave to a language: the doc comments and the messages in
profiles/<language>/comments/profile.toml, and the test frameworks and their native tools in the other profiles.references/briefs.md holds the briefs of the reviewers and of the disproving pass, and
references/report-template.md the report.The command line is code-slop. Run it as java -jar "$JAR" <command>, 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, record in the report that no check ran, and go on.
--report <path>: the path of the report.--disprovers <n>: the number of subagents of the disproving pass, 3 by default (step 6).A subagent knows only its brief, so every brief repeats these rules.
TMPDIR to a folder of the scratch directory..env or .env.*, keys and certificates (*.pem, *.key, *.p12, id_*), .netrc,
a file named *secret* or *credential*, or a file that the constraints of the repository name. Do not print the
environment. The name of a tracked secret file is enough evidence for a finding.AGENTS.md, CLAUDE.md, and the files that they import apply in the
repository and in every scratch copy, such as "run the tests only in the container" or "never run X". The reviewers
follow a constraint that forbids or restricts an action, and only such a constraint (rule 4). A constraint can say
that tools or tests run only in a container, or not on the host. Then every tool of the review runs there, the
checks of code-slop included, with the copy mounted read-only and without network. When that container has no
Java, the jar runs in a container of an image with Java. The report quotes each such constraint with its file and
says how the reviewers followed it.-Dorg.gradle.daemon.registry.base=<scratch>/daemons for Gradle. The
session ends these daemons by the process IDs in that directory, never with a command that stops the daemons of
everyone, such as gradle --stop. The session records each process, container, and image that the review starts in
<scratch>/run.txt. A subagent keeps its files in the scratch directory for the disproving pass and removes nothing
of it. At the end, the session removes the scratch directory and what run.txt lists.Scope. git can be the shim of a tool manager that refuses the configuration of the repository, such as mise
for an untrusted mise.toml. Then run the Git of the system by its path for every command of the review. Record the
root (git rev-parse --show-toplevel), git rev-parse HEAD, git status --porcelain, and
the time. Read AGENTS.md, CLAUDE.md, and the files that they import, and list their hard constraints word for
word. List the documents that state requirements and design, such as the README, the design documents, and the
decision records. List the tracked files by language and part, and rank the parts. First come the entry points and
the code that reads input from outside, and then the code that writes, deletes, or starts processes. Then come the
parts that the design names as critical, and last the rest.
Scratch copy. Create a scratch directory outside the repository, such as the scratchpad of the client or
mktemp -d, and copy the repository into <scratch>/base:
git clone --quiet --no-checkout "$root" "$scratch/base"
git -C "$scratch/base" fetch --quiet "$root" HEAD && git -C "$scratch/base" checkout --quiet --detach FETCH_HEAD
When the working tree has changes, apply git -C "$root" diff --binary HEAD in the copy, copy the untracked files
of git -C "$root" ls-files --others --exclude-standard except secret files, and commit them in the copy, so that
the clones of the reviewers have them.
Check that Git and the tools that the repository pins run in the copy, because code-slop reads the files without Git
when Git fails there. A tool manager can refuse the configuration of a copy, such as the shims of mise for an
untrusted mise.toml. Then put the pinned tools on the PATH without the shims instead of trusting the copy, and
write this setup, with TMPDIR and the state directories of rule 6, to <scratch>/env.sh for the subagents. A
constraint that names a task of the tool manager, such as mise run check, then means the commands of the task, run
as the task runs them, such as in its container.
Write <scratch>/run.txt with the repository, the commit, and the time. Write the report at once with its scope,
the status running, and the path of the scratch directory, so that a stopped run leaves a trace (see "A run that
stops early").
Deterministic checks. Run these commands with the copy as the working directory and with
--root "$scratch/base", and write each command, its exit code, and its output to <scratch>/checks.txt. Some
checks print nothing when the configuration of the repository does not switch them on, so record from the
configuration which checks it switches on.
scan-tests --candidates, check-markdown (never with --fix), check-comments, and check-messages;vendor --check when the manifest of code-slop vendor exists, which is .claude/code-slop/vendor.tsv or the
path of [vendor] manifest in code-slop.toml, and catalog --check in a checkout of code-slop.The report lists these results, so no reviewer reports them again. Exit code 1 means that a check could not run.
Reviewers. Start one reviewer per group of rules/review.toml, seven in all, at the same time, each with its
brief and the examples of references/briefs.md. When the client limits the subagents, start the others as soon as
a reviewer ends. In Claude Code, start each with the Agent tool, and in Codex with spawn_agent. Give a reviewer its
brief and the examples and nothing else, and never the findings of another reviewer, which would steer its search
to the same places. Each one returns its findings as its final message, because Claude Code does not let a
subagent write a file of findings, and the session saves them as <scratch>/findings-<area>.txt. In pi with the
extension pi-subagents, start each with its tool Agent. In pi without subagent tools, follow "Without subagents"
below.
Merge. Merge the findings as the reviewers return them. Findings with the same cause at the same place become
one, with the rule of the first area and the names of the others. A cause with effects at different places gives
one finding per effect, each naming the shared cause and fix. Remove a finding that checks.txt already reports.
A finding without the evidence that its group names becomes a question of the report.
Disproving pass. Give the merged findings to new subagents with the disproving brief of
references/briefs.md, because a reviewer tends to defend its own findings. Three disprovers check the findings by
area. The first checks functional correctness and safety and security. The second checks robustness and
maintainability and readability. The third checks architecture, documentation, and the fixes at the root cause. A
run then has at most ten subagents, and --disprovers <n> splits the areas among another number. A finding goes
with the area of its rule. Start a disprover as soon as its areas have returned, and put a long batch into a file of
the scratch directory that the brief names. Each disprover reruns every reproduction in its own clone of
<scratch>/base and returns a verdict for each finding. Keep the confirmed findings, with the severity, the fix,
and the part that the disprover confirmed.
Report. Write the report with references/report-template.md to build/code-slop/adversarial-review.md below
the root, or to the path that the user names, and create its directory. Quote the commands and the output of each
reproduction, because step 8 removes the scratch directory. Replace the status running with complete. Do not
commit the report. If Git does not ignore the path, tell the user that the report is an untracked file.
Answer. Remove what rule 6 names. Tell the user the path of the report, the count of findings per severity and area, each critical and major finding in one line, the run time, and the number of reviewers and disprovers.
Without a tool that starts a subagent, as in pi without the extension pi-subagents, the session takes the role of each reviewer in turn, and these steps keep the areas apart:
rules/review.toml. Before each area, read its brief as your
only instructions, and start again from the code, not from the notes of an earlier area.<scratch>/findings-<area>.txt, and do not change it afterwards.<scratch>/base, and refute it when the output differs from its evidence.The user can stop the review, or a limit of the client can end it. Then stop the subagents, and write the findings
that they returned into the report under the status stopped, marked as not disproved. Clean up as rule 6 says. A run
that ends before it can clean up leaves the status running.
When a new run finds a report with the status running or stopped, read the run.txt of its scratch directory. End
a process that the file lists only while the command line of the process still names that directory. Remove the
containers and the images that the file lists, and then the directory. Then start from step 1. Report no finding of
the earlier run without new reviewers and a new disproving pass, and name the earlier run in the scope.
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-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./domain-modelModel the stored classes of an app and the rules for their values in Alloy, check the model against the code, and draw it as a PlantUML class diagram. Use for /domain-model, when a class or a property of the domain changes, to find where the layers of an app state different limits, or to review the domain as a diagram. The commands that write and check a diagram need the JVM library code-slop-models, and without it, the skill runs the Alloy Analyzer by hand./glossaryBuild or maintain GLOSSARY.md for a code repository and check its terminology. Use when the user asks for a glossary of a code base, for proposed definitions, for a check of competing names, or for a check that the comments, the Markdown documents, the messages of the program, and the identifiers use one term for each concept, or runs `/code-slop:glossary`. Reads the text through the language adapters and lexers of code-slop with `code-slop glossary`, and writes definitions in the form of ISO 704 and in the format of the glossary of ai-slop. Flags competing names, avoided terms, new terms without a definition, and deficient definitions. Writes the glossary and `build/code-slop/glossary-report.md`, and validates an existing glossary with --check./review-commentsReview the comments and doc comments of a repository, or of the files that a change touches, against the comment catalog of code-slop. Finds comments that narrate or restate the code, explanations that belong in a decision record, pointers to missing records, doc comments that are too long or document private code, missing contracts, filler phrases, and markers of unfinished work. Use when the user asks to review, audit, or clean up the comments of a repository or a change, or runs `/code-slop:review-comments`. Runs `check-comments` and the native tools that the language profiles name, judges the rest against the catalog, and writes `build/code-slop/review-comments.md`. Covers Kotlin, Go, TypeScript and JavaScript, Swift, shell, Lua, Python, and AppleScript./review-testsReview 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./review-tests-diffReview only the tests that a change adds or modifies, and the production code that it changes, for tests that cannot fail, tests coupled to implementation details, and tests that the change weakens. Use when the user has uncommitted changes or a branch and asks to check the tests of the change, such as "review the tests I just wrote", "did the agent fake the tests", or `/code-slop:review-tests-diff`. Uses the test catalog of `/code-slop:review-tests`, adds the rules of a diff (an expected value that changes together with the code, a weakened test), confirms the strongest findings in a scratch worktree, and writes `build/code-slop/review-tests-diff.md`.