No slash command · from code-review
Headless first step of a code review workflow that resolves a committed change against a base ref, reads project conventions, and writes context for downstream review steps. Not for interactive use.
Ships in code-review. 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.
None: SKILL.md is the whole skill.
Arguments: $ARGUMENTS
You do /start-cr's Steps 1–2b for a caller that cannot answer questions: nobody reads a question
you ask, so every decision below is taken from the input or reported back, never put to anyone.
--base <ref> — required. The ref the change is measured from; a commit SHA is fine.--out <dir> — required. The context directory; create it. It is the only place you write.-C <checkout> — the checkout under review. Defaults to the current directory.--spec <path> — optional. A spec the spec Lens reviews against.--spec-focus "<codes>" — optional, only with --spec. Comma-separated spec element codes and
decision ids (DB-1,API-2,D3) naming the part of the spec this change implements; the spec
and correctness Lenses judge the change against those first.--codex, --omp — optional, each on its own. The caller adds that external review through
Collegium (${CLAUDE_PLUGIN_ROOT}/references/external-review.md): --codex the OpenAI Codex
review, --omp the omp review. You check neither the settings nor the tools.A missing --base or --out, a -C that is not a git checkout, a --spec-focus without
--spec, or a --spec-focus that holds no code ends the run with status: error and the reason.
Guess nothing.
Read every file this skill names — scope.md, review-setup.md, each convention and standards
file — with the Read tool, one call per file. A cat chain through Bash is no substitute:
under zsh a separator such as echo ===== aborts the whole chain, and joined output past a size
is truncated. Bash is for git and the scope script.
The review covers what the checkout's commits changed since the base — never its uncommitted work, which belongs to whoever has the checkout open:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/get_changes.py -C <checkout> --scope committed --base <ref>
A count of zero is never a clean review. With an alternate in the output, return
status: empty and name the alternate ref and its count; without one, return status: empty
alone. The caller decides what an empty change means — you do not call it "nothing to review".
Apply ${CLAUDE_PLUGIN_ROOT}/references/scope.md to the list: which files are judged, which are
skipped and why, and each judged file's kind (source, test, iac, policy) from its ## File kinds
section.
Then type the source files when the session has mcp__code-review__change_types (look it up with
ToolSearch; it exists only when the user configured a decision backend): one call with checkout,
diff_args from the script, files the source paths and changed_files every path in the
change. Its types narrow the lens lists in §2. You ask nothing, so a Backend choice needed: result
is not answered: like a Change types unavailable: result or a missing tool, it narrows nothing, and
change_types in scope.json records why.
An active lens never carries an empty files list — a lens with nothing of its kind to read is
inactive, with that reason — and a change that leaves every lens inactive has nothing to judge
either: return status: empty with files: 0 judged and each skip reason in skipped, never
ready. Lenses that "pass" over zero files read downstream as a clean review of a change nobody
looked at. A change whose every file is skipped is not always that change: coherence judges
every skipped file but lockfiles, generated output and real .env* files, and an active spec maps the spec against
all of them but the real .env* files. An all-skipped change that leaves coherence a file — a document, a changeset,
config data — is ready, with coherence (plus spec and hookify when they count) the only active lenses and
every other lens inactive. One of lockfiles and generated files alone is ready only with a
usable --spec, spec then the only active lens; without one it is empty.
--spec counts only when it names a readable local file. Anything else — a URL, a ticket id, a
path that does not open — leaves the spec Lens inactive with that reason; never substitute a file
you think was meant. --spec-focus is recorded only beside a spec that counts: split it on commas,
trim each code, and keep the codes as given and in their order, without checking them against the
spec — the Lenses that read it report a code they cannot find.
Settle the conventions note, the standards slot and the active lens set by
${CLAUDE_PLUGIN_ROOT}/references/review-setup.md, working the mechanical read scope.md
describes inside the checkout. A lens is named by its rules file's basename: comments,
readability, tests, naming-module, objects-patterns, simplicity-types, correctness,
security, coherence, assumptions, performance, spec, hookify. The hookify rule files
are looked for in the checkout's own .claude/, never in the directory you run from.
Write each file with the Write tool:
conventions.md — the note exactly as every Scanner will receive it. One text for all lenses.standards.md — the standards text, or one ## <lens> section per lens when you pre-sliced it;
the single word none when the root has neither file.scope.json:{
"checkout": "<absolute path>",
"base": "<the base the script resolved>",
"diff_args": ["<from the script>"],
"files": [{ "path": "src/a.ts", "status": "M", "kind": "source", "untracked": false, "types": ["backend"] }],
"skipped": [{ "path": "pnpm-lock.yaml", "reason": "lockfile" }],
"spec": "<absolute path, or null>",
"spec_focus": ["<code from --spec-focus>"],
"hookify": ["<absolute path of each hookify rule file, in load order>"],
"change_types": { "backend": "typesafe", "model": "<from the tool>", "typed": 3, "of": 4 },
"lenses": {
"active": [{ "lens": "performance", "files": ["src/a.ts"] }],
"inactive": [{ "lens": "spec", "reason": "no spec named" }]
}
}
types is the list the change_types tool returned for that file, left out for a file it did
not type. change_types holds the tool's backend and model, typed the files that got at
least one type and of the files sent; it is { "unavailable": "<reason>" } when the tool failed
or asked for a backend choice, and null when the session has no such tool or the change has no
source file. spec_focus is null when no focus was given or spec is null. hookify is the gate's file
list when the hookify lens is active, and null when it is inactive. files holds the judged files only. Every lens appears once, active or inactive; an active lens's
files is its own list — the source subset for performance, the test and source files
for tests, the whole judged list for
security and assumptions, the whole judged list plus every skipped path but real .env* files (every one but .env.example, .env.sample, .env.template and .env.dist) for spec, the whole judged list plus
every skipped path but lockfiles, generated output and real .env* files, minus the spec, for coherence, the
same list with the spec kept for hookify, and the
judged list minus its policy files for every other lens. With --codex, append
{ "lens": "codex", "files": <the whole judged list> } to lenses.active, and with --omp the
same entry with "lens": "omp" — only when that list is not empty, and never in
lenses.inactive; without its flag there is no such entry. Neither is a lens: neither turns an
empty change ready. On status: empty, write scope.json with empty lists and the alternate object
the script returned, so the caller can read what you saw.
End this skill with this block and nothing after it. The block closes this skill, not the turn: when the prompt that invoked it names further steps, carry them out after it.
status: ready | empty | error
context: <dir>
base: <resolved base> · diff_args: <…>
files: <N> judged · <S> skipped
active: <lens, lens, …>
inactive: <lens — reason; …>
On empty, add alternate: <ref> — <count> files when the script returned one, or
reason: every file skipped when the count was above zero; on error, reason: <what stopped you>.
A codex or omp entry is listed on active: like a lens, but the caller dispatches each as its
own cr-scan --lens <id> agent, never inside a --lens list: inside a list cr-scan answers it with
an error block, and the merge reads that external review as skipped.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub grixu/cc-toolkit --plugin code-review3 skills in this plugin
/cr-mergeHeadless last step of a code review that another workflow drives — merges the lens outputs cr-scan wrote into one re-graded report, writes it into the context directory, and returns every finding with its fix and risk class in a fixed line shape. Asks nothing and applies nothing. Not for interactive use: a person reviews with /start-cr./cr-scanHeadless code-review Scanner for one lens, or a listed few in turn — reads the context directory cr-prepare or /start-cr wrote, judges the change against each lens's rules, and writes each lens's findings into the directory for cr-merge. Asks nothing and edits nothing. Not for interactive use: a person reviews with /start-cr.Other plugins' skills for the same job