From e28c89ac9e72e576b7601c8e272aede09db239e7 Mon Sep 17 00:00:00 2001 From: fOuttaMyPaint Date: Sat, 25 Apr 2026 22:02:16 -0400 Subject: [PATCH] chore: add validate-counts job for README aggregate count enforcement 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. Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> Made-with: Cursor --- .github/workflows/validate.yml | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 783f16b..f01f6a1 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -125,3 +125,40 @@ jobs: rule_count=$(ls rules/*.mdc 2>/dev/null | wc -l) echo "Skills: $skill_count" echo "Rules: $rule_count" + + validate-counts: + name: Validate content counts + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Check content counts match README + run: | + python3 << 'PYEOF' + import os, sys + + errors = [] + + skill_count = len([ + d for d in os.listdir('skills') + if os.path.isdir(os.path.join('skills', d)) + and os.path.exists(os.path.join('skills', d, 'SKILL.md')) + ]) + rule_count = len([ + f for f in os.listdir('rules') + if f.endswith('.mdc') + ]) + + readme = open('README.md').read() + if f'{skill_count} skills' not in readme: + errors.append(f'README skill count mismatch (expected "{skill_count} skills")') + if f'{rule_count} rules' not in readme: + errors.append(f'README rule count mismatch (expected "{rule_count} rules")') + + if errors: + for e in errors: + print(f'::error::{e}', file=sys.stderr) + sys.exit(1) + + print(f'Counts verified: {skill_count} skills, {rule_count} rules') + PYEOF