gstack/scripts
Garry Tan 8a4afd868b
fix: zsh glob compatibility in skill preamble (v0.11.7.0) (#386)
* fix(preamble): make .pending-* glob pattern zsh-compatible (fixes #313)

**Problem:**
When running gstack skills in zsh, users see this error:
  (eval):22: no matches found: /Users/.../.gstack/analytics/.pending-*

**Root Cause:**
The Preamble code in gen-skill-docs.ts (line 167) contains:
  for _PF in ~/.gstack/analytics/.pending-*; do ...

In zsh, glob patterns that don't match any files cause an error:
  'no matches found: pattern'

In bash, the loop simply iterates zero times. This breaks all gstack
skills for zsh users (common on macOS).

**Solution:**
Check if any .pending-* files exist BEFORE attempting the for loop:
  [ -n "$(ls ~/.gstack/analytics/.pending-* 2>/dev/null)" ] && for ...

This approach:
-  Works in both bash and zsh
-  Silently skips the loop when no pending files exist (normal case)
-  Executes the loop when pending files are present
-  Uses ls with error suppression (2>/dev/null) for portability

**Testing:**
-  No pending files: loop skipped, no error
-  Pending files exist: loop runs normally
-  Compatible with bash and zsh
-  TypeScript syntax check passes

**Impact:**
Fixes all gstack skills for zsh users (macOS default shell).

Fixes #313

* 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>

* chore: regenerate SKILL.md files after merge with main

New skills from main (benchmark, autoplan, canary, cso, land-and-deploy,
setup-deploy) now include the zsh-compatible .pending-* glob guard.

* fix: use find instead of ls for zsh glob safety

Codex adversarial review caught that $(ls .pending-* 2>/dev/null) still
triggers zsh NOMATCH error because the shell expands the glob before ls
runs. Using find avoids shell glob expansion entirely.

* chore: bump version and changelog (v0.11.7.0)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: update codex agent skill descriptions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Hiten Shah <hnshah@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 07:36:58 -07:00
..
analytics.ts feat: safety hook skills + skill usage telemetry (v0.7.1) (#189) 2026-03-18 23:57:59 -05:00
dev-skill.ts feat: SKILL.md template system, 3-tier testing, DX tools (v0.3.3) (#41) 2026-03-13 21:08:12 -07:00
eval-compare.ts feat: eval CLI tools + docs cleanup 2026-03-14 03:49:57 -05:00
eval-list.ts feat: QA restructure, browser ref staleness, eval efficiency metrics (v0.4.0) (#83) 2026-03-15 23:55:39 -05:00
eval-select.ts feat: diff-based test selection for E2E and LLM-judge evals (v0.6.1.0) (#139) 2026-03-17 18:45:41 -05:00
eval-summary.ts feat: QA restructure, browser ref staleness, eval efficiency metrics (v0.4.0) (#83) 2026-03-15 23:55:39 -05:00
eval-watch.ts feat: /land-and-deploy, /canary, /benchmark + perf review (v0.7.0) (#183) 2026-03-21 14:31:36 -07:00
gen-skill-docs.ts fix: zsh glob compatibility in skill preamble (v0.11.7.0) (#386) 2026-03-23 07:36:58 -07:00
skill-check.ts fix: community security + stability fixes (wave 1) (#325) 2026-03-22 13:19:10 -07:00