Repository navigation
feat(test): bash syntax validation for all SKILL.md code blocks (#1667) - #1722
NikhileshNanduri wants to merge 2 commits into
Conversation
|
Thanks for tackling #1667. I think this PR currently collides with #1697 and is hard to land as-is. Live map evidence:
Recommended path: make #1697 the canonical PR for the bash-snippet validation gate, or rebase/narrow this PR down to only the #1667 pieces:
The important coverage to preserve is a regression that catches both the missing Codex fence and the |
29a8588 to
5ca2c6f
Compare
The bash block opened at the "For a resumed session" section was missing its closing ``` fence. Prose text with backtick-quoted identifiers (e.g. `SESSION_ID:<id>`) was being parsed as shell code, causing bash -n to report "unexpected EOF while looking for matching `". Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Adds test/skill-bash-syntax.test.ts — a gate-tier free test that extracts all bash code blocks from all 53 generated SKILL.md files and runs bash -n on each. Covers 1327+ blocks in ~4s with no API calls. Fixes garrytan#1667. Angle-bracket placeholders like <branch-name> are preprocessed to PLACEHOLDER before validation so template markers don't produce false positives. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
5ca2c6f to
1754e15
Compare
|
Thanks for this. The extractor misses unclosed final fences, and |
|
Thanks for this, it was the right idea. Main now has an every-host |
Summary
Closes #1667.
test/skill-bash-syntax.test.ts: gate-tier free test that runsbash -non every```bash ```block in all 53 generated SKILL.md files (1327+ blocks total), catching syntax errors before they reach userscodex/SKILL.mdhad a missing closing```fence on the resumed-session bash block, causing prose with backtick-quoted identifiers to be parsed as shell —bash -nreported "unexpected EOF while looking for matching `"<branch-name>are preprocessed toPLACEHOLDERbefore validation to avoid false positives on intentional template tokensWhy it matters
bun testpreviously never validated bash syntax in skill files. A typo like2/dev/nullinstead of2>/dev/null(the exact corruption in PR #1654) would pass all CI checks and silently break at runtime. Now it's a gate failure in ~4 seconds with zero API cost.Test plan
bun test test/skill-bash-syntax.test.ts— 54 tests pass (1 discovery + 53 skills)bun test test/skill-validation.test.ts test/gen-skill-docs.test.ts test/skill-bash-syntax.test.ts— 772 tests pass