---
name: pr-description
description: Write a pull request title and description a reviewer can act on, covering what changed, why, how it was verified, what it risks, and which judgment calls need a second look. Use when opening a PR, when the user asks to "write the PR description", "summarize this diff for review", or "clean up this PR body", or when an agent is about to run gh pr create. Reads the actual diff and commits rather than guessing, and follows the repo's PR template if it has one. Not for reviewing someone else's PR for bugs (use review-to-prs) or for writing commit messages alone.
license: MIT
metadata:
  title: PR Description
  summary: Write a PR title and body from the real diff, covering what changed, why, how it was tested, the risks, and what the reviewer should look at first.
  category: engineering
  tags: [pull-requests, github, code-review, writing]
  version: "1.0.0"
  author: Austin Christensen
  publisher: Christensen Equity
  related: [review-to-prs, coding-agent-handoff, safe-db-migration]
---

# PR Description

A PR description is the reviewer's map. A good one cuts review time and catches problems the diff hides; a bad one ("fixes stuff") makes the reviewer reconstruct intent from code. Write it from the actual changes, not from memory of what you meant to do.

## When to use

- Before running `gh pr create`, or when updating a PR after new commits.
- When the user asks for a PR summary, title, or a tidier body.

## Inputs

- The branch and its base.
- The issue or request it addresses, if any.
- What was actually run to verify it (commands and results).

## Workflow

1. **Read the real change.**
   ```bash
   git fetch origin <base>
   git log --oneline origin/<base>..HEAD
   git diff --stat origin/<base>...HEAD
   git diff origin/<base>...HEAD
   ```
   Note every file touched. Surprising files (lockfiles, config, migrations, CI) need a sentence each.
2. **Find the repo's template.** Check `.github/PULL_REQUEST_TEMPLATE.md`, `.github/pull_request_template.md`, and `docs/`. If one exists, fill in its headings in order and skip only sections that genuinely don't apply. Look at a recent merged PR for tone and length.
3. **Write the title.** Imperative, specific, under about 70 characters, in the repo's style (Conventional Commits if the log uses them): `fix(billing): round invoice totals half-up`, not `Bug fixes`.
4. **Write the body.** Lead with why. Then what changed, grouped by intent rather than file by file. Then verification, risks, and what to review closely.
5. **State verification honestly.** List the commands you ran and their results. If you didn't run something (no local database, CI pending), say so. Never write "tested" for code that wasn't run.
6. **Flag judgment calls.** Any place you chose between two reasonable behaviors gets its own line, so the reviewer approves it knowingly.
7. **Link, don't paste.** Reference issues with `Closes #N` (only when it truly closes them). Add screenshots or recordings for UI changes. Keep logs short.
8. **Re-read as the reviewer.** Could someone who has never seen the issue review this in ten minutes? Cut anything that doesn't help them.

## Output

Fallback structure when the repo has no template:

```markdown
## Why
<The problem or goal in 1-3 sentences. Link the issue.>

## What changed
- <Change grouped by intent, with the key file in backticks>
- <...>

## How I verified it
- `npm test -- invoice` passed (14 tests, 2 new)
- `npm run typecheck` clean
- Manual: created a $10.005 invoice in staging; total shows $10.01

## Risks and rollout
<What could break, who is affected, and how to roll back. "Low: pure function, covered by tests" is a fine answer.>

## Review focus
- <The 1-3 places a reviewer should read most carefully, and why>
- Judgment call: <the choice made and the alternative>

Closes #123
```

## Guardrails

- Describe only what the diff contains. No claimed features, fixes, or test results that aren't there.
- Never include secrets, tokens, customer data, or internal hostnames in the body or screenshots.
- Keep scope honest: if the PR also reformats files or bumps a dependency, say so.
- A breaking change, migration, or new environment variable goes in its own clearly labeled line, not buried in a list.
- If the repo's template asks for credentials or deploy secrets, leave that section out and tell the user.

## Handoff

For schema changes, include the rollout and rollback plan from `safe-db-migration`. When an agent opened the PR, record its URL in the ledger kept by `coding-agent-handoff`.
