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:
@@ -15,7 +15,7 @@ Read config.json for planning behavior settings.
|
||||
Load execution context (uses `init execute-phase` for full context, including file contents):
|
||||
|
||||
```bash
|
||||
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.js init execute-phase "${PHASE}" --include state,config)
|
||||
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs init execute-phase "${PHASE}" --include state,config)
|
||||
```
|
||||
|
||||
Extract from init JSON: `executor_model`, `commit_docs`, `phase_dir`, `phase_number`, `plans`, `summaries`, `incomplete_plans`.
|
||||
@@ -337,13 +337,13 @@ Update STATE.md using gsd-tools:
|
||||
|
||||
```bash
|
||||
# Advance plan counter (handles last-plan edge case)
|
||||
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}"
|
||||
```
|
||||
@@ -354,11 +354,11 @@ From SUMMARY: Extract decisions and add to STATE.md:
|
||||
|
||||
```bash
|
||||
# Add each decision from SUMMARY key-decisions
|
||||
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_TEXT}" --rationale "${RATIONALE}"
|
||||
|
||||
# Add blockers if any found
|
||||
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"
|
||||
```
|
||||
</step>
|
||||
|
||||
@@ -366,7 +366,7 @@ node ~/.claude/get-shit-done/bin/gsd-tools.js state add-blocker "Blocker descrip
|
||||
Update session info using gsd-tools:
|
||||
|
||||
```bash
|
||||
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" \
|
||||
--resume-file "None"
|
||||
```
|
||||
@@ -380,7 +380,7 @@ If SUMMARY "Issues Encountered" ≠ "None": yolo → log and continue. Interacti
|
||||
|
||||
<step name="update_roadmap">
|
||||
```bash
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.js roadmap update-plan-progress "${PHASE}"
|
||||
node ~/.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>
|
||||
@@ -389,7 +389,7 @@ Counts PLAN vs SUMMARY files on disk. Updates progress table row with correct co
|
||||
Task code already committed per-task. Commit plan metadata:
|
||||
|
||||
```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 .planning/ROADMAP.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 .planning/ROADMAP.md
|
||||
```
|
||||
</step>
|
||||
|
||||
@@ -404,7 +404,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.js commit "" --files .planning/codebase/*.md --amend
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "" --files .planning/codebase/*.md --amend
|
||||
```
|
||||
</step>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user