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:
@@ -35,6 +35,8 @@ make_fixture() {
|
||||
echo "---"
|
||||
echo "name: $name"
|
||||
echo "description: Test fixture."
|
||||
echo "metadata:"
|
||||
echo " version: \"1.0.0\""
|
||||
echo "---"
|
||||
for ((i = 1; i <= lines; i++)); do
|
||||
w=""
|
||||
@@ -173,9 +175,11 @@ make_line_fixture() {
|
||||
echo "---"
|
||||
echo "name: $name"
|
||||
echo "description: Test fixture."
|
||||
echo "metadata:"
|
||||
echo " version: \"1.0.0\""
|
||||
echo "---"
|
||||
} > "$file"
|
||||
body_lines=$((total_lines - 4))
|
||||
body_lines=$((total_lines - 6))
|
||||
for ((i = 1; i <= body_lines; i++)); do
|
||||
echo "word"
|
||||
done >> "$file"
|
||||
@@ -228,6 +232,8 @@ make_word_fixture() {
|
||||
echo "---"
|
||||
echo "name: $name"
|
||||
echo "description: Test fixture."
|
||||
echo "metadata:"
|
||||
echo " version: \"1.0.0\""
|
||||
echo "notes:$padding"
|
||||
echo "---"
|
||||
echo ""
|
||||
@@ -241,6 +247,8 @@ make_word_fixture() {
|
||||
echo "---"
|
||||
echo "name: $name"
|
||||
echo "description: Test fixture."
|
||||
echo "metadata:"
|
||||
echo " version: \"1.0.0\""
|
||||
echo "notes:$padding"
|
||||
echo "---"
|
||||
echo ""
|
||||
@@ -287,6 +295,8 @@ make_budget_fixture() {
|
||||
echo "---"
|
||||
echo "name: $name"
|
||||
echo "description: $desc"
|
||||
echo "metadata:"
|
||||
echo " version: \"1.0.0\""
|
||||
echo "---"
|
||||
echo ""
|
||||
python3 -c "print(' '.join(['word'] * $body_words))"
|
||||
@@ -352,6 +362,8 @@ make_tree_fixture() {
|
||||
echo "---"
|
||||
echo "name: $(basename "$sib")"
|
||||
echo "description: Use when doing the other thing. Do not use for anything else."
|
||||
echo "metadata:"
|
||||
echo " version: \"1.0.0\""
|
||||
echo "---"
|
||||
echo ""
|
||||
echo "Do the thing."
|
||||
@@ -361,6 +373,8 @@ make_tree_fixture() {
|
||||
echo "---"
|
||||
echo "name: $label"
|
||||
echo "description: $desc"
|
||||
echo "metadata:"
|
||||
echo " version: \"1.0.0\""
|
||||
echo "---"
|
||||
echo ""
|
||||
python3 -c "print(' '.join(['word'] * $body_words))"
|
||||
@@ -518,6 +532,8 @@ make_hand_invoked_fixture() {
|
||||
echo "name: $name"
|
||||
echo "description: $desc"
|
||||
echo "disable-model-invocation: true"
|
||||
echo "metadata:"
|
||||
echo " version: \"1.0.0\""
|
||||
echo "---"
|
||||
echo ""
|
||||
python3 -c "print(' '.join(['word'] * $body_words))"
|
||||
@@ -577,6 +593,8 @@ HAND_FALSE="$TMPDIR/hand-false.md"
|
||||
echo "name: hand-false"
|
||||
echo "description: $HAND_DESC"
|
||||
echo "disable-model-invocation: false"
|
||||
echo "metadata:"
|
||||
echo " version: \"1.0.0\""
|
||||
echo "---"
|
||||
echo ""
|
||||
echo "Do the thing."
|
||||
@@ -851,6 +869,8 @@ cat > "$LOCALE_SKILL/SKILL.md" <<'LOCALEEOF'
|
||||
---
|
||||
name: locale-skill
|
||||
description: A valid skill description that is well within the limit.
|
||||
metadata:
|
||||
version: "1.0.0"
|
||||
---
|
||||
|
||||
## Step 1
|
||||
|
||||
Reference in New Issue
Block a user