merge-pr
Safely merges GitHub pull requests using gh CLI. Use when the user wants to merge a PR, merge a pull request, or complete code review.
Security Assessment
About merge-pr
The merge-pr skill is designed to streamline and safeguard the process of merging GitHub pull requests using the `gh` CLI. It addresses the common challenge of ensuring that code changes are integrated safely into the main branch while adhering to best practices for code review, CI checks, and merge strategies. By providing structured guidance for pre-merge verification, merge execution, and post-merge updates, this skill reduces the risk of introducing errors or conflicts in the repository, making the merge process more reliable and efficient.
This skill offers a comprehensive set of features to support developers in managing pull requests. It includes pre-merge checks to confirm that all required CI tests have passed, approvals are in place, and no unresolved review comments remain. Users can select from multiple merge strategies—merge commit, squash merge, or rebase merge—based on the nature of the pull request and repository workflow. Additionally, it guides users on respecting repository branch deletion settings and ensures local branches are updated after a merge. The skill emphasizes using custom merge commit messages to maintain clear and consistent project history.
The merge-pr skill is particularly useful for developers, code reviewers, and DevOps engineers who regularly interact with GitHub repositories. It is ideal for teams that want to enforce consistent merging practices, maintain high-quality codebases, and reduce errors from manual merges. This skill can be leveraged in scenarios such as merging feature branches, completing code reviews, or maintaining CI/CD pipelines. By following its structured workflow, users can confidently manage pull requests while keeping local and remote repositories in sync.
FAQ
How do I start using the merge-pr skill?
You start by announcing to the user: 'Using merge-pr skill to merge a pull request safely,' then perform pre-merge checks using `gh pr view`, `gh pr checks`, and optionally `gh pr diff`.
Which merge strategies are supported?
The skill supports three strategies: merge commit (--merge), squash merge (--squash), and rebase merge (--rebase). Each strategy is suitable for different scenarios depending on commit history and project conventions.
Does this skill automatically delete branches after merging?
No, branch deletion depends on the repository settings. If automatic deletion is enabled, branches are removed after merging. The skill instructs not to use the `--delete-branch` flag to respect repository configuration.
Can I use this skill without the `gh` CLI?
No, the skill relies on the GitHub CLI (`gh`) for all operations including viewing PRs, checking CI status, and performing merges.
What should I do if CI checks fail or there are unresolved reviews?
You should wait for CI checks to complete, address review feedback, fix any failing tests, and re-run checks if necessary before attempting to merge.
Install merge-pr
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
sakuro/dotfiles