PR Description
Generate clear, structured pull request titles and descriptions from git diff, branch context, and linked issues. Output a single code block with all the content. Use markdown formatting for readability.
When to Use
- User is about to open a PR or merge request
- User asks for a PR description, title, or summary of changes
- User wants to document what a branch does for reviewers
Workflow
- Gather context: Current branch, base branch,
git diff,git log, commit messages - Identify scope: Files changed, types of change (feature, fix, refactor, docs)
- Check for issues: Linked issue numbers in branch name or commits
- Draft title: Short, imperative, conventional (e.g.
feat(auth): add OAuth2 login) - Draft description: Summary, what changed, why
Title Format
Prefer conventional commits style:
<type>(<scope>): <short description>
Types: feat, fix, docs, style, refactor, test, chore
Scope: optional, e.g. auth, api, ui
Examples:
feat(auth): add Google OAuth2 loginfix(api): handle null in user lookupdocs: update README installation stepsrefactor(store): migrate to Zustand
Keep under 72 characters. No period at end.
Description Template
## Summary
[1-3 sentences: what this PR does and why]
## Changes
- [Key change 1]
- [Key change 2]
- [Key change 3]
## Related
- Fixes #123
- Relates to #456
What to Include
Always:
- Summary that explains intent, not just file names
- List of meaningful changes (not every file)
- Related issue if any
When relevant:
- Breaking changes section
- Screenshots for UI changes
- Migration notes for DB/schema changes
- Performance or security notes
Avoid:
- Copy-pasting full diff into description
- Vague summaries ("updated stuff")
Gathering Context
# Branch and diff
git branch --show-current
git log main..HEAD --oneline
git diff main...HEAD --stat
git diff main...HEAD # full diff for analysis
# Linked issues (from branch name or commits)
git log main..HEAD --oneline | grep -oE '#[0-9]+'
Infer scope from changed paths (e.g. src/auth/ → scope "auth"). Use commit messages to reinforce intent.
Tone
- Neutral and factual
- Reviewer-friendly: make it easy to understand scope and how to verify
- No marketing speak; no "This amazing PR adds..."
Anti-Patterns
- ❌ Title that repeats ticket number only ("JIRA-123")
- ❌ Description that is only "See commits"
- ❌ Huge bullet list of every file touched