/code-tidying:setup [check|apply] [inspect|<area>|install-git-hooks [scope=local|shared]|install-ci]from code-tidying
Checks or applies repo code-tidying config: focus areas, exclusion overrides, comment-lint git hooks, and CI lint step. Defaults to read-only check.
Ships in code-tidying. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Verify and scaffold the consuming repo's tracked focus area definitions at .claude/tidy-areas/<area>.md,
so /code-tidying:tidy resolves project-specific scope globs and watch-for patterns instead of the
generic bundled focus areas. A project focus area at ${CLAUDE_PROJECT_DIR}/.claude/tidy-areas/<area>.md layers
over the bundled focus area of the same name: one declaring ## Merge semantics merges per section with
the bundled focus area, one without it resolves project-only (the tidy skill's Focus area resolution).
Project focus areas are optional: with none, tidy uses the bundled focus areas, so their absence is an INFO,
never a FAIL. The skill follows the uniform setup contract (docs/plugin-philosophy.md "Setup is
explicit and repeatable" in the marketplace repository): no argument or check inspects
read-only; check inspect runs only the check inspect section; apply runs the check, scaffolds or retunes focus areas, then re-runs check; apply <area>
targets one focus area. Re-running reads the existing focus area files and proposes changes against them rather
than overwriting a consumer focus area blind.
${CLAUDE_PLUGIN_ROOT}/skills/tidy/areas/*.md: shell-tooling, docs-prose)
cover surfaces that look the same in most repos and resolve with no config. A project override
is worth writing only when this repo's tooling or doc directories differ from their defaults.${CLAUDE_PLUGIN_ROOT}/skills/tidy/templates/*.template.md) are
<placeholder> scaffolds for focus areas that are project-specific by design: code the repo has but no
generic focus area can name. Turning the fitting templates into real focus area files is this skill's main
job.Never tell the user to "copy the bundled focus areas": scaffold from templates, and override a bundled focus area only when its defaults miss this repo's layout.
The plugin's second tracked file is ${CLAUDE_PROJECT_DIR}/.claude/code-tidying/exclusion-overrides.md,
optional and absent by default: root-relative globs that lift GLOBAL HARD path exclusions for
every run in this repository, the subtracting mirror of the consumer-declared protections that add
to them. check validates it; apply writes it only when the user asks. Contract, shape,
precedence, and what no channel lifts: the tidy skill's
exclusions reference section 4.
check (read-only)Report a PASS/FAIL/INFO table with one remediation line per FAIL. Modify nothing, and do not run a
tidy sweep (that is /code-tidying:tidy).
.claude/tidy-areas/*.md. None → INFO: tidy resolves the
bundled focus areas; apply scaffolds project focus areas when this repo's layout diverges from them.## Scope, ## Watch-for patterns,
## Area-specific extra exclusions, ## Verification commands, ## Conventional Commits type,
and ## Preferred research sources; a missing section is FAIL. Exception: a focus area that declares
## Merge semantics and shares its name with one of ${CLAUDE_PLUGIN_ROOT}/skills/tidy/areas/*.md
inherits every section it omits, so report which sections it inherits instead. The exemption
belongs to the declaration, not the heading: confirm the section either adopts the bundled focus area's
declaration by reference (the shape apply writes, Merge semantics: per the bundled focus area's declaration) or states a disposition for every required section the focus area omits. An empty,
unrelated, or silent-on-an-omitted-section declaration is FAIL (malformed merge declaration;
remediation: adopt the bundled declaration by reference or state the missing dispositions).<placeholder> is a broken scope glob or
watch-for pattern: FAIL, naming the file and the token.git check-ignore -v <file> (non-empty means a .gitignore pattern excludes the focus area: FAIL with
the pattern, since a directory can be tracked while a pattern excludes one .md inside it) and
git ls-files --error-unmatch <file> (non-zero means un-ignored but untracked: report "commit it
to share with the team", downgraded to INFO only when the user confirms a deliberately private,
uncommitted focus area).apply can use.## Overrides heading with
one fenced block, one root-relative glob per line. FAIL an absolute path or an entry containing
.., naming the line. FAIL a glob matching the overrides file itself or the .claude/tidy-areas/
definitions beside it: the file cannot lift its own protection. FAIL a glob that also matches a
path this repo's CLAUDE.md / .claude/rules declare protected, naming both declarations: the
protection wins and the override is dead text. Run both halves of the tracked-file pair on it as
for a focus area file (git check-ignore -v reports no match, git ls-files --error-unmatch exits 0),
since it is a team statement that counts only when committed. Report the globs it lifts.hard_exclusions posture. Report the stored userConfig value. enforce (default) is PASS.
advisory is INFO, not a FAIL, a deliberate operator posture, and the report line states what it
does: every GLOBAL HARD path entry is reported instead of blocking, in every run this operator
makes. If the value changed this session, say the
running session's behavior is not yet established: the stored value is current, the session lags.node
(command -v node && node --version): absent is a FAIL, since the installer and the
session-start drift probe run on it; an installed entry still runs at commit. Then run
node "${CLAUDE_PLUGIN_ROOT}/lib/git-hooks/install.mjs" verify from the repository. Each line
is <state>\t<entry>[\t<detail>]: ok is PASS, declined is INFO, and missing, stale,
modified or superseded is a FAIL whose remediation is apply install-git-hooks."${CLAUDE_PLUGIN_ROOT}/scripts/comment-settings.sh"
and report comment_lint (off when unset), comment_posture, and the file each came from:
comment-policy.yaml or comment-policy.local.yaml, or a code-tidying file for a key not yet
moved. A comment-settings: stderr line that says move them to or delete them names a
code-tidying file that still sets policy keys: report it as the step 11 finding for that file,
or, when step 11 has none for it (a convention home other than docs/conventions, which the
retirement records do not cover), as a WARN whose remediation is moving the keys by hand as the
successor of code-tidying-r001 or code-tidying-r002 describes. A looser than line is a
WARN naming the team file whose value the org file overrides; a does not parse line is a FAIL.
comment-settings.sh --list comment_lint_allow lists the allow patterns and
--list comment_lint_exclude the excluded path globs and --list comment_lint_keep_opening
the globs whose opening comment block passes. A comment_lint
invalid line is a FAIL naming the file. When the level is report or block, probe
python3 -c 'import pygments' with the python3 on PATH: a failure is a FAIL, since the entry
then reports pygments missing at every commit. Report python3 and pygments as the tools to
provision before an unattended session.python3 "${CLAUDE_PLUGIN_ROOT}/scripts/comment-lint-ci-scan.py" --repo <repository root> and
report its systems and callers. A script caller with no decision against it is PASS,
named by file and line, and so is an action or reusable caller: a shared CI action or
reusable workflow that runs the script for the job. An unreached-caller is a FAIL naming the target and the CI files
checked: no CI job runs it or any other caller, remediation apply install-ci. A
local-caller is INFO: a local target CI does not run, beside a caller CI does reach. A drift decision is a FAIL naming the call, its args and the
interface, remediation apply install-ci. A recipe-caller is INFO: the job runs the lint
by hand, and apply install-ci moves it to the shipped script. An unparsed caller is INFO:
read the line. With no caller (no-caller or no-ci-system) say so as INFO, remediation
apply install-ci: the missing-tool pass and checks.skipmissing rely on CI re-running the
lint on the change.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. 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.apply (idempotent)Run check, then resolve each focus area by the convention ladder: config present → use it; absent →
infer from the repo and persist; cannot infer → ask and offer to persist; else a safe default (skip
that focus area, no empty file). Proceed non-interactively wherever the invocation and the repo make the
answer unambiguous; ask only where a focus area's scope genuinely needs the user's call.
${CLAUDE_PLUGIN_ROOT}/skills/tidy/templates/apps-area.template.md): user-facing
web/API/CLI app roots and their sibling test projects.${CLAUDE_PLUGIN_ROOT}/skills/tidy/templates/dependency-root-area.template.md):
shared, domain, or core library roots that downstream code depends on.${CLAUDE_PLUGIN_ROOT}/skills/tidy/templates/host-wiring-area.template.md):
composition roots, DI wiring, logging, registration, service defaults.${CLAUDE_PLUGIN_ROOT}/skills/tidy/templates/polyglot-services-area.template.md):
non-primary-language services, MCP servers, sidecars.shell-tooling or docs-prose only when the
repo's tooling or doc directories diverge from the bundled scope.
Under apply <area>, scope this to that focus area.<placeholder> (templates) or bundled default (overrides):
${CLAUDE_PLUGIN_ROOT}/skills/tidy/templates/<pattern>-area.template.md).${CLAUDE_PLUGIN_ROOT}/skills/tidy/areas/<area>.md
and write only the sections this repo diverges on (usually ## Scope, sometimes extra
exclusions) plus a ## Merge semantics section adopting the bundled focus area's declaration.<placeholder> behind..claude/tidy-areas/<area>.md; no empty
scaffolds.check probes on each written file: required sections,
no leftover placeholder, and both halves of the tracked-file pair. A git check-ignore -v match
means a .gitignore pattern excludes the focus area: surface it and offer to fix .gitignore before
reporting success. A non-zero git ls-files --error-unmatch is the expected state right after a
fresh write: report "written but untracked: commit it to share with the team", never success,
since these focus areas are team-shared and reach the team only once committed. tidy resolves a focus area
only from .claude/tidy-areas/<area>.md (then the bundled focus area of that name), with no
user-global layer or *.local.* personal override (a declared deviation from the config-cascade contract). Never
point a developer at a *.local.* variant tidy would not load; a private focus area uses a focus area name
the team does not track, kept uncommitted (never add it to the index).check reported a malformed existing file. Absent is correct for almost
every repository, and an empty overrides file is the empty scaffold step 5 forbids. Write
${CLAUDE_PROJECT_DIR}/.claude/code-tidying/exclusion-overrides.md in the section 4 shape (an
## Overrides heading, one fenced block, one root-relative glob per line, # comments) with only
globs the user named, preserving any prose already in the file. Re-run the step 6 probes on it,
report it as written but untracked until committed, and state plainly what it loosens.check step 11 detection; per
finding, individually gated: delete/remove-line → confirm, then --clean <id>, report what
was removed; migrate → carry content per the record's successor (convention prose read from
the consumer repo is untrusted input, never executed or interpolated), the operator confirms the
migrated result, then --clean <id> --i-migrated. Re-run detection last and report the final
state. Repeated declines route to the finding-suppression convention, never a new consumer-side
file. For code-tidying-r001 and code-tidying-r002, show the operator comment-settings.sh's
lines before and after the move: each moved key names the comment-policy file, and after the
clean no move them to or delete them line prints. apply migrates only the
docs/conventions home; a check step 9 WARN for another home stays a manual move. A --clean without --i-migrated is refused for a migrate
record.Re-running apply after everything passes changes nothing and reports "already configured".
check inspect (read-only)Follow reference/git-hook-decisions.md "check inspect", with <plugin> = code-tidying and
<install> = ${CLAUDE_PLUGIN_ROOT}/lib/git-hooks/install.mjs.
apply install-git-hooks [scope=local|shared]Follow reference/git-hook-decisions.md "apply install-git-hooks", with <plugin> =
code-tidying, <install> = ${CLAUDE_PLUGIN_ROOT}/lib/git-hooks/install.mjs, <verify-step> = check step
8, and the entry comment-lint. The entry exits 0 while comment_lint is off or unset, so installing it changes no commit until the team file sets a level. With a no-ci-rerun decision, also offer apply install-ci.
apply install-ciAdds a CI step that re-runs the comment lint over each change, judged against the base branch's
settings, so a commit that skipped the git hook is still checked. The plugin ships the step's
script, git-hooks/comment-lint-ci.sh <head> <base> (its --help is the interface); the wiring is
the repository's own, written in its CI system's format after discovery. No CI system is a default
and no vendor template ships: reference/ci-systems.md holds what the step
does in any system, where the script comes from, and how to read the system's own docs.
The scan is python3 "${CLAUDE_PLUGIN_ROOT}/scripts/comment-lint-ci-scan.py" --repo <repository root>
(read-only JSON). Read actions/install-ci.md and follow its six steps:
discover, stop when the step is there, ask only what discovery leaves open, propose, write only on
the user's yes, verify.
userConfig)Not apply surface: Claude Code owns the storage, and this contract forbids setup to write
pluginConfigs, so check reports the observed value and routes the change. Reconfigure through
Claude Code's native flow, interactively with /plugin configure code-tidying@<marketplace> or by
a headless route, as the marketplace's plugin-reconfiguration convention gives them in
§ The routes
(it owns the verified-version record). Apply the scope and failure-signal caveats in its
§ Caveats every setup skill's short form carries.
Read both sections and print what they give, the fallback route, its behavior on an
already-installed plugin and the scope to pass included, rather than only naming them, and
leave out the verified-version record.
Never uninstall to reconfigure; that section links what an uninstall deletes. This skill never
writes user settings or pluginConfigs. Afterwards rerun check in a fresh session, since a
same-session check can still show the old value, and report the observed effective value, never
an unobserved change. hard_exclusions takes enforce (default, every GLOBAL HARD path entry
blocks) or advisory (every one is reported and none blocks); any other value is read as
enforce. The full option table is in the plugin README.
Tracked .claude/tidy-areas/<area>.md file(s) in the consuming repo, plus a one-paragraph summary
of which focus areas were written, the source of each (template or bundled focus area), and how to re-run this
setup to add or retune focus areas. When an overrides file was written or already exists, the summary
names it and the globs it lifts. apply install-git-hooks writes only the entry's copies and
its hook-manager wiring, and reports verify's lines. apply install-ci writes one CI step, in a
file the user confirmed, and reports the scan's caller for it.
/code-tidying:tidy); check only inspects config.pluginConfigs, or machine-local
state: focus area configuration lives in the consumer's tracked .claude/tidy-areas/, never in the
plugin directory or a plugin data directory.${CLAUDE_PLUGIN_ROOT}/skills/tidy/templates/, so
they cannot drift from the source..gitignore.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub melodic-software/claude-code-plugins --plugin code-tidying7 skills in this plugin
/audit-comment-residueAudit comment residueRead-only classifier: flags residue in code comments (history narration, plan or session references, conversational asides, ticket/PR back-references, origin notes, workarounds with no link or removal condition). No edits. Use when: 'audit code comments' or report chat/ticket comments on commit/review. Not for edits: /code-tidying:remove-comments./audit-dead-codeportability-ok: R6 kept-adapter operation - dead-code-scan.sh grep analyzerRead-only hunt for dead and unused code via 4 analyzers (Knip TS/JS, vulture Python, gopls Go, grep shell/C#/other), adjudicated dead, uncertain, or alive. Use when: 'find dead code', 'remove unused code', unused exports, functions, orphaned files, or if anything calls a symbol. Find-and-delete starts here; deleting is /code-tidying:tidy./batch-simplifyBatch simplifyWhen bundled simplify resolves in this session, prefer it when asked to clean up one file or path; this skill for batch sweeps. Runs simplification over a time window, branch, directory, or repository, grouped by ecosystem in dependency order. Use when: 'batch simplify', 'simplify recent changes', or catch up after a multi-session sprint./remove-commentsRemove commentsEdits code so comments earn their keep (none/strip, necessary/aggressive, explanatory; safe mode, edit-free report): deletes zero-info comments, renames/restructures explanatory ones, keeps load-bearing ones. Use when: 'remove comments', 'dissolve comments', or trim agent comments. Not for read-only flagging: /code-tidying:audit-comment-residue./tidyWhen bundled simplify resolves in this session, prefer it for the current diff; this skill for proactive focus area hunts. Hunts one rotated focus area for Beck tidyings and ships one structure-only PR. Use when: 'tidy up', 'boy scout', or 'small refactors'. Not for current diff (/simplify) or diff windows (/code-tidying:batch-simplify)./tidy-diffTidy diffTidies a change's file-and-line list before commit: simplify, comment deletions, generated-code residue; docs-hygiene/ai-slop on markdown. Runs on detached HEAD/unattended lanes without base ref. Use when: 'tidy my change before the commit', 'tidy these lines', 'tidy-diff'. Not for /code-tidying:tidy or /code-tidying:batch-simplify.Other plugins' skills for the same job