Skip to content

Commit 2e9bb12

Browse files
authored
Merge pull request #8 from davepoon/automated-subagent-validation
Add CONTRIBUTING.md and add an automated validation checks for all subagent contributions.
2 parents facb07e + c4a793b commit 2e9bb12

11 files changed

Lines changed: 1382 additions & 11 deletions
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Validate Subagents
2+
3+
on:
4+
push:
5+
# Run on pushes to any branch
6+
branches: [ '**' ]
7+
pull_request:
8+
paths:
9+
- '*.md'
10+
- '!README.md'
11+
- '!CONTRIBUTING.md'
12+
- '.github/workflows/validate-subagents.yml'
13+
- 'scripts/**'
14+
15+
jobs:
16+
validate:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: '18'
27+
28+
- name: Install dependencies
29+
run: |
30+
npm init -y
31+
npm install gray-matter ajv glob chalk
32+
33+
- name: Run validation
34+
run: node scripts/validate-subagents.js
35+
36+
- name: Check for naming inconsistencies
37+
run: |
38+
# Check if any files have mismatched names
39+
for file in *.md; do
40+
if [[ "$file" != "README.md" && "$file" != "CONTRIBUTING.md" && "$file" != "LICENSE" ]]; then
41+
name=$(grep -E "^name:" "$file" | sed 's/name: //')
42+
expected="${file%.md}"
43+
if [[ "$name" != "$expected" ]]; then
44+
echo "❌ File $file has name field '$name' but should be '$expected'"
45+
exit 1
46+
fi
47+
fi
48+
done
49+
echo "✅ All file names match their name fields"
50+
51+
- name: Upload validation report
52+
if: failure()
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: validation-report
56+
path: validation-report.txt

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
validation-report.txt

0 commit comments

Comments
 (0)