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

@@ -6,7 +6,7 @@ Calculate the next decimal phase number for urgent insertions.
```bash
# Get next decimal phase after phase 6
node ~/.claude/get-shit-done/bin/gsd-tools.cjs phase next-decimal 6
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" phase next-decimal 6
```
Output:
@@ -32,14 +32,14 @@ With existing decimals:
## Extract Values
```bash
DECIMAL_INFO=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs phase next-decimal "${AFTER_PHASE}")
DECIMAL_INFO=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" phase next-decimal "${AFTER_PHASE}")
DECIMAL_PHASE=$(echo "$DECIMAL_INFO" | jq -r '.next')
BASE_PHASE=$(echo "$DECIMAL_INFO" | jq -r '.base_phase')
```
Or with --raw flag:
```bash
DECIMAL_PHASE=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs phase next-decimal "${AFTER_PHASE}" --raw)
DECIMAL_PHASE=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" phase next-decimal "${AFTER_PHASE}" --raw)
# Returns just: 06.1
```
@@ -57,7 +57,7 @@ DECIMAL_PHASE=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs phase next-decima
Decimal phase directories use the full decimal number:
```bash
SLUG=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs generate-slug "$DESCRIPTION" --raw)
SLUG=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" generate-slug "$DESCRIPTION" --raw)
PHASE_DIR=".planning/phases/${DECIMAL_PHASE}-${SLUG}"
mkdir -p "$PHASE_DIR"
```

View File

@@ -51,7 +51,7 @@ Phases:
What to commit:
```bash
node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "docs: initialize [project-name] ([N] phases)" --files .planning/
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs: initialize [project-name] ([N] phases)" --files .planning/
```
</format>
@@ -129,7 +129,7 @@ SUMMARY: .planning/phases/XX-name/{phase}-{plan}-SUMMARY.md
What to 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}-PLAN.md .planning/phases/XX-name/{phase}-{plan}-SUMMARY.md .planning/STATE.md .planning/ROADMAP.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}-PLAN.md .planning/phases/XX-name/{phase}-{plan}-SUMMARY.md .planning/STATE.md .planning/ROADMAP.md
```
**Note:** Code files NOT included - already committed per-task.
@@ -149,7 +149,7 @@ Current: [task name]
What to commit:
```bash
node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "wip: [phase-name] paused at task [X]/[Y]" --files .planning/
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "wip: [phase-name] paused at task [X]/[Y]" --files .planning/
```
</format>

View File

@@ -7,7 +7,7 @@ Commit planning artifacts using the gsd-tools CLI, which automatically checks `c
Always use `gsd-tools.cjs commit` for `.planning/` files — it handles `commit_docs` and gitignore checks automatically:
```bash
node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "docs({scope}): {description}" --files .planning/STATE.md .planning/ROADMAP.md
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs({scope}): {description}" --files .planning/STATE.md .planning/ROADMAP.md
```
The CLI will return `skipped` (with reason) if `commit_docs` is `false` or `.planning/` is gitignored. No manual conditional checks needed.
@@ -17,7 +17,7 @@ The CLI will return `skipped` (with reason) if `commit_docs` is `false` or `.pla
To fold `.planning/` file changes into the previous commit:
```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
```
## Commit Message Patterns

View File

@@ -14,7 +14,7 @@ From `$ARGUMENTS`:
The `find-phase` command handles normalization and validation in one step:
```bash
PHASE_INFO=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs find-phase "${PHASE}")
PHASE_INFO=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" find-phase "${PHASE}")
```
Returns JSON with:
@@ -45,7 +45,7 @@ fi
Use `roadmap get-phase` to validate phase exists:
```bash
PHASE_CHECK=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "${PHASE}")
PHASE_CHECK=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" roadmap get-phase "${PHASE}")
if [ "$(echo "$PHASE_CHECK" | jq -r '.found')" = "false" ]; then
echo "ERROR: Phase ${PHASE} not found in roadmap"
exit 1
@@ -57,5 +57,5 @@ fi
Use `find-phase` for directory lookup:
```bash
PHASE_DIR=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs find-phase "${PHASE}" --raw)
PHASE_DIR=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" find-phase "${PHASE}" --raw)
```

View File

@@ -40,14 +40,14 @@ Configuration options for `.planning/` directory behavior.
```bash
# Commit with automatic commit_docs + gitignore checks:
node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "docs: update state" --files .planning/STATE.md
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs: update state" --files .planning/STATE.md
# Load config via state load (returns JSON):
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 available in the JSON output
# Or use init commands which include commit_docs:
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs init execute-phase "1")
INIT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" init execute-phase "1")
# commit_docs is included in all init command outputs
```
@@ -56,7 +56,7 @@ INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs init execute-phase "1")
**Commit via CLI (handles checks automatically):**
```bash
node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "docs: update state" --files .planning/STATE.md
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs: update state" --files .planning/STATE.md
```
The CLI checks `commit_docs` config and gitignore status internally — no manual conditionals needed.
@@ -144,13 +144,13 @@ To use uncommitted mode:
Use `init execute-phase` which returns all config as JSON:
```bash
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs init execute-phase "1")
INIT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" init execute-phase "1")
# JSON output includes: branching_strategy, phase_branch_template, milestone_branch_template
```
Or use `state load` for the config values:
```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)
# Parse branching_strategy, phase_branch_template, milestone_branch_template from JSON
```