Skip to content
Source
Sign inSign up
TanStack/cli
Open History to see the last commit

validate-skills.yml

57 lines1.5 KB

1# validate-skills.yml — Drop this into your library repo's .github/workflows/
2#
3# Validates skill files on PRs that touch the skills/ directory.
4# Ensures frontmatter is correct, names match paths, and files stay under
5# the 500-line limit.
6​
7name: Validate Skills
8​
9on:
10 pull_request:
11 paths:
12 - 'skills/**'
13 - '**/skills/**'
14​
15permissions:
16 contents: read
17​
18jobs:
19 validate:
20 name: Validate skill files
21 runs-on: ubuntu-latest
22 steps:
23 - name: Checkout
24 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
25 with:
26 persist-credentials: false
27​
28 - name: Setup Node
29 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
30 with:
31 node-version: 20
32​
33 - name: Install intent CLI
34 run: npm install -g @tanstack/intent
35​
36 - name: Find and validate skills
37 run: |
38 # Find all directories containing SKILL.md files
39 SKILLS_DIR=""
40 if [ -d "skills" ]; then
41 SKILLS_DIR="skills"
42 elif [ -d "packages" ]; then
43 # Monorepo — find skills/ under packages
44 for dir in packages/*/skills; do
45 if [ -d "$dir" ]; then
46 echo "Validating $dir..."
47 intent validate "$dir"
48 fi
49 done
50 exit 0
51 fi
52​
53 if [ -n "$SKILLS_DIR" ]; then
54 intent validate "$SKILLS_DIR"
55 else
56 echo "No skills/ directory found — skipping validation."
57 fi