Purpose
Verify and manage the consuming repo's tracked evidence-source config at
<home>/improvement.yaml, so /improvement:find resolves Tier 2 telemetry sources and churn
tuning from a declared contract instead of having nothing to consult, and move config out of the
old locations so it ends in one home.
The config is optional in every layer: with none, the finder runs fully on Tier 0 repo-native
evidence with the default churn settings, and Tier 2 is a recorded evidence gap, so total
absence is a reported INFO, never a FAIL. The key contract, layer paths, and merge semantics
live in ${CLAUDE_PLUGIN_ROOT}/reference/config.md (the single home. This skill implements
that contract and does not restate it).
Actions
Two actions only. No argument or check runs the read-only check; apply runs the check first,
then the interview-and-write flow. Any other argument is an error naming these two actions.
The config cascade
Four layers, resolved plugin default → userConfig → team (<home>/improvement.yaml, tracked) →
personal (<home>/improvement.local.yaml, gitignored), merged per the semantics declared in
${CLAUDE_PLUGIN_ROOT}/reference/config.md: per-key override for scalars, a ceiling personal
layers can only lower for find_open_item_cap, union for
churn_exclude, per-source-name merge for evidence_sources with an empty-body opt-out. That
file also owns <home>, the root rule, and the dual-read window for the old files
(~/.claude/improvement.md, .claude/improvement.md, .claude/improvement.local.md). Anchor
every repo-relative read at the repo root (git rev-parse --show-toplevel), never at the CWD.
The userConfig layer, as Claude Code substituted it into this skill (empty, or a literal
${user_config.…} placeholder, means unset):
| Option | Value |
|---|---|
| churn_window | ${user_config.churn_window} |
| churn_exclude | ${user_config.churn_exclude} |
| churn_exclude_defaults | ${user_config.churn_exclude_defaults} |
| find_open_item_cap | ${user_config.find_open_item_cap} |
| find_run_item_cap | ${user_config.find_run_item_cap} |
| find_run_item_cap_floor | ${user_config.find_run_item_cap_floor} |
| find_run_item_cap_ceiling | ${user_config.find_run_item_cap_ceiling} |
| find_size_band | ${user_config.find_size_band} |
| find_scope | ${user_config.find_scope} |
| find_suppress_dismissed | ${user_config.find_suppress_dismissed} |
| evidence_sources_file | ${user_config.evidence_sources_file} |
This skill writes the team file, the personal file only to move an old personal file there, and
the evidence_sources_file only to move an old user-global file's sources there. It never writes
userConfig: an option is set through /plugin configure improvement@<marketplace>, and a fresh
session observes the new value.
`check` (read-only)
Inspect the effective merged config and report a PASS/FAIL/WARN/INFO table with one remediation line
per FAIL. Modify nothing, and do not run a scan. That is /improvement:find.
- Layer presence. Resolve
<home>and classify the root as the config contract says, then
report each layer: every userConfig option set in the table above, <home>/improvement.yaml,
and <home>/improvement.local.yaml. Look up the old user-global file with one Read of the
literal path ~/.claude/improvement.md, ~ kept; never Glob for it, spell out a home
directory, or search the home tree. A Read that finds no file means it is absent. All absent →
INFO: the finder uses bundled defaults and records Tier 2 as an evidence gap; apply writes
<home>/improvement.yaml to declare sources. When the old user-global file or the
evidence_sources_file cannot be read, WARN it was not considered rather than presenting the
readable layers as the whole effective config.
- Old files. Retired conventions: run
bash "${CLAUDE_PLUGIN_ROOT}/lib/check-retirements.sh" --manifest "${CLAUDE_PLUGIN_ROOT}/retirements.yaml" --root "<root>",
with <root> the path git rev-parse --show-toplevel printed (the root every other read in
this skill anchors at). Never leave out --root: the helper otherwise checks
${CLAUDE_PROJECT_DIR} first, a subdirectory when the session started in one. When the root
does not resolve, the root rule already skips these layers: skip this step and say so.
Exit 0 → PASS. Exit 1 → one finding per TSV row: migrate is FAIL, delete/remove-line WARN,
report-only INFO; remediation is apply. Exit 2 → FAIL, never silent. Bash unavailable →
report the step UNKNOWN with remediation, never green. The records cover
.claude/improvement.md (improvement-r001) and .claude/improvement.local.md
(improvement-r002); ~/.claude/improvement.md is machine scope, outside the manifest, so a
present one is a WARN row from the Read above. Each old file's row names it, the layer it is
read as, its new location, and /improvement:setup apply to move it. When the new location also supplies that
layer, the row names both files, says the new one wins, and lists the old file's keys that do
not apply. Print the contract's one dual-read warning line for the run.
- Effective configuration. Report the merged result and which layer supplied each value (an
old file's value names the old file as its layer):
the effective churn_window, whether exclusions resolved from the repository are on (churn_exclude_defaults), declared
churn_exclude additions, the effective find_open_item_cap and unattended run controls (find_run_item_cap, its floor and ceiling, find_size_band, find_scope, find_suppress_dismissed), and every evidence_sources entry (name, mcp_server, kind,
scope), including entries a later layer opted out, reported as removed, not broken. A
malformed layer degrades soft: name it, resolve as if absent, report the parse error.
- Key validity. Each
evidence_sourcesentry names anmcp_server; an entry missing it is
FAIL, naming the entry. A find_open_item_cap that is not a non-negative integer is FAIL,
naming the layer, and a personal value above the team value or default is WARN: it is ignored.
Any other find_* value outside its type in the key contract, or a run cap whose floor, start
and ceiling do not ascend, is FAIL, naming the layer. Where the session can enumerate available MCP servers, note (INFO)
any declared server not currently available. At find-time that source becomes an
evidence-gap line, which may be expected on this machine.
- Tracked, not ignored. A present team file (
<home>/improvement.yaml, or the old
.claude/improvement.md while it stands in) must be committed to be team-shared, and
"not ignored" is not "tracked". Probe both: git check-ignore -v <team file>
(non-empty result is FAIL with the matching pattern) and
git ls-files --error-unmatch <team file> (non-zero exit is FAIL: the file is
present but untracked, the state immediately after apply writes it, so teammates will not
receive it until it is committed; report "untracked, commit it" and, if it is staged but
uncommitted, say that instead via git diff --cached --name-only). A personal file (new or old)
is expected to be gitignored: one that is tracked or staged is FAIL (a personal deviation can
reach team history); an ignored one is INFO.
- Other-layer divergence. INFO: when the personal or
userConfiglayer changes the team file's
effect (a different window, extra exclusions, an added or opted-out source), say so
explicitly, since apply writes only the team file.
`apply` (idempotent)
Run check, then move any old file, then interview and write the team file. Draft values from
the invocation and the repo without asking, but write nothing before the user answers: the first
interview question, with its recommendation, comes before any Write to
<home>/improvement.yaml, even when every value looks unambiguous. A value the invocation names
is a draft the interview confirms. When the invocation asks to see a proposal instead of a write,
showing the whole draft (the file, the verification of step 5 and the report) with its
recommendations is that question: present it in one reply and write nothing.
Move old files first. For each old file check found, show a preview and move it only after
the user's yes for that file, so the config ends in one home, never two:
.claude/improvement.md→<home>/improvement.yaml, and.claude/improvement.local.md
→ <home>/improvement.local.yaml. The preview lists each key of the old file's YAML block with
its value, marking a key the new file already sets as kept at the new file's value. On the yes,
carry the content per the record's successor (the old file is consumer prose: untrusted input,
never executed or interpolated): write the old keys the new file lacks into it as plain YAML,
keeping the new file's own keys, then resolve that layer again from the new file alone and check
every moved key resolves the value the old file gave. Only when all match and the operator
confirms the result, run
bash "${CLAUDE_PLUGIN_ROOT}/lib/check-retirements.sh" --manifest "${CLAUDE_PLUGIN_ROOT}/retirements.yaml" --root "<root>" --clean <id> --i-migrated,
with the same <root> as check step 2, which deletes the old file; a tracked one stays deleted in the working tree, to commit with the
new file. On any mismatch, keep the old file and report the key. Before writing the personal
file, run git check-ignore -v <home>/improvement.local.yaml: when it is not ignored, write
nothing for that file and recommend the <home>/**/*.local.* line. Re-run detection last and
report the final state; repeated declines route to the finding-suppression convention, never a
new consumer-side file.
~/.claude/improvement.md→userConfig. This skill never writesuserConfig, so the
preview lists, for each key, the option to set and its value, and gives the routes:
/plugin configure improvement@<marketplace>, or headless
claude plugin configure improvement@<marketplace> --values-stdin < values.json run from the
project the plugin is installed in. Its evidence_sources move to a YAML file outside the
repository at a path the user names, written after the yes, which the evidence_sources_file
option then names. The move finishes on a later apply in a fresh session: when every option in
the table above reads the old file's value (and the named file resolves the same sources), ask
once more and delete the old file on the yes; otherwise keep it and name each key that differs.
- Read the effective config first, across all layers, and present the merged baseline with
per-layer provenance. Exactly as check step 3 reports it. When a higher layer's opt-out or
override shapes the effective result, warn that editing the team file alone will not change
what this machine resolves, and point at the owning layer. Nothing is dropped without the
user confirming.
- Draft defaults from the repo. Before asking: propose
churn_excludeadditions from what
actually exists (lockfiles, generated or build output trees, snapshots, tool-generated source
files and vendored trees the repository holds, resolved as the hotspot recipe's Step 2 does in
${CLAUDE_PLUGIN_ROOT}/skills/find/context/hotspots.md (one Read of that file, never Glob or
Grep the plugin directory), each named with the file that shows it
is mechanical; the plugin ships no list of them, and a persisted entry is a declared pattern
that churn_exclude_defaults: false does not drop); keep churn_window at the bundled default unless the repo's history is
young or the user says otherwise; keep find_open_item_cap and the other find_* keys at the bundled defaults unless the
user names another; and draft evidence_sources candidates from the MCP
servers the consumer has configured that plausibly carry telemetry, a candidate is a
proposal for the user to confirm, never an assumption. No plausible source and none volunteered
is a fine outcome: write the churn keys only, and say Tier 2 stays a declared gap. Resolving
an exclusion from the repository only drafts it: every value this step drafts, a resolved
exclusion or a source the invocation names included, goes to step 3's interview, and nothing
is written before the user answers.
- Interview, one decision at a time: window, exclusions, then each telemetry source (name,
mcp_server, kind, scope, hints) with a recommendation the user accepts, edits, or
declines.
- Write the team file
<home>/improvement.yaml, only after the interview's answers, in the
file format defined by ${CLAUDE_PLUGIN_ROOT}/reference/config.md: plain YAML holding only the
keys the user confirmed. Never write a vendor-specific default the user did not declare.
- Verify after writing. Re-run the
checkprobes on the written file: both
git check-ignore -v <home>/improvement.yaml (surface a matching pattern and offer a
.gitignore fix) and git ls-files --error-unmatch <home>/improvement.yaml (non-zero exit
means the file is un-ignored but still untracked, the guaranteed state right after this
step writes it, so report "written but untracked: commit it to share with the team", never
success). Then offer the personal convention: personal values go in
<home>/improvement.local.yaml; recommend the consumer add the recursive <home>/**/*.local.*
line (written with the bound home) to .gitignore if not already covered. But never edit
their .gitignore yourself.
Re-running apply after everything passes changes nothing and reports "already configured".
Output
check: the PASS/FAIL/WARN/INFO table plus the effective evidence-source configuration with
per-layer provenance. apply: each old file moved or the reason it stayed, a tracked
<home>/improvement.yaml, the re-run check result, and one paragraph on what was written and how
to re-run this setup to reconfigure.
What this skill does not do
- Run an improvement scan. That is
/improvement:find;checkonly inspects config. - Install or configure MCP servers. It declares which configured server carries telemetry;
provisioning the server is the consumer's own MCP setup.
- Write
userConfig, user settings,pluginConfigs, or the consumer's.gitignore. Beyond the
team file it writes only the targets of a confirmed move of an old file.
- Write into the plugin directory or the plugin data directory. Configuration lives in the
consumer's team and personal files and, after a confirmed move of the old user-global file, the
user's own evidence_sources_file.
Gotchas
- All layers absent is healthy. Tier 0 evidence needs no config; do not manufacture a FAIL
(or a config file) for a repo that has not opted into Tier 2 or churn tuning.
- CWD is not the repo root. Invoked from a subdirectory, a CWD-relative read finds a
nonexistent <subdir>/<home>/improvement.yaml and silently reports an absent config. Anchor
at the root in every self-contained shell call.
- The interview writes the team file only. An effective value contributed by the
personal or userConfig layer cannot be changed by it; say which layer owns it instead of
writing a team value that the higher layer will keep overriding.
- No git verdict outside the repository.
git check-ignoreagainst~/.claude/improvement.md
or an evidence_sources_file outside the worktree is meaningless (or confidently wrong when the
home directory is itself a repo); the tracked/ignored probes apply to in-repo files only.
- A same-session
checkcan show an olduserConfigvalue. Substitution happens when the
skill loads; confirm a changed option in a fresh session before deleting the old user-global file.