You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
-**gstack skills now work in zsh without errors.** Every skill preamble used a `.pending-*` glob pattern that triggered zsh's "no matches found" error on every invocation (the common case where no pending telemetry files exist). Replaced shell glob with `find` to avoid zsh's NOMATCH behavior entirely. Thanks to @hnshah for the initial report and fix in PR #332. Fixes #313.
8
+
9
+
### Added
10
+
11
+
-**Regression test for zsh glob safety.** New test verifies all generated SKILL.md files use `find` instead of bare shell globs for `.pending-*` pattern matching.
If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills — only invoke
56
58
them when the user explicitly asks. The user opted out of proactive suggestions.
57
59
58
-
If output shows `UPGRADE_AVAILABLE <old> <new>`: read `$GSTACK_ROOT/gstack-upgrade/SKILL.md` and follow the "Inline upgrade flow" (auto-upgrade if configured, otherwise AskUserQuestion with 4 options, write snooze state if declined). If `JUST_UPGRADED <from> <to>`: tell user "Running gstack v{to} (just updated!)" and continue.
60
+
If output shows `UPGRADE_AVAILABLE <old> <new>`: read `~/.claude/skills/gstack/gstack-upgrade/SKILL.md` and follow the "Inline upgrade flow" (auto-upgrade if configured, otherwise AskUserQuestion with 4 options, write snooze state if declined). If `JUST_UPGRADED <from> <to>`: tell user "Running gstack v{to} (just updated!)" and continue.
59
61
60
62
If `LAKE_INTRO` is `no`: Before continuing, introduce the Completeness Principle.
61
63
Tell the user: "gstack follows the **Boil the Lake** principle — always do the complete
@@ -81,7 +83,7 @@ Options:
81
83
- A) Help gstack get better! (recommended)
82
84
- B) No thanks
83
85
84
-
If A: run `$GSTACK_BIN/gstack-config set telemetry community`
86
+
If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`
85
87
86
88
If B: ask a follow-up AskUserQuestion:
87
89
@@ -92,8 +94,8 @@ Options:
92
94
- A) Sure, anonymous is fine
93
95
- B) No thanks, fully off
94
96
95
-
If B→A: run `$GSTACK_BIN/gstack-config set telemetry anonymous`
96
-
If B→B: run `$GSTACK_BIN/gstack-config set telemetry off`
97
+
If B→A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous`
98
+
If B→B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off`
97
99
98
100
Always run:
99
101
```bash
@@ -153,7 +155,7 @@ Never let a noticed issue silently pass. The whole point is proactive communicat
153
155
154
156
## Search Before Building
155
157
156
-
Before building infrastructure, unfamiliar patterns, or anything the runtime might have a built-in — **search first.** Read `$GSTACK_ROOT/ETHOS.md` for the full philosophy.
158
+
Before building infrastructure, unfamiliar patterns, or anything the runtime might have a built-in — **search first.** Read `~/.claude/skills/gstack/ETHOS.md` for the full philosophy.
157
159
158
160
**Three layers of knowledge:**
159
161
-**Layer 1** (tried and true — in distribution). Don't reinvent the wheel. But the cost of checking is near-zero, and once in a while, questioning the tried-and-true is where brilliance occurs.
0 commit comments