A good pull request (PR) has at least three key components. Together, they safeguard against errors, speed up the review process and document the decision-making process.
I’ll explain each component and provide a full PR example at the end.
What?
Describe your changes clearly.
Someone should be able to read this section and comprehend how this is reflected in the changes they’ll be reviewing. This is a place to describe the changes conceptually. Explain what is the purpose of this PR and what you’re expecting it to achieve, as well as the mechanisms you’re using to achieve it.
Aside from clarifying the key changes, it’s useful to highlight some of the “weird” decision-making. Expect the comments before-hand and preemptively resolve them. Build more context without being asked for it.
As a rule of thumb, a reviewer should have enough context from this section alone, to be able to conceptually approve or decline the PR after reading the code. Provide enough context, but not so much that it becomes clutter. Don’t forget to use formatting.
Why?
Describe the purpose and the value of your changes. Instant documentation.
Any review is insufficient without a deep understanding of the purpose of the changes. A reviewer should understand why something is being done, so make this transparent. Explain how this impacts the team, the company, the process, or whatever feels the most suiting for the task at hand.
Are we fixing invalid behavior? Are we introducing a new feature? Are we slowly migrating something and this is part 1/16? Are we trying to reduce error clutter? Are we doing damage control? Why do we need to merge this PR?
Your goal is to write something understandable by a cross-team member in the next 6-12 months during a production outage investigation. Once someone’s frantically going over the commits, you want to make sure you help them as much as you can.
This is done by being explicit and transparent.
Metadata
Add more context to the issue. Link Jira tickets, Slack threads, Notion documents, related PRs, etc.
With this section, you provide the reviewer an opportunity to dig deeper and find out more about the issue. You provide the opportunity for easier future investigations, leading to the root cause. You also gather all relevant information in a single place, making it easier on yourself as well.
Don’t treat this as a garbage bit, just because it has a vague name. Link with captions and intentionality. If it isn’t relevant, or if it will sidetrack people simply don’t include it.
It is your responsibility to cater the reader’s experience. Be intentional, people will appreciate it.
Example
This might seem like overkill when you’re just trying to merge a few lines of code. But this is one of those habits that compound over time. Writing better PRs forces you to slow down and think more clearly. It helps your teammates, makes reviews faster, and builds long-term documentation without extra work.
It’s a small investment that pays dividends.
What you get from day one
When your colleagues can’t stand your industry rants anymore, you start venting on Substack. And in that tone - welcome to my newsletter!
Solid brotha 💪