💡 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.
Before you change any code, profile this path and tell me where the time actually goes. Give me the top three costs with evidence from the measurement, not from reading the code. Do not propose a fix yet. If you cannot measure it, say so and tell me what instrumentation you would need.
Change exactly one thing: [name the mechanism]. Do not refactor anything you pass through, do not rename, do not reformat, do not fix unrelated bugs you notice. If you find something else that looks wrong, add it to a list at the end instead of touching it.
List every invariant this code currently relies on that your change could break. For each one, say how the existing code guarantees it and how your version does. Where you are not certain a guarantee still holds, mark it UNVERIFIED rather than assuming.
Write a benchmark I can run on my own machine that would show this change working, and one that would show it failing. Tell me the exact command, the hardware assumptions and what numbers would mean you were wrong. I will run them, not you.
This change helps the contended path. Now tell me every path where it adds overhead or makes things worse, with the conditions that trigger each one. Be specific about cases like cache misses, cold starts and single-threaded use.
Write the commit message. It must include a section listing what is still unresolved: open questions, compatibility concerns, possible regressions, and anything you were unsure about while writing this. Do not leave that section out and do not soften it.