A pull request description template is a Markdown file in your repository that pre-fills the description box of every new pull request. A good one asks the author for five things: what changed, why, how to test it, what could break, and where the reviewer should look first.
Below is a template you can copy, where GitHub looks for the file, how to keep more than one, a filled-in example, and what reviewers — human and AI — actually use the description for.
The template (copy this)
## What changed
<!-- One or two sentences. What does this PR do? -->
## Why
<!-- The problem this solves, and the issue it closes. -->
Closes #
## How to test
<!-- Steps or commands a reviewer can run. -->
## Risk and rollout
<!-- What could break, how it ships, how to undo it. -->
## Notes for reviewers
<!-- Where to look first. What is deliberately out of scope. -->
## Checklist
- [ ] Tests cover the changed behavior
- [ ] Docs updated, or not needed
- [ ] No secrets or debug output in the diff
The lines in <!-- --> are HTML comments. GitHub
hides them in the rendered description, so they work as prompts for
the author and never show up for the reviewer. The
- [ ] lines render as checkboxes.
What each section is for
- What changed. The change in plain words. If it takes more than two sentences, the PR is probably two PRs.
-
Why. The part the diff cannot tell anyone. On
GitHub,
Closes #123also links the issue and closes it when the PR merges into the default branch. - How to test. Commands or clicks. “Tested locally” is not a test plan.
- Risk and rollout. A flag, a migration, a config change, or “plain deploy, revert the commit to undo.”
- Notes for reviewers. The file to read first, and anything you left out on purpose.
- Checklist. Three boxes people tick honestly beat twelve they tick without reading.
How to save it as .github/pull_request_template.md
-
Create a file named
pull_request_template.mdin the.githubfolder of your repository. - Paste the template and edit the sections to fit your team.
- Commit it and merge it into the repository’s default branch. GitHub only uses templates that are on the default branch.
- Open a new pull request. The description box now starts with your template.
The details, from GitHub’s documentation:
-
GitHub looks in three places: the repository root, the
docs/folder, and the.github/folder..github/keeps it out of the way. -
The filename is not case sensitive, so
PULL_REQUEST_TEMPLATE.mdworks too. The extension can be.mdor.txt. - A template on a feature branch does nothing until it is merged into the default branch.
Multiple pull request templates
For more than one template, create a
PULL_REQUEST_TEMPLATE folder inside
.github/ (or the root, or docs/) and put
one file per template in it:
.github/
PULL_REQUEST_TEMPLATE/
feature.md
hotfix.md
release.md
A template from that folder is chosen with the
template query parameter on the compare URL:
https://github.com/OWNER/REPO/compare/main...my-branch?quick_pull=1&template=hotfix.md
The same URL can
carry other parameters, such as title=Bug+fix or labels=bug,
so a link in your contributing guide or a script can open a
ready-made hotfix PR. An invalid parameter, or one you do not have
permission to use, returns a 404 page.
Start with one template. Add a second only when a kind of change really needs different questions: a hotfix wants “what is the customer impact right now”, a release wants a changelog.
One template for every repository
An organization or personal account can set a default. Create a
public repository named .github and put the template
in it. GitHub uses that file for any repository in the account that
has no pull request template of its own; a repository’s own
template wins. GitHub documents this under
default community health files.
A filled-in example
A made-up pull request, written with the template above:
## What changed
Password reset requests are now limited to 5 per email address per hour.
The sixth request gets a 429 and no email is sent.
## Why
Support reported one address receiving hundreds of reset emails in a day.
The endpoint had no limit of its own.
Closes #482
## How to test
1. `npm test -- reset-limit`
2. Locally: request a reset 6 times for the same address.
The first 5 return 200, the sixth returns 429.
## Risk and rollout
Shared office IPs are not affected: the limit is per email, not per IP.
Behind the `reset_rate_limit` flag, off by default. Turn the flag off to undo.
## Notes for reviewers
Start with `src/auth/reset-limit.ts`.
The old `ResetThrottle` class is deleted on purpose. Nothing called it.
Limits on the login endpoint are out of scope and tracked in #490.
## Checklist
- [x] Tests cover the changed behavior
- [x] Docs updated, or not needed
- [x] No secrets or debug output in the diff
A reviewer who reads only this knows what to expect in the diff, how to check it, and which surprising thing (the deleted class) is intended.
What human reviewers need from the description
- The reason. A reviewer can read what the code does. They cannot read why you chose it.
- A place to start. One file name saves the first five minutes of any review.
- A way to check. If they can run it, they will find things reading alone does not.
- The edges. What is out of scope, so they do not ask for it, and what is risky, so they look harder there.
The first item on our pull request review checklist is “intent is clear.” The description is where that is passed or failed.
What AI reviewers need from the description
An AI PR reviewer reads the description too, as context for the diff. It has even less to go on than a teammate: it was not in the meeting and has not seen the ticket unless you link it. Three habits help:
- State the intent in the first lines. A model judges the diff against what you said you were doing.
- Say what you removed on purpose. A deleted retry or a dropped code path looks like a bug unless the description says it is the point.
-
Link the issue with a closing keyword.
Closes #482is a link a tool can follow.
This is how Mergestorm’s Vortex works, and we build it, so we are not neutral. Vortex reads the pull request title and description along with the diff. It also reads the issues the PR closes. When the description says the PR deletes or deprecates something, Vortex is told not to flag the missing piece as a bug. On a PR that has gone several rounds, a later pass compares where the PR is now with the original title and description, to ask whether it is still the change that was proposed.
Two things to keep out of a description, for any reader: secrets, and instructions aimed at the reviewer bot. A description is context, and a careful tool treats it as untrusted text.
Mistakes that make a template useless
- Too long. A template with ten headings gets deleted wholesale. Keep the sections you would answer on a one-line fix.
- A wall of checkboxes. If CI can check it, let CI check it and take the box out.
-
Restating the diff. “Changed
foo.tsandbar.ts” is already on the Files tab. - Leftover placeholders. An empty “Why” is worse than no heading. Delete a section that does not apply.
The short version
Save a six-section Markdown file as
.github/pull_request_template.md on your default
branch. Ask for what changed, why, how to test, the risk, and where
to look. Write it for a reader who was not there — which now
includes the
AI reviewer on the pull request.