fix: zsh glob compatibility in skill preamble (v0.11.7.0)#386
Merged
Conversation
**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
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>
# Conflicts: # .agents/skills/gstack-browse/SKILL.md # .agents/skills/gstack-design-consultation/SKILL.md # .agents/skills/gstack-design-review/SKILL.md # .agents/skills/gstack-document-release/SKILL.md # .agents/skills/gstack-investigate/SKILL.md # .agents/skills/gstack-office-hours/SKILL.md # .agents/skills/gstack-plan-ceo-review/SKILL.md # .agents/skills/gstack-plan-design-review/SKILL.md # .agents/skills/gstack-plan-eng-review/SKILL.md # .agents/skills/gstack-qa-only/SKILL.md # .agents/skills/gstack-qa/SKILL.md # .agents/skills/gstack-retro/SKILL.md # .agents/skills/gstack-review/SKILL.md # .agents/skills/gstack-setup-browser-cookies/SKILL.md # .agents/skills/gstack-ship/SKILL.md # .agents/skills/gstack/SKILL.md
New skills from main (benchmark, autoplan, canary, cso, land-and-deploy, setup-deploy) now include the zsh-compatible .pending-* glob guard.
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.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolved CHANGELOG.md conflict (bumped to v0.11.8.0 since main took v0.11.7.0). Resolved SKILL.md conflict via regeneration.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.pending-*telemetry glob in every skill preamble has been replaced withfindto avoid zsh's NOMATCH behavior entirely.findinstead of bare shell globs.ls-based guard still triggered zsh glob expansion.Fixes #313
Test Coverage
All new code paths have test coverage.
.pending-*globfindfor pattern matchingPre-Landing Review
No issues found.
Adversarial Review
Codex adversarial (medium tier) caught that the original
$(ls .pending-* 2>/dev/null)fix still triggered zsh NOMATCH. Fixed by switching tofindwhich avoids shell glob expansion entirely. Verified in actual zsh.TODOS
No TODO items completed in this PR.
Test plan
🤖 Generated with Claude Code