Create PRs with perfect commit messages

Quick Start

/git pr

What happens:

  1. Ensures remote is synced
  2. Compares REMOTE branches (not local)
  3. Analyzes actual PR content
  4. Generates conventional commit title
  5. Creates PR via GitHub CLI

Output: GitHub PR URL

Syntax

/git pr [to-branch] [from-branch]

Arguments

ArgumentDescriptionDefault
to-branchTarget branchmain
from-branchSource branchCurrent branch

Example

Input:

/git pr main feature/email-campaigns

Process:

✓ Fetching remote branches...
✓ Pushing feature/email-campaigns to remote...

Analyzing remote diff: origin/main...origin/feature/email-campaigns

Commits (3):
- Add email campaign creation API
- Implement campaign scheduler
- Add campaign analytics dashboard

Files changed (12):
+1,247 lines, -89 lines

Key changes:
- lib/email/campaign.ts (new file)
- lib/email/scheduler.ts (new file)
- app/api/campaigns/route.ts (modified)
- components/CampaignDashboard.tsx (new file)
[... 8 more files]

Generating PR content...

Title: feat(email): add email campaign system with analytics

Body:
## Summary
- Email campaign creation and scheduling
- Trigger-based automation
- Real-time analytics dashboard

## Technical Changes
- Added campaign API endpoints
- Implemented scheduling engine
- Created analytics dashboard component
- Added 12 test cases

## Testing
✓ All tests passing (101/101)
✓ Type-safe
✓ Code reviewed

---

Creating PR...
✓ PR created: https://github.com/yourorg/yourrepo/pull/42

Next: Review PR and merge when ready

Critical: Remote Comparison

ALWAYS compares REMOTE branches, not local:

Correct:

git diff origin/main...origin/feature-branch

Wrong (includes unpushed local changes):

git diff main...HEAD
git diff --cached
git status

Workflow Integration

After Implementation

"Implement feature"
# Implementation complete
/git pr  # Create PR

After /cook

/cook add feature
# User approves
/git pr  # Create PR

Custom Branch Flow

/git pr dev  # PR to dev branch
/git pr main feature/auth  # Specific branches

Requirements

GitHub CLI

Must have gh CLI installed and authorized:

# Install (macOS)
brew install gh

# Install (Linux)
sudo apt install gh

# Authorize
gh auth login

If gh not available, instructs user to install.

Conventional Commits

Auto-generates titles following convention:

TypeExampleWhen
featfeat(auth): add OAuth supportNew feature
fixfix(email): resolve send timeoutBug fix
docsdocs: update API documentationDocumentation only
refactorrefactor(db): optimize queriesCode restructure
testtest(api): add integration testsTest addition
chorechore: update dependenciesMaintenance
  • /cook - Auto-commits after implementation and includes git commit
  • /git cm - Commit only (no PR)

Perfect PRs. Every time. Automated commit messages that follow conventions.