fix: use $HOME instead of ~ for gsd-tools.cjs paths to prevent subagent MODULE_NOT_FOUND (#786)

Claude Code subagents sometimes rewrite ~/. paths to relative paths,
causing MODULE_NOT_FOUND when CWD is the project directory. $HOME is a
shell variable resolved at runtime, immune to model path rewriting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lex Christopherson
2026-02-27 13:11:19 -06:00
parent aaea14efd6
commit 69b28eeca4
44 changed files with 166 additions and 166 deletions

View File

@@ -15,7 +15,7 @@ Read config.json for planning behavior settings.
Load execution context (paths only to minimize orchestrator context):
```bash
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs init execute-phase "${PHASE}")
INIT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" init execute-phase "${PHASE}")
```
Extract from init JSON: `executor_model`, `commit_docs`, `phase_dir`, `phase_number`, `plans`, `summaries`, `incomplete_plans`, `state_path`, `config_path`.
@@ -124,7 +124,7 @@ This IS the execution instructions. Follow exactly. If plan references CONTEXT.m
<step name="previous_phase_check">
```bash
node ~/.claude/get-shit-done/bin/gsd-tools.cjs phases list --type summaries --raw
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" phases list --type summaries --raw
# Extract the second-to-last summary from the JSON result
```
If previous SUMMARY has unresolved "Issues Encountered" or "Next Phase Readiness" blockers: AskUserQuestion(header="Previous Issues", options: "Proceed anyway" | "Address first" | "Review previous").
@@ -334,13 +334,13 @@ Update STATE.md using gsd-tools:
```bash
# Advance plan counter (handles last-plan edge case)
node ~/.claude/get-shit-done/bin/gsd-tools.cjs state advance-plan
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" state advance-plan
# Recalculate progress bar from disk state
node ~/.claude/get-shit-done/bin/gsd-tools.cjs state update-progress
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" state update-progress
# Record execution metrics
node ~/.claude/get-shit-done/bin/gsd-tools.cjs state record-metric \
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" state record-metric \
--phase "${PHASE}" --plan "${PLAN}" --duration "${DURATION}" \
--tasks "${TASK_COUNT}" --files "${FILE_COUNT}"
```
@@ -352,11 +352,11 @@ From SUMMARY: Extract decisions and add to STATE.md:
```bash
# Add each decision from SUMMARY key-decisions
# Prefer file inputs for shell-safe text (preserves `$`, `*`, etc. exactly)
node ~/.claude/get-shit-done/bin/gsd-tools.cjs state add-decision \
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" state add-decision \
--phase "${PHASE}" --summary-file "${DECISION_TEXT_FILE}" --rationale-file "${RATIONALE_FILE}"
# Add blockers if any found
node ~/.claude/get-shit-done/bin/gsd-tools.cjs state add-blocker --text-file "${BLOCKER_TEXT_FILE}"
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" state add-blocker --text-file "${BLOCKER_TEXT_FILE}"
```
</step>
@@ -364,7 +364,7 @@ node ~/.claude/get-shit-done/bin/gsd-tools.cjs state add-blocker --text-file "${
Update session info using gsd-tools:
```bash
node ~/.claude/get-shit-done/bin/gsd-tools.cjs state record-session \
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" state record-session \
--stopped-at "Completed ${PHASE}-${PLAN}-PLAN.md" \
--resume-file "None"
```
@@ -378,7 +378,7 @@ If SUMMARY "Issues Encountered" ≠ "None": yolo → log and continue. Interacti
<step name="update_roadmap">
```bash
node ~/.claude/get-shit-done/bin/gsd-tools.cjs roadmap update-plan-progress "${PHASE}"
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" roadmap update-plan-progress "${PHASE}"
```
Counts PLAN vs SUMMARY files on disk. Updates progress table row with correct count and status (`In Progress` or `Complete` with date).
</step>
@@ -387,7 +387,7 @@ Counts PLAN vs SUMMARY files on disk. Updates progress table row with correct co
Mark completed requirements from the PLAN.md frontmatter `requirements:` field:
```bash
node ~/.claude/get-shit-done/bin/gsd-tools.cjs requirements mark-complete ${REQ_IDS}
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" requirements mark-complete ${REQ_IDS}
```
Extract requirement IDs from the plan's frontmatter (e.g., `requirements: [AUTH-01, AUTH-02]`). If no requirements field, skip.
@@ -397,7 +397,7 @@ Extract requirement IDs from the plan's frontmatter (e.g., `requirements: [AUTH-
Task code already committed per-task. Commit plan metadata:
```bash
node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "docs({phase}-{plan}): complete [plan-name] plan" --files .planning/phases/XX-name/{phase}-{plan}-SUMMARY.md .planning/STATE.md .planning/ROADMAP.md .planning/REQUIREMENTS.md
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs({phase}-{plan}): complete [plan-name] plan" --files .planning/phases/XX-name/{phase}-{plan}-SUMMARY.md .planning/STATE.md .planning/ROADMAP.md .planning/REQUIREMENTS.md
```
</step>
@@ -412,7 +412,7 @@ git diff --name-only ${FIRST_TASK}^..HEAD 2>/dev/null
Update only structural changes: new src/ dir → STRUCTURE.md | deps → STACK.md | file pattern → CONVENTIONS.md | API client → INTEGRATIONS.md | config → STACK.md | renamed → update paths. Skip code-only/bugfix/content changes.
```bash
node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "" --files .planning/codebase/*.md --amend
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "" --files .planning/codebase/*.md --amend
```
</step>