resolve-conflicts
ما الذي تفعله
تساعد هذه المهارة في حل تعارضات الدمج في Git بطريقة مدروسة ومخططة. تغطي الاستيرادات والاختبارات وملفات القفل والملفات التي حُذفت في أحد الفرعين. وهي مخصصة للمطورين الذين يواجهون تعارضات الدمج.
متى تستخدمها
- ✓عندما يتوقف دمج Git أو إعادة الأساس بسبب تعارضات تحتاج إلى حلها.
- ✓عندما يكون ملف قفل أو ملف مولّد في حالة تعارض، ويجب إعادة توليده.
- ✓عندما يحذف أحد الفرعين ملفاً غيّره الفرع الآخر.
رابط المهارة
https://github.com/tailcallhq/forgecode/blob/main/.forge/skills/resolve-conflicts/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“هل يمكنك مساعدتي في حل تعارضات الدمج هذه، وشرح ما فعلته لكل واحد منها؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يتحقق الوكيل من حالة التعارض، ويضع خطة لكل ملف، ويطلب موافقتك عليها. ثم ينفذ الخطة، ويشغّل الاختبارات، ويشرح كل اختيار.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Git Conflict Resolution
Resolve Git merge conflicts by intelligently combining changes from both branches while preserving the intent of both changes. This skill follows a plan-first approach: assess conflicts, create a detailed resolution plan, get approval, then execute.
Core Principles
- Plan Before Executing: Always create a structured resolution plan and get user approval before making changes
- Prefer Both Changes: Default to keeping both changes unless they directly contradict
- Merge, Don't Choose: Especially for imports, tests, and configuration
- Regenerate Generated Files: Never manually merge generated files - always regenerate them from their sources
- Backup Before Resolving: For deleted-modified files, create backups first
- Validate with Tests: Always run tests after resolution
- Explain All Resolutions: For each conflict resolved, provide a one-line explanation of the resolution strategy
- Ask When Unclear: When the correct resolution isn't clear from the diff, present options to the user and ask for their choice
Workflow
Step 1: Assess the Conflict Situation
Run initial checks to understand the conflict scope:
git status
Identify and categorize all conflicted files:
- Regular file conflicts (both modified)
- Deleted-modified conflicts (one deleted, one modified)
- Generated file conflicts (lock files, build artifacts, generated code)
- Test file conflicts
- Import/configuration conflicts
- Binary file conflicts
For each conflicted file, gather information:
- File type and purpose
- Nature of the conflict (content, deletion, type change)
- Scope of changes (lines changed, sections affected)
- Whether the file is generated or hand-written
Step 2: Create Merge Resolution Plan
Based on the assessment, create a structured plan before resolving any conflicts. Present the plan in the following markdown format:
## Merge Resolution Plan
### Conflict Summary
- **Total conflicted files**: [N]
- **Deleted-modified conflicts**: [N]
- **Generated files**: [N]
- **Regular conflicts**: [N]
### Resolution Strategy by File
#### 1. [File Path]
**Conflict Type**: [deleted-modified / generated / imports / tests / code logic / config / struct / binary]
**Strategy**: [Brief description of resolution approach]
**Rationale**: [Why this strategy is appropriate]
**Risk**: [Low/Medium/High] - [Brief risk description]
**Action Items**:
- [ ] [Specific action 1]
- [ ] [Specific action 2]
#### 2. [File Path]
...
### Execution Order
1. **Phase 1: Deleted-Modified Files** - Handle deletions and backups first
2. **Phase 2: Generated Files** - Regenerate from source
3. **Phase 3: Low-Risk Merges** - Imports, tests, documentation
4. **Phase 4: High-Risk Merges** - Code logic, configuration, structs
5. **Phase 5: Validation** - Compile, test, verify
### Questions/Decisions Needed
- [ ] **[File/Decision]**: [Question for user] (Options: 1, 2, 3)
### Validation Steps
- [ ] Run conflict validation script
- [ ] Compile project
- [ ] Run test suite
- [ ] Manual verification of high-risk changes
Present this plan to the user and wait for their approval before proceeding with resolution. If there are any unclear conflicts where you need user input, list them in the "Questions/Decisions Needed" section.
For a complete example plan, see references/sample-plan.md.
Step 3: Handle Deleted-Modified Files
Execute this phase only after the plan is approved.
If there are deleted-but-modified files (status: DU, UD, DD, UA, AU):
.forge/skills/resolve-conflicts/scripts/handle-deleted-modified.sh
This script will:
- Create timestamped backups of modified content
- Analyze potential relocation targets
- Generate analysis reports for each file
- Automatically resolve the deletion status
Review the backup directory and analysis files to understand where changes should be applied.
Step 4: Execute Resolution Plan
Follow the execution order defined in your plan. For each conflicted file, apply the appropriate resolution pattern according to your plan. For every conflict you resolve, provide a one-line explanation of how you're resolving it.
As you complete each action item in your plan, mark it as done and report progress to the user.
When Resolution is Unclear
When you cannot determine the correct resolution from the diff alone (these should already be listed in your plan's "Questions/Decis
الأسئلة الشائعة
هل سيحل التعارضات دون أن يسألني؟
لا. يضع خطة ويطلب موافقتك عليها قبل إجراء أي تغيير.
كيف يتعامل مع ملفات القفل؟
يعيد توليدها من مصادرها بدلاً من دمجها يدوياً.
هل يشغّل الاختبارات بعد الحل؟
نعم. يشغّل الاختبارات بعد الحل للتأكد من النتيجة.
التفاصيل
الوصف الأصلي من المؤلف
Use this skill immediately when the user mentions merge conflicts that need to be resolved. Do not attempt to resolve conflicts directly - invoke this skill first. This skill specializes in providing a structured framework for merging imports, tests, lock files (regeneration), configuration files, and handling deleted-but-modified files with backup and analysis.
repo: tailcallhq/forgecode
الشعبية
- نجوم GitHub
- 7.6k
- الترتيب
- #13114
- الترخيص
- Apache-2.0
- آخر تحديث
- 1/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
create-agent
7.6kيعلّم وكيلك كيف ينشئ وكلاء مخصصين لتطبيق Forge البرمجي أو يعدّلهم، محفوظين كملفات Markdown مع إعداداتهم في الأعلى.
create-command
7.6kيعلّم وكيلك كيف ينشئ أوامر قابلة لإعادة الاستخدام في تطبيق Forge البرمجي، مكتوبة كخطوات Markdown تُنفَّذ بالترتيب.
create-github-issue
7.6kيساعد وكيلك على فتح بلاغ في GitHub يتبع قالب المستودع الخاص به، مع الحقول والوسوم الصحيحة.
create-plan
7.6kيساعد وكيلك على كتابة خطة تنفيذ مفصلة لمهمة معقدة، تتضمن الخطوات والمخاطر والبدائل، قبل أي تغيير في الكود.
مهارات مشابهة
diffs
394kيتيح لوكيلك إنتاج فرق تعديلات حقيقي يمكن مشاركته، كرابط عرض أو ملف صورة، بدلاً من ملخص مكتوب يدوياً.
coding-agent
394kيساعد وكيلك على تسليم مهمة برمجة كبيرة إلى Codex أو Claude Code أو OpenCode كعامل في الخلفية، ثم متابعة تقدمها.
gh-issues
394kيساعد وكيلك على إيجاد مشكلات GitHub واختيار ما ستعمل عليه، وفتح طلبات سحب بالإصلاحات، ومتابعة تعليقات المراجعة.