/docs-naming:audit-file-names [audit] [root ...] [--repo <repo> ...]from docs-naming
Read-only audit of a docs tree's file names against a lower-kebab naming rule. Proposes corrected names, classifies every reference, refuses case-only collisions, and writes a rename plan without renaming anything.
Ships in docs-naming. 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.
Read when SKILL.md points to them; scripts run unread.
Run each command below as its own Bash call, all sent together in one message (worktree isolation).
Keep any bound in the command's own pipe (output limits).
Unless this section says otherwise, treat a failure (not a repository, git unavailable) as an unknown value and carry on. Keep these as body calls, never ## Pre-computed context lines (gather-block convention).
git branch --show-currentgit status --porcelain | head -20git rev-parse --show-toplevelA documentation tree drifts one file at a time, and by the time anyone notices, the cost of fixing it is not the renames. It is finding every citation of every renamed file, deciding which of them may be rewritten, and not corrupting a generated record or a released changelog entry on the way through.
This skill does the finding and the deciding, and writes the result down. It
renames nothing. /docs-naming:realign-file-names executes the plan, one
acceptance at a time.
With no target form, the run covers this checkout. A target
form selects several repositories, resolved, counted and listed as
${CLAUDE_PLUGIN_ROOT}/reference/target-scope.md
"Target forms" and "Resolving repositories" say. What differs here:
docs-naming/file-names, found in git -C <root> worktree list --porcelain.
Reuse it wherever it is, so a re-audit merges into the earlier plan and keeps
every decision ("Where the artifact goes"). Only when none exists, create one
on that branch: from the local branch when it is left without a worktree,
else from origin/HEAD. Place it under the worktree root
git -C <root> config --get-all --type=path worktreeroot.path | tail -n 1
prints, after git -C <root> rev-parse --git-dir succeeds, never scoping the
read without --includes (the source-control plugin's worktree root
convention owns the key and requires a root outside every repository), in
the directory <owner>-<name>-docs-naming-file-names named for that
repository's owner/name. One root can serve every repository in the run,
all on the same branch name, so a directory named for the branch alone
collides at the second repository. With the key unset, the gate failing, or the root
inside a working tree, place it by that repository's convention. Run "Facts
before judgment" there with --root set to it, one subagent per repository
("Fan-out" there). A detached worktree would key the plan by a short SHA that
the realign's first commit changes. This worktree, its branch and the
untracked plan inside it are the run's only writes to another repository; the
contract's read-only rule holds for every tracked file.owner/name FN-xxxxxxxx.| Read | For |
|---|---|
context/tiers.md | the form table to print before any plan, and why a historical tier keeps its links while a released tier is frozen |
../../context/file-name-findings.md | where the artifact goes, its shape, its stable ids, its status arcs, and the re-audit merge |
../../reference/config.md | every configuration key, its default, and which layer may supply it |
Three scripts produce the facts. Run them in order and build the plan on what they emit.
The inventory and the sweep each take --user-config with this plugin's
file_names option, ${user_config.file_names}, on every call, as one
single-quoted argument (escape any single quote in it). An empty value or the
literal ${user_config.…} placeholder means unset.
Inventory the tree:
${CLAUDE_SKILL_DIR}/scripts/inventory.sh --root <repo> --user-config '<option>'
It emits OFFENDER, COLLISION, EXEMPT, and SCANNED rows. A COLLISION
row means the plan would put two paths differing only by case into one tree.
Stop there. Report the pair and the reason, and propose nothing: on a
case-insensitive checkout the second file overwrites the first, so this is a
corrupted tree rather than a plan to review.
A SCANNED 0 row, with its stderr warning, means nothing is tracked under
the roots. Report that and stop: it is an empty root, not a clean tree.
Done when: a SCANNED row with a nonzero count is present and the
COLLISION count is zero, or the run reported an empty root and stopped.
Sweep for references, feeding it the offender pairs:
${CLAUDE_SKILL_DIR}/scripts/sweep.sh --root <repo> --pairs <pairs.tsv> --user-config '<option>'
Each REF row carries the citing file, the line, the form, the tier, the
action, and an excerpt. The actions are edit, report, review, skip,
and regenerate; context/tiers.md owns what each means.
Done when: a SITES row is present and every offender pair appears in at
least one REF row or is reported as having no site at all.
Compose the plan into its home:
${CLAUDE_SKILL_DIR}/scripts/emit-findings.sh --root <repo> \
--inventory <inv.tsv> --sweep <sweep.tsv>
Pass no --out: the emitter composes the home "Where the artifact goes"
names from the memory root and the branch, and prints it on a home line.
Add --memory-root <dir> only when the project's instructions declare a
memory root other than .work/.
A zero-offender run over a non-empty root still runs the sweep with an empty
pairs file and the emit, and leaves a findings: 0 plan.
After the home and wrote lines it prints one finding line per record, most-cited
first, with the site count, file count, tier breakdown, review count and
generated files, then one total line with the sweep's SITES count, the
sites by action and the report-site total, then one report line per
report site (file:line, finding id, old path). All of them are counted from
the sweep's REF rows.
Done when: the script reports the path it wrote and a finding count equal
to the inventory's offender count.
Cite the scripts' rows verbatim. The realign applies the action each site
carries, so a form or a tier you inferred by reading is a guess that edits the
wrong shape. If a site does not correspond to a REF row, say so rather than
inventing one.
Write under the home ../../context/file-name-findings.md "Where it lives"
defines, which the emitter composes when no --out is given. A plan written
anywhere else is one the realign never finds, and that
failure reads exactly like "no audit has been run".
If a plan already exists at the resolved home, the emitter merges into it by finding id and carries every decision forward. Do not delete it to get a clean run; a declined finding that reappears as pending is a decision the operator made being asked again.
context/tiers.md.finding line for that record.review site, individually, with its line and excerpt. These are the
ambiguous bare stems, and no script can settle them.home line gives it, and the next step: /docs-naming:realign-file-names
with the ids to accept.Say the count of report sites plainly, as the total line's report sites
figure, then list each report site from the emitter's report lines. A
maintainer who expected a frozen tier to change needs to see that it did not.
The report-site total spans every file those lines name: credit each file only
with the sites its own lines show.
Quote every count from the emitter's finding and total lines as printed:
each site count, tier breakdown and the report-site total. A count you tally
yourself drifts between runs. When a figure you were about to state disagrees
with those lines, state theirs.
The run is done when the artifact exists at the resolved home, its finding count
equals the inventory's offender count, the tree is byte-identical to how it
started (git status --porcelain unchanged), and every review site has been
surfaced to the operator rather than folded into a total.
docs-naming/file-names worktree, its branch and the plan inside it per
repository ("Over several repositories").review site names the file. It escalates them./docs-naming:realign-file-names
SCANNED 0 is an empty root, not a clean tree. A roots entry that
matches no tracked file inventories nothing and finds nothing. The emitter
exits 3 rather than overwrite an existing plan that holds findings with an
empty one; pass --replace only when the plan is meant to be discarded.review site is not a smaller edit. It is a bare stem that is also an
ordinary word. Rewriting one on a text match is how a rename edits a sentence
that had nothing to do with the file.regenerate, because a substitution that looks right leaves a stale derived
value no reader would notice.--root; inside a second
worktree, pass it, or run from that worktree.context/tiers.md (opens in a new tab)scripts/emit-findings.sh (opens in a new tab)scripts/emit-findings.test.sh (opens in a new tab)scripts/fixtures/build-fixture.sh (opens in a new tab)scripts/fixtures/config.json (opens in a new tab)scripts/fixtures/edit-config.sh (opens in a new tab)scripts/fixtures/tree/CHANGELOG.md (opens in a new tab)scripts/fixtures/tree/README.md (opens in a new tab)scripts/fixtures/tree/build/out.json (opens in a new tab)scripts/fixtures/tree/docs/Alpha-One.md (opens in a new tab)scripts/fixtures/tree/docs/BETA.md (opens in a new tab)scripts/fixtures/tree/docs/Gamma_Three.md (opens in a new tab)scripts/fixtures/tree/docs/README.md (opens in a new tab)scripts/fixtures/tree/docs/adr/0001-historical.md (opens in a new tab)scripts/fixtures/tree/docs/frozen/t/NOTES.md (opens in a new tab)scripts/fixtures/tree/docs/tool.py (opens in a new tab)scripts/fixtures/tree/docs/v1.2.schema.json (opens in a new tab)scripts/fixtures/tree/tools/gen.sh (opens in a new tab)scripts/inventory.sh (opens in a new tab)scripts/inventory.test.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
bashThree short reads, in order
npx claudepluginhub melodic-software/claude-code-plugins --plugin docs-naming4 skills in this plugin
/generate-file-name-gateGenerate File Name GateEmit a standalone bash file-name gate checker + test suite (inlined rule, roots, exemptions; --rule; no overwrite without --force; unwired steps). Use when: 'generate the file-name gate', 'add a CI check for doc filenames', 'enforce the naming rule'. Not for auditing: /docs-naming:audit-file-names; renaming: /docs-naming:realign-file-names./realign-file-namesRealign file namesApply a file-name rename plan one file at a time (human must accept each): git mv, rewrite tier-allowed references, rebuild generated records, sweep stragglers; refuses blanket yes/ranges/globs/'all'; never commits. Use when: 'apply the rename plan', 'apply FN-...', 'rename these files'. Needs /docs-naming:audit-file-names./setupVerify docs-naming layers, regex, tiers, and regenerators (check, read-only), or write docs/conventions/docs-naming.yaml per key (apply).Other plugins' skills for the same job