본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)16k · #10803

pr-merge

하는 일

이 스킬은 풀 리퀘스트로 보내진 기여를 검토하고 병합하는 메인테이너를 안내합니다. 기여자가 자신의 크레딧을 유지하기를 원하는 프로젝트 소유자를 위한 스킬입니다.

사용하는 경우

  • ✓외부 기여자가 보낸 열린 풀 리퀘스트가 여러 개 있어서 검토하고 병합해야 할 때.
  • ✓풀 리퀘스트에 병합 충돌이 있는데, 기여자의 작업을 다시 쓰지 않고 해결하고 싶은 경우.
  • ✓풀 리퀘스트의 일부 파일만 병합하고 싶을 때.

스킬 링크

https://github.com/HKUDS/OpenHarness/blob/main/.claude/skills/pr-merge/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/HKUDS/OpenHarness/blob/main/.claude/skills/pr-merge/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“우리 저장소의 열린 풀 리퀘스트를 살펴보고, 문제없는 것은 병합하되 각 작성자의 크레딧은 유지해 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 열린 풀 리퀘스트를 나열하고 분류합니다. 문제없는 것은 GitHub에서 병합해 작성자를 유지하고, 더 어려운 것은 로컬에서 병합한 뒤 충돌을 별도의 변경으로 고칩니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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

  1. Preserve authorship — use gh pr merge --squash for clean PRs. For manual merges, use --author="Name <email>".
  2. Merge first, fix after — accept the PR's approach even if it differs from local style. Fix conflicts in a separate commit.
  3. Selective merge is OK — exclude files with --exclude when a PR contains features already implemented locally. Document what was excluded.
  4. 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 --author or 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)
자주 묻는 질문

기여자가 여전히 크레딧을 받나요?

네. 스킬은 GitHub 병합을 선호하고, 직접 병합할 때도 작성자를 설정하므로 크레딧이 유지됩니다.

기여자의 코드를 다시 쓰나요?

아니요. 스킬은 먼저 기여자의 방식을 받아들이고, 충돌은 나중에 별도의 커밋에서 고치라고 안내합니다.

풀 리퀘스트의 일부 파일만 병합할 수 있나요?

네. 스킬은 이미 로컬에 구현된 파일을 뺀 선택적 병합을 허용하며, 무엇을 뺐는지 기록하라고 요청합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
16k
순위
#10803
라이선스
MIT
업데이트
2026. 6. 3.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

비슷한 스킬