You finish a branch, paste a vague “write a PR description” prompt into ChatGPT, and get a tidy summary in seconds. It says you added unit tests for expired sessions, confirmed the change on Node 20, and closed a billing incident. You open the diff: there is one production file, no new test file, and you have not run the suite yet. The description is easier to review than the work.
The fix is not a longer prompt about “being accurate.” It is to feed ChatGPT the same change a reviewer will see, then forbid claims that are not in that change or in notes you actually supplied. OpenAI’s own prompting guidance is to be clear and specific, and its help article on factual accuracy warns that ChatGPT can sound confident while inventing details, so important claims need a check against a reliable source.[1][2] GitHub’s review guidance asks for context about the problem, the approach, and where reviewers should look, and it also asks you to review your own pull request first — including whether relevant tests have actually run.[3] A generated summary is a draft. The diff is the evidence.
The walkthrough below is a teaching example. The repository, diff, and ChatGPT outputs were not executed for this article, and they are not a claim about any real pull request.
1. Export the diff the reviewer will actually see
Start by naming the base and the head. For a branch you are about to open against main, a three-dot comparison summarizes what the topic branch introduced since the branches diverged:
git diff main...HEAD > /tmp/pr.diff
git diff --name-status main...HEAD > /tmp/pr.files
git log --oneline main..HEAD > /tmp/pr.commits
If you only want to describe what is currently staged, use git diff --cached and git diff --cached --name-status instead. Do not paste a two-dot comparison, a single commit, or the whole repository “for context” unless you have a reason. Extra files give the model more room to narrate work that is not in this pull request.
If /tmp/pr.diff is empty, stop. That is a result: no changes in the selected range. Check whether you chose the wrong base, forgot to stage files, or are already on the base branch. Do not fall back to nearby commit messages and ask ChatGPT to “still write something useful.”
Commit messages can explain why the work started, but they also collect abandoned directions and merge noise. Treat them as optional context. Treat the selected diff and the --name-status list as the inventory of what changed.
2. Paste a prompt that separates evidence from author notes
Give ChatGPT the file list and the diff first, then any notes you can actually stand behind. Leave a blank if you do not have a ticket, a motivation, or a test result:
Write a pull request description from the materials below only.
Use this structure:
## Summary
## What changed
## Why (only if I supplied a reason)
## How to review
## Test plan
## Risks and open questions
Rules:
- Describe only behavior and files visible in the selected diff or the name-status list.
- If I did not supply a reason, ticket, or user problem, write “Why: not stated” and do not infer business impact.
- In the test plan, list only tests, commands, or manual checks that I said I ran, or test files that appear in the diff. If I ran nothing, write “Not run” and suggest a plan labeled as a suggestion, not as a result.
- Never invent a pass count, CI status, screenshot, benchmark, or “tested on Node 20.”
- Group changes by purpose, not by reciting every line.
- Point reviewers at the first file or behavior to read when the change spans more than one concern.
- Call out dependency, auth, permission, workflow, or data-handling changes when they appear in the diff. Do not claim they are safe.
- If the selected diff is empty, say so and do not describe other commits.
- Plain sentences. No marketing verbs. No emojis.
Author notes (may be incomplete):
Why this change: [not stated / paste a ticket or your own reason]
Tests I ran: [none yet / paste the exact command and result]
Reviewer should know: [optional]
Name-status list:
[paste]
Selected diff:
[paste]
OpenAI recommends starting with a specific request and then refining the output rather than hoping the first pass is final.[1] The first useful refinement is often: “Quote the hunk that supports each bullet in What changed and Test plan. If you cannot quote one, delete the bullet or move it to open questions.”
3. Audit the draft against the file list, not against how finished it sounds
Read the draft with /tmp/pr.files open. Check four things:
- Every changed path in the description appears in the name-status list, with the same status (modified, added, deleted, renamed).
- Every test mentioned in the test plan is either a file in that list or a command you wrote in the author notes, with the result copied as you gave it.
- “Why” does not introduce an incident, customer, or deadline you did not supply.
- Risk notes point at a surface that is actually in the diff. “Might affect performance” with no changed hot path is filler; “this edits session expiry in
src/session.ts” is usable.
Here is a compact fictional diff, only for teaching. Imagine this is the entire selected change:
M src/session.ts
--- a/src/session.ts
+++ b/src/session.ts
@@
- return lookupAccount(session.accountId)
+ if (session.expiresAt <= Date.now()) {
+ return { ok: false, reason: "expired" }
+ }
+ return lookupAccount(session.accountId)
A weak description might say: “Added regression tests for expired sessions, verified locally, and fixed a production login outage.” None of that is in the diff, and the author notes said tests were not run. A tighter draft would say the handler now rejects an expired session before the account lookup, name src/session.ts, write “Why: not stated,” and record “Tests: not run.” It can suggest a manual check or a unit case as a suggestion. It should not claim the suggestion already happened.
If ChatGPT adds a test file, a migration, a feature flag, or a rollback plan that you cannot find in the materials, delete it. If it turns your “none yet” into “tests pass,” send the draft back. GitHub’s advice to self-review before you ask others for review applies to the description as well as the code.[3]
4. Keep the published description honest when you still need to add context
Some facts a reviewer needs will never appear in a diff: the user problem, a linked issue, a screenshot, or the exact command you ran after the draft was written. Add those yourself, in your own words, after you have them. If you later run pnpm test -- session, paste the command and the result you saw. If you did not take a screenshot because there is no UI change, say that screenshots do not apply. Do not ask ChatGPT to “fill in the usual test plan” so the template looks complete.
If the change is large, do not compensate by asking for a longer narrative. GitHub recommends small, focused pull requests when a change grows past one purpose.[3] A model that cannot summarize the diff in a short, evidence-bound description is often telling you the branch is doing more than one job.
The point of this workflow is not a prettier template. It is to stop a reviewer from planning around tests that were never written, or around a motivation that only exists in the generated prose. When the description and the diff disagree, believe the diff.
Disclosure
This is original NeedGPT brand content, prepared by the content team. NeedGPT is an independent third-party ChatGPT Plus/Pro membership top-up and membership-account service. It is not affiliated with OpenAI and is not a ChatGPT mirror.
Sources
Official pages and the public guides listed below were read on 2026-11-15 (Asia/Singapore). The sample diff and ChatGPT wording in this article are teaching fixtures and were not executed.
- OpenAI: Prompt engineering best practices for ChatGPT
- OpenAI: Does ChatGPT tell the truth?
- GitHub: Helping others review your changes

Comments
Join the discussionNo comments yet. Be the first to comment.