Skip to content
mentoor

Topic 3 of 5 · 5 min read

Honest PR descriptions for agent work

Goal: Rewrite an agent-drafted PR description so every claim about scope and testing matches the diff and CI results.

A pull request description is a set of claims, and every claim must be checkable against the diff or the CI run. Agents write fluent descriptions that overstate: "added tests", "no breaking changes", "fully backwards compatible". You are the one who signs your name under it.

Check yourself · 1 of 3

What is the best way to treat an agent-written PR description?

Choose one answer

Why it matters

Reviewers use the description to decide where to look. If it says "refactor only, no behaviour change" and the diff alters a default, the review goes to the wrong place. A description also stays in history: months later it explains why a change was made. Google's engineering guide asks for a change description to say what changed and why, in a form a future reader can use.

How to do it

Keep a fixed structure, and put it in the agent's memory file so drafts follow it:

  1. What changed. Two or three plain sentences. Name the files or areas.
  2. Why. The ticket, the bug, the user need.
  3. How it was verified. The exact commands run and their result: "ran pnpm test billing, 42 passed". Link the CI run.
  4. Not tested or not done. Say plainly what is missing: no test for the empty cart, migration not tried on production-sized data.
  5. Risk and rollback. What could break, and how to undo it.

Then audit each claim. For every sentence, find its proof: a hunk, a test name, a CI job. A claim with no proof gets removed or fixed. Check numbers against the diff stats, and check "no behaviour change" by reading changed defaults, conditions and removed lines.

Before and after

Before, drafted by the agent:

Refactored the order module and added comprehensive tests.
All existing functionality preserved. No breaking changes.

The diff adds two tests, changes a default page size from 20 to 50 and deletes one test file. After your rewrite:

Moves price calculation into price.ts. Adds 2 tests for rounding.
Changes default page size from 20 to 50 (intended, see ISSUE-212).
Removes legacy-orders.test.ts (feature removed in v3).
Verified: unit tests pass in CI run 5521. Not tested: export endpoint.

What goes wrong

  • Overclaiming tests. "Comprehensive" when two happy-path tests were added.
  • Silent behaviour changes hidden under "refactor".
  • Missing deletions. Removed tests or code never mentioned.

Examples

Claim versus diff

Agent draft: 'Fixed the login bug and added tests.' The diff shows one test added, but it only covers a valid password. The failing case from the bug report (expired token) has no test. Rewrite: 'Fixes token expiry check. Adds one test for valid login. Expired-token path is not yet covered.'

A reusable template

## What
## Why
## Verified (commands and CI link)
## Not tested
## Risk and rollback

Put this template in the memory file and tell the agent to leave a section empty rather than invent content for it.

Key points

  • Treat the description as a list of claims, each of which needs a hunk, a test or a CI run behind it.
  • Use a fixed structure: what changed, why, how it was verified, what is not tested, risk and rollback.
  • Name the exact commands run and link the CI result instead of writing 'all tests pass'.
  • Say what is untested; an honest gap is more useful to a reviewer than a confident blanket claim.
  • Compare 'no behaviour change' against changed defaults, conditions and deleted tests.

Common mistakes

  • Pasting the agent's description without reading the diff.
  • Accepting 'comprehensive tests' or 'fully backwards compatible' without evidence.
  • Leaving out deleted or weakened tests.
  • Writing only what changed and never what is untested.

Check yourself · 2 of 3

Which line belongs in an honest PR description?

Choose one answer

Check yourself · 3 of 3

A draft says 'refactor only, no behaviour change', but the diff changes a default timeout from 5 to 30 seconds. What do you do?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic