From 7216d72f8f86786f7b18b01b50115b5c18d952dc Mon Sep 17 00:00:00 2001 From: Ahmed Abushagur Date: Thu, 16 Apr 2026 21:30:25 -0700 Subject: [PATCH] fix(growth): replace BASH_SOURCE with git rev-parse for path resolution Closes #3303. BASH_SOURCE resolves to /dev/fd/XX under bash <(curl ...) which violates .claude/rules/shell-scripts.md. Switched to git rev-parse --show-toplevel which always works regardless of invocation method. Applied only to growth.sh per the issue scope. The same pattern exists in refactor.sh, security.sh, and discovery.sh but those are separate issues and those scripts are also never curl-piped. --- .claude/skills/setup-agent-team/growth.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.claude/skills/setup-agent-team/growth.sh b/.claude/skills/setup-agent-team/growth.sh index 0d3b0164d..b6e5150a0 100644 --- a/.claude/skills/setup-agent-team/growth.sh +++ b/.claude/skills/setup-agent-team/growth.sh @@ -6,8 +6,11 @@ set -eo pipefail # Phase 2: Pass results to Claude for scoring/qualification (no tool use) # Phase 3: POST candidate to SPA for Slack notification -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -REPO_ROOT="$(cd "${SCRIPT_DIR}/../../.." && pwd)" +# Derive paths from git — works regardless of how the script is invoked +# (direct execution, Bun.spawn, or process substitution). Avoids BASH_SOURCE +# which breaks under bash <(curl ...) per .claude/rules/shell-scripts.md. +REPO_ROOT="$(git rev-parse --show-toplevel)" +SCRIPT_DIR="${REPO_ROOT}/.claude/skills/setup-agent-team" cd "${REPO_ROOT}" SPAWN_REASON="${SPAWN_REASON:-manual}"