fix(gates): body-level routing targets are checked by nothing #124
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found during the #99 ADR-0020 retrofit and the follow-up audit pass on
refactor/adr0020-skill-retrofit. The two live instances are fixed on that branch; the gate is not, and the gate is the actual ask.The claim that is narrower than it reads
AGENTS.mdsays:True, and scoped to descriptions only. Every function in
scripts/skill-size-check.shthat participates in target resolution takes the description string as its input —has_boundary_clause(description),boundary_targets(description),_arrow_targets(description),unresolved_targets(description, known),boundary_clause_status(description). The body is measured for word count and for unqualifiedreferences/…pointers; it is never scanned for skill names or slash commands.tests/test-adr0020-targets.sh'sEXPECTED_DANGLING=""assertion inherits that scope. It pins "no description names a target that does not resolve".So: a skill name or slash command named in a body is validated by nothing. That is the larger surface — a description is one to three sentences, a body is up to 900 words of procedure, and the body is where an agent is actually told what to run next.
Both live instances were found by reading, not by any check
1.
bin/write-docs/SKILL.mdrouted twice toto-prd, a skill deleted under the great refactoring milestone (its scope line: "delete stale bin skills (to-issues, to-prd)") and present nowhere in the tree:Note the arrow form. Had either line sat in the description,
BOUNDARY_ARROWwould have caught it and the commit would have been blocked. In the body it was invisible.2.
bin/triage/SKILL.mdtold the agent to run/setup-matt-pocock-skills, an unremoved upstream artifact with no counterpart in this repo:This one had teeth: the role-to-label mapping step was left with no resolution path at all. An agent hitting the "if not" branch had nowhere to go.
Both were fixed in commit
03abcff. The fix requested here is the gate, not those two edits.Design notes for whoever implements it
The description-side resolver is reusable —
known_targets()walks up from the target file to an authoring root and builds the resolution universe without consulting the deployed.claude//.agents/trees, which is what makes the verdict machine-independent. Point it at body text and the resolution half is done.The hard half is extraction, and
skill-size-check.sh's own comments are the best available record of why: a hyphenated token used as a compound modifier ("pre-commit hooks") is prose, not a route; terminal position alone is not evidence either ("runpre-commitinstead", "seecommit-msg"). Body prose is far denser in this hazard than a description is — a procedure step naming a file, a CLI verb, or a config key looks exactly like a route. Starting narrow is probably right: slash-command tokens (/name) and arrow forms (-> name,→ name) only, both of which are unambiguous notation and both of which would have caught the two instances above.The related-but-distinct gap in the same commit
bin/improve-codebase-architecture/SKILL.mdlinked twice into a sibling skill's directory:That resolves in this monorepo and breaks on a cache install, where each skill deploys standalone — the constraint
skill-audit/references/file-structure.mdstates under "Cross-plugin path references". Also fixed in03abcff, rewritten to the sanctioned possessive form. Also caught by reading rather than by a gate, and worth folding into the same check: a body-level../chain leaving the skill root is mechanically detectable and needs no grammar heuristic at all. That half could ship first.Files
scripts/skill-size-check.sh— the resolver and every call sitetests/test-adr0020-targets.sh—EXPECTED_DANGLINGand the machine-independence fixturesAGENTS.md— the "No routing target dangles" line, which should say description once the scope is either widened or documentedplugins/kyberforge/.apm/skills/skill-audit/references/file-structure.md— "Cross-plugin path references"Related
Automated note from the PR #135 review follow-up. This issue's own conclusion, state and labels are untouched — this comment only records what PR #135's branch renamed or removed, so the issue stays actionable.
What this issue quotes that no longer exists
tests/test-adr0020-targets.sh, does still exist and still runs. Only the AGENTS.md sentence describing it is gone, so the guarantee is still enforced even though the prose pointer is not.skill-audit/references/file-structure.md, the same stale path as #121. It is nowfactory-audit/references/skill-file-structure.md—skill-auditwas merged intofactory-audit(ADR-0025, commit620f20b), and the filename changed as well as the directory.Nothing else in this issue was re-validated.
Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01NwD8Egs5r4ndqeFLmhusX2