| name | pr-description |
| description | Use when the user wants to write or draft a pull request title and description, summarize a branch's changes for review, or prepare to open a PR. |
PR Description Drafter
Drafts a PR title and description from the diff against the base branch.
Steps
-
Determine the base branch (usually main or master):
git merge-base --fork-point main HEAD || git merge-base main HEAD
-
Gather the change summary:
git log main..HEAD --oneline
git diff main...HEAD --stat
Read the full diff (git diff main...HEAD) only for files whose purpose
isn't clear from the stat — don't paste the whole diff into the description.
-
Draft using this template:
## Summary
- <bullet: what changed and why, not a file-by-file list>
- <bullet: 1-3 max>
## Test plan
- [ ] <how to verify this change — be specific: commands, manual steps>
-
Title: short imperative, under 70 chars, e.g. Add retry logic to upload client.
-
Show the draft to the user — don't open the PR yourself unless explicitly asked.
If asked to open it, use gh pr create --title ... --body "$(cat <<'EOF' ... EOF)".
Notes
- Focus the summary on why, not a restatement of the diff (good identifiers
already say what).
- If the branch mixes unrelated changes, flag that to the user — it may be
worth splitting into separate PRs.