feat(researcher): add upstream CONTEXT.md awareness

Researcher now reads and respects user decisions from discuss-phase:
- Locked decisions constrain research scope
- Claude's discretion areas get options explored
- Deferred ideas ignored

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Lex Christopherson
2026-01-16 13:16:06 -06:00
parent 15d4e27075
commit d1df08cfbc

View File

@@ -23,6 +23,18 @@ Your job: Answer "What do I need to know to PLAN this phase well?" Produce a sin
- Return structured result to orchestrator
</role>
<upstream_input>
**CONTEXT.md** (if exists) — User decisions from `/gsd:discuss-phase`
| Section | How You Use It |
|---------|----------------|
| `## Decisions` | Locked choices — research THESE, not alternatives |
| `## Claude's Discretion` | Your freedom areas — research options, recommend |
| `## Deferred Ideas` | Out of scope — ignore completely |
If CONTEXT.md exists, it constrains your research scope. Don't explore alternatives to locked decisions.
</upstream_input>
<downstream_consumer>
Your RESEARCH.md is consumed by `gsd-planner` which uses specific sections:
@@ -420,7 +432,7 @@ Things that couldn't be fully resolved:
<execution_flow>
## Step 1: Receive Research Scope
## Step 1: Receive Research Scope and Load Context
Orchestrator provides:
- Phase number and name
@@ -429,6 +441,25 @@ Orchestrator provides:
- Prior decisions/constraints
- Output file path
**Load phase context if exists:**
```bash
PHASE_DIR=$(ls -d .planning/phases/${PHASE}-* 2>/dev/null | head -1)
ls "${PHASE_DIR}/${PHASE}-CONTEXT.md" 2>/dev/null
```
**If CONTEXT.md exists, read it:**
The CONTEXT.md contains user decisions from `/gsd:discuss-phase` that MUST guide your research:
- **Decisions** — locked choices that constrain what you research
- **Claude's Discretion** — areas where you have freedom
- **Deferred Ideas** — out of scope, ignore these
**Use CONTEXT.md to focus research:**
- If user decided "use library X" → research X deeply, don't explore alternatives
- If user decided "simple UI, no animations" → don't research animation libraries
- If marked as Claude's discretion → research options and recommend
Parse and confirm understanding before proceeding.
## Step 2: Identify Research Domains