Skip to main content

Phase Researcher Agent

The phase researcher agent investigates the technical domain of a phase before planning begins, producing RESEARCH.md that guides plan creation.

Purpose

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.

When Invoked

Spawned by:
  • /gsd:plan-phase (integrated research)
  • /gsd:research-phase (standalone research)

Upstream Input: CONTEXT.md

If CONTEXT.md exists from /gsd:discuss-phase, it constrains research: Examples:
  • User decided “use library X” → research X deeply, don’t explore alternatives
  • User decided “simple UI, no animations” → don’t research animation libraries
  • Marked as Claude’s discretion → research options and recommend

Downstream Consumer: Planner

Your RESEARCH.md is consumed by gsd-planner:
Be prescriptive, not exploratory. “Use X” not “Consider X or Y.”

What It Does

1. Tool Strategy

Tool Priority:
1

1st: Context7 (highest priority)

Library APIs, features, configuration, versions
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:
Provides independent index with less SEO spam and faster responses.

2. Verification Protocol

WebSearch findings MUST be verified:
Never present LOW confidence findings as authoritative.

3. Claude’s Training as Hypothesis

Training data is 6-18 months stale. Treat pre-existing knowledge as hypothesis, not fact. The discipline:
  1. Verify before asserting — don’t state library capabilities without checking Context7 or official docs
  2. Date your knowledge — “As of my training” is a warning flag
  3. Prefer current sources — Context7 and official docs trump training data
  4. Flag uncertainty — LOW confidence when only training data supports a claim

4. Discovery Levels

Level 0 - Skip (pure internal work, existing patterns only)
  • ALL work follows established codebase patterns (grep confirms)
  • No new external dependencies
Level 1 - Quick Verification (2-5 min)
  • Single known library, confirming syntax/version
  • Action: Context7 resolve-library-id + query-docs, no DISCOVERY.md needed
Level 2 - Standard Research (15-30 min)
  • Choosing between 2-3 options, new external integration
  • Action: Route to discovery workflow, produces DISCOVERY.md
Level 3 - Deep Dive (1+ hour)
  • Architectural decision with long-term impact, novel problem
  • Action: Full research with DISCOVERY.md
For niche domains (3D, games, audio, shaders, ML), suggest /gsd:research-phase before plan-phase.

What It Produces

RESEARCH.md Structure

Location: .planning/phases/XX-name/{phase_num}-RESEARCH.md

Architecture Patterns

Pattern 1: [Pattern Name]

What: [description] When to use: [conditions] Example:

Anti-Patterns to Avoid

  • [Anti-pattern]: [why it’s bad, what to do instead]

Don’t Hand-Roll

Key insight: [why custom solutions are worse in this domain]

Common Pitfalls

Pitfall 1: [Name]

What goes wrong: [description] Why it happens: [root cause] How to avoid: [prevention strategy] Warning signs: [how to detect early]

Code Examples

Verified patterns from official sources:

[Common Operation 1]

State of the Art

Deprecated/outdated:
  • [Thing]: [why, what replaced it]

Open Questions

  1. [Question]
    • What we know: [partial info]
    • What’s unclear: [the gap]
    • Recommendation: [how to handle]

Validation Architecture

Skip this section entirely if workflow.nyquist_validation is explicitly set to false in .planning/config.json.

Test Framework

Phase Requirements → Test Map

Sampling Rate

  • Per task commit: quick run command
  • Per wave merge: full suite command
  • Phase gate: Full suite green before /gsd:verify-work

Wave 0 Gaps

  • test file path — covers requirement ID
  • {tests/conftest.py} — shared fixtures
  • Framework install: {command} — if none detected

Sources

Primary (HIGH confidence)

  • [Context7 library ID] - [topics fetched]
  • [Official docs URL] - [what was checked]

Secondary (MEDIUM confidence)

  • [WebSearch verified with official source]

Tertiary (LOW confidence)

  • [WebSearch only, marked for validation]

Metadata

Confidence breakdown:
  • Standard stack: [level] - [reason]
  • Architecture: [level] - [reason]
  • Pitfalls: [level] - [reason]
Research date: [date] Valid until: [estimate - 30 days for stable, 7 for fast-moving]

Philosophy

Honest Reporting

  • “I couldn’t find X” is valuable (now we know to investigate differently)
  • “This is LOW confidence” is valuable (flags for validation)
  • “Sources contradict” is valuable (surfaces real ambiguity)
Avoid: Padding findings, stating unverified claims as facts, hiding uncertainty behind confident language.

Research is Investigation, Not Confirmation

Bad research: Start with hypothesis, find evidence to support it Good research: Gather evidence, form conclusions from evidence When researching “best library for X”: find what the ecosystem actually uses, document tradeoffs honestly, let evidence drive recommendation.

Source Hierarchy

Priority: Context7 → Official Docs → Official GitHub → Verified WebSearch → Unverified WebSearch

Planner

Consumes RESEARCH.md to create plans

Project Researcher

Researches entire project ecosystem