fix: rename gsd-tools.js to .cjs to prevent ESM conflicts (closes #495)
Projects with "type": "module" in package.json cause Node to treat gsd-tools.js as ESM, crashing on require(). The .cjs extension forces CommonJS regardless of the host project's module configuration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -982,7 +982,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.js state load)
|
||||
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs state load)
|
||||
# commit_docs is in the JSON output
|
||||
```
|
||||
|
||||
@@ -999,7 +999,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.js commit "docs: resolve debug {slug}" --files .planning/debug/resolved/{slug}.md
|
||||
node ~/.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.
|
||||
|
||||
@@ -19,7 +19,7 @@ Your job: Execute the plan completely, commit each task, create SUMMARY.md, upda
|
||||
Load execution context:
|
||||
|
||||
```bash
|
||||
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.js init execute-phase "${PHASE}")
|
||||
INIT=$(node ~/.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`.
|
||||
@@ -329,24 +329,24 @@ 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.js state advance-plan
|
||||
node ~/.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.js state update-progress
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs state update-progress
|
||||
|
||||
# Record execution metrics
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.js state record-metric \
|
||||
node ~/.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.js state add-decision \
|
||||
node ~/.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.js state record-session \
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs state record-session \
|
||||
--stopped-at "Completed ${PHASE}-${PLAN}-PLAN.md"
|
||||
```
|
||||
|
||||
@@ -361,13 +361,13 @@ node ~/.claude/get-shit-done/bin/gsd-tools.js state record-session \
|
||||
|
||||
**For blockers found during execution:**
|
||||
```bash
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.js state add-blocker "Blocker description"
|
||||
node ~/.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.js commit "docs({phase}-{plan}): complete [plan-name] plan" --files .planning/phases/XX-name/{phase}-{plan}-SUMMARY.md .planning/STATE.md
|
||||
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
|
||||
```
|
||||
|
||||
Separate from per-task commits — captures execution results only.
|
||||
|
||||
@@ -102,7 +102,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.js websearch "your query" --limit 10
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs websearch "your query" --limit 10
|
||||
```
|
||||
|
||||
**Options:**
|
||||
@@ -311,7 +311,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.js init phase-op "${PHASE}")
|
||||
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs init phase-op "${PHASE}")
|
||||
```
|
||||
|
||||
Extract from init JSON: `phase_dir`, `padded_phase`, `phase_number`, `commit_docs`.
|
||||
@@ -384,7 +384,7 @@ Write to: `$PHASE_DIR/$PADDED_PHASE-RESEARCH.md`
|
||||
## Step 6: Commit Research (optional)
|
||||
|
||||
```bash
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.js commit "docs($PHASE): research phase domain" --files "$PHASE_DIR/$PADDED_PHASE-RESEARCH.md"
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "docs($PHASE): research phase domain" --files "$PHASE_DIR/$PADDED_PHASE-RESEARCH.md"
|
||||
```
|
||||
|
||||
## Step 7: Return Structured Result
|
||||
|
||||
@@ -299,7 +299,7 @@ issue:
|
||||
|
||||
Load phase operation context:
|
||||
```bash
|
||||
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.js init phase-op "${PHASE_ARG}")
|
||||
INIT=$(node ~/.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`.
|
||||
@@ -308,7 +308,7 @@ Orchestrator provides CONTEXT.md content in the verification prompt. If provided
|
||||
|
||||
```bash
|
||||
ls "$phase_dir"/*-PLAN.md 2>/dev/null
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.js roadmap get-phase "$phase_number"
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "$phase_number"
|
||||
ls "$phase_dir"/*-BRIEF.md 2>/dev/null
|
||||
```
|
||||
|
||||
@@ -321,7 +321,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.js verify plan-structure "$plan")
|
||||
PLAN_STRUCTURE=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs verify plan-structure "$plan")
|
||||
echo "$PLAN_STRUCTURE"
|
||||
done
|
||||
```
|
||||
@@ -339,7 +339,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.js frontmatter get "$PLAN_PATH" --field must_haves)
|
||||
MUST_HAVES=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs frontmatter get "$PLAN_PATH" --field must_haves)
|
||||
```
|
||||
|
||||
Returns JSON: `{ truths: [...], artifacts: [...], key_links: [...] }`
|
||||
@@ -382,7 +382,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.js verify plan-structure "$PLAN_PATH")
|
||||
PLAN_STRUCTURE=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs verify plan-structure "$PLAN_PATH")
|
||||
```
|
||||
|
||||
The `tasks` array in the result shows each task's completeness:
|
||||
|
||||
@@ -794,7 +794,7 @@ Group by plan, dimension, severity.
|
||||
### Step 6: Commit
|
||||
|
||||
```bash
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.js commit "fix($PHASE): revise plans based on checker feedback" --files .planning/phases/$PHASE-*/$PHASE-*-PLAN.md
|
||||
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
|
||||
```
|
||||
|
||||
### Step 7: Return Revision Summary
|
||||
@@ -833,7 +833,7 @@ node ~/.claude/get-shit-done/bin/gsd-tools.js commit "fix($PHASE): revise plans
|
||||
Load planning context:
|
||||
|
||||
```bash
|
||||
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.js init plan-phase "${PHASE}")
|
||||
INIT=$(node ~/.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`.
|
||||
@@ -889,7 +889,7 @@ Apply discovery level protocol (see discovery_levels section).
|
||||
|
||||
**Step 1 — Generate digest index:**
|
||||
```bash
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.js history-digest
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs history-digest
|
||||
```
|
||||
|
||||
**Step 2 — Select relevant phases (typically 2-4):**
|
||||
@@ -1007,7 +1007,7 @@ Include all frontmatter fields.
|
||||
Validate each created PLAN.md using gsd-tools:
|
||||
|
||||
```bash
|
||||
VALID=$(node ~/.claude/get-shit-done/bin/gsd-tools.js frontmatter validate "$PLAN_PATH" --schema plan)
|
||||
VALID=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs frontmatter validate "$PLAN_PATH" --schema plan)
|
||||
```
|
||||
|
||||
Returns JSON: `{ valid, missing, present, schema }`
|
||||
@@ -1020,7 +1020,7 @@ Required plan frontmatter fields:
|
||||
Also validate plan structure:
|
||||
|
||||
```bash
|
||||
STRUCTURE=$(node ~/.claude/get-shit-done/bin/gsd-tools.js verify plan-structure "$PLAN_PATH")
|
||||
STRUCTURE=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs verify plan-structure "$PLAN_PATH")
|
||||
```
|
||||
|
||||
Returns JSON: `{ valid, errors, warnings, task_count, tasks }`
|
||||
@@ -1057,7 +1057,7 @@ Plans:
|
||||
|
||||
<step name="git_commit">
|
||||
```bash
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.js commit "docs($PHASE): create phase plan" --files .planning/phases/$PHASE-*/$PHASE-*-PLAN.md .planning/ROADMAP.md
|
||||
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
|
||||
```
|
||||
</step>
|
||||
|
||||
|
||||
@@ -96,7 +96,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.js websearch "your query" --limit 10
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs websearch "your query" --limit 10
|
||||
```
|
||||
|
||||
**Options:**
|
||||
|
||||
@@ -49,7 +49,7 @@ cat .planning/research/FEATURES.md
|
||||
cat .planning/research/ARCHITECTURE.md
|
||||
cat .planning/research/PITFALLS.md
|
||||
|
||||
# Planning config loaded via gsd-tools.js in commit step
|
||||
# Planning config loaded via gsd-tools.cjs in commit step
|
||||
```
|
||||
|
||||
Parse each file to extract:
|
||||
@@ -128,7 +128,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.js commit "docs: complete project research" --files .planning/research/
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "docs: complete project research" --files .planning/research/
|
||||
```
|
||||
|
||||
## Step 8: Return Summary
|
||||
|
||||
@@ -54,7 +54,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.js roadmap get-phase "$PHASE_NUM"
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "$PHASE_NUM"
|
||||
grep -E "^| $PHASE_NUM" .planning/REQUIREMENTS.md 2>/dev/null
|
||||
```
|
||||
|
||||
@@ -91,7 +91,7 @@ must_haves:
|
||||
If no must_haves in frontmatter, check for Success Criteria:
|
||||
|
||||
```bash
|
||||
PHASE_DATA=$(node ~/.claude/get-shit-done/bin/gsd-tools.js roadmap get-phase "$PHASE_NUM" --raw)
|
||||
PHASE_DATA=$(node ~/.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:
|
||||
@@ -134,7 +134,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.js verify artifacts "$PLAN_PATH")
|
||||
ARTIFACT_RESULT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs verify artifacts "$PLAN_PATH")
|
||||
```
|
||||
|
||||
Parse JSON result: `{ all_passed, passed, total, artifacts: [{path, exists, issues, passed}] }`
|
||||
@@ -183,7 +183,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.js verify key-links "$PLAN_PATH")
|
||||
LINKS_RESULT=$(node ~/.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}] }`
|
||||
@@ -251,12 +251,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.js summary-extract "$PHASE_DIR"/*-SUMMARY.md --fields key-files)
|
||||
SUMMARY_FILES=$(node ~/.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.js verify commits $COMMIT_HASHES)
|
||||
COMMITS_VALID=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs verify commits $COMMIT_HASHES)
|
||||
fi
|
||||
|
||||
# Fallback: grep for files
|
||||
|
||||
Reference in New Issue
Block a user