Write a Minimal Reproduction
Added 2026-11-01
Compress the bug to the fewest steps so someone else can reproduce it on the first try.
Here is a bug report. Write a minimal reproduction: 1) environment — version, config, only what matters; 2) input data as the smallest sample, not the whole file; 3) numbered steps, eight at most; 4) expected versus actual; 5) which step can be dropped and still reproduce, and which one cannot; 6) one assertion that would verify the fix. Do not explain the cause, just the reproduction.
Site original
Chinese original
How to use
能一次复现的 bug,才修得快。
Try tweaking it
- Have it restate requirements and constraints before writing code.
- Ask for the smallest change plus a rollback path, not a full-file rewrite.
What you should get
- A minimal, runnable change with copy-ready code
- Impact list: which files and call sites must follow
Common mistakes
- Asking it to touch ten files at once, then losing track of what broke what.
- Pasting only the error, with no code or version, and getting an unfixable answer.
How to check the output
- The change runs, can be rolled back, and touches nothing unrelated.
- Edge cases (empty, oversized, concurrent) are covered or explained.
Where it works
- Good for: having it restate requirements and constraints, then propose the smallest runnable change.
- Watch out: include versions and a minimal reproduction with the error, or the fix may look plausible but not fit.