-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (80 loc) · 3.1 KB
/
Copy pathacos-health-check.yml
File metadata and controls
87 lines (80 loc) · 3.1 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
name: ACOS Health Check
on:
schedule:
- cron: '0 6 * * *'
push:
branches: [main]
paths:
- '.claude/skills/**'
- '.claude/commands/**'
- '.claude/agents/**'
- '.claude/hooks/**'
workflow_dispatch:
jobs:
health-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Count assets
id: count
run: |
SKILLS=$(find .claude/skills -name "SKILL.md" 2>/dev/null | wc -l)
COMMANDS=$(find .claude/commands -name "*.md" 2>/dev/null | wc -l)
AGENTS=$(find .claude/agents -name "*.md" 2>/dev/null | wc -l)
HOOKS=$(find .claude/hooks \( -name "*.sh" -o -name "*.js" -o -name "*.ts" \) 2>/dev/null | wc -l)
echo "skills=$SKILLS" >> "$GITHUB_OUTPUT"
echo "commands=$COMMANDS" >> "$GITHUB_OUTPUT"
echo "agents=$AGENTS" >> "$GITHUB_OUTPUT"
echo "hooks=$HOOKS" >> "$GITHUB_OUTPUT"
echo "Skills: $SKILLS | Commands: $COMMANDS | Agents: $AGENTS | Hooks: $HOOKS"
- name: Validate skills
run: |
ERRORS=0
find .claude/skills -name "SKILL.md" | while read -r skill; do
NAME=$(dirname "$skill" | xargs basename)
if [ ! -s "$skill" ]; then
echo "ERROR: $NAME — empty SKILL.md"
ERRORS=$((ERRORS + 1))
fi
WORDS=$(wc -w < "$skill")
if [ "$WORDS" -lt 50 ]; then
echo "WARN: $NAME — $WORDS words (stub)"
fi
done
- name: Check hook syntax
run: |
find .claude/hooks -name "*.sh" 2>/dev/null | while read -r hook; do
NAME=$(basename "$hook")
if bash -n "$hook" 2>/dev/null; then
echo "OK: $NAME"
else
echo "ERROR: $NAME — syntax error"
fi
done
- name: Cross-reference check
run: |
if [ -f ".claude/skills/skill-rules.json" ]; then
python3 << 'PYEOF'
import json, os
rules = json.load(open('.claude/skills/skill-rules.json'))
categories = rules.get('categories', {})
missing = 0
for cat, data in categories.items():
for s in data.get('skills', []):
path = os.path.join('.claude/skills', s, 'SKILL.md')
if not os.path.exists(path):
print(f'WARN: skill-rules references "{s}" but not found')
missing += 1
print(f'Cross-ref check: {missing} missing references')
PYEOF
fi
- name: Generate health badge data
if: always()
env:
SKILLS: ${{ steps.count.outputs.skills }}
COMMANDS: ${{ steps.count.outputs.commands }}
AGENTS: ${{ steps.count.outputs.agents }}
HOOKS: ${{ steps.count.outputs.hooks }}
run: |
TOTAL=$((SKILLS + COMMANDS + AGENTS + HOOKS))
echo "ACOS v11 Health: $TOTAL total assets ($SKILLS skills, $COMMANDS commands, $AGENTS agents, $HOOKS hooks)"