audit-file-names
Read-only audit of a docs tree's file names against a configured casing rule: proposes a name per offender, classifies every reference to it, refuses case-only collisions, and writes the plan realign-file-names applies. Use when: 'audit file names', 'are our doc filenames consistent', 'plan a docs rename', 'which files break the naming rule', 'find every reference to this doc', 'rename the docs tree', 'lower-kebab the docs folder', 'what would a docs rename touch'. Renames nothing.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 30
- Forks
- 7
01 前言 Front Matter
- shell
- bash
- metadata
- { "summary": "Inventory a doc tree's file names and plan the renames with their references", "workflow-stage": "anytime" }
- description
- Read-only audit of a docs tree's file names against a configured casing rule: proposes a name per offender, classifies every reference to it, refuses case-only collisions, and writes the plan realign-file-names applies. Use when: 'audit file names', 'are our doc filenames consistent', 'plan a docs rename', 'which files break the naming rule', 'find every reference to this doc', 'rename the docs tree', 'lower-kebab the docs folder', 'what would a docs rename touch'. Renames nothing.
- allowed-tools
- [ "Bash(${CLAUDE_SKILL_DIR}/scripts/inventory.sh:*)", "Bash(${CLAUDE_SKILL_DIR}/scripts/sweep.sh:*)", "Bash(${CLAUDE_SKILL_DIR}/scripts/emit-findings.sh:*)", "Bash(git branch --show-current:*)", "Bash(git rev-parse:*)", "Bash(git check-ignore:*)", "Read", "Write", "Grep" ]
- argument-hint
- [audit] [root ...]
- user-invocable
- true
- disable-model-invocation
- false
02 资源文件 21
- 参考文档context/tiers.md3.2 KB
- 脚本scripts/emit-findings.sh8.6 KB
- 脚本scripts/emit-findings.test.sh9.1 KB
- 脚本scripts/fixtures/build-fixture.sh1.9 KB
- 脚本scripts/fixtures/config.json984 B
- 脚本scripts/fixtures/edit-config.sh764 B
- 脚本scripts/fixtures/tree/CHANGELOG.md189 B
- 脚本scripts/fixtures/tree/docs/adr/0001-historical.md373 B
- 脚本scripts/fixtures/tree/docs/Alpha-One.md343 B
- 脚本scripts/fixtures/tree/docs/BETA.md268 B
- 脚本scripts/fixtures/tree/docs/frozen/t/NOTES.md122 B
- 脚本scripts/fixtures/tree/docs/Gamma_Three.md111 B
- 脚本scripts/fixtures/tree/docs/README.md122 B
- 脚本scripts/fixtures/tree/docs/tool.py105 B
- 脚本scripts/fixtures/tree/docs/v1.2.schema.json68 B
- 脚本scripts/fixtures/tree/README.md516 B
- 脚本scripts/fixtures/tree/tools/gen.sh466 B
- 脚本scripts/inventory.sh10.8 KB
- 脚本scripts/inventory.test.sh8.8 KB
- 脚本scripts/sweep.sh14.7 KB
- 脚本scripts/sweep.test.sh12.7 KB
03 SKILL.md 正文
Repository context. Gather first
Collect these with individual Bash calls, one command per call, never combined into a single invocation:
- Current branch,
git branch --show-current - Working tree status (empty = clean),
git status --porcelain | head -20 - Repository root,
git rev-parse --show-toplevel
The pipe is the bound and belongs in the command. A read-time cap comes too late for whatever the command has already returned inline. What a result returns inline, and when it arrives as a saved file instead, is Tools reference § Output limits.
Treat a failure as an unknown value and carry on.
Purpose
A 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.
Read these before presenting anything
| 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 |
Facts before judgment
Three scripts produce the facts. Run them in order and build the plan on what they emit.
-
Inventory the tree:
${CLAUDE_SKILL_DIR}/scripts/inventory.sh --root <repo>It emits
OFFENDER,COLLISION,EXEMPT, andSCANNEDrows. ACOLLISIONrow 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. ASCANNED 0row, 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: aSCANNEDrow with a nonzero count is present and theCOLLISIONcount 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>Each
REFrow carries the citing file, the line, the form, the tier, the action, and an excerpt. The actions areedit,report,review,skip, andregenerate;context/tiers.mdowns what each means. Done when: aSITESrow is present and every offender pair appears in at least oneREFrow or is reported as having no site at all. -
Compose the plan into the resolved home:
${CLAUDE_SKILL_DIR}/scripts/emit-findings.sh --root <repo> \ --inventory <inv.tsv> --sweep <sweep.tsv> --out <resolved>/file-names.mdA zero-offender run over a non-empty root still runs the sweep with an empty pairs file and the emit, and leaves a
findings: 0plan. 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.
Where the artifact goes
Write under the home ../../context/file-name-findings.md "Where it lives"
defines. 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.
Present the result
- The form table for every tier the plan touched, from
context/tiers.md. - One line per finding, most-cited first: the old and new path, the site count, the tier breakdown, and whether a generated file is involved.
- Every
reviewsite, individually, with its line and excerpt. These are the ambiguous bare stems, and no script can settle them. - The artifact's path, and the next step:
/docs-naming:realign-file-nameswith the ids to accept.
Say the count of report sites plainly. A maintainer who expected a frozen tier
to change needs to see that it did not.
Completion criteria
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.
What this skill does NOT do
- Rename anything, edit any reference, or run any regenerator. It is read-only on every file it inspects.
- Re-judge a plan it already wrote. A stale plan is re-audited, not patched.
- Decide whether a
reviewsite names the file. It escalates them. - Bump a version, write a changelog entry, or commit.
- Sweep a tree the configuration excludes, or a file a tier freezes.
Next
/docs-naming:realign-file-names
Gotchas
- A collision refuses the plan, not just one finding. Two paths differing only by case cannot coexist on macOS or Windows checkouts. The whole run stops so nobody applies half of it.
SCANNED 0is an empty root, not a clean tree. Arootsentry 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--replaceonly when the plan is meant to be discarded.- Existence is asked of the git index, never the filesystem. On a case-insensitive checkout a filesystem test answers for the wrong spelling, which would refuse every case-only rename on exactly the platforms the rule protects.
- A
reviewsite is not a smalleredit. 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. - A generated record is never text-edited. Its sites are marked
regenerate, because a substitution that looks right leaves a stale derived value no reader would notice. - The plan is checkout-local. It lives in the memory tier, keyed by branch, and a sibling worktree never sees it. A decision that must outlive the branch goes into the tracked concern file, which the realign offers and never takes.
- Run it from the tree you mean. Every script takes
--root; inside a second worktree, pass it, or run from that worktree.
04 同仓库更多 Skills
track
Backlog reads through the bound tracker: search open and closed items, view one item with its comments and state history. Use when another skill searches or reads tracker items.
reviewer-media
Reviewer media for one pull request: decides whether it needs a narrated walkthrough, builds the storyboard from /review:explain-change's digest, has /explainer-video:produce render it and hands the manifest to /source-control:pull-request media. Use when asked for 'reviewer media', 'a walkthrough video for this PR', 'a produced video of this change', or when pull-request ready or monitor hands a PR over.
route
Model and effort per agent role (orchestrator, worker, verifier, retrieval) for a multi-agent run, resolved through the bundled defaults and the user, team and personal override config layers into fenced JSON with single-agent and fan-out variants and the layer behind each value. Use when asked 'which model for the subagents', 'route the roles' or 'model routing', or before a skill passes a role's model on a spawn.
route
Model and effort per agent role (orchestrator, worker, verifier, retrieval) for a multi-agent run, resolved through the bundled defaults and the user, team and personal override config layers into fenced JSON with single-agent and fan-out variants and the layer behind each value. Use when asked 'which model for the subagents', 'route the roles' or 'model routing', or before a skill passes a role's model on a spawn.
principles
Module-design vocabulary for architecture findings, and the checks built on it. Use when: 'what is a deep module', 'what is a seam', 'deep vs shallow module', 'what is the deletion test', 'leverage and locality', 'module design vocabulary', 'which word do we use for X in architecture findings'. Scanning a codebase for friction is /architecture:improve.
write
Structured five-field bug report (title, steps to reproduce, expected vs actual, justified severity, suggested fix location) from an informal description, read-only. Use when the user names a defect they observed, or asks for one written up ('report a bug', 'file a bug', 'write this up as a bug').