merge-pr
FeaturedMerge a pull request with status checks, squash merge, and branch cleanup. Handles worktree contexts.
Code & Development 421 stars
49 forks Updated today MIT
Install
Quality Score: 93/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Merge Pull Request
Merge a pull request with consistent practices: verify checks, squash merge, clean up the branch, and pull the latest base branch.
## Command Options
- `$ARGUMENTS`: PR number (optional — defaults to the PR for the current branch)
## Your task
### Step 1: Identify the PR
- If a PR number was provided, use it
- Otherwise, detect from the current branch: `gh pr view --json number,title,state,headRefName,baseRefName`
- Confirm the PR exists and is open
- Display the PR title and number before proceeding
### Step 2: Verify merge readiness
Check each of the following and report status:
- **CI status**: Run `gh pr checks` to verify all required checks have passed
- **Merge conflicts**: Run `gh pr view --json mergeable` to verify no conflicts
- **Review feedback**: Run `gh pr view --json reviewDecision,reviews` to surface any unresolved review threads or a pending "changes requested" — advisory, not a hard gate. (Carries over the review-thread awareness from the retired `/review-pr`.)
If CI has not passed, **stop and report**. Do not proceed with the merge.
### Step 3: Merge the PR
- Squash merge: `gh pr merge --squash`
- Do **not** pass `--delete-branch` — GitHub is configured to auto-delete remote branches on merge. Local branch cleanup is handled in Step 4.
### Step 4: Detect worktree context
Before updating local state, determine whether you are inside a git worktree:
```bash
git rev-parse --git-dir
git rev-parse --git-common-dir
```
- If the...
Details
- Author
- joshukraine
- Repository
- joshukraine/dotfiles
- Created
- 12 years ago
- Last Updated
- today
- Language
- Shell
- License
- MIT
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
Code & Development Listed
merge-pr-this
Merge one PR via gh with a merge commit matching the repo's git history — readiness-gated, CI-watched, trunk synced after
2 Updated today
tony Code & Development Listed
merge-pr-multiple
Merge a set of PRs one at a time — detect stack vs independent set, rebase and resolve conflicts between merges, watch CI, merge each via gh
2 Updated today
tony Code & Development Listed
pr-merge
Merge a PR locally with fast-forward to preserve GPG-signed commits, then clean up.
0 Updated 1 weeks ago
AnotherSava