Skip to content

Commit 4f8175b

Browse files
committed
fix(scripts): update skill validator to support v3 format
Accept metadata-version 3, read author field (v3) as fallback for owner (v1/v2), and allow v3 skills to use activation metadata.
1 parent a1f8054 commit 4f8175b

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

scripts/validate-skills.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ for file in "$ROOT"/*/SKILL.md; do
9898

9999
name="$(get_frontmatter_value "$frontmatter" "name")"
100100
description="$(get_frontmatter_value "$frontmatter" "description")"
101+
# v3 uses 'author', v1/v2 use 'owner' — accept both
101102
owner="$(get_frontmatter_value "$frontmatter" "owner")"
103+
author="$(get_frontmatter_value "$frontmatter" "author")"
104+
owner="${owner:-$author}"
102105
version="$(get_frontmatter_value "$frontmatter" "version")"
103106
metadata_version="$(get_frontmatter_value "$frontmatter" "metadata-version")"
104107
capabilities="$(get_frontmatter_value "$frontmatter" "capabilities")"
@@ -127,8 +130,8 @@ for file in "$ROOT"/*/SKILL.md; do
127130
FAILED=1
128131
fi
129132

130-
if [[ "$metadata_version" != "1" && "$metadata_version" != "2" ]]; then
131-
echo "FAIL $file: metadata-version must be '1' or '2', got '$metadata_version'"
133+
if [[ "$metadata_version" != "1" && "$metadata_version" != "2" && "$metadata_version" != "3" ]]; then
134+
echo "FAIL $file: metadata-version must be '1', '2', or '3', got '$metadata_version'"
132135
FAILED=1
133136
fi
134137

@@ -143,11 +146,11 @@ for file in "$ROOT"/*/SKILL.md; do
143146
fi
144147

145148
if [[ "$metadata_version" == "1" && (-n "$capabilities" || -n "$activation_intents" || -n "$activation_events" || -n "$activation_artifacts" || -n "$risk_level") ]]; then
146-
echo "FAIL $file: activation metadata requires metadata-version '2'"
149+
echo "FAIL $file: activation metadata requires metadata-version '2' or '3'"
147150
FAILED=1
148151
fi
149152

150-
if [[ "$metadata_version" == "2" ]]; then
153+
if [[ "$metadata_version" == "2" || "$metadata_version" == "3" ]]; then
151154
if [[ -n "$capabilities" ]]; then
152155
validate_csv_field "$file" "capabilities" "$capabilities" validate_capability_item
153156
fi

0 commit comments

Comments
 (0)