Slash command
/pr
Generates a pull-request title and body from every commit on the branch — not just the latest diff.
Install to
~/.claude/commands/pr.md descriptionDraft a pull request title and body for the current branch.
Draft a PR for the current branch:
- Find the base branch (usually
main). Rungit log <base>..HEAD --onelineandgit diff <base>...HEADto see the FULL set of changes — every commit on the branch, not just the last one. - Write:
- Title — under 70 chars, imperative, scoped.
- Summary — 1-3 bullets on what changed and why.
- Test plan — a short checklist a reviewer can actually run.
- Output the title and body as plain markdown I can paste into GitHub.
Do not run
gh pr createunless I ask.
If the branch has no commits ahead of base, say so.
---
description: Draft a pull request title and body for the current branch.
---
Draft a PR for the current branch:
1. Find the base branch (usually `main`). Run
`git log <base>..HEAD --oneline` and `git diff <base>...HEAD` to see
the FULL set of changes — every commit on the branch, not just the
last one.
2. Write:
- **Title** — under 70 chars, imperative, scoped.
- **Summary** — 1-3 bullets on what changed and why.
- **Test plan** — a short checklist a reviewer can actually run.
3. Output the title and body as plain markdown I can paste into GitHub.
Do not run `gh pr create` unless I ask.
If the branch has no commits ahead of base, say so. How to install
- Copy the code and save it to
~/.claude/commands/pr.md(user) or.claude/commands/pr-description.md(project). - Commands hot-reload — it's available in the current session immediately.
- Run it by typing
/pr-descriptionin the prompt. - Verify: type
/and look for it in the command list.