-
Notifications
You must be signed in to change notification settings - Fork 2
95 lines (83 loc) · 3.35 KB
/
validate.yml
File metadata and controls
95 lines (83 loc) · 3.35 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
93
94
95
name: Validate Plugin
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
validate-json:
name: Validate JSON Files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate plugin.json
run: |
python3 -m json.tool .claude-plugin/plugin.json > /dev/null
echo "✓ plugin.json is valid"
- name: Validate marketplace.json
run: |
python3 -m json.tool .claude-plugin/marketplace.json > /dev/null
echo "✓ marketplace.json is valid"
- name: Check version consistency
run: |
PLUGIN_VERSION=$(python3 -c "import json; print(json.load(open('.claude-plugin/plugin.json'))['version'])")
MARKET_VERSION=$(python3 -c "import json; print(json.load(open('.claude-plugin/marketplace.json'))['plugins'][0]['version'])")
if [ "$PLUGIN_VERSION" != "$MARKET_VERSION" ]; then
echo "❌ Version mismatch: plugin.json=$PLUGIN_VERSION, marketplace.json=$MARKET_VERSION"
exit 1
fi
echo "✓ Versions match: $PLUGIN_VERSION"
validate-structure:
name: Validate Directory Structure
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check required directories
run: |
echo "Checking directory structure..."
test -d .claude/skills || (echo "❌ Missing .claude/skills" && exit 1)
test -d .claude/agents || (echo "❌ Missing .claude/agents" && exit 1)
test -d Docs || (echo "❌ Missing Docs" && exit 1)
echo "✓ All required directories exist"
- name: Check required files
run: |
echo "Checking required files..."
test -f .claude-plugin/plugin.json || (echo "❌ Missing plugin.json" && exit 1)
test -f .claude-plugin/marketplace.json || (echo "❌ Missing marketplace.json" && exit 1)
test -f README.md || (echo "❌ Missing README.md" && exit 1)
test -f LICENSE || (echo "❌ Missing LICENSE" && exit 1)
test -f .gitignore || (echo "❌ Missing .gitignore" && exit 1)
echo "✓ All required files exist"
- name: Count skills
run: |
SKILL_COUNT=$(find .claude/skills -name "SKILL.md" | wc -l)
echo "Found $SKILL_COUNT skills"
if [ "$SKILL_COUNT" -lt 6 ]; then
echo "⚠️ Expected at least 6 skills, found $SKILL_COUNT"
else
echo "✓ Skill count OK"
fi
- name: Count agents
run: |
AGENT_COUNT=$(ls .claude/agents/*.md 2>/dev/null | wc -l)
echo "Found $AGENT_COUNT agents"
if [ "$AGENT_COUNT" -lt 4 ]; then
echo "⚠️ Expected at least 4 agents, found $AGENT_COUNT"
else
echo "✓ Agent count OK"
fi
validate-markdown:
name: Validate Markdown
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for broken links (basic)
run: |
echo "Checking for obvious broken links..."
# Check if README links to existing files
for file in INSTALLATION.md CONTRIBUTING.md CLAUDE.md LICENSE; do
if ! test -f "$file"; then
echo "⚠️ README.md references $file but it doesn't exist"
fi
done
echo "✓ Basic link check complete"