/docs-naming:realign-file-names [FN-xxxxxxxx ...] [--repo <repo> ...]from docs-naming
Applies a file-name rename plan one file at a time with human acceptance per file. Runs git mv, rewrites tier-allowed references, rebuilds generated records, and sweeps stragglers. Refuses bulk operations.
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-toplevel/docs-naming:audit-file-names decided what should be renamed and what each
citation of it may become. This skill is the hand that does it, and the gate
that keeps a human in front of every one.
A rename is not one edit. It is a tracked move plus a rewrite of every reference the tier rules allow, across files nobody opened, with a generated record and a frozen changelog somewhere in the set. That is exactly the shape of change an operator approves in bulk and regrets in review. So the unit here is one file, and the acceptance is one file's worth.
| Read | For |
|---|---|
context/apply-recipe.md | the present-apply-sweep-verify loop, and what a decline offers |
../../context/file-name-findings.md | where the plan lives, the record's fields, its status arc, and why applying resumes |
../audit-file-names/context/tiers.md | the form table to print before each acceptance |
Each explicit FN-xxxxxxxx in the argument is one acceptance. Nothing else is.
Refuse out loud, then re-present the current finding, when the operator
offers a range (FN-a through FN-d), a glob, a count (the first five), all,
everything, the rest, yes to all, or a bare go ahead standing in for the
set. Say what was refused and why: a blanket yes is one decision standing in for
many, and the rename this skill is about to make is the one the operator has not
read yet.
Refusing is not a stall. Present the current finding again, in full, and ask for it alone. An operator who genuinely wants twelve renames gives twelve answers, and each one is cheap because the presentation is already on screen.
This is a gate on the acceptance, not on the operator. A finding they already
accepted is applied without asking a second time. It is still presented first, the
recipe's step 1 in full, before apply-rename.sh runs; only the question is skipped.
Read the artifact from the home ../../context/file-name-findings.md "Where it
lives" defines. A plan looked for anywhere else is reported as "no plan found"
for a plan that exists.
The artifact's branch: frontmatter proves which branch it belongs to, not the
directory it sits in. A mismatch against the current branch is a refusal with
"re-audit here" as the remedy; the script checks the same thing and exits 1.
head: is recorded and never checked. A consumer commits between accepted
renames, so an equality test on it would block the walk after the first one.
With no target form, the run applies this checkout's plan. A
target form selects the repositories an audit over several of them planned,
resolved as
${CLAUDE_PLUGIN_ROOT}/reference/target-scope.md
"Target forms" and "Resolving repositories" say. What differs here:
owner/name FN-xxxxxxxx. With more than one
repository in scope, a bare id is a question, not an acceptance: ask which
repository it means.docs-naming/file-names: select the entry on that
branch in git -C <root> worktree list --porcelain, never another worktree of
the clone, and pass it as --root. A repository with no worktree on that
branch, or no plan in it, is reported as "no plan found" and skipped.For each accepted finding, in the order the operator accepted them, walk
context/apply-recipe.md top to bottom: present,
apply, sweep for stragglers, verify. Do not reorder it and do not batch a step
across findings, particularly the sweep: a straggler found after four renames
cannot be attributed to one of them.
The sweep covers the reference forms the plan did not classify. If
docs-hygiene is enabled it runs /docs-hygiene:rename-references (if enabled); without
it, the recipe's own sweep over the tracked files does the same job.
Report the script's five output rows as it wrote them. DRIFTED above zero is
surfaced with the sites it named, not folded into a total.
Every apply-rename.sh call, the recipe's included, takes --user-config with
this plugin's file_names option, ${user_config.file_names}, as one
single-quoted argument (escape any single quote in it). An empty value or the
literal ${user_config.…} placeholder means unset.
When a run of several findings ends, run the closing pass once:
${CLAUDE_SKILL_DIR}/scripts/apply-rename.sh --regenerate-only --root <repo> --user-config '<option>'
A generated record is rebuilt per finding only when the plan recorded a site inside it, so the last rename of a run can leave a derived sample or index stale. This settles that, and is a no-op on a tree already current.
The run is done when every accepted finding reads - **Status:** applied, the
tree carries one R line per applied pair with no changed path outside those
records' site tables, the orphan sweep has run for every applied or applying
pair, and the working tree is left uncommitted for the operator to review.
A finding the operator declined reads declined, and the durable
exempt_paths entry was offered and not taken. A finding whose file moved under
the plan reads blocked, and the re-audit that settles it has been named.
git mv stages, push, or open a PR. The diff is
left for the operator to read. A rename sweep is exactly the change that
should be reviewed before it is recorded.review site. An ambiguous bare stem is escalated with its line and
left alone, whatever the operator says about the finding as a whole.review site is shown with its file and line for the operator
to edit. Decline each such request separately, in plain words, and still apply the
accepted finding.[[ -e docs/foo.md ]] is true while only
docs/Foo.md exists, so a filesystem test refuses every case-only rename on
exactly the platforms the rule protects.applying is a
half-finished apply. Re-run the same id.DRIFTED is not a smaller EDITED. It means the recorded line no longer
carries the old name, so the audit's decision no longer describes that site.
Re-audit; do not hand-edit the sites the script declined to touch.--regenerate-only pass is not optional. Skipping it leaves
the last renamed file stale inside a generated record, which is the one change
a reviewer will not see.--root takes the checkout; inside a
second worktree, pass it, or run from that worktree.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
/audit-file-namesAudit file namesRead-only audit of a docs tree's file names against a casing/naming rule (lower-kebab): proposes names, classifies every reference, refuses case-only collisions, and writes a rename plan (renames nothing). Use when: 'audit file names', 'which files break the naming rule', 'plan a docs rename'. Not for applying: /docs-naming:realign-file-names./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./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