Files
msd-core/get-shit-done/workflows/research-phase.md
Lex Christopherson 24b933e018 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>
2026-02-15 11:03:22 -06:00

75 lines
1.8 KiB
Markdown

<purpose>
Research how to implement a phase. Spawns gsd-phase-researcher with phase context.
Standalone research command. For most workflows, use `/gsd:plan-phase` which integrates research automatically.
</purpose>
<process>
## Step 0: Resolve Model Profile
@~/.claude/get-shit-done/references/model-profile-resolution.md
Resolve model for:
- `gsd-phase-researcher`
## Step 1: Normalize and Validate Phase
@~/.claude/get-shit-done/references/phase-argument-parsing.md
```bash
PHASE_INFO=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "${PHASE}")
```
If `found` is false: Error and exit.
## Step 2: Check Existing Research
```bash
ls .planning/phases/${PHASE}-*/RESEARCH.md 2>/dev/null
```
If exists: Offer update/view/skip options.
## Step 3: Gather Phase Context
```bash
# Phase section from roadmap (already loaded in PHASE_INFO)
echo "$PHASE_INFO" | jq -r '.section'
cat .planning/REQUIREMENTS.md 2>/dev/null
cat .planning/phases/${PHASE}-*/*-CONTEXT.md 2>/dev/null
# Decisions from state-snapshot (structured JSON)
node ~/.claude/get-shit-done/bin/gsd-tools.cjs state-snapshot | jq '.decisions'
```
## Step 4: Spawn Researcher
```
Task(
prompt="<objective>
Research implementation approach for Phase {phase}: {name}
</objective>
<context>
Phase description: {description}
Requirements: {requirements}
Prior decisions: {decisions}
Phase context: {context_md}
</context>
<output>
Write to: .planning/phases/${PHASE}-{slug}/${PHASE}-RESEARCH.md
</output>",
subagent_type="gsd-phase-researcher",
model="{researcher_model}"
)
```
## Step 5: Handle Return
- `## RESEARCH COMPLETE` — Display summary, offer: Plan/Dig deeper/Review/Done
- `## CHECKPOINT REACHED` — Present to user, spawn continuation
- `## RESEARCH INCONCLUSIVE` — Show attempts, offer: Add context/Try different mode/Manual
</process>