{"slug": "how-to-write-a-pull-request-description-with-ai", "title": "How to Write a Pull Request Description with AI", "summary": "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.", "body_md": "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.\n\nBad 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.\n\nStart by pulling the diff between your branch and main:\n\n```\ngit diff main...HEAD > pr_diff.txt\n```\n\nIf the diff is large (500+ lines), focus on the meaningful parts — skip lockfile changes and generated files:\n\n```\ngit diff main...HEAD -- '*.ts' '*.py' '*.go' > pr_diff.txt\n```\n\nOpen your AI tool of choice (ChatGPT, Claude, Gemini — all work here) and use this prompt:\n\n```\nYou are a senior engineer writing a pull request description for a code review.\n\nHere is the diff:\n\n<paste diff here>\n\nWrite a pull request description with the following sections:\n1. **What changed** — a 2–3 sentence plain-English summary of what this PR does.\n2. **Why** — the motivation or problem being solved.\n3. **How to test** — concrete steps a reviewer can follow to verify the change locally.\n4. **Notes for reviewer** — anything non-obvious, edge cases to watch, or follow-up work deferred.\n\nBe specific. Reference actual function names, files, or logic from the diff. Do not be vague.\n```\n\nThe AI output will be 80–90% usable. Your job is to:\n\nThis takes 2–3 minutes, not 15.\n\nOnce you've done this a few times, extract the structure into a `.github/pull_request_template.md`\n\nfile in your repo:\n\n```\n## What changed\n\n## Why\n\n## How to test\n- [ ] Step 1\n- [ ] Step 2\n\n## Notes for reviewer\n```\n\nNow 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.\n\n```\nYou are a senior engineer writing a pull request description for a code review.\n\nHere is the diff:\n\n[PASTE DIFF]\n\nWrite a pull request description with the following sections:\n1. **What changed** — a 2–3 sentence plain-English summary of what this PR does.\n2. **Why** — the motivation or problem being solved.\n3. **How to test** — concrete steps a reviewer can follow to verify the change locally.\n4. **Notes for reviewer** — anything non-obvious, edge cases to watch, or follow-up work deferred.\n\nBe specific. Reference actual function names, files, or logic from the diff. Do not be vague.\n```\n\nThis 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.\n\nI 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](https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&utm_medium=article&utm_campaign=medium_w8)", "url": "https://wpnews.pro/news/how-to-write-a-pull-request-description-with-ai", "canonical_source": "https://dev.to/leveragenotes/how-to-write-a-pull-request-description-with-ai-24ma", "published_at": "2026-07-01 09:01:01+00:00", "updated_at": "2026-07-01 09:19:17.578961+00:00", "lang": "en", "topics": ["developer-tools", "artificial-intelligence", "large-language-models"], "entities": ["ChatGPT", "Claude", "Gemini", "GitHub"], "alternates": {"html": "https://wpnews.pro/news/how-to-write-a-pull-request-description-with-ai", "markdown": "https://wpnews.pro/news/how-to-write-a-pull-request-description-with-ai.md", "text": "https://wpnews.pro/news/how-to-write-a-pull-request-description-with-ai.txt", "jsonld": "https://wpnews.pro/news/how-to-write-a-pull-request-description-with-ai.jsonld"}}