Skip to content

Commit e6b1c08

Browse files
authored
chore: add validate-counts job for README aggregate count enforcement (#10)
Adds a validate-counts job that enforces README.md aggregate count claims match the actual filesystem counts of skills/SKILL.md and rules/*.mdc. Mirrors the canonical pattern shipping in CFX and Unity. Filesystem walk (not plugin.json introspection) because this repo uses glob-based plugin.json (`"skills": ["skills/**/SKILL.md"]`), where len(m['skills']) would always return 1. The walk approach matches what the existing "Count components" step already does informationally; this job promotes it to enforcement. Currently passes (skill/rule counts match README claims). Pure CI hardening; catches future drift before it ships. Refs TMHSDigital/Developer-Tools-Directory#39. Made-with: Cursor Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com>
1 parent 1754066 commit e6b1c08

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/validate.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,40 @@ jobs:
125125
rule_count=$(ls rules/*.mdc 2>/dev/null | wc -l)
126126
echo "Skills: $skill_count"
127127
echo "Rules: $rule_count"
128+
129+
validate-counts:
130+
name: Validate content counts
131+
runs-on: ubuntu-latest
132+
steps:
133+
- uses: actions/checkout@v6
134+
135+
- name: Check content counts match README
136+
run: |
137+
python3 << 'PYEOF'
138+
import os, sys
139+
140+
errors = []
141+
142+
skill_count = len([
143+
d for d in os.listdir('skills')
144+
if os.path.isdir(os.path.join('skills', d))
145+
and os.path.exists(os.path.join('skills', d, 'SKILL.md'))
146+
])
147+
rule_count = len([
148+
f for f in os.listdir('rules')
149+
if f.endswith('.mdc')
150+
])
151+
152+
readme = open('README.md').read()
153+
if f'{skill_count} skills' not in readme:
154+
errors.append(f'README skill count mismatch (expected "{skill_count} skills")')
155+
if f'{rule_count} rules' not in readme:
156+
errors.append(f'README rule count mismatch (expected "{rule_count} rules")')
157+
158+
if errors:
159+
for e in errors:
160+
print(f'::error::{e}', file=sys.stderr)
161+
sys.exit(1)
162+
163+
print(f'Counts verified: {skill_count} skills, {rule_count} rules')
164+
PYEOF

0 commit comments

Comments
 (0)