Create Pull Request
Create a draft PR from existing commits on current branch. $ARGUMENTS
Prerequisites
- •Branch has commits ahead of base branch
- •Changes already pushed to remote
Workflow
- •Get current branch:
git branch --show-current - •Get base branch:
git rev-parse --abbrev-ref origin/HEADor default tomain - •Review commits:
git log origin/main..HEAD --oneline - •Review changes:
git diff origin/main..HEAD --stat - •Create draft PR with
gh pr create
PR Rules
Critical
- •Always draft: Use
--draftflag - •No AI attribution: Never include "Co-authored-by: Claude" or similar
Title Format
type(scope): Description
Types: feat, fix, refactor, chore, docs, style, test, perf, ci, build
Description Template
code
## Changes - [bullet point 1] - [bullet point 2] ## Why [business or technical reason for the change]
Command
bash
gh pr create --draft --title "type(scope): Description" --body "$(cat <<'EOF' ## Changes - Change 1 - Change 2 ## Why Reason for the change EOF )"
Output
After creating PR, display:
- •PR URL
- •PR number
- •Title
- •Draft status confirmation