github-pr

Create high-quality Pull Requests with conventional commits and proper descriptions. Trigger: When creating PRs, writing PR descriptions, or preparing PR flows using git commands.

When to Use

  • Creating a new Pull Request
  • Writing PR titles and descriptions
  • Preparing commits for review
  • Preparing PR handoff with git-only workflows

Critical Patterns

PR Title = Conventional Commit

<type>(<scope>): <short description>

feat     New feature
fix      Bug fix  
docs     Documentation
refactor Code refactoring
test     Adding tests
chore    Maintenance

PR Description Structure

## Summary
- 1-3 bullet points explaining WHAT and WHY

## Changes
- List main changes

## Testing
- [ ] Tests added/updated
- [ ] Manual testing done

Closes #123

Atomic Commits

# Good: One thing per commit
git commit -m "feat(user): add User model"
git commit -m "feat(user): add UserService"
git commit -m "test(user): add UserService tests"

# Bad: Everything in one commit
git commit -m "add user feature"

Code Examples

Basic PR Handoff (Git Only)

git checkout -b feat/auth-oauth2-login
git add .
git commit -m "feat(auth): add OAuth2 login"
git push -u origin feat/auth-oauth2-login

# Share this compare URL in GitHub UI to open PR
# https://github.com/<owner>/<repo>/compare/main...feat/auth-oauth2-login?expand=1

Generate Request-Pull Summary

git request-pull main https://github.com/<owner>/<repo>.git feat/dashboard-analytics

Optional Patch Export for Offline Review

git format-patch origin/main..HEAD

Commands

# Check branch and tracking
git status -sb

# Inspect commits included in PR
git log --oneline --decorate origin/main..HEAD

# Push branch
git push -u origin <branch>

# Create request-pull summary text
git request-pull main <repo-url> <branch>

# Generate patches
git format-patch origin/main..HEAD

# Diff against base branch
git diff --stat origin/main...HEAD

# Show remote URLs
git remote -v

Anti-Patterns

Don't: Vague Titles

# Bad
git commit -m "fix bug"
git commit -m "update"

# Good
git commit -m "fix(auth): prevent session timeout"

Don't: Giant PRs

# Bad: 50 files, 2000+ lines in one PR

# Good: Split into logical PRs
# PR 1: feat(models): add User model
# PR 2: feat(api): add user endpoints
# PR 3: feat(ui): add user pages

Don't: Empty Descriptions

# Bad
PR opened without Summary/Changes/Testing context

# Good
Include this in PR description:
## Summary
- What you did and why

## Changes
- Specific changes

Closes #123

Quick Reference

TaskCommand
Publish branchgit push -u origin <branch>
Compare commitsgit log --oneline origin/main..HEAD
Request-pull textgit request-pull main <repo-url> <branch>
Export patchgit format-patch origin/main..HEAD
Link issueCloses #123 in PR body
Verify clean statusgit status -sb
Review diff statsgit diff --stat origin/main...HEAD

Resources

github-pr — skill by DvC99 | Shared Context