|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: ci-${{ github.ref }} |
| 14 | + cancel-in-progress: true |
| 15 | + |
| 16 | +jobs: |
| 17 | + validate: |
| 18 | + name: Validate Skills |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: Check marketplace.json is valid JSON |
| 24 | + run: python3 -c "import json; json.load(open('.claude-plugin/marketplace.json'))" |
| 25 | + |
| 26 | + - name: Check plugin.json is valid JSON |
| 27 | + run: python3 -c "import json; json.load(open('elnora/.claude-plugin/plugin.json'))" |
| 28 | + |
| 29 | + - name: Validate SKILL.md files exist and have frontmatter |
| 30 | + run: | |
| 31 | + errors=0 |
| 32 | + for skill_dir in elnora/skills/*/; do |
| 33 | + skill_name=$(basename "$skill_dir") |
| 34 | + skill_file="$skill_dir/SKILL.md" |
| 35 | + if [ ! -f "$skill_file" ]; then |
| 36 | + echo "ERROR: Missing $skill_file" |
| 37 | + errors=$((errors + 1)) |
| 38 | + continue |
| 39 | + fi |
| 40 | + # Check frontmatter exists |
| 41 | + if ! head -1 "$skill_file" | grep -q '^---$'; then |
| 42 | + echo "ERROR: $skill_file missing frontmatter" |
| 43 | + errors=$((errors + 1)) |
| 44 | + fi |
| 45 | + # Check name matches directory |
| 46 | + name=$(sed -n 's/^name: *//p' "$skill_file" | head -1) |
| 47 | + if [ "$name" != "$skill_name" ]; then |
| 48 | + echo "ERROR: $skill_file name '$name' does not match directory '$skill_name'" |
| 49 | + errors=$((errors + 1)) |
| 50 | + fi |
| 51 | + done |
| 52 | + if [ $errors -gt 0 ]; then |
| 53 | + echo "$errors validation error(s) found" |
| 54 | + exit 1 |
| 55 | + fi |
| 56 | + echo "All skills validated successfully" |
| 57 | +
|
| 58 | + - name: Check skill line counts (warn if over 500) |
| 59 | + run: | |
| 60 | + for skill_file in elnora/skills/*/SKILL.md; do |
| 61 | + lines=$(wc -l < "$skill_file") |
| 62 | + if [ "$lines" -gt 500 ]; then |
| 63 | + echo "WARNING: $skill_file has $lines lines (recommended: < 500)" |
| 64 | + fi |
| 65 | + done |
0 commit comments