# Reproduce → diagnose → fix

Source: https://refyneit.com/prompts/reproduce-diagnose-fix

Debug from a confirmed reproduction and competing hypotheses instead of guessing at a patch.

## When to use it

The prompt makes reproduction and falsifiable hypotheses gates before editing, so a plausible patch is not mistaken for a demonstrated fix.

## Prompt

Debug [BUG OR FAILURE] in this repository.

Work in this order:
1. Read the relevant repository guidance, error output, recent changes, and nearby tests.
2. Reproduce the failure before editing. Record exact steps, expected behavior, actual behavior, environment details, and the smallest useful error/log excerpt. If reproduction is impossible, say why and gather the strongest available evidence instead.
3. Trace the affected execution path and form at least two specific root-cause hypotheses. Rank them and define a falsifying check for each.
4. Test the hypotheses. Do not suppress errors, weaken tests, or add a broad fallback as a substitute for understanding the cause.
5. Implement the smallest fix that addresses the confirmed cause and follows existing project patterns.
6. Add or update a regression test that fails before the fix and passes after it.
7. Run the targeted test, the original reproduction, and the relevant broader checks.

Finish with:
- Root cause
- Fix and files changed
- Proof, including commands and results
- Remaining risks or adjacent issues you deliberately did not change

## Adaptation and provenance

Condensed and made tool-neutral from GitHub Awesome Copilot's Debug Mode Instructions.

Contributor: [@aaronpowell](https://github.com/aaronpowell)
Repository: https://github.com/github/awesome-copilot
Pinned commit: b95e24caae4f25c5985f8527fd092ccfed039c36
License: [MIT](https://github.com/github/awesome-copilot/blob/b95e24caae4f25c5985f8527fd092ccfed039c36/LICENSE)
- [debug](https://github.com/github/awesome-copilot/blob/b95e24caae4f25c5985f8527fd092ccfed039c36/agents/debug.agent.md)
Review: source-reviewed, 2026-08-23. Compared with the commit-pinned source and adapted into a tool-neutral, copy/paste request. This is a non-visual task, so no output artifact is required.
