From 47514c7bc28bda8af9f37ef9f46d33a4747ffcc4 Mon Sep 17 00:00:00 2001 From: The Anh Date: Sat, 14 Mar 2026 14:32:18 +0700 Subject: [PATCH] fix: setup creates skill symlinks when gstack is symlinked from dev checkout When ~/.claude/skills/gstack is a symlink to a dev checkout, the setup script resolved GSTACK_DIR to the real path, so SKILLS_DIR pointed to the workspace parent instead of ~/.claude/skills/. This caused newer skills (gstack-upgrade, qa, setup-browser-cookies) to never get symlinked. Now detects this case by checking if ~/.claude/skills/gstack points back to us, and creates symlinks there. Co-Authored-By: Claude Opus 4.6 (1M context) --- setup | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/setup b/setup index 0bf2736..c8632a2 100755 --- a/setup +++ b/setup @@ -57,8 +57,21 @@ if ! ensure_playwright_browser; then exit 1 fi -# 3. Only create skill symlinks if we're inside a .claude/skills directory +# 3. Create skill symlinks in ~/.claude/skills/ +# Resolve SKILLS_DIR: either we're directly inside .claude/skills/, or a symlink +# in .claude/skills/ points to us (e.g., dev checkout symlinked in). SKILLS_BASENAME="$(basename "$SKILLS_DIR")" +if [ "$SKILLS_BASENAME" != "skills" ]; then + # Check if ~/.claude/skills/gstack is a symlink pointing to us + CANDIDATE="$HOME/.claude/skills" + if [ -L "$CANDIDATE/gstack" ]; then + LINK_TARGET="$(cd "$CANDIDATE/gstack" 2>/dev/null && pwd -P)" + if [ "$LINK_TARGET" = "$GSTACK_DIR" ]; then + SKILLS_DIR="$CANDIDATE" + SKILLS_BASENAME="skills" + fi + fi +fi if [ "$SKILLS_BASENAME" = "skills" ]; then linked=() for skill_dir in "$GSTACK_DIR"/*/; do