/docs-naming:generate-file-name-gate [--out-dir <dir>] [--rule] [--force]from docs-naming
Generates a standalone bash file-name gate checker and test suite with inlined naming rules, roots, and exemptions. Use when enforcing doc filename conventions in CI or local checks.
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.
A naming rule that nothing enforces decays back into a mixed tree, one file at a time. This skill writes the thing that enforces it: a checker over the tracked set, plus the suite that proves the checker still means what it says.
The checker is the consumer's file, not this plugin's. The rule, the roots, and every exemption are inlined at emission, so a checkout with the plugin uninstalled, or a CI runner that never had it, still enforces what the team agreed.
The gate is the deliverable. Whether a path-scoped rule file should also carry
the naming rule is a separate choice: when /corrections:codify (if enabled) is among the
available skills, hand it the choice of mechanism; it picks the strongest rung
of the enforcement ladder that can decide the rule and proves the check. Name
the call, /corrections:codify "<the naming rule>" (if enabled), for the operator to run;
never make it. When the corrections plugin is not enabled, propose the strongest mechanism that can decide the
rule: a change that makes the mistake impossible first, then a check that blocks
it, then a test, and an instruction only when nothing a machine runs can decide
it. Say that the corrections plugin was not available, so the proposal is
unproven.
${CLAUDE_SKILL_DIR}/scripts/emit-gate.sh --root <repo> --user-config '<option>' [--out-dir <dir>] [--rule] [--force]
--user-config takes 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. Pointer: when checking where a
saved option value reaches, fetch
plugins manifest reference § Reference a saved value
live.--out-dir places the pair somewhere other than scripts/. The emitted
checker resolves the repository from its own location, so any depth works.--rule also writes .claude/rules/file-names.md.--force overwrites. Without it an existing target refuses the run and
nothing is written, including the files that did not exist yet.The output is EMITTED rows for what it wrote, possibly a REINDEX row, and
NOT-WIRED rows for what it did not. Report all three kinds; the NOT-WIRED
rows are the point of the run as much as the files are.
| Template | Emitted as | Carries |
|---|---|---|
templates/check-file-names.sh.tmpl | <out-dir>/check-file-names.sh | the rule, the roots, the exemptions, and the case-collision pass |
templates/check-file-names.test.sh.tmpl | <out-dir>/check-file-names.test.sh | one case per declared exemption, seeded with a name the rule would reject |
templates/file-names-rule.md.tmpl | .claude/rules/file-names.md, only with --rule | the rule in prose, scoped to the roots, naming the gate |
Read a template only when a rendered file looks wrong; the emitted files are what the operator reviews.
Emission writes files. It does not wire them, because each of these is a repository-shaped decision with no single right answer:
/architecture:adr (if enabled); do not write one unprompted.If a REINDEX row appeared, the repository's AGENTS.md or CLAUDE.md carries
a generated instruction-placement rules index, and the new rule file is not in
it yet. Say so and name /instruction-placement:check (if enabled); do not edit the block.
Run the emitted pair once, from the consumer's root:
bash <out-dir>/check-file-names.sh --check
bash <out-dir>/check-file-names.test.sh
The checker's exit is the answer about the tree, not about the emission: a 1
here means the repository already has offenders, which is a finding to report
and route to /docs-naming:audit-file-names, not a failed run.
The run is done when the EMITTED rows name files that exist, the emitted suite
exits 0, the checker has been run once and its verdict reported, and every
NOT-WIRED row has been said out loud to the operator.
/docs-naming:audit-file-names
to plan and /docs-naming:realign-file-names to apply./docs-naming:setup apply, which owns
the plugin's own artifact and nothing else./architecture:adr
For the rule itself, once the gate is wired and green.
--rule is
opt-in for exactly that reason. When you offer it, give the route Purpose
names for the rule-file question (the /corrections:codify (if enabled) call, else the fallback proposal), and let the operator decide.sed substitution, so an & or a | in a regex cannot be
re-read; values travel through the environment rather than awk -v, which
performs escape processing and would halve a doubled backslash; and every
value reaching the emitted shell is single-quoted, so a backtick or a
$(...) in a root or an exemption cannot execute on a CI run.EMITTED row.
Each rendered script goes through bash -n before it is claimed, and a
failure removes it and stops the run.--force.What SKILL.md sets; muted values are Claude Code's defaults
bashThree short reads, in order
4 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./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).npx claudepluginhub melodic-software/claude-code-plugins --plugin docs-namingOther plugins' skills for the same job