pr-merge
What it does
This skill guides a maintainer through reviewing and merging contributions sent as pull requests. It is for project owners who want contributors to keep their credit.
When to use it
- βWhen you have several open pull requests from outside contributors to review and merge.
- βWhen a pull request has merge conflicts and you want to resolve them without rewriting the contributor's work.
- βWhen you only want part of a pull request merged, such as a selected set of files.
Skill link
https://github.com/HKUDS/OpenHarness/blob/main/.claude/skills/pr-merge/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βPlease go through the open pull requests on our repo and merge the clean ones while keeping each author credited.β
5 new skills a week. 1 minute to read.
How it works
The agent lists the open pull requests and sorts them. It merges the clean ones through GitHub so the author is kept, and for harder ones it merges locally and fixes conflicts in a separate change.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
PR Merge β Contributor-First Pull Request Integration
Merge external pull requests while maximizing original author attribution. Core principle: merge first, resolve conflicts after β never rewrite a contributor's work from scratch.
Core Principles
- Preserve authorship β use
gh pr merge --squashfor clean PRs. For manual merges, use--author="Name <email>". - Merge first, fix after β accept the PR's approach even if it differs from local style. Fix conflicts in a separate commit.
- Selective merge is OK β exclude files with
--excludewhen a PR contains features already implemented locally. Document what was excluded. - Never
git apply+ self-commit β this loses author attribution entirely.
Workflow
1. Triage Open PRs
gh pr list --repo OWNER/REPO --state open \
--json number,title,author,additions,deletions,mergeable
Classify each PR: merge directly, merge with conflict resolution, selective merge, or close.
2. Merge Clean PRs via GitHub
Prefer gh pr merge β preserves author automatically:
gh pr merge NUMBER --repo OWNER/REPO --squash \
--subject "feat: description (#NUMBER)"
3. Handle Conflicting PRs Locally
git fetch origin pull/NUMBER/head:pr-NUMBER
git merge pr-NUMBER --no-edit
# Resolve conflicts keeping both sides where possible
git add -A && git commit --no-edit
4. Selective Merge (Skip Some Files)
When a PR contains features already implemented locally:
gh pr diff NUMBER --repo OWNER/REPO | \
git apply --exclude='path/to/skip.py' --exclude='CHANGELOG.md'
git commit --author="Author Name <author@email>" \
-m "feat: description (#NUMBER)
Cherry-picked from PR #NUMBER. Excluded: file.py (already implemented)."
5. Close Duplicate/Superseded PRs
gh pr close NUMBER --repo OWNER/REPO \
--comment "Fixed via PR #OTHER. Thank you for the contribution!"
6. Post-Merge Verification
python -m ruff check src/ tests/ # lint
python -m pytest tests/ -q # unit tests
git push origin main # push
Then run harness-eval for end-to-end verification on an unfamiliar codebase.
Attribution Checklist
Before pushing a merged PR:
- Original author appears in
git log(via--authoror GitHub squash merge) - Commit message references PR number (
#NUMBER) - If selectively merged, commit body explains exclusions
- Closed PRs have a comment thanking the contributor
- Duplicate PRs acknowledge the contributor's investigation
Common Pitfalls
git apply+ self-commit loses author- Rewriting from scratch instead of merging β merge their code, fix style after
- Force-pushing main after merge β may remove contributor commits
- Forgetting CHANGELOG conflicts β always exclude and handle manually
- Not testing after merge β clean merge doesn't mean working code
Additional Resources
Reference Files
references/merge-scenarios.mdβ Detailed examples for each merge scenario (clean, conflicting, selective, duplicate)
FAQ
Will the contributor still get credit?
Yes. The skill prefers GitHub merges and sets the author when merging by hand, so credit is kept.
Does it rewrite the contributor's code?
No. The skill says to accept the contributor's approach first and fix any conflicts afterwards in a separate commit.
Can I merge only some files from a pull request?
Yes. The skill allows a selective merge that leaves out files already implemented locally, and asks you to note what was left out.
Details
Original description by the author
This skill should be used when the user asks to "merge a PR", "review and merge pull requests", "integrate external contributions", "handle PR conflicts", "cherry-pick from a PR", or needs to merge GitHub PRs while maximizing contributor attribution.
repo: HKUDS/OpenHarness
Popularity
- GitHub stars
- 16k
- Ranking position
- #10803
- License
- MIT
- Updated
- 6/3/2026
Comments
- β¦
Similar skills
openclaw-update
394kHelps your agent update an existing OpenClaw Gateway, choosing the update method that fits how it was installed and keeping your session working.
diagnose-gateway
394kHelps your agent find out why your OpenClaw Gateway is failing by checking settings, channels, and ports without changing anything.
crabbox-apps
394kHelps your agent open and run an app on a temporary cloud machine, then show its view in your chat side panel.