# Test-Driven Bug Hunting With Reproduction Agents

| Field | Value |
| --- | --- |
| Content type | [Writing](https://dopamine-prompt.com/en/type/writing) |
| Models | [GPT](https://dopamine-prompt.com/en/model/gpt) |
| License | [CC0](https://creativecommons.org/publicdomain/zero/1.0/) |
| Source | Submitted by [zara\_h](https://dopamine-prompt.com/en/u/db5a83d6-137d-47bc-9298-bfe1417a792e) |
| Last updated | 2026-11-26 |

## Prompt

```
Bug report: ${bug}. Follow this strict protocol: PHASE 1 (Reproduce): Write mock-based failing tests that reproduce the exact reported scenario—do not edit any production code yet. Show me the failing test output. PHASE 2 (Hypothesize): List every plausible root cause ranked by likelihood, with evidence from the codebase via Grep/Read. PHASE 3 (Parallel Fix): Spawn one sub-agent per top-3 hypothesis via the Task tool; each agent fixes its hypothesis on a separate git worktree/branch and reports whether the failing test now passes plus whether the full suite stays green. PHASE 4 (Synthesize): Recommend which fix to merge and why, then commit. Refuse to skip phases.
```

## Words you can change

The words in brackets in the prompt can be replaced with your own.

- `{bug}`: Type your own.

Web page: <https://dopamine-prompt.com/en/prompts/test-driven-bug-hunting-with-reproduction-agents>
