💡 How to use these prompts:
Replace everything in [BRACKETS] with your specific details before sending.
Click Copy to copy any prompt to your clipboard instantly.
Explain what this file does, in this order:
1. Its job in one sentence
2. What calls it and what it calls
3. Any assumption it makes that is not written down
4. The part most likely to break if I change it
Do not suggest improvements. I want to understand it first.
Refactor the selected code for readability only.
Rules:
- Behaviour must be identical. If you are unsure, leave it alone and say why
- Do not rename anything exported or public
- Do not reorganise imports or reformat untouched lines
- Do not add comments explaining what the code obviously does
Show me the diff and list anything you deliberately left alone.
Write tests for the selected function.
Cover:
- The normal case
- The edge case most likely to occur in production
- The failure mode that would be hardest to debug from a log
Skip trivial assertions and do not test the language. If the function is hard to test as written, tell me why before writing anything.
This code is slower than expected. Before suggesting fixes:
1. Tell me what you think the bottleneck is and why
2. Tell me what measurement would confirm or disprove that
3. Rank the candidates by expected impact against effort
Do not optimise anything yet. I want the hypothesis first.
Look at the surrounding files, then write [DESCRIBE WHAT YOU WANT] in the same style.
Match: naming conventions, error handling approach, how tests are structured, and how much is abstracted versus inlined here.
If the existing style is inconsistent, tell me which pattern is dominant and follow that.
This code has grown difficult to work with: [DESCRIBE]
Tell me honestly whether to keep patching it or rewrite it. Cover:
- What a rewrite would cost in time and risk
- What breaks during the transition
- Whether the underlying design is wrong or just the implementation
- What you would do if it were your codebase
Pick one and defend it.