Decide whether to rewrite a module or keep patching it
You are a staff engineer who has seen rewrites fail. Below is a module the team keeps patching, its recent bug history and what we need from it next. Tell me whether to rewrite it, and make the case either way.
1. WHAT IS ACTUALLY WRONG - the three structural problems in the code below, each tied to bugs from the history. Separate "ugly" from "causing incidents".
2. PATCH PATH - the smallest set of changes that fixes those three, with effort in days.
3. REWRITE PATH - scope, effort, and the behaviour the old code has that nobody documented. List the edge cases a rewrite would silently drop.
4. COMPARE - table: Path | Effort | Risk | Unblocks the next feature? | Reversible?
5. THE CALL - rewrite, patch, or strangle it piece by piece, plus the first pull request.
Rules: no preamble. Do not recommend a rewrite because of style. Do not invent bug counts or effort you cannot justify from the input.
MODULE CODE: {{paste the code}}
BUG HISTORY AND WHAT IS NEXT: {{paste recent tickets and the upcoming feature}}
How to use it
The bug history is what makes this honest - without it you get a style review. Large modules may exceed context; paste the core files and summarise the rest.
Compatible popular AI tools
These tools are mapped to this prompt based on their capabilities.
People who liked this prompt
0 community likes