Generate File Name Gate
Emit a standalone bash file-name gate checker + test suite (inlined rule, roots, exemptions; --rule; no overwrite without --force; unwired steps). Use when…
by melodic-software★ 34 GitHub stars
Install Generate File Name Gate in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
Generate File Name Gate
Purpose
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.
- Pointer: when weighing whether a rule could stand in for the gate, fetch memory § Path-specific rules live.
Emit
${CLAUDE_SKILL_DIR}/scripts/emit-gate.sh --root <repo> --user-config '<option>' [--out-dir <dir>] [--rule] [--force]
--user-configtakes this plugin'sfile_namesoption,${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-dirplaces the pair somewhere other thanscripts/. The emitted checker resolves the repository from its own location, so any depth works.--rulealso writes.claude/rules/file-names.md.--forceoverwrites. 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.
What the templates render
| 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.
After emitting, say what is left
Emission writes files. It does not wire them, because each of these is a repository-shaped decision with no single right answer:
- A CI step invoking the checker. Name the emitted path and let the operator place it in their own workflow.
- A registry row, if the repository keeps a list of its gates.
- An architecture decision record for the rule itself. Offer
/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.
Verify before handing back
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.
Completion criteria
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.
What this skill does NOT do
- Wire the gate into CI, a registry, or a decision record. It names each one and stops.
- Edit a generated rules index. It reports that one needs re-rendering.
- Rename anything. An existin
Allowed tools
Tools this skill is permitted to call.
- 01
Bash(${CLAUDE_SKILL_DIR}/scripts/emit-gate.sh:*) - 02
Bash(git rev-parse:*) - 03
Bash(git status --porcelain:*) - 04
Read
Bundled files
- scripts/emit-gate.sh
- scripts/emit-gate.test.sh
- templates/check-file-names.sh.tmpl
- templates/check-file-names.test.sh.tmpl
- templates/file-names-rule.md.tmpl
FAQ
What does the Generate File Name Gate skill do?
Emit 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.
How do I install the Generate File Name Gate skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the Generate File Name Gate skill run scripts?
Yes, this skill bundles executable scripts. Review the source before installing.
Related skills
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…