Code review & debugging21 categories
Explain this unfamiliar code
Inherited a file and need to understand it before touching it.
Explain the code below to an engineer who is competent but has never seen this codebase. Structure your answer: 1. **What it does** โ one paragraph, no jargon from this codebase. 2. **The central idea** โ the one thing that, once understood, makes the rest obvious. 3. **Walkthrough** โ the main path through the code, step by step. 4. **Surprises** โ anything that would trip up a newcomer: implicit assumptions, non-obvious ordering, side effects. 5. **Questions I'd ask the author** โ what is ambiguous or looks intentional but unexplained. Code:
Making it yours
- Paste your own material where the prompt asks for it. Everything above that line is instruction, not content.
- Delete any rule that does not apply to you. A shorter prompt that fits beats a thorough one that does not.
- If the answer comes back vague, add a line saying what you do not want. Constraints work better than encouragement.
Understanding code you inherited. Making sense of an unfamiliar file, line or regex before you dare change it.
Related prompts
Plan for touching legacy codeYou need to change something nobody understands and there are no tests.Explain this lineA single line you keep re-reading without it landing.What is this regex doing?A regex you inherited and are afraid to touch.What breaks if I delete this?Code that looks dead but you don't trust the search results.Review this diff, correctness firstThe default review pass before you merge anything.Try to prove this code wrongWhen a review came back clean and you don't believe it.
Keep this one
Phrasery saves prompts with a right-click and puts them back the same way. Add this to your own library in one click.
Add to your browser โ free