chore: fold skill-frontmatter into skill-size-check

skill-frontmatter was a 62-line bash script inlined in
.pre-commit-config.yaml, re-parsing SKILL.md frontmatter with grep and
awk to check for name/description/metadata.version fields.
skill-size-check.sh already parses the same frontmatter block with
PyYAML for its ADR-0020 checks, so the two checks belonged in one
script.

Adds a ~20-line required-frontmatter check (name, description,
metadata.version as three-part semver) to scripts/skill-size-check.sh.
Removes the inline skill-frontmatter hook from .pre-commit-config.yaml
and deletes tests/test-skill-frontmatter.sh (366 lines). Removes the
79-line "the other hook on that scope" discussion from
docs/spec/gates.md and its now-dangling cross-reference, replacing
both with a one-line note of the fold, and updates the pre-push hook
counts there.

Updates fixture builders in test-skill-size-check.sh,
test-adr0020-body-checks.sh, test-adr0020-targets.sh,
test-adr0020-differential.sh, and test-vale-hooks-consumer.sh to carry
valid metadata.version so the new check doesn't spuriously fail
existing fixtures that predate it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YR2CjVumUbEGWcMikcoXBD
This commit is contained in:
2026-09-12 20:00:28 +00:00
parent e647f14535
commit c8a7c9ea87
10 changed files with 62 additions and 537 deletions

View File

@@ -60,6 +60,8 @@ make_fx() {
echo "---"
echo "name: $name"
echo "description: $desc"
echo "metadata:"
echo " version: \"1.0.0\""
echo "---"
echo ""
python3 -c "print(' '.join(['word'] * $body_words))"
@@ -94,6 +96,8 @@ mkdir -p "$FX/folded-desc"
echo "name: folded-desc"
echo "description: >"
python3 -c "print('\n'.join([' ' + 'x' * 40] * 11))"
echo "metadata:"
echo " version: \"1.0.0\""
echo "---"
echo ""
echo "Do the thing."
@@ -212,6 +216,8 @@ mkdir -p "$ORPHAN_ROOT/no-universe"
echo "---"
echo "name: no-universe"
echo "description: Use when doing the thing. Do not use for the other thing — use some-other-skill instead."
echo "metadata:"
echo " version: \"1.0.0\""
echo "---"
echo ""
echo "Do the thing."