| name | pr-draft-summary |
| description | Generate a PR-ready summary block with branch suggestion, title, and description. Use in the final handoff after moderate-or-larger code changes; skip for trivial or conversation-only tasks. |
PR Draft Summary
Purpose
Produce the PR-ready summary after substantive code work: a concise summary plus a PR title and draft description. The block should be ready to paste into a PR.
When to Trigger
- The task is finished and it touched runtime code (
src/), tests, docs with behavior impact, or build configuration.
- Default final handoff step for substantive code work.
- Skip for trivial or conversation-only tasks, or when the user says not to.
Inputs to Collect Automatically
- Current branch:
git rev-parse --abbrev-ref HEAD
- Working tree:
git status -sb
- Untracked files:
git ls-files --others --exclude-standard
- Changed files:
git diff --name-only and git diff --name-only --cached
- Latest release tag:
git tag -l 'v*' --sort=-v:refname | head -n1
- Base reference:
git rev-parse --abbrev-ref --symbolic-full-name @{upstream} 2>/dev/null || echo origin/main
- Commits ahead:
git log --oneline --no-merges ${BASE_COMMIT}..HEAD
Workflow
- Run the commands above without asking the user.
- If no changes detected, say so and skip the block.
- Classify as feature, fix, refactor, or docs and flag backward-compatibility risk against the latest release tag.
- Summarize changes in 1-3 sentences using key paths and diff stats.
- Choose the lead verb: feature →
adds, fix → fixes, refactor → improves, docs → updates.
- Suggest a branch name if on main:
feat/<slug>, fix/<slug>, or docs/<slug>.
- Draft using the template below.
Output Format
# Pull Request Draft
## Branch name suggestion
git checkout -b <kebab-case, e.g., feat/add-firewall-tools>
## Title
<single-line imperative title, e.g., "feat: add firewall management tools">
## Description
<Start with "This pull request adds/fixes/improves ...", explain the change, any behavior changes or considerations. No need to list tests.>