pr-merge
ما الذي تفعله
توجه هذه المهارة المشرف في مراجعة مساهمات الآخرين المرسلة كطلبات سحب ودمجها. وهي موجهة إلى أصحاب المشاريع الذين يريدون أن يحتفظ المساهمون بحقوق ذكرهم.
متى تستخدمها
- ✓عندما يكون لديك عدة طلبات سحب مفتوحة من مساهمين خارجيين تحتاج إلى مراجعتها ودمجها.
- ✓عندما يكون لطلب سحب تعارضات في الدمج، وتريد حلها دون إعادة كتابة عمل المساهم.
- ✓عندما تريد دمج جزء فقط من طلب سحب، مثل مجموعة محددة من الملفات.
رابط المهارة
https://github.com/HKUDS/OpenHarness/blob/main/.claude/skills/pr-merge/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“من فضلك راجع طلبات السحب المفتوحة في مستودعنا وادمج النظيفة منها، مع الإبقاء على ذكر كل مؤلف.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يعرض وكيلك طلبات السحب المفتوحة ويرتبها. يدمج النظيفة منها عبر 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
- 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)
الأسئلة الشائعة
هل سيبقى المساهم مذكوراً؟
نعم. تفضّل المهارة الدمج عبر GitHub، وتحدد المؤلف عند الدمج يدوياً، فيبقى الذكر محفوظاً.
هل يعيد كتابة كود المساهم؟
لا. تنص المهارة على قبول نهج المساهم أولاً، ثم إصلاح التعارضات لاحقاً في commit منفصل.
هل أستطيع دمج بعض الملفات فقط من طلب السحب؟
نعم. تسمح المهارة بالدمج الانتقائي الذي يستبعد الملفات المنفذة محلياً أصلاً، ويطلب منك تسجيل ما استُبعد.
التفاصيل
الوصف الأصلي من المؤلف
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
- آخر تحديث
- 3/6/2026
التعليقات
- …
مهارات مشابهة
openclaw-update
394kيساعد وكيلك على تحديث بوابة OpenClaw Gateway الموجودة، مع اختيار طريقة التحديث المناسبة لطريقة تثبيتها والحفاظ على جلستك.
diagnose-gateway
394kيساعد وكيلك على معرفة سبب فشل بوابة OpenClaw Gateway عبر فحص الإعدادات والقنوات والمنافذ دون تغيير أي شيء.
crabbox-apps
394kيساعد وكيلك على فتح تطبيق وتشغيله على جهاز سحابي مؤقت، ثم عرض واجهته في الشريط الجانبي للدردشة.