Investigation Workflow
Investigation is a separate phase from implementation. It produces a durable artifact — a research note in docs/research/<topic>.md — that captures what's true today, the viable approaches, and the recommendation with its tradeoff. The artifact survives the conversation; future contributors can reach for it.
When to use
- The user explicitly asks for investigation, research, a proposal, options, or "how would we approach X".
- A non-trivial structural decision is on the table: new dependency, new architectural pattern, framework choice, contract change, cross-cutting refactor.
- The decision passes the same bar as an ADR: hard to reverse, surprising-without-context, or the result of a real trade-off.
When to skip
- One obvious approach (typo fixes, config tweaks, mechanical refactors).
- Pure execution of an already-decided plan.
- Bug fixes that don't change architecture.
Phases
Each phase is a stop. Don't start the next until the previous is grounded.
1. Survey the current state — read first, claim later
Do not work from impressions. Read the relevant files and ground every claim in the artifact in something cite-able (path:line). Specifically check:
- The relevant code paths. Read entire functions, not just headers. If a behavior is being challenged, read the test that pins it.
- Existing ADRs (
docs/adr/). A prior decision may already constrain the space — surface it; do not relitigate without flagging.
CONTEXT.md if the topic touches domain language. Get the terms right before writing anything down.
- Feature docs (
docs/features/) for acceptance criteria already committed.
- Open follow-ups in the codebase (TODO/FIXME) related to the topic.
- Known Issues Ledger (
docs/known-issues.md). Check for historical "surprises" or wire-shape drifts found during past end-to-end verifications in this area. Learning from past failures prevents repeating them.
The Context section of the artifact lists what you found, with citations. Not what you guessed.
2. Map the design space — 2 to 3 options
Aim for 2 to 3 genuinely viable options. One option is not a design space; six is performance art. For each option capture:
- Approach — one or two sentences. Concrete, not abstract.
- Pros — what makes this attractive.
- Cons — what hurts. Don't soft-pedal — if you'd reject the option later, name the reason now.
- Fit with project — does it align with existing ADRs, conventions, the level of ceremony the team uses? Misfit isn't disqualifying but should be explicit.
- Main tradeoff — one line. The thing being accepted if this option is picked.
If you found only one option, say so and explain why other paths were ruled out. Do not pad with strawmen.
3. Recommend — with reasoning
Pick one option. Name it. Give explicit reasoning. Name the tradeoff being accepted. If the recommendation genuinely depends on user preference, say which preferences map to which option — do not punt the decision back without structure.
4. Checkpoint questions
Identify the user decisions that must land before any code does. Examples:
- "Do you want X or Y?"
- "Is the team OK with adding dependency Z?"
- "Should I draft an ADR first or start the implementation?"
Each question should be answerable; if it's open-ended, sharpen it.
5. (Optional) Independent review
For high-stakes artifacts — specs, ADRs, anything load-bearing for cross-team alignment — spawn an independent reviewer agent (e.g., general-purpose) with a self-contained brief and the artifact path. Do not delegate the synthesis; ask for a critique against specific axes (correctness, completeness, internal consistency).
The artifact
Save the research note to docs/research/<short-topic>.md. Use templates/research-note.md as the skeleton. Create docs/research/ lazily on first use.
The note must include:
- Context with citations.
- Options — 2 to 3, each with the five fields above.
- Recommendation with reasoning and the accepted tradeoff.
- Checkpoint questions the user must answer.
- Out of scope — explicit, so adjacent decisions don't silently leak in.
Rules
- Do not start implementing inside the investigation. Stop at the artifact and the recommendation; wait for the user to choose.
- Do not narrow to one option silently. If only one option survives, the artifact must explain why the others were ruled out.
- Do not conflate research with planning. A plan executes a chosen option; research surfaces options.
- Do not skip the artifact for "small" investigations. The discipline of writing it is the value; the durable trail is the bonus.
- Do not add a Recommendation that just lists the options again. Pick one.
Handoff
Once the user picks an option:
- Mark the research note Decided and bold the chosen option in the Recommendation section.
- If the decision is hard-to-reverse / surprising-without-context / the result of a real tradeoff → write an ADR (use
grill-plan, or write directly into docs/adr/). Link the ADR back from the research note.
- If a concrete feature is now being built → run
feature-doc next; link it from the research note.
- If the chosen option requires later validation → leave the research note Open and add a "Follow-ups" section.
1---2name: investigate3description: Use when the user asks for investigation, research, a proposal, or "options" before any code lands; or proactively for non-trivial structural decisions (new dependency, framework choice, API contract change, cross-cutting refactor). Triggered by phrases like "investigate X", "research Y", "give me a proposal", "what are our options", "how would we approach", "let's explore", "should we...". Produces a durable research note in `docs/research/<topic>.md`. Skip for tasks where one obvious approach exists (typo fixes, config tweaks, mechanical refactors). Pairs with `feature-doc` (captures *what* we're building once a direction is chosen) and `grill-plan` (stress-tests a chosen plan).4---56# Investigation Workflow78Investigation is a separate phase from implementation. It produces a durable artifact — a research note in `docs/research/<topic>.md` — that captures what's true today, the viable approaches, and the recommendation with its tradeoff. The artifact survives the conversation; future contributors can reach for it.910## When to use1112- The user explicitly asks for investigation, research, a proposal, options, or "how would we approach X".13- A non-trivial structural decision is on the table: new dependency, new architectural pattern, framework choice, contract change, cross-cutting refactor.14- The decision passes the same bar as an ADR: hard to reverse, surprising-without-context, or the result of a real trade-off.1516## When to skip1718- One obvious approach (typo fixes, config tweaks, mechanical refactors).19- Pure execution of an already-decided plan.20- Bug fixes that don't change architecture.2122## Phases2324Each phase is a stop. Don't start the next until the previous is grounded.2526### 1. Survey the current state — read first, claim later2728Do not work from impressions. Read the relevant files and ground every claim in the artifact in something cite-able (`path:line`). Specifically check:2930- **The relevant code paths.** Read entire functions, not just headers. If a behavior is being challenged, read the test that pins it.31- **Existing ADRs** (`docs/adr/`). A prior decision may already constrain the space — surface it; do not relitigate without flagging.32- **`CONTEXT.md`** if the topic touches domain language. Get the terms right before writing anything down.33- **Feature docs** (`docs/features/`) for acceptance criteria already committed.34- **Open follow-ups** in the codebase (TODO/FIXME) related to the topic.35- **Known Issues Ledger** (`docs/known-issues.md`). Check for historical "surprises" or wire-shape drifts found during past end-to-end verifications in this area. Learning from past failures prevents repeating them.3637The Context section of the artifact lists what you found, with citations. Not what you guessed.3839### 2. Map the design space — 2 to 3 options4041Aim for 2 to 3 genuinely viable options. One option is not a design space; six is performance art. For each option capture:4243- **Approach** — one or two sentences. Concrete, not abstract.44- **Pros** — what makes this attractive.45- **Cons** — what hurts. Don't soft-pedal — if you'd reject the option later, name the reason now.46- **Fit with project** — does it align with existing ADRs, conventions, the level of ceremony the team uses? Misfit isn't disqualifying but should be explicit.47- **Main tradeoff** — one line. The thing being accepted if this option is picked.4849If you found only one option, say so and explain why other paths were ruled out. Do not pad with strawmen.5051### 3. Recommend — with reasoning5253Pick one option. Name it. Give explicit reasoning. Name the tradeoff being accepted. If the recommendation genuinely depends on user preference, say which preferences map to which option — do not punt the decision back without structure.5455### 4. Checkpoint questions5657Identify the user decisions that must land before any code does. Examples:5859- "Do you want X or Y?"60- "Is the team OK with adding dependency Z?"61- "Should I draft an ADR first or start the implementation?"6263Each question should be answerable; if it's open-ended, sharpen it.6465### 5. (Optional) Independent review6667For high-stakes artifacts — specs, ADRs, anything load-bearing for cross-team alignment — spawn an independent reviewer agent (e.g., `general-purpose`) with a self-contained brief and the artifact path. Do not delegate the synthesis; ask for a critique against specific axes (correctness, completeness, internal consistency).6869## The artifact7071Save the research note to `docs/research/<short-topic>.md`. Use [`templates/research-note.md`](./templates/research-note.md) as the skeleton. Create `docs/research/` lazily on first use.7273The note must include:74- **Context** with citations.75- **Options** — 2 to 3, each with the five fields above.76- **Recommendation** with reasoning and the accepted tradeoff.77- **Checkpoint questions** the user must answer.78- **Out of scope** — explicit, so adjacent decisions don't silently leak in.7980## Rules8182- Do **not** start implementing inside the investigation. Stop at the artifact and the recommendation; wait for the user to choose.83- Do **not** narrow to one option silently. If only one option survives, the artifact must explain why the others were ruled out.84- Do **not** conflate research with planning. A plan executes a chosen option; research surfaces options.85- Do **not** skip the artifact for "small" investigations. The discipline of writing it is the value; the durable trail is the bonus.86- Do **not** add a Recommendation that just lists the options again. Pick one.8788## Handoff8990Once the user picks an option:9192- Mark the research note **Decided** and bold the chosen option in the Recommendation section.93- If the decision is hard-to-reverse / surprising-without-context / the result of a real tradeoff → write an ADR (use `grill-plan`, or write directly into `docs/adr/`). Link the ADR back from the research note.94- If a concrete feature is now being built → run `feature-doc` next; link it from the research note.95- If the chosen option requires later validation → leave the research note Open and add a "Follow-ups" section.