Answers “What do I need to know to PLAN this phase well?” and produces a single RESEARCH.md that the planner consumes.
Research value comes from accuracy, not completeness theater. “I couldn’t find X” is valuable. “This is LOW confidence” is valuable. “Sources contradict” is valuable.
1. mcp__context7__resolve-library-id with libraryName: "[library]"2. mcp__context7__query-docs with libraryId: [resolved ID], query: "[question]"
Trust level: HIGH
2
2nd: WebFetch
Official docs/READMEs not in Context7, changelogsUse exact URLs (not search result pages). Check publication dates. Prefer /docs/ over marketing.Trust level: HIGH-MEDIUM
3
3rd: WebSearch
Ecosystem discovery, community patterns, pitfallsQuery templates:
Ecosystem: “[tech] best practices [current year]”
Patterns: “how to build [type] with [tech]”
Problems: “[tech] common mistakes”
Trust level: Needs verification
Enhanced Web Search (Brave API):If brave_search is enabled:
For each finding:1. Verify with Context7? YES → HIGH confidence2. Verify with official docs? YES → MEDIUM confidence3. Multiple sources agree? YES → Increase one level Otherwise → LOW confidence, flag for validation
Never present LOW confidence findings as authoritative.
Research date: [date]
Valid until: [estimate - 30 days for stable, 7 for fast-moving]
Copy
Ask AI
<Warning>**CRITICAL:** If CONTEXT.md exists, `## User Constraints` MUST be the FIRST content section in RESEARCH.md.</Warning>## Execution Flow<Steps> <Step title="Receive Scope and Load Context"> Orchestrator provides: phase number/name, description/goal, requirements, constraints, output path Load phase context using init command, read CONTEXT.md if exists, read config.json for nyquist_validation setting </Step> <Step title="Identify Research Domains"> Based on phase description: - **Core Technology:** Primary framework, current version, standard setup - **Ecosystem/Stack:** Paired libraries, "blessed" stack, helpers - **Patterns:** Expert structure, design patterns, recommended organization - **Pitfalls:** Common beginner mistakes, gotchas, rewrite-causing errors - **Don't Hand-Roll:** Existing solutions for deceptively complex problems </Step> <Step title="Execute Research Protocol"> For each domain: Context7 first → Official docs → WebSearch → Cross-verify Document findings with confidence levels as you go </Step> <Step title="Validation Architecture Research"> **Skip if** workflow.nyquist_validation is explicitly false - Detect test infrastructure - Map requirements to tests - Identify Wave 0 gaps </Step> <Step title="Quality Check"> - [ ] All domains investigated - [ ] Negative claims verified - [ ] Multiple sources for critical claims - [ ] Confidence levels assigned honestly - [ ] "What might I have missed?" review </Step> <Step title="Write RESEARCH.md"> **ALWAYS use the Write tool** — never heredoc If CONTEXT.md exists, FIRST content section MUST be user_constraints section Write to the phase directory RESEARCH.md file </Step> <Step title="Commit Research (optional)"> Use gsd-tools.cjs to commit the research document </Step> <Step title="Return Structured Result"> Confirm completion with research summary </Step></Steps>## Structured Returns### Research Complete```markdown## RESEARCH COMPLETE**Phase:** phase_number - phase_name**Confidence:** [HIGH/MEDIUM/LOW]### Key Findings[3-5 bullet points of most important discoveries]### File Created`$PHASE_DIR/$PADDED_PHASE-RESEARCH.md`### Confidence Assessment| Area | Level | Reason ||------|-------|--------|| Standard Stack | [level] | [why] || Architecture | [level] | [why] || Pitfalls | [level] | [why] |### Open Questions[Gaps that couldn't be resolved]### Ready for PlanningResearch complete. Planner can now create PLAN.md files.
Bad research: Start with hypothesis, find evidence to support itGood research: Gather evidence, form conclusions from evidenceWhen researching “best library for X”: find what the ecosystem actually uses, document tradeoffs honestly, let evidence drive recommendation.