| name | pr |
| description | Rebase current branch onto target base branch, analyze full commit history, and create a GitHub Pull Request. Use this skill whenever the user says /pr, 'PR ๋ง๋ค์ด', 'create a PR', 'pull request', 'ํ๋ฆฌํ', 'PR ์ฌ๋ ค์ค', or any request to open a pull request. Also trigger on casual phrases like 'PR ์ข', 'open a PR against main', 'merge request'. This skill handles the full workflow: rebase, push, and PR creation with comprehensive summary. |
Pull Request
Rebase onto the target branch, analyze the full commit history, and create a well-structured GitHub PR.
Steps
1. Gather context (run in parallel)
git status
git branch -vv
git log --oneline -20
git remote -v
2. Handle uncommitted changes
If there are staged or unstaged changes, ask the user:
- Commit them before creating the PR? (recommended)
- Stash them?
- Ignore them?
Don't silently discard changes.
3. Determine base branch
If the user specified a target branch, use it. Otherwise, detect the default:
git remote show origin | grep 'HEAD branch'
Common defaults: main, master, develop.
4. Rebase onto base branch
Rebase keeps the commit history clean and linear โ merging would create noise in the PR diff.
git fetch origin <base-branch>
git rebase origin/<base-branch>
If conflicts arise, stop and tell the user. Don't auto-resolve conflicts โ the user needs to decide how to handle them. Show which files conflict and offer guidance.
5. Analyze changes
After successful rebase, examine the full scope of the PR:
git log origin/<base-branch>..HEAD --oneline
git diff origin/<base-branch>...HEAD
git diff origin/<base-branch>...HEAD --stat
Look at all commits, not just the latest one. The PR summary should reflect the entire branch, not a single commit.
6. Push
git push -u origin <current-branch> --force-with-lease
--force-with-lease is necessary after rebase (history was rewritten) but safe โ it refuses to overwrite commits that aren't in the local history. This is different from --force which blindly overwrites.
If the branch doesn't exist on remote yet, -u sets tracking.
7. Create PR
Draft the title and body, then create via gh:
gh pr create --title "<title>" --base <base-branch> --body "$(cat <<'EOF'
## Summary
<1-3 bullet points covering the full scope of changes>
## Changes
<file-level breakdown of what was modified and why>
## Test Plan
- [ ] test item 1
- [ ] test item 2
EOF
)"
Title rules:
- Under 70 characters
- Describe the outcome, not the process
- Don't repeat the branch name
Body rules:
- Summary covers ALL commits, not just the last one
- Changes section groups related modifications
- Test plan has actionable verification steps
8. Report
Print the PR URL so the user can review it in the browser.