From git-plugin
Creates GitHub pull requests with formatted descriptions, labels, issue references, draft mode, reviewers, and base branch selection from pushed branches. Use for 'create PR' or 'submit for review'.
npx claudepluginhub laurigates/claude-plugins --plugin git-pluginThis skill is limited to using the following tools:
Create pull requests with comprehensive descriptions and proper issue linkage.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Create pull requests with comprehensive descriptions and proper issue linkage.
| Use this skill when... | Use X instead when... |
|---|---|
| Creating a new PR | Just crafting a title (github-pr-title) |
| Full PR workflow | Just pushing (git-push) |
| Submit for review | Just committing (git-commit) |
## Summary
Brief description of what this PR does.
## Motivation
Why this change is needed. Link to issue if applicable.
## Changes
- Key change 1
- Key change 2
- Key change 3
## Pre-merge Checklist
- [ ] Tests pass locally
- [ ] Code reviewed
- [ ] Documentation updated (if needed)
## Follow-up Issues
<!-- Post-merge actions tracked as separate issues so they survive PR closure -->
- Closes #456 after merge: database migration for new schema
- Refs #457: update deployment runbook
## Related Issues
Fixes #123
Related: #124, #125
| Section | Purpose | Required |
|---|---|---|
| Summary | What the PR does (1-2 sentences) | Yes |
| Motivation | Why this change is needed | Yes |
| Changes | Key changes as bullet points | Yes |
| Pre-merge Checklist | Actions before merge only — never post-merge steps | If applicable |
| Follow-up Issues | Links to issues tracking post-merge actions | If post-merge work exists |
| Related Issues | Issue links at bottom | Yes |
Place at the bottom of the PR description:
## Related Issues
Fixes #123 <!-- Auto-closes on merge -->
Closes #456 <!-- Auto-closes on merge -->
Resolves #789 <!-- Auto-closes on merge -->
Related: #124, #125 <!-- Links without closing -->
Rules:
Fixes, Closes, or Resolves for issues this PR solvesRelated: for issues that are related but not solvedBefore creating the PR, check whether any post-merge follow-up actions are needed (migrations, deployments, config changes, runbook updates). Create a GitHub issue for each and link them in the PR description. See Post-Merge Follow-up Issues.
# Check current branch
git branch --show-current
# Fetch latest remote state for accurate comparison
git fetch origin main
# Check commits ahead of origin/main (always compare against remote)
ahead=$(git rev-list --count origin/main..HEAD 2>/dev/null || echo "0")
if [ "$ahead" = "0" ]; then
echo "No commits ahead of origin/main - nothing to create PR for"
exit 1
fi
# Check for existing PR
gh pr view --json number,state 2>/dev/null || echo "no existing PR"
CRITICAL: Always compare against origin/main (not local main) to avoid including commits that haven't been merged to the remote. Local main may be ahead of origin/main with unrelated commits.
# Fetch latest remote state
git fetch origin main
# Always use origin/main as base reference
base_ref="origin/main"
git log $base_ref..HEAD --format='%H %s'
# Extract issue references
git log $base_ref..HEAD --format='%B' | grep -oE '#[0-9]+' | sort -u
# Get diff stats
git diff $base_ref...HEAD --stat
Before creating the PR, scan for any actions required after the PR is merged (deployments, migrations, config changes, external docs). For each:
# Create a follow-up issue
gh issue create \
--title "[Chore] DB: Run migration for new schema" \
--body "Follow-up to PR that adds user_preferences.\n\nRun: rake db:migrate in production after deploy."
# Returns: https://github.com/org/repo/issues/456
Keep a list of created issue numbers to link in the PR body.
gh pr create \
--title "feat(scope): add feature" \
--body "$(cat <<'EOF'
## Summary
Brief description of what this PR does.
## Motivation
Why this change is needed.
## Changes
- Change 1
- Change 2
## Pre-merge Checklist
- [ ] Tests pass locally
- [ ] Code reviewed
## Follow-up Issues
- #456: run database migration after deploy
- #457: update production config
## Related Issues
Fixes #123
Related: #456
EOF
)"
Use conventional commits format (see github-pr-title skill):
<type>(<scope>): <subject>
Examples:
feat(auth): add OAuth2 supportfix(api): handle null responsedocs(readme): update installation| Option | Command |
|---|---|
| Draft | gh pr create --draft |
| Labels | gh pr create --label "enhancement" |
| Reviewers | gh pr create --reviewer user1,user2 |
| Base branch | gh pr create --base develop |
| Assignee | gh pr create --assignee @me |
When on main, push to remote feature branch:
# Push main to remote feature branch
git push origin main:feat/feature-name
# Create PR with --head
gh pr create --head feat/feature-name --base main --title "..." --body "..."
Include only actions before merging:
Do NOT include post-merge steps in the checklist. PR descriptions are closed and buried after merge — checklists embedded there are easily missed. Post-merge actions must be tracked as GitHub issues.
When a PR requires actions after it is merged, create a separate GitHub issue for each follow-up. Link all follow-up issues in the PR description under a Follow-up Issues section.
Why issues, not PR checklists: Once a PR is merged and closed, its description is rarely revisited. A GitHub issue stays open and assignable until explicitly closed, ensuring the follow-up is not lost.
| Type | Example follow-up issue title |
|---|---|
| Database migration | [Chore] DB: Run schema migration for user_preferences table |
| Deployment | [Chore] Ops: Deploy feature-flag config to production |
| Manual configuration | [Chore] Config: Enable new OAuth provider in admin panel |
| External documentation | [Docs] Wiki: Update runbook for new deploy process |
| Communication | [Chore] Comms: Announce deprecation of /v1 API to customers |
| Dependent PR | [Feature] Next: Implement follow-on X after Y lands |
gh issue create \
--title "[Chore] DB: Run migration for new schema" \
--body "After #42 merges, run: \`rake db:migrate\` in production.\n\nSee PR #42 for context." \
--label "chore"
gh pr edit <pr-number> --body "$(gh pr view <pr-number> --json body -q '.body')
## Follow-up Issues
- #<issue-num>: run database migration
- #<issue-num>: update deployment runbook"
## Follow-up Issues
<!-- These issues track post-merge work and will stay open until completed -->
- #456: run database migration for user_preferences table
- #457: update production feature-flag config
On success, report:
Created PR #42: feat(auth): add OAuth2 support
URL: https://github.com/org/repo/pull/42
Related Issues:
Fixes #123
Related: #456
Status: Open
| Error | Solution |
|---|---|
| Branch not pushed | Push first or use main-branch pattern |
| PR exists | gh pr view or gh pr edit |
| No commits | Commit changes first |
| Action | Command |
|---|---|
| Create PR | gh pr create --title "..." --body "..." |
| Draft PR | gh pr create --draft |
| View PR | gh pr view |
| Edit PR | gh pr edit --title "..." --body "..." |
| List PRs | gh pr list |
| Check status | gh pr checks |
| Create follow-up issue | gh issue create --title "[Chore] ..." --body "..." |
| Context | Command |
|---|---|
| PR readiness | gh pr view --json number,state 2>/dev/null |
| Commits | git log origin/main..HEAD --format='%s' |
| Issue refs | git log origin/main..HEAD --format='%B' | grep -oE '#[0-9]+' |
| Create follow-up issue | gh issue create --title "[Chore] ..." --body "Follow-up to PR #N..." |
| Create PR | gh pr create --title "..." --body "..." |