Generate a PR description for the current branch and its linked GitHub issue. Outputs to an unstaged markdown file in the repo root. Never creates or updates PRs. Triggers on: "generate PR description", "write PR description", "PR description", "describe this PR", "draft PR", or after completing implementation work when the user wants to prepare a PR. Also use when the user says "pr", "pull request description", or asks to summarize their branch changes for review.
Generate a concise, high-quality PR description from the current branch and its linked GitHub issue. Output to an unstaged .md file — never publish or update a PR.
Run these in parallel:
# Current branch name
git branch --show-current
# Commits on this branch vs main
git log main..HEAD --oneline
# Full diff against main
git diff main...HEAD
# Check for linked issue number in branch name or commits
# Branch names often follow: username/issue-description or fix/NNNN-description
If the branch name or commits reference an issue number, fetch it:
gh issue view <number> --repo antiwork/gumroad --comments
If no issue number is found, ask the user.
From the issue and diff, determine:
Read key changed files if the diff alone doesn't make the approach clear.
Follow the PR description structure in CONTRIBUTING.md. The template below implements it:
Adapt sections based on what's relevant — not every section is needed for every PR.
Style rules:
Fixes #<issue-number>
## What
[What this PR does. Concrete changes — not a list of files.
For features: what was built. For fixes: what was wrong and what was changed.]
## Why
[Why this change exists and why this approach over alternatives.
Business or user rationale. Strategic context if relevant.]
<!-- BEFORE/AFTER — include for UI/CSS changes, delete this section otherwise
## Before/After
Before:
<!-- screenshot or video -->
After:
<!-- screenshot or video -->
Include: Desktop (light + dark) and Mobile (light + dark) if applicable.
-->
<!-- TEST RESULTS — include a screenshot of test suite passing locally
## Test Results
<!-- screenshot -->
-->
---
This PR was implemented with AI assistance using [specific model, e.g., Claude Opus 4.6].
Prompts used:
<!-- chronological, verbatim if under ~100 chars otherwise summarized, skip pure confirmations -->
- "[first prompt that shaped the code]"
- "[next prompt]"
See references/example.md for a well-received PR description example.
Write the description to gh-pr-draft.md in the repo root. Do NOT stage or commit this file.
If gh-pr-draft.md already exists, overwrite it.
Tell the user the file was created and suggest they review it before posting.
gh read-only only. Never create, comment on, or update PRs.