Setup

From melodic-software/claude-code-plugins · View interactive version

Setup is an AI agent skill from the GitHub repository melodic-software/claude-code-plugins. Check or apply the review plugin's repository setup: the standards index, docs/conventions/review.yaml settings, the repository's own design-smell list, and the move of retired review-digest files.

How to use this skill

Skill file

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

CODE0.

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

(CODE0

"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:

CODE0; 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.

Retired digest files

The review-digest settings once lived in ~/.claude/review-digest.json (per user) and

.claude/review-digest.local.json (personal, per repository). Their homes now are the review

plugin's digest_* options and docs/conventions/review-digest.local.yaml. Until each old file is

moved, the digest still reads it and warns on every run, naming this setup.

In every command below, pass --setting '<name>=<value>' once for each option that reads as a

value, never one that reads empty or as an unsubstituted placeholder, and never a ${user_config.*}

string. Keep the whole argument inside the single quotes and write each ' in the value as '\'',

so no value ends the quoting: digest_policy ${user_config.digest_policy}, digest_max_files

${user_config.digest_max_files}, digest_max_changed_lines

${user_config.digest_max_changed_lines}, digest_blast_radius

${user_config.digest_blast_radius}, digest_risk_paths ${user_config.digest_risk_paths},

digest_opt_in_label ${user_config.digest_opt_in_label}.

check row. Run node "${CLAUDE_SKILL_DIR}/scripts/digest-migrate.mjs" check [--setting ...]

from the project root and add each line it prints to the table with its own INFO or WARN prefix.

Each WARN names an old file and where each of its settings goes.

apply. Run when check printed a WARN for an old file:

  1. Personal file. Run node "${CLAUDE_SKILL_DIR}/scripts/digest-migrate.mjs" personal. It exits

3 and prints the YAML it would write or add to docs/conventions/review-digest.local.yaml, and

any key that file already sets, which wins and is kept. Show it and ask whether to move it. Only

on an explicit yes, rerun with --yes: it adds the keys, reads the file back, checks each moved

value resolves the same and that the file is untracked and gitignored, and only then deletes the

old file. A new file the digest would not read (tracked, not gitignored, or a symlink at it or

a parent) is refused before anything is written or deleted. Exit 1 leaves both files as they

were and names why; report it. A file that is not

gitignored needs the docs/conventions/**/*.local.* line in .gitignore, which the

convention-home offer of Repository settings adds. An old file the digest

does not read (tracked, or behind a symlink) is not moved.

  1. Per-user file. Run node "${CLAUDE_SKILL_DIR}/scripts/digest-migrate.mjs" user [--setting ...].

Exit 4 lists each option still unset and the old value to give it: the operator sets them with

/plugin configure review (this skill never writes user settings), reloads, and runs this setup

again. An option already set wins over the old value and needs nothing. Exit 3 means every old

setting is covered by an option: show that, and only on an explicit yes rerun with --yes,

which deletes ~/.claude/review-digest.json.

  1. Verify. Rerun the check row and report what it prints.

Exit 1 is a refusal with its reason, such as an old file that does not parse or holds an unknown or

invalid key, which the operator fixes by hand first. The read of the old paths is removed in a later

release, once no old file is reported.

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.

  1. 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 downstream

to state its probe without running it, in which case report; fanout_diversity: lens, the

default, unless the team wants /review:fanout run-everything to run each review prompt on

several fan-out models, in which case model, or to use the Codex reviewer as its model-diversity

panel, in which case codex; fanout_act_on_cap: 2, the default, unless the team wants

more or fewer rows under each /review:fanout ## By axis heading marked act on;

reproduce_findings: off, the default, unless the team wants /review:fanout and

/review:council to label each finding by what a refute gate showed and stop acting on refuted

ones (label) or also to stop

acting on findings nobody reproduced (require); reproduce_findings_floor: IMPORTANT, the

default, unless the team wants the gate to see only CRITICAL findings or SUGGESTION ones too;

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;

loosened_check_decision_record: unset, the default, unless the team keeps a record of the

decisions that allow a loosened check, in which case its https URL prefix ending in /). Never

invent a key the schema

does not list. downstream_probe and loosened_check_decision_record are read from the default

branch, so a value written here takes effect once it is merged there.

  1. Write. One call with every value:

```bash

node "${CLAUDE_SKILL_DIR}/scripts/setup-apply.mjs" downstream_probe=report

```

Pass 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 records written_against and

provenance:, 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 $HOME or an ancestor of it, a symlinked docs, docs/conventions or

target, a hard-linked target, or a docs/conventions that 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 prints already configured.

  1. 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 --yes writes both.

  1. The convention-home offer. When the repository's AGENTS.md or CLAUDE.md binds no

convention home, the script prints an offer: with the operator's confirmation it adds a

convention-home pointer region to that instruction file (creating AGENTS.md when neither

exists or CLAUDE.md only imports it) and the personal override ignore line

docs/conventions/**/*.local.* to .gitignore, the only files apply writes outside

docs/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, run node "${CLAUDE_SKILL_DIR}/scripts/setup-apply.mjs" --decline

alone: 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 --decline first, then the same call with

--yes. When the instruction file or .gitignore is 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 --decline too, so the operator fixes the link or adds the region by

hand.

  1. Verify. Re-run the check row and report the value it prints, not the value written. Then

the tracked-file pair from the apply task below on docs/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:

  1. Ask which entries to keep, and where the file goes (recommend <standards_dir>/design-smells.md,

with the root resolved as the apply task below does). Never pre-select the further candidates.

  1. Show, then write. Show the file text, the chosen entries copied in the catalog's

- Name: sign → remedy shape, and write it on an explicit yes. An existing file is shown as a

diff and never overwritten without a yes.

  1. Point the reviewer at it. Set the key through the Repository settings

apply steps, 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).

  1. Verify with the tracked-file pair from the apply task below on the written file.

`apply` task

Plugin-side notes on top of the binding's procedure:

  1. 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-root

REVIEW.md or docs/review* directory, other docs directories, ecosystem configs, a root

CODING_STANDARDS.md and CONTRIBUTING.md, ambient CLAUDE.md content). Pre-existing review documentation is an inference source for proposing

index rows. Converting it requires the binding's explicit-confirmation gate.

  1. Bootstrap writes (interactive, user-accepted. No silent writes): the skeleton index with

its standards-contract frontmatter at the binding's version, and the setup-owned

<standards_dir>/.gitignore containing *.local.md (the personal override ignore). Write

.claude/standards.yaml only 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 -v reports no match (a match is FAIL with the pattern) and

git ls-files --error-unmatch exits 0 (non-zero right after a fresh write means "written but

untracked: commit it to share with the team", never success).

  1. Validate every index row path on each run (external-row validation duty); surface broken

rows with an offered fix.

  1. Optional offers, never demands: reorganizing mixed or spread standards content toward the

SRP + index shape.

  1. 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. One INFO line: the gate that denies

publishing a connected page (explain-change's interactive view) as an Artifact ships in guardrails

and runs only when that plugin is enabled; without it nothing blocks the publish. Give

claude plugin enable guardrails@<marketplace>.

Next

/review:quality-gate, which resolves review criteria through the index this setup bootstraps.

What this skill does not do

criteria through the index this setup bootstraps.

downstream_probe, fanout_diversity, fanout_act_on_cap, reproduce_findings,

reproduce_findings_floor and smell_baseline options are set through

/plugin configure, not here.

change a digest setting docs/conventions/review-digest.yaml, and when it moves a retired

personal digest file docs/conventions/review-digest.local.yaml. Apart from that move and the

retired per-user file, it deletes no file. The design-smell list it may write is criteria, not

settings.

setup-owned ignore file is the standards root's bootstrap-shipped <standards_dir>/.gitignore.

(${CLAUDE_PLUGIN_DATA} is for caches and generated state only).

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.