From 51171f323344470a6c6b2498ed8f44066f02bf04 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Fri, 27 Mar 2026 00:42:10 -0600 Subject: [PATCH] =?UTF-8?q?fix:=20zsh=20glob=20safety=20=E2=80=94=20setopt?= =?UTF-8?q?=20guards=20+=20find=20for=20shell=20glob=20patterns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New zsh-safe test from main catches unsafe for-in globs and ls/grep with glob args. Fix ship/SKILL.md.tmpl (for-in → find) and gstack-submit (add setopt +o nomatch guards for ls with glob patterns). Co-Authored-By: Claude Opus 4.6 (1M context) --- gstack-submit/SKILL.md | 2 ++ gstack-submit/SKILL.md.tmpl | 2 ++ ship/SKILL.md | 2 +- ship/SKILL.md.tmpl | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gstack-submit/SKILL.md b/gstack-submit/SKILL.md index 5701359d..8949899c 100644 --- a/gstack-submit/SKILL.md +++ b/gstack-submit/SKILL.md @@ -366,6 +366,7 @@ eval "$(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null)" 3. Read existing design docs for context: ```bash + setopt +o nomatch 2>/dev/null || true # zsh compat ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -5 ``` If design docs exist, read the most recent one. This gives you the "what was planned" narrative. @@ -490,6 +491,7 @@ Use AskUserQuestion: ```bash PROJECT_DIR=$(git rev-parse --show-toplevel | sed 's|/|-|g; s|^-||') echo "Looking for transcripts in: ~/.claude/projects/-$PROJECT_DIR/" + setopt +o nomatch 2>/dev/null || true # zsh compat ls ~/.claude/projects/-$PROJECT_DIR/*.jsonl 2>/dev/null | tail -10 ``` diff --git a/gstack-submit/SKILL.md.tmpl b/gstack-submit/SKILL.md.tmpl index abc9372b..0ab2f19d 100644 --- a/gstack-submit/SKILL.md.tmpl +++ b/gstack-submit/SKILL.md.tmpl @@ -46,6 +46,7 @@ You help gstack users submit their projects to the gstack.gg showcase gallery. Y 3. Read existing design docs for context: ```bash + setopt +o nomatch 2>/dev/null || true # zsh compat ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -5 ``` If design docs exist, read the most recent one. This gives you the "what was planned" narrative. @@ -170,6 +171,7 @@ Use AskUserQuestion: ```bash PROJECT_DIR=$(git rev-parse --show-toplevel | sed 's|/|-|g; s|^-||') echo "Looking for transcripts in: ~/.claude/projects/-$PROJECT_DIR/" + setopt +o nomatch 2>/dev/null || true # zsh compat ls ~/.claude/projects/-$PROJECT_DIR/*.jsonl 2>/dev/null | tail -10 ``` diff --git a/ship/SKILL.md b/ship/SKILL.md index b8323223..32b206e3 100644 --- a/ship/SKILL.md +++ b/ship/SKILL.md @@ -1809,7 +1809,7 @@ If the user chooses A or B: ```bash REPO_SLUG=$(basename "$(git rev-parse --show-toplevel 2>/dev/null)") BRANCH=$(git branch --show-current 2>/dev/null) - for img in /tmp/gstack-pr-screenshots/*.png; do + for img in $(find /tmp/gstack-pr-screenshots -name '*.png' 2>/dev/null); do VIEWPORT=$(basename "$img" .png) URL=$(~/.claude/skills/gstack/bin/gstack-screenshot-upload "$img" \ --repo-slug "$REPO_SLUG" --branch "$BRANCH" --viewport "$VIEWPORT") diff --git a/ship/SKILL.md.tmpl b/ship/SKILL.md.tmpl index aff25611..557caaf5 100644 --- a/ship/SKILL.md.tmpl +++ b/ship/SKILL.md.tmpl @@ -551,7 +551,7 @@ If the user chooses A or B: ```bash REPO_SLUG=$(basename "$(git rev-parse --show-toplevel 2>/dev/null)") BRANCH=$(git branch --show-current 2>/dev/null) - for img in /tmp/gstack-pr-screenshots/*.png; do + for img in $(find /tmp/gstack-pr-screenshots -name '*.png' 2>/dev/null); do VIEWPORT=$(basename "$img" .png) URL=$(~/.claude/skills/gstack/bin/gstack-screenshot-upload "$img" \ --repo-slug "$REPO_SLUG" --branch "$BRANCH" --viewport "$VIEWPORT")