Free to read · no account needed

16 min · code

Write a PR description that helps reviewers

Goal: Turn a messy change into a clear pull-request summary—then you verify every file and test step before you open the PR.

Best for: First PRs, small-team reviews, hotfix communication.

Reviewers should not reverse-engineer your intent from a 40-file diff. AI can draft Why / What / How to test / Risk. It must not invent files, tickets, or test results you never ran.

Why beginners skip this

“Just fix it” on “Turn a messy change into a clear” skips the explain pass that catches the wrong layer The fix is one dated pass/fail on a live artifact for “Turn a messy change into a clear”—not another bookmark. If you cannot name what you will refuse this week, you are still collecting titles

Step 1 — PR template prompt

Do this step with a real artifact open—not from memory.

From this diff summary, write a PR description:
## Why
## What changed
## How to test

## Risk
Rules:
- Do not invent files, tickets, or screenshots I did not mention
- Keep under 180 words
- How to test must be steps I can run
- If tests were not run, say Not run yet
Summary:
[paste]

Step 2 — Null-check hotfix

Example

Filled prompt

Messy branch: 12 files including accidental .env.example tweak.
PR body must list every file; flag .env.example for remove-from-PR.

What good output looks like

  • Why names the user-visible null when cart.coupon is missing
  • What changed stays on the null check + checkout.test.ts only
  • How-to-test gives a local command or click path you can run
  • Risk admits coupon edge cases—not “no risk”
  • No invented Jira ID or “CI already green” claim

Step 3 — Human gate before “Create pull request”

  • Diff still matches the What section?
  • You actually ran at least one How-to-test step?
  • Secrets absent from the PR body and screenshots?
Tighten this PR body: remove any claim about CI or coverage I did not state. Keep under 150 words.

Example

Filled prompt

Tighten this PR body. Remove any claim about CI or coverage I did not state. Keep under 150 words. Keep Why/What/How-to-test/Risk.
Draft:
Why: cart crashed when coupon missing.
What: null check in checkout.ts + unit test.
How to test: npm test checkout.test.ts
Risk: other coupon edge cases.
(Do not add “CI green” or coverage %.)

What good output looks like

  • PR body under 150 words after the tighten pass
  • Removes any CI/coverage sentence you did not state
  • How-to-test still lists at least one runnable step
  • Risk line stays honest about coupon edge cases—not “no risk”
  • You can open the PR without a second fact scrub

Diff in, vibes out

Draft PR text from the diff summary you paste. Delete invented ticket numbers.

How-to-test must be runnable

“Works for me” is not a test plan. Write the command, the click path, or “Not run yet.” Reviewers trust an honest Not run more than a fake green check.

Example

Filled prompt

PR leaves console.log of user email.
Body must flag risk + remove-before-merge checklist + honest file list.
Context: real workstream this week (Asia/Shanghai). Name actual files/people.
Constraints: no invented metrics/owners/prices; label Unknowns; stop before send/delete/pay.
Done check: I can mark pass/fail in one minute on the output.

What good output looks like

  • Names files/functions you provided for “Turn a messy change into a clear pull-request summ”
  • No secrets in logs; no mystery whole-repo rewrite
  • Explain-before-patch or minimal repro respected
  • Pass/fail: you can restate the change in 3 bullets

Red flag

No risk section; “tests passed locally” with no command; description disagrees with the diff—rewrite.

Save this card

Card: PR text from the diff you paste; never invent tickets, CI, or mystery owners. Keep this beside the tool; read before you start.

1. What I shipped: ___ 2. What I refused: ___ 3. What I will never-do again: ___ (date: Asia/Shanghai)

  • [ ] Tools/writes paused
  • [ ] Refuse-line dated
  • [ ] Artifact path saved
  • [ ] Next link chosen (or stop)

Before you start

Open the failing test, diff, or ticket for “Turn a messy change into a clear.” Keep secrets out of the chat. Have the file path you will name. Guide: code-pr-description-that-helps. If you only have a blank practice box, stop and fetch the real job first.

  • Goal in one line: ___
  • Allowed tools: ___
  • Forbidden: ___
  • Human approve needed for: ___

How to use this week

For your next PR, paste a short diff summary (not vibes) and ask for Why / What / How to test / Risk under 180 words. Delete any invented Jira IDs or “CI green” claims you did not run. Ship the artifact out of chat (doc/PR/note) so the week leaves a file, not only a thread—date it Asia/Shanghai.

Mid-week cost check: if this habit disappeared tomorrow, what breakages would you notice in 24 hours? Write one line (Asia/Shanghai).

Pitfalls

PitfallFix
Pasting the entire diff blindlySummarize; attach diff in the host tool
Invented ticket linksLeave “No ticket yet”
“How to test: works for me”Steps another person can follow
Hiding riskOne honest risk line builds trust

Example

Filled prompt

Temptation: skip the habit for code-pr-description-that-helps to “save five minutes.”
Job still: Turn a messy change into a clear
Do the smallest correct pass: Done visible · one checkable artifact · Unknowns labeled [?].
Boundaries: draft only; no silent send; no invented metrics.
Return: the artifact + the refuse-line you said aloud.

What good output looks like

  • Names the shortcut you refused (specific to code-pr-description-that-helps)
  • Still delivers a checkable artifact for “Turn a messy change into a clear”
  • Unknowns labeled; draft-only respected
  • Pass/fail: refuse-line written and dated (code-pr-description-that-helps #4)

Practice now

Live card: one real code change under “Write a PR description that helps reviewers”—diff-only + test note (Asia/Shanghai).

Today: take one real change. Fill Why (user-visible), What (files you touched), How to test (commands or clicks), Risk (one honest line). Ban ticket numbers you do not have.

Today card (copy) — code-pr-description-that-helps: 1. Artifact I will produce: ___ 2. Pass/fail check: ___ 3. Refuse-line if tempted to skip verify/send: ___ (date: Asia/Shanghai) 4. One never-do from this guide: ___

  • [ ] Artifact path written
  • [ ] Refuse example would say "yes"
  • [ ] Dated Asia/Shanghai

One sentence takeaway

PR text from the diff you paste; never invent tickets, CI, or mystery owners. This week: ship one PR with motive / change / test / risk filled.

  • You can point to a dated refuse-line
  • You have one artifact path from tonight
  • You can teach the red flag in one sentence

Next

Code review checklist · Explain then change · Tests with the model · Minimal repro first

Pair with today: open the first Next link (claude-code-review-checklist) only after you dated a refuse-line for this guide (Asia/Shanghai).

← Back to home · Learn · Tools · Compare · Start