This repository was archived by the owner on Mar 22, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (74 loc) · 2.87 KB
/
ci.yml
File metadata and controls
92 lines (74 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Validate Skill
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check SKILL.md exists
run: test -f SKILL.md || (echo "SKILL.md not found" && exit 1)
- name: Validate YAML frontmatter
run: |
python3 << 'EOF'
import re
import yaml
with open('SKILL.md', 'r') as f:
content = f.read()
# Extract frontmatter
match = re.match(r'^---\s*\n(.*?)\n---', content, re.DOTALL)
if not match:
print("ERROR: SKILL.md missing YAML frontmatter (--- ... ---)")
exit(1)
try:
frontmatter = yaml.safe_load(match.group(1))
except yaml.YAMLError as e:
print(f"ERROR: Invalid YAML in frontmatter: {e}")
exit(1)
# Validate required fields
if 'name' not in frontmatter:
print("ERROR: Missing required field 'name' in frontmatter")
exit(1)
if 'description' not in frontmatter:
print("ERROR: Missing required field 'description' in frontmatter")
exit(1)
# Validate field types
if not isinstance(frontmatter['name'], str):
print("ERROR: 'name' must be a string")
exit(1)
if not isinstance(frontmatter['description'], str):
print("ERROR: 'description' must be a string")
exit(1)
print("✓ SKILL.md frontmatter is valid")
print(f"✓ Skill name: {frontmatter['name']}")
print(f"✓ Description: {frontmatter['description']}")
EOF
- name: Validate markdown body exists
run: |
python3 << 'EOF'
import re
with open('SKILL.md', 'r') as f:
content = f.read()
# Check if there's content after frontmatter
match = re.match(r'^---\s*\n.*?\n---\s*\n(.*)', content, re.DOTALL)
if not match or not match.group(1).strip():
print("WARNING: SKILL.md has minimal or no markdown body")
print("Consider adding sections: Purpose, When to Use, Setup, Commands, Examples")
else:
print("✓ SKILL.md has markdown body content")
EOF
- name: Check for example skills
run: |
if [ -d "examples" ]; then
count=$(find examples -name "SKILL.md" 2>/dev/null | wc -l)
if [ "$count" -gt 0 ]; then
echo "✓ Found $count example skill(s)"
fi
fi
- name: Validate README exists
run: test -f README.md && echo "✓ README.md found" || echo "WARNING: README.md not found"
- name: Validate LICENSE exists
run: test -f LICENSE && echo "✓ LICENSE found" || echo "WARNING: LICENSE not found"