setup
Check or apply the review plugin's repository setup: the standards index, docs/conventions/review.yaml settings, and the repository's own design-smell list.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 30
- Forks
- 7
01 前言 Front Matter
- description
- Check or apply the review plugin's repository setup: the standards index, docs/conventions/review.yaml settings, and the repository's own design-smell list.
- argument-hint
- [check|apply] [<key>=<value> ...]
- user-invocable
- true
- disable-model-invocation
- true
02 资源文件 3
- 参考文档evals/evals.json5.4 KB
- 脚本scripts/setup-apply.mjs846 B
- 脚本scripts/setup-apply.test.sh37.3 KB
03 SKILL.md 正文
Purpose
Settle where the consumer's standards live, the adopted conventions and criteria this
plugin's review modes resolve through. By implementing the normative "Setup and migration"
section of the plugin's contract binding
${CLAUDE_PLUGIN_ROOT}/reference/standards-contract.md.
The procedure (state reading via the index presence test, the conforming-index short-circuit, the
hand-authored-README confirmation gate, interview, skeleton write, row-path validation,
DIRECTIONAL version-delta detection with guided migration, idempotent re-run) lives there. Implement it by reference; do not restate it.
Idempotent: re-running reads the current state and offers an update rather than overwriting blind; a re-run against a conforming, current-version index proposes no changes.
Action routing per the uniform setup contract
(docs/plugin-philosophy.md
"Setup is explicit and repeatable"): no argument or check runs
the binding's state-reading procedure read-only and reports index presence and resolved
standards root, per-row path validation, and the DIRECTIONAL version delta as a PASS/FAIL/INFO
table with one remediation line per FAIL, writing nothing. apply runs check first, then the
binding's bootstrap / reconfigure / migration flow below; after any write it re-runs the relevant
probe and reports the actual result. Non-interactive when the state admits exactly one conforming
action (the conforming-index short-circuit); the binding's explicit-confirmation gates
(hand-authored README conversion, bootstrap writes) remain explicit user decisions, never silent.
The plugin also owns one tracked settings file, docs/conventions/review.yaml, the repository
layer of its settings (keys, values and layers:
${CLAUDE_PLUGIN_ROOT}/reference/config.md; schema:
${CLAUDE_PLUGIN_ROOT}/schemas/review.schema.json). check reports it; apply writes it only
when the operator names a key or asks to change a setting, as described under
Repository settings.
The plugin owns a second tracked file, docs/conventions/review-digest.yaml, the team layer of the
review-digest concern that /review:explain-change reads (schema:
${CLAUDE_PLUGIN_ROOT}/schemas/review-digest.schema.json; keys and layers: the review-digest
convention in the marketplace repository). The shared setup-apply.mjs writer does not check list
keys (blast_radius, risk_paths), so apply writes this file itself, only when the operator asks
to change a digest setting: create it at docs/conventions/review-digest.yaml, the one path the
reader looks at whatever convention home the repository binds, with only the keys the operator
names, values taken from the schema's allowed values, list globs in double quotes, or edit the
named lines of the existing file and show the diff first. Then read the written file back from the
working tree and check it against the schema: no key the schema does not list, digest_policy one
of its values, the counts unquoted whole numbers, blast_radius only its levels, risk_paths at
most 64 globs of at most 256 characters. Report each value that fails, quoting the key and value.
Do not read it back through digest-policy.mjs: that script reads the team file only from a pull
request's base commit, never the working tree, so it ignores an uncommitted file and warns that it
is not on the base commit. Tell the operator the setting takes effect once the file is merged into
the base branch.
Repository settings
check row. Run node "${CLAUDE_SKILL_DIR}/scripts/setup-apply.mjs" --check from the project
root and add each line it prints to the table with its own INFO, PASS or WARN prefix. INFO when the
file is absent (every key comes from userConfig or its default); PASS with each key's value when
it validates; WARN when it does not (a value outside the key's values, a key set
twice, an empty value, a key the schema does not list, a file that does not parse, or a map or list
where one value belongs), quoting the file, key and value. A key the schema does not list is
ignored: the other keys keep their PASS lines, so a valid downstream_probe floor beside it counts.
A WARN never stops a review skill: the skill names the value and drops that layer for the key the
WARN names. Any whole-file problem prints no PASS line and drops the layer for every key: a parse
error, an unknown key set twice or holding a map or list, or a refusal of the file itself (a
symlink, a hard link, a path outside the
repository, a target that is not a regular file, an unreadable file, a committed entry that is not
a regular file). apply is the fix.
apply.
-
Resolve the values. With complete
<key>=<value>arguments, use them. Otherwise ask one key at a time, recommendation first, from the table in${CLAUDE_PLUGIN_ROOT}/reference/config.md(downstream_probe:run, the default, unless the team wants/review:quality-gate downstreamto state its probe without running it, in which casereport;fanout_diversity:lens, the default, unless the team wants/review:fanout run-everythingto run each review prompt on several model tiers, in which casemodel, or to use the Codex reviewer as its model-diversity panel, in which casecodex;fanout_act_on_cap:2, the default, unless the team wants more or fewer rows under each/review:fanout## By axisheading marked act on;smell_baseline:default, unless the team wants no smell check (off) or its own list, which Design-smell list writes and points the key at). Never invent a key the schema does not list.downstream_probeis a policy floor read from the default branch, so a value written here takes effect once it is merged there. -
Write. One call with every value:
node "${CLAUDE_SKILL_DIR}/scripts/setup-apply.mjs" downstream_probe=reportPass a key the operator accepts at the plugin default as
--default <key>instead of<key>=<value>, so a later change to that default reaches it;<key>=<value>records the team's choice, which the script never changes. The script also recordswritten_againstandprovenance:, so a file with no record, or one written against another plugin version, shows a diff even when no value changes.The script checks each value against the schema, refuses a key given twice, validates the existing file, and validates the whole resulting document before it writes. In the existing file it overwrites only a value outside the key's values, an empty value or null; it refuses a key set twice, a map or list in block or flow form, an empty quoted string, an unknown key set twice or holding a map or list, or a file that does not parse; any other unknown key is named in one warning and its line kept as written. It writes only
<git toplevel>/docs/conventions/review.yaml. It resolves a symlinked root first, then refuses a root that is$HOMEor an ancestor of it, a symlinkeddocs,docs/conventionsor target, a hard-linked target, or adocs/conventionsthat resolves outside the repository, checked again before each directory it creates and right before the write. Every refusal is one line, exits 1 and leaves the file as it was; a failed write removes only its own temp file. A missing file is created; a value already in place printsalready configured. -
An existing file that would change exits 3 and prints a unified diff without writing. Show the operator that diff and ask whether to write it. Only on an explicit yes, re-run the same call with
--yes; on anything else, stop with the file unchanged. When the convention-home offer prints below the diff, ask about it too (the next step) before any re-run, since--yeswrites both. -
The convention-home offer. When the repository's
AGENTS.mdorCLAUDE.mdbinds no convention home, the script prints an offer: with the operator's confirmation it adds a convention-home pointer region to that instruction file (creatingAGENTS.mdwhen neither exists orCLAUDE.mdonly imports it) and the personal override ignore linedocs/conventions/**/*.local.*to.gitignore, the only filesapplywrites outsidedocs/conventions/. It prints the offer at the end of an exit 0 run and below the diff of an exit 3 run, so show the operator stdout on exit 0 too. Ask whether to add the region and the ignore line. Only on an explicit yes, re-run the same call with--yes, which also writes any diff shown with it. On a no, runnode "${CLAUDE_SKILL_DIR}/scripts/setup-apply.mjs" --declinealone: it records the decline in the instruction file, and the next run does not offer again. To write a shown diff without the region, run--declinefirst, then the same call with--yes. When the instruction file or.gitignoreis a symlink or hard link the script will not write through, it prints a one-line refusal in place of the offer, with the same exit code: show it, and do not re-run with--yes, which that refusal stops with exit 1. A refused instruction file refuses--declinetoo, so the operator fixes the link or adds the region by hand. -
Verify. Re-run the
checkrow and report the value it prints, not the value written. Then the tracked-file pair from theapplytask below ondocs/conventions/review.yaml.
Design-smell list
When the operator asks for the repository's own design-smell list, or answers smell_baseline
with one, offer the catalog in ${CLAUDE_PLUGIN_ROOT}/reference/design-smells.md: every entry of
its "Baseline" and "Further candidates" sections, the baseline ones marked as shipped. Write only
what the operator picks:
- Ask which entries to keep, and where the file goes (recommend
<standards_dir>/design-smells.md, with the root resolved as theapplytask below does). Never pre-select the further candidates. - Show, then write. Show the file text, the chosen entries copied in the catalog's
- Name: sign → remedyshape, and write it on an explicit yes. An existing file is shown as a diff and never overwritten without a yes. - Point the reviewer at it. Set the key through the Repository settings
applysteps,smell_baseline=<repository-relative path>, diff and confirmation included. When the file sits under the standards root, also offer its index row (the binding's row shape). - Verify with the tracked-file pair from the
applytask below on the written file.
apply task
Plugin-side notes on top of the binding's procedure:
- State reading order:
.claude/standards.yaml→ index presence test at the resolved<standards_dir>/README.md→ inference sources (existing review docs such as a repo-rootREVIEW.mdordocs/review*directory, other docs directories, ecosystem configs, a rootCODING_STANDARDS.mdandCONTRIBUTING.md, ambientCLAUDE.mdcontent). Pre-existing review documentation is an inference source for proposing index rows. Converting it requires the binding's explicit-confirmation gate. - Bootstrap writes (interactive, user-accepted. No silent writes): the skeleton index with
its
standards-contractfrontmatter at the binding's version, and the setup-owned<standards_dir>/.gitignorecontaining*.local.md(the personal override ignore). Write.claude/standards.yamlonly when the user relocates the root from the documented default. After a bootstrap write, run the tracked-file pair on each written team file:git check-ignore -vreports no match (a match is FAIL with the pattern) ANDgit ls-files --error-unmatchexits 0 (non-zero right after a fresh write means "written but untracked: commit it to share with the team", never success). - Validate every index row path on each run (external-row validation duty); surface broken rows with an offered fix.
- Optional offers, never demands: reorganizing mixed or spread standards content toward the SRP + index shape.
- Migration is this skill re-run. No separate action; direction and messaging per the binding.
Output
A written (or confirmed-healthy) standards index and its personal override .gitignore, a one-line summary
of the effective standards root, the row-validation result, and how to re-run this setup to
reconfigure or migrate. When repository settings were written: the diff shown, the written path,
the value check reads back, and whether the file is tracked.
Next
/review:quality-gate, which resolves review criteria through the index this setup bootstraps.
What this skill does NOT do
- Run a review. That is
/review:quality-gateand this plugin's reviewer agents; they resolve criteria through the index this setup bootstraps. - Write the plugin cache, Claude Code user settings, or
pluginConfigs. The per-userdownstream_probe,fanout_diversity,fanout_act_on_capandsmell_baselineoptions are set through/plugin configure, not here. - Write any settings file other than
docs/conventions/review.yamland, when the operator asks to change a digest setting,docs/conventions/review-digest.yaml. The design-smell list it may write is criteria, not settings. - Edit the consumer's root
.gitignoreor any ignore file it did not itself create, the single setup-owned ignore file is the standards root's bootstrap-shipped<standards_dir>/.gitignore. - Write anything into the plugin directory or the plugin data directory
(
${CLAUDE_PLUGIN_DATA}is for caches and generated state only).
04 同仓库更多 Skills
track
Backlog reads through the bound tracker: search open and closed items, view one item with its comments and state history. Use when another skill searches or reads tracker items.
reviewer-media
Reviewer media for one pull request: decides whether it needs a narrated walkthrough, builds the storyboard from /review:explain-change's digest, has /explainer-video:produce render it and hands the manifest to /source-control:pull-request media. Use when asked for 'reviewer media', 'a walkthrough video for this PR', 'a produced video of this change', or when pull-request ready or monitor hands a PR over.
route
Model and effort per agent role (orchestrator, worker, verifier, retrieval) for a multi-agent run, resolved through the bundled defaults and the user, team and personal override config layers into fenced JSON with single-agent and fan-out variants and the layer behind each value. Use when asked 'which model for the subagents', 'route the roles' or 'model routing', or before a skill passes a role's model on a spawn.
route
Model and effort per agent role (orchestrator, worker, verifier, retrieval) for a multi-agent run, resolved through the bundled defaults and the user, team and personal override config layers into fenced JSON with single-agent and fan-out variants and the layer behind each value. Use when asked 'which model for the subagents', 'route the roles' or 'model routing', or before a skill passes a role's model on a spawn.
principles
Module-design vocabulary for architecture findings, and the checks built on it. Use when: 'what is a deep module', 'what is a seam', 'deep vs shallow module', 'what is the deletion test', 'leverage and locality', 'module design vocabulary', 'which word do we use for X in architecture findings'. Scanning a codebase for friction is /architecture:improve.
write
Structured five-field bug report (title, steps to reproduce, expected vs actual, justified severity, suggested fix location) from an informal description, read-only. Use when the user names a defect they observed, or asks for one written up ('report a bug', 'file a bug', 'write this up as a bug').