You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .forge/skills/resolve-conflicts/SKILL.md
+96-22Lines changed: 96 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,22 @@
1
1
---
2
2
name: resolve-conflicts
3
-
description: Resolve Git merge conflicts by intelligently combining changes from both branches. Use when encountering merge conflicts during git merge, rebase, or cherry-pick operations. Specializes in merging imports, tests, lock files (regeneration), configuration files, and handling deleted-but-modified files with backup and analysis.
3
+
description: 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.
4
4
---
5
5
6
6
# Git Conflict Resolution
7
7
8
-
Resolve Git merge conflicts by intelligently combining changes from both branches while preserving the intent of both changes.
8
+
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.
9
9
10
10
## Core Principles
11
11
12
-
1.**Prefer Both Changes**: Default to keeping both changes unless they directly contradict
13
-
2.**Merge, Don't Choose**: Especially for imports, tests, and configuration
14
-
3.**Regenerate Generated Files**: Never manually merge generated files - always regenerate them from their sources
15
-
4.**Backup Before Resolving**: For deleted-modified files, create backups first
16
-
5.**Validate with Tests**: Always run tests after resolution
17
-
6.**Explain All Resolutions**: For each conflict resolved, provide a one-line explanation of the resolution strategy
18
-
7.**Ask When Unclear**: When the correct resolution isn't clear from the diff, present options to the user and ask for their choice
12
+
1.**Plan Before Executing**: Always create a structured resolution plan and get user approval before making changes
13
+
2.**Prefer Both Changes**: Default to keeping both changes unless they directly contradict
14
+
3.**Merge, Don't Choose**: Especially for imports, tests, and configuration
15
+
4.**Regenerate Generated Files**: Never manually merge generated files - always regenerate them from their sources
16
+
5.**Backup Before Resolving**: For deleted-modified files, create backups first
17
+
6.**Validate with Tests**: Always run tests after resolution
18
+
7.**Explain All Resolutions**: For each conflict resolved, provide a one-line explanation of the resolution strategy
19
+
8.**Ask When Unclear**: When the correct resolution isn't clear from the diff, present options to the user and ask for their choice
19
20
20
21
## Workflow
21
22
@@ -27,15 +28,80 @@ Run initial checks to understand the conflict scope:
27
28
git status
28
29
```
29
30
30
-
Identify conflict types:
31
+
Identify and categorize all conflicted files:
31
32
32
33
- Regular file conflicts (both modified)
33
34
- Deleted-modified conflicts (one deleted, one modified)
-[ ]**[File/Decision]**: [Question for user] (Options: 1, 2, 3)
89
+
90
+
### Validation Steps
91
+
92
+
-[ ] Run conflict validation script
93
+
-[ ] Compile project
94
+
-[ ] Run test suite
95
+
-[ ] Manual verification of high-risk changes
96
+
```
97
+
98
+
**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.
99
+
100
+
**For a complete example plan**, see `references/sample-plan.md`.
101
+
102
+
### Step 3: Handle Deleted-Modified Files
103
+
104
+
**Execute this phase only after the plan is approved.**
39
105
40
106
If there are deleted-but-modified files (status: DU, UD, DD, UA, AU):
41
107
@@ -52,13 +118,15 @@ This script will:
52
118
53
119
Review the backup directory and analysis files to understand where changes should be applied.
54
120
55
-
### Step 3: Resolve Regular Conflicts
121
+
### Step 4: Execute Resolution Plan
122
+
123
+
**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.
56
124
57
-
For each conflicted file, apply the appropriate resolution pattern. **For every conflict you resolve, provide a one-line explanation** of how you're resolving it.
125
+
As you complete each action item in your plan, mark it as done and report progress to the user.
58
126
59
127
#### When Resolution is Unclear
60
128
61
-
When you cannot determine the correct resolution from the diff alone:
129
+
When you cannot determine the correct resolution from the diff alone (these should already be listed in your plan's "Questions/Decisions Needed" section):
62
130
63
131
1.**Present the conflict** to the user with the conflicting code from both sides
64
132
2.**Provide numbered options** for resolution (Option 1, Option 2, etc.)
0 commit comments