Skip to content

Commit eb9c293

Browse files
TMHSDigitalclaude
andcommitted
ci: enforce the README example count in validate-counts
The job enforced skills/rules/templates/snippets but not examples, so the '20 examples' figure in the README could silently go stale when example 21 lands. Counts example directories by README.md presence (robust against stray dirs), mirrors the existing substring check, and was proven to fail on a deliberate mismatch before shipping. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 6f199ef commit eb9c293

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

‎.github/workflows/validate.yml‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,11 @@ jobs:
244244
f for f in os.listdir('snippets')
245245
if f.endswith('.py')
246246
])
247+
example_count = len([
248+
d for d in os.listdir('examples')
249+
if os.path.isdir(os.path.join('examples', d))
250+
and os.path.exists(os.path.join('examples', d, 'README.md'))
251+
])
247252
248253
readme = open('README.md').read()
249254
if f'{skill_count} skills' not in readme:
@@ -255,11 +260,13 @@ jobs:
255260
errors.append(f'README template count mismatch (expected "{template_count} {template_word}" substring)')
256261
if f'{snippet_count} snippets' not in readme:
257262
errors.append(f'README snippet count mismatch (expected "{snippet_count} snippets" substring)')
263+
if f'{example_count} examples' not in readme:
264+
errors.append(f'README example count mismatch (expected "{example_count} examples" substring)')
258265
259266
if errors:
260267
for e in errors:
261268
print(f'::error::{e}', file=sys.stderr)
262269
sys.exit(1)
263270
264-
print(f'Counts verified: {skill_count} skills, {rule_count} rules, {template_count} {template_word}, {snippet_count} snippets')
271+
print(f'Counts verified: {skill_count} skills, {rule_count} rules, {template_count} {template_word}, {snippet_count} snippets, {example_count} examples')
265272
PYEOF

‎AGENTS.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ way, and a one-paragraph rationale. 30 to 80 lines is the right size.
119119
## CI/CD workflows
120120

121121
- `validate.yml` runs file structure checks plus a `validate-counts` job that
122-
asserts the README aggregate counts (12 skills, 6 rules, 2 templates, 17
123-
snippets) match filesystem reality. The counts language in `README.md` is
124-
load-bearing: the job greps for it.
122+
asserts the README aggregate counts (skills, rules, templates, snippets,
123+
and examples) match filesystem reality. The counts language in `README.md`
124+
is load-bearing: the job greps for it.
125125
- `validate.yml` also runs a `validate-manifest` job that checks
126126
`.cursor-plugin/plugin.json` against reality: every listed path must exist,
127127
every skill, rule, snippet, template, and example on disk must be listed,

0 commit comments

Comments
 (0)