test: add zsh glob safety test + regenerate SKILL.md files

Adds a test verifying the .pending-* glob in preamble is guarded by
an ls check (zsh-compatible). Regenerates all SKILL.md files to
propagate the fix from the previous commit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-03-23 06:48:41 -07:00
parent cfda9cb46f
commit b6efa8067c
34 changed files with 80 additions and 37 deletions
+11
View File
@@ -165,6 +165,17 @@ describe('gen-skill-docs', () => {
expect(content).toContain('~/.gstack/analytics');
});
test('preamble .pending-* glob is zsh-safe (guarded by ls check)', () => {
for (const skill of ALL_SKILLS) {
const content = fs.readFileSync(path.join(ROOT, skill.dir, 'SKILL.md'), 'utf-8');
if (!content.includes('.pending-')) continue;
// Must NOT have a bare "for _PF in .../.pending-*" without the ls guard
expect(content).not.toMatch(/(?<!ls [^\n]*)\bfor _PF in [^\n]*\.pending-\*/);
// Must have the zsh-compatible ls guard
expect(content).toContain('$(ls ~/.gstack/analytics/.pending-* 2>/dev/null)');
}
});
test('preamble-using skills have correct skill name in telemetry', () => {
const PREAMBLE_SKILLS = [
{ dir: '.', name: 'gstack' },