cd /news/developer-tools/how-to-write-a-pull-request-descript… Β· home β€Ί topics β€Ί developer-tools β€Ί article
[ARTICLE Β· art-46247] src=dev.to β†— pub= topic=developer-tools verified=true sentiment=↑ positive

How to Write a Pull Request Description with AI

A developer outlines a workflow using AI tools like ChatGPT, Claude, or Gemini to generate pull request descriptions from git diffs, reducing writing time from 15 minutes to under 2 minutes. The method involves extracting the diff, prompting an AI with a structured template, and optionally creating a PR template for team consistency. The approach aims to improve code review quality by lowering the friction of writing detailed descriptions.

read3 min views1 publishedJul 1, 2026

Writing a good PR description takes longer than it should. You've already done the hard work β€” the code is done β€” but now you're staring at a blank text box trying to summarize context, motivation, and testing notes while your brain is already on the next task. AI handles this well. Here's a step-by-step walkthrough you can use today.

Bad PR descriptions slow down review cycles. Reviewers ask questions that are already answered in the diff, or they approve without really understanding the change. The fix isn't discipline β€” it's reducing the friction of writing a good description in the first place.

Start by pulling the diff between your branch and main:

git diff main...HEAD > pr_diff.txt

If the diff is large (500+ lines), focus on the meaningful parts β€” skip lockfile changes and generated files:

git diff main...HEAD -- '*.ts' '*.py' '*.go' > pr_diff.txt

Open your AI tool of choice (ChatGPT, Claude, Gemini β€” all work here) and use this prompt:

You are a senior engineer writing a pull request description for a code review.

Here is the diff:

<paste diff here>

Write a pull request description with the following sections:
1. **What changed** β€” a 2–3 sentence plain-English summary of what this PR does.
2. **Why** β€” the motivation or problem being solved.
3. **How to test** β€” concrete steps a reviewer can follow to verify the change locally.
4. **Notes for reviewer** β€” anything non-obvious, edge cases to watch, or follow-up work deferred.

Be specific. Reference actual function names, files, or logic from the diff. Do not be vague.

The AI output will be 80–90% usable. Your job is to:

This takes 2–3 minutes, not 15.

Once you've done this a few times, extract the structure into a .github/pull_request_template.md

file in your repo:

## What changed

## Why

## How to test
- [ ] Step 1
- [ ] Step 2

## Notes for reviewer

Now the AI output maps directly to the template fields. Every PR on your team starts from the same skeleton, and the quality floor rises across the board.

You are a senior engineer writing a pull request description for a code review.

Here is the diff:

[PASTE DIFF]

Write a pull request description with the following sections:
1. **What changed** β€” a 2–3 sentence plain-English summary of what this PR does.
2. **Why** β€” the motivation or problem being solved.
3. **How to test** β€” concrete steps a reviewer can follow to verify the change locally.
4. **Notes for reviewer** β€” anything non-obvious, edge cases to watch, or follow-up work deferred.

Be specific. Reference actual function names, files, or logic from the diff. Do not be vague.

This workflow takes about 5 minutes the first time and under 2 minutes once it's part of your routine. Better descriptions mean faster reviews β€” that's a compounding win on every PR you ship.

I break down one workflow like this every week in The AI Leverage Weekly β€” practical, no fluff, free. Subscribe: https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&utm_medium=article&utm_campaign=medium_w8

── more in #developer-tools 4 stories Β· sorted by recency
── more on @chatgpt 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/how-to-write-a-pull-…] indexed:0 read:3min 2026-07-01 Β· β€”