# Module 5 — The Researcher Role

> The Researcher asks the questions that prevent expensive mistakes.

---

## What Is the Researcher?

The **Researcher** gathers information before execution begins. It finds what already exists, what the best approach is, what the constraints are, and what the risks are — so the Executor doesn't build the wrong thing.

Research is the cheapest phase of any project. A 10-minute Researcher prompt can prevent a 10-hour Executor mistake.

---

## The Researcher's Responsibilities

- Identify what is already known vs. what needs to be found
- Search documentation, codebases, databases, and the web
- Summarize findings in a format the Planner and Executor can act on
- Flag contradictions, gaps, and risks
- **Stop when the question is answered** — not when curiosity is satisfied

---

## What the Researcher Is NOT

| Not the Researcher's job | Who does it |
|--------------------------|-------------|
| Making decisions | Planner |
| Building anything | Executor |
| Checking quality | Reviewer |
| Exhaustive exploration | That's procrastination |

---

## Best Models for Research

| Model | Why |
|-------|-----|
| Claude Opus 4 | Best at synthesizing large documents and nuanced analysis |
| Claude Sonnet 4.5 | Fast research for well-defined questions |
| Gemini 2.5 Flash | Best for large-volume document ingestion (1M context) |
| GPT-4.1 | Good for web-grounded research (with browsing enabled) |

**Rule:** Match the model to the complexity of the question, not the prestige of the task.

---

## Types of Research Tasks

### 1. Codebase Research
*"What does this function do? What calls it? What does it depend on?"*

Tools: Claude Code, Cursor chat, VS Code + Copilot chat  
Output: Summary of purpose, inputs, outputs, dependencies

### 2. Documentation Research
*"What does the Stripe API require for subscription cancellations?"*

Tools: Model with web search, or paste docs directly  
Output: Exact parameters, edge cases, required fields

### 3. Decision Research
*"Should we use Redis or Memcached for session storage at our scale?"*

Tools: Opus or Sonnet with a structured comparison prompt  
Output: Comparison table + recommendation with rationale

### 4. Risk Research
*"What could go wrong if we migrate the database while the app is live?"*

Tools: Opus (for nuanced risk modeling)  
Output: Risk list with likelihood + mitigation options

---

## Writing a Researcher Prompt

```
You are a Researcher. Your question:
[state the specific question]

Context:
[what is already known]

Constraints:
- Answer only the question asked
- If you find conflicting information, list both sides
- End with a one-sentence recommendation

Output format:
- Summary (2-3 sentences)
- Key findings (bullet list)
- Recommendation
- Open questions (if any remain)
```

---

## Researcher in Practice

**Before a build:**
- Research the existing codebase before writing new code
- Research the API docs before calling an endpoint you haven't used
- Research similar solutions before designing your own

**During a build:**
- When the Executor hits a blocker, the Researcher investigates
- When the Reviewer finds a bug, the Researcher finds the root cause

**The rule:** If you're about to make a decision with incomplete information, send in the Researcher first.

---

## Researcher Failure Modes

| Failure | Cause | Fix |
|---------|-------|-----|
| Research never ends | Question too broad | Constrain to one specific question |
| Findings ignored | Output format unusable | Require bullet-point summary |
| Hallucinated sources | Model inventing citations | Require model to quote exact text |
| Over-research | Researcher does the Executor's job | Enforce role separation |

---

## Checkpoint

Before moving on, you should be able to:

- [ ] Identify when research is needed before execution
- [ ] Write a scoped, answerable research question
- [ ] Choose the right model for the type of research
- [ ] Produce a research summary the Planner can act on

---

*Next: [Module 6 — The Reviewer Role](reviewer.md)*
