/create-pr
Create a pull request with summary, test plan, and proper labeling.
Usage
/create-pr [--base <branch>] [--draft] [--title "title"]
What It Does
Analyzes all commits on the current branch vs the base branch, generates a PR title and description, pushes the branch, and creates the PR using gh. Includes a summary of changes, test plan, and links to related issues.
Implementation
- Analyze changes --
git logandgit diffagainst base branch. - Generate PR title -- concise (<70 chars), focused on the "what".
- Generate PR body -- summary bullets, test plan checklist, related issues.
- Push branch --
git push -u origin <branch>. - Create PR --
gh pr createwith title, body, labels, reviewers. - Return URL -- display the PR link.
Examples
# Create PR against main
/create-pr
# Create draft PR against specific base
/create-pr --base develop --draft
# Create PR with explicit title
/create-pr --title "Add user authentication flow"