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:
@@ -1027,7 +1027,7 @@ mv .planning/debug/{slug}.md .planning/debug/resolved/
|
||||
**Check planning config using state load (commit_docs is available from the output):**
|
||||
|
||||
```bash
|
||||
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs state load)
|
||||
INIT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" state load)
|
||||
# commit_docs is in the JSON output
|
||||
```
|
||||
|
||||
@@ -1044,7 +1044,7 @@ Root cause: {root_cause}"
|
||||
|
||||
Then commit planning docs via CLI (respects `commit_docs` config automatically):
|
||||
```bash
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "docs: resolve debug {slug}" --files .planning/debug/resolved/{slug}.md
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs: resolve debug {slug}" --files .planning/debug/resolved/{slug}.md
|
||||
```
|
||||
|
||||
Report completion and offer next steps.
|
||||
|
||||
@@ -37,7 +37,7 @@ This ensures project-specific patterns, conventions, and best practices are appl
|
||||
Load execution 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`, `plans`, `incomplete_plans`.
|
||||
@@ -200,7 +200,7 @@ Do NOT continue reading. Analysis without action is a stuck signal.
|
||||
Check if auto mode is active at executor start:
|
||||
|
||||
```bash
|
||||
AUTO_CFG=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs config-get workflow.auto_advance 2>/dev/null || echo "false")
|
||||
AUTO_CFG=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-get workflow.auto_advance 2>/dev/null || echo "false")
|
||||
```
|
||||
|
||||
Store the result for checkpoint handling below.
|
||||
@@ -389,34 +389,34 @@ After SUMMARY.md, update STATE.md using gsd-tools:
|
||||
|
||||
```bash
|
||||
# Advance plan counter (handles edge cases automatically)
|
||||
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}"
|
||||
|
||||
# Add decisions (extract from SUMMARY.md key-decisions)
|
||||
for decision in "${DECISIONS[@]}"; do
|
||||
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 "${decision}"
|
||||
done
|
||||
|
||||
# Update session info
|
||||
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"
|
||||
```
|
||||
|
||||
```bash
|
||||
# Update ROADMAP.md progress for this phase (plan counts, status)
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs roadmap update-plan-progress "${PHASE_NUMBER}"
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" roadmap update-plan-progress "${PHASE_NUMBER}"
|
||||
|
||||
# Mark completed requirements from PLAN.md frontmatter
|
||||
# Extract the `requirements` array from the plan's frontmatter, then mark each complete
|
||||
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}
|
||||
```
|
||||
|
||||
**Requirement IDs:** Extract from the PLAN.md frontmatter `requirements:` field (e.g., `requirements: [AUTH-01, AUTH-02]`). Pass all IDs to `requirements mark-complete`. If the plan has no requirements field, skip this step.
|
||||
@@ -434,13 +434,13 @@ node ~/.claude/get-shit-done/bin/gsd-tools.cjs requirements mark-complete ${REQ_
|
||||
|
||||
**For blockers found during execution:**
|
||||
```bash
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs state add-blocker "Blocker description"
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" state add-blocker "Blocker description"
|
||||
```
|
||||
</state_updates>
|
||||
|
||||
<final_commit>
|
||||
```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
|
||||
```
|
||||
|
||||
Separate from per-task commits — captures execution results only.
|
||||
|
||||
@@ -120,7 +120,7 @@ When researching "best library for X": find what the ecosystem actually uses, do
|
||||
Check `brave_search` from init context. If `true`, use Brave Search for higher quality results:
|
||||
|
||||
```bash
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs websearch "your query" --limit 10
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" websearch "your query" --limit 10
|
||||
```
|
||||
|
||||
**Options:**
|
||||
@@ -359,7 +359,7 @@ Orchestrator provides: phase number/name, description/goal, requirements, constr
|
||||
|
||||
Load phase context using init command:
|
||||
```bash
|
||||
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs init phase-op "${PHASE}")
|
||||
INIT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" init phase-op "${PHASE}")
|
||||
```
|
||||
|
||||
Extract from init JSON: `phase_dir`, `padded_phase`, `phase_number`, `commit_docs`.
|
||||
@@ -461,7 +461,7 @@ Write to: `$PHASE_DIR/$PADDED_PHASE-RESEARCH.md`
|
||||
## Step 7: Commit Research (optional)
|
||||
|
||||
```bash
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "docs($PHASE): research phase domain" --files "$PHASE_DIR/$PADDED_PHASE-RESEARCH.md"
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs($PHASE): research phase domain" --files "$PHASE_DIR/$PADDED_PHASE-RESEARCH.md"
|
||||
```
|
||||
|
||||
## Step 8: Return Structured Result
|
||||
|
||||
@@ -365,7 +365,7 @@ If FAIL: return to planner with specific fixes. Same revision loop as other dime
|
||||
|
||||
Load phase operation context:
|
||||
```bash
|
||||
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs init phase-op "${PHASE_ARG}")
|
||||
INIT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" init phase-op "${PHASE_ARG}")
|
||||
```
|
||||
|
||||
Extract from init JSON: `phase_dir`, `phase_number`, `has_plans`, `plan_count`.
|
||||
@@ -376,7 +376,7 @@ Orchestrator provides CONTEXT.md content in the verification prompt. If provided
|
||||
ls "$phase_dir"/*-PLAN.md 2>/dev/null
|
||||
# Read research for Nyquist validation data
|
||||
cat "$phase_dir"/*-RESEARCH.md 2>/dev/null
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "$phase_number"
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" roadmap get-phase "$phase_number"
|
||||
ls "$phase_dir"/*-BRIEF.md 2>/dev/null
|
||||
```
|
||||
|
||||
@@ -389,7 +389,7 @@ Use gsd-tools to validate plan structure:
|
||||
```bash
|
||||
for plan in "$PHASE_DIR"/*-PLAN.md; do
|
||||
echo "=== $plan ==="
|
||||
PLAN_STRUCTURE=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs verify plan-structure "$plan")
|
||||
PLAN_STRUCTURE=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" verify plan-structure "$plan")
|
||||
echo "$PLAN_STRUCTURE"
|
||||
done
|
||||
```
|
||||
@@ -407,7 +407,7 @@ Map errors/warnings to verification dimensions:
|
||||
Extract must_haves from each plan using gsd-tools:
|
||||
|
||||
```bash
|
||||
MUST_HAVES=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs frontmatter get "$PLAN_PATH" --field must_haves)
|
||||
MUST_HAVES=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" frontmatter get "$PLAN_PATH" --field must_haves)
|
||||
```
|
||||
|
||||
Returns JSON: `{ truths: [...], artifacts: [...], key_links: [...] }`
|
||||
@@ -452,7 +452,7 @@ For each requirement: find covering task(s), verify action is specific, flag gap
|
||||
Use gsd-tools plan-structure verification (already run in Step 2):
|
||||
|
||||
```bash
|
||||
PLAN_STRUCTURE=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs verify plan-structure "$PLAN_PATH")
|
||||
PLAN_STRUCTURE=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" verify plan-structure "$PLAN_PATH")
|
||||
```
|
||||
|
||||
The `tasks` array in the result shows each task's completeness:
|
||||
|
||||
@@ -920,7 +920,7 @@ Group by plan, dimension, severity.
|
||||
### Step 6: Commit
|
||||
|
||||
```bash
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "fix($PHASE): revise plans based on checker feedback" --files .planning/phases/$PHASE-*/$PHASE-*-PLAN.md
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "fix($PHASE): revise plans based on checker feedback" --files .planning/phases/$PHASE-*/$PHASE-*-PLAN.md
|
||||
```
|
||||
|
||||
### Step 7: Return Revision Summary
|
||||
@@ -959,7 +959,7 @@ node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "fix($PHASE): revise plans
|
||||
Load planning context:
|
||||
|
||||
```bash
|
||||
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs init plan-phase "${PHASE}")
|
||||
INIT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" init plan-phase "${PHASE}")
|
||||
```
|
||||
|
||||
Extract from init JSON: `planner_model`, `researcher_model`, `checker_model`, `commit_docs`, `research_enabled`, `phase_dir`, `phase_number`, `has_research`, `has_context`.
|
||||
@@ -1015,7 +1015,7 @@ Apply discovery level protocol (see discovery_levels section).
|
||||
|
||||
**Step 1 — Generate digest index:**
|
||||
```bash
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs history-digest
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" history-digest
|
||||
```
|
||||
|
||||
**Step 2 — Select relevant phases (typically 2-4):**
|
||||
@@ -1143,7 +1143,7 @@ Include all frontmatter fields.
|
||||
Validate each created PLAN.md using gsd-tools:
|
||||
|
||||
```bash
|
||||
VALID=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs frontmatter validate "$PLAN_PATH" --schema plan)
|
||||
VALID=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" frontmatter validate "$PLAN_PATH" --schema plan)
|
||||
```
|
||||
|
||||
Returns JSON: `{ valid, missing, present, schema }`
|
||||
@@ -1156,7 +1156,7 @@ Required plan frontmatter fields:
|
||||
Also validate plan structure:
|
||||
|
||||
```bash
|
||||
STRUCTURE=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs verify plan-structure "$PLAN_PATH")
|
||||
STRUCTURE=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" verify plan-structure "$PLAN_PATH")
|
||||
```
|
||||
|
||||
Returns JSON: `{ valid, errors, warnings, task_count, tasks }`
|
||||
@@ -1193,7 +1193,7 @@ Plans:
|
||||
|
||||
<step name="git_commit">
|
||||
```bash
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "docs($PHASE): create phase plan" --files .planning/phases/$PHASE-*/$PHASE-*-PLAN.md .planning/ROADMAP.md
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs($PHASE): create phase plan" --files .planning/phases/$PHASE-*/$PHASE-*-PLAN.md .planning/ROADMAP.md
|
||||
```
|
||||
</step>
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ Always include current year. Use multiple query variations. Mark WebSearch-only
|
||||
Check `brave_search` from orchestrator context. If `true`, use Brave Search for higher quality results:
|
||||
|
||||
```bash
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs websearch "your query" --limit 10
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" websearch "your query" --limit 10
|
||||
```
|
||||
|
||||
**Options:**
|
||||
|
||||
@@ -131,7 +131,7 @@ Write to `.planning/research/SUMMARY.md`
|
||||
The 4 parallel researcher agents write files but do NOT commit. You commit everything together.
|
||||
|
||||
```bash
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "docs: complete project research" --files .planning/research/
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs: complete project research" --files .planning/research/
|
||||
```
|
||||
|
||||
## Step 8: Return Summary
|
||||
|
||||
@@ -72,7 +72,7 @@ Set `is_re_verification = false`, proceed with Step 1.
|
||||
```bash
|
||||
ls "$PHASE_DIR"/*-PLAN.md 2>/dev/null
|
||||
ls "$PHASE_DIR"/*-SUMMARY.md 2>/dev/null
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "$PHASE_NUM"
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" roadmap get-phase "$PHASE_NUM"
|
||||
grep -E "^| $PHASE_NUM" .planning/REQUIREMENTS.md 2>/dev/null
|
||||
```
|
||||
|
||||
@@ -109,7 +109,7 @@ must_haves:
|
||||
If no must_haves in frontmatter, check for Success Criteria:
|
||||
|
||||
```bash
|
||||
PHASE_DATA=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "$PHASE_NUM" --raw)
|
||||
PHASE_DATA=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" roadmap get-phase "$PHASE_NUM" --raw)
|
||||
```
|
||||
|
||||
Parse the `success_criteria` array from the JSON output. If non-empty:
|
||||
@@ -152,7 +152,7 @@ For each truth:
|
||||
Use gsd-tools for artifact verification against must_haves in PLAN frontmatter:
|
||||
|
||||
```bash
|
||||
ARTIFACT_RESULT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs verify artifacts "$PLAN_PATH")
|
||||
ARTIFACT_RESULT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" verify artifacts "$PLAN_PATH")
|
||||
```
|
||||
|
||||
Parse JSON result: `{ all_passed, passed, total, artifacts: [{path, exists, issues, passed}] }`
|
||||
@@ -201,7 +201,7 @@ Key links are critical connections. If broken, the goal fails even with all arti
|
||||
Use gsd-tools for key link verification against must_haves in PLAN frontmatter:
|
||||
|
||||
```bash
|
||||
LINKS_RESULT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs verify key-links "$PLAN_PATH")
|
||||
LINKS_RESULT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" verify key-links "$PLAN_PATH")
|
||||
```
|
||||
|
||||
Parse JSON result: `{ all_verified, verified, total, links: [{from, to, via, verified, detail}] }`
|
||||
@@ -283,12 +283,12 @@ Identify files modified in this phase from SUMMARY.md key-files section, or extr
|
||||
|
||||
```bash
|
||||
# Option 1: Extract from SUMMARY frontmatter
|
||||
SUMMARY_FILES=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs summary-extract "$PHASE_DIR"/*-SUMMARY.md --fields key-files)
|
||||
SUMMARY_FILES=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" summary-extract "$PHASE_DIR"/*-SUMMARY.md --fields key-files)
|
||||
|
||||
# Option 2: Verify commits exist (if commit hashes documented)
|
||||
COMMIT_HASHES=$(grep -oE "[a-f0-9]{7,40}" "$PHASE_DIR"/*-SUMMARY.md | head -10)
|
||||
if [ -n "$COMMIT_HASHES" ]; then
|
||||
COMMITS_VALID=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs verify commits $COMMIT_HASHES)
|
||||
COMMITS_VALID=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" verify commits $COMMIT_HASHES)
|
||||
fi
|
||||
|
||||
# Fallback: grep for files
|
||||
|
||||
Reference in New Issue
Block a user