🤖 The AI Prompt That Checks the PR Description Against What the Code Actually Does
A pull request description is written by a human, usually before or during the work, describing what the change is INTENDED to do – and it’s genuinely common for the code to drift from that description as the work evolves: a scope expansion that never made it back into the summary, a mentioned change that got reverted partway through, a side effect the author didn’t think to call out. This prompt asks an AI assistant to compare the two directly, specifically looking for places where they’ve quietly stopped matching.
📋 The Prompt
Here'"'"'s a pull request'"'"'s description and its actual diff. Compare them and tell me specifically where they don'"'"'t match: 1. Anything the description claims the PR does that you can'"'"'t actually find evidence of in the diff 2. Anything the diff clearly changes that the description doesn'"'"'t mention at all - a file, a function, or a behavior that'"'"'s modified but never called out in the summary 3. Any place where the description'"'"'s explanation of WHY a change was made doesn'"'"'t seem to match what the change actually does mechanically, based on reading the code itself For each mismatch found, describe it plainly and specifically enough that I could ask the PR author about exactly that one point. PR description: [PASTE THE PR DESCRIPTION HERE] Diff: [PASTE THE DIFF HERE]
✅ Why This Prompt Works
- Comparing the description against the diff directly, rather than reviewing either one in isolation, is what actually surfaces drift – a description read on its own always sounds plausible, and a diff read on its own is just code; the mismatch only becomes visible once the two are checked against each other specifically.
- Explicitly asking for changes the diff makes that the description never mentions catches undisclosed scope creep – the case where a PR quietly grew beyond what it was originally framed as, which is exactly the kind of thing a reviewer skimming the description alone would have no reason to go looking for in the code.
- Requiring a mismatch to be specific enough to ask the author about directly keeps the output actionable – a reviewer walking into a conversation with ‘you changed the retry logic in PaymentService but the description only mentions the UI update’ is in a completely different position than one who’s only vaguely uneasy that something feels off.
⚠️ Where to Draw the Line
- This finds mismatches between two pieces of TEXT and CODE – it has no way to know whether an undisclosed change was intentional and simply left out of the summary by oversight, or something that genuinely shouldn’t be in this PR at all; that judgment call still belongs to the reviewer and the author, working from what this surfaces.
- A PR with no meaningful mismatches at all is still worth reviewing normally for correctness – this specifically catches drift between description and diff, which is a different (and narrower) concern than whether the code itself is actually correct or well-designed.
A PR description is a claim about the diff, not a guarantee – and the only way to know whether the claim still holds is to actually read the two side by side instead of trusting one to summarize the other.
