resolve-conflicts
Skill20 starsChanged 13 days agoMITView on GitHub
Analyze and resolve Git merge/rebase conflicts intelligently, showing diffs and asking clarifying questions when needed. Invoke with /resolve-conflicts.
16 other projects use a version of this.
Adopted by
Most recently taken up by
- domengabrovsek/agent-configtheir own version, first seen Nov 8, 2026
- domengabrovsek/claudetheir own version, first seen Nov 8, 2026
- LeonardiFranco/skillstheir own version, first seen Nov 8, 2026
- marinvch/Cortextheir own version, first seen Nov 1, 2026
- SantiagoVqz/claude-skillstheir own version, first seen Nov 1, 2026
- edloidas/skillstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use worktree, worktrees and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkillworktree
Create, reuse or clean up a dedicated git worktree for working on a pull request or a private branch. Use from any PR-scoped workflow that needs an isolated checkout to keep current code and build output untouched.
Also in 5 projects that use this
nilecuiSkillworktrees
Guide for using git worktrees to parallelize development with coding agents. Use this skill when the user requests to work in a new worktree or wants to work on a separate feature in isolation (e.g., "Work in a new worktree", "Create a worktree for feature X").
Also in 3 projects that use this
johnlindquistSkilldiagram
Maintain and synchronize Unified Impact Diagrams following Diagram Driven Development (DDD) methodology. Create, update, and manage diagrams that connect user value to technical implementation.
Also in 3 projects that use this
nicolasestremSkilldocument
Create focused documentation for specific components or features
Also in 3 projects that use this
AWSSkillwizard
Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.
Also in 4 projects that use this
sunnyclinches44Skillexplain
Explains code using real-world analogies and ASCII diagrams
Also in 4 projects that use this
Other versions16 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 16
- domengabrovsek/agent-config★ 22same name
- domengabrovsek/claude★ 22same name
- loremaster-ai/loremaster★ 4same name
- ralphkrauss/agent-orchestrator★ 4same name
- edloidas/skills★ 2same name
- Pradnyeshp/Claude-Skills★ 2same name
- SantiagoVqz/claude-skills★ 2same name
- LeonardiFranco/skills★ 1same name
- marinvch/Cortex★ 1same name
- nielsmadan/skills★ 1same name
6 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository48 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- skills/workflow/autonomous-workflow/CLAUDE.mdCLAUDE.md
- ideateSkill
- interviewSkill
- playwright-trace-analyzerSkill
- profile-optimizerSkill
- rum-trackingSkill
- screencastSkill
- video-analyserSkill
- youtube-transcriptSkill
- create-skillSkill
- docsSkill
- handoffSkill
- optimize-claude-mdSkill
- persistent-memorySkill
- attach-mediaSkill
- ci-auto-fixSkill
- create-prSkill
- github-actions-authorSkill
- animations-nativeSkill
- animationsSkill
- behavioral-designSkill
- chartingSkill
- storybookSkill
- uxSkill
- visual-designSkill
- ai-engineeringSkill
- confidenceSkill
- criticalSkill
- impact-mapSkill
- jev-assertSkill
- measurableSkill
- optimize-approachSkill
- polishSkill
- pr-reviewSkill
- review-loopSkill
- tddSkill
- verify-behaviorSkill
- aw-verifySkill
- e2e-testing-mobileSkill
- e2e-testingSkill
- telemetry-verifySkill
- ui-verifySkill
- autonomous-workflowSkill
- aw-create-planSkill
- aw-create-walkthroughSkill
- fix-bugSkill
- implement-suggestionSkill
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 12 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 16 edited versions we read keep these.
12
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 115
Accept Ours: Keep current branch changes (theirs were superseded/duplicated)
- Distinctive: line 122
When intent is ambiguous, ask specific questions:
- Distinctive: line 153
After understanding all conflicts and getting answers to questions:
- Distinctive: line 182
After resolving all conflicts:
- Distinctive: line 214
If more conflicts appear during rebase, repeat from Step 3.
- Distinctive: line 230
If many conflicts occurred, consider more frequent rebasing/merging
- Distinctive: line 231
If semantic conflicts are common, consider better branch coordination
- Distinctive: line 232
Document any non-obvious resolution decisions for PR reviewers
- Distinctive: line 236
If resolution isn't going well:
- Distinctive: line 250
Always fetch first: Ensure you have the latest remote state
- Distinctive: line 252
Tests after resolution: Run tests to verify merged code works
- Distinctive: line 253
Commit message clarity: Document what conflicts were resolved and how
“Common” is measured: kept by at least 6 in 10 of the 16 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Resolve Git Conflicts
You are tasked with helping resolve Git merge or rebase conflicts. This command handles both active conflict states and proactive conflict preview/resolution.
Step 1: Detect Conflict State
First, determine the current state:
# Check if we're in the middle of a merge
git rev-parse --verify MERGE_HEAD 2>/dev/null && echo "MERGE_IN_PROGRESS" || echo "NO_MERGE"
# Check if we're in the middle of a rebase
test -d "$(git rev-parse --git-dir)/rebase-merge" -o -d "$(git rev-parse --git-dir)/rebase-apply" && echo "REBASE_IN_PROGRESS" || echo "NO_REBASE"
# Check for unmerged files (active conflicts)
git diff --name-only --diff-filter=UBased on results:
- Active merge conflict: MERGE_HEAD exists + unmerged files present
- Active rebase conflict: rebase-merge/rebase-apply dir exists + unmerged files present
- No active conflict: Can preview differences for potential conflicts
Step 2: Gather Context
Get Branch Information
# Current branch
git branch --show-current
# Target branch (default: main)
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo "main"
# Fetch latest to ensure accurate comparison
git fetch originIf Active Conflict Exists
# List all conflicted files AND capture the list now — once files are staged
# in Step 5, `--diff-filter=U` returns nothing. Step 7's merge commit message
# reads this file.
git diff --name-only --diff-filter=U | tee /tmp/conflicted.txt
# Show the conflict markers in each file
git diff --checkIf No Active Conflict (Preview Mode)
# Show what would change when merging target into current
git diff origin/main...HEAD --name-status
# Show detailed diff
git diff origin/main...HEAD --stat
# Identify files modified in both branches (potential conflicts)
git log origin/main..HEAD --name-only --pretty=format: | sort -u > /tmp/head_files
git log HEAD..origin/main --name-only --pretty=format: | sort -u > /tmp/main_files
comm -12 /tmp/head_files /tmp/main_filesStep 3: Analyze Each Conflicted File
For each conflicted or potentially conflicting file:
3.1 Show Both Versions
# For active conflicts - show the three-way diff
git diff <file>
# Show "ours" version (current branch)
git show :2:<file>
# Show "theirs" version (incoming branch)
git show :3:<file>
# Show common ancestor
git show :1:<file>3.2 Understand the Changes
For each file, analyze:
- What "ours" (current branch) changed: What was the intent of changes on the current branch?
- What "theirs" (target branch) changed: What was the intent of changes from the incoming branch?
- Conflict type:
- Overlapping edits: Same lines modified differently
- Adjacent edits: Close proximity changes
- Structural conflicts: Function/class restructuring
- Semantic conflicts: Logic changes that may conflict conceptually
3.3 Propose Resolution Strategy
For each conflict, suggest one of:
- Accept Ours: Keep current branch changes (theirs were superseded/duplicated)
- Accept Theirs: Accept incoming changes (ours are outdated/wrong)
- Merge Both: Both changes are valid and can coexist
- Manual Resolution: Changes conflict semantically - need human decision
Step 4: Ask Clarifying Questions
When intent is ambiguous, ask specific questions:
Template Questions
For overlapping edits:
"In
<file>at line X, both branches modified the same code:
- Current branch: [summary of change]
- Incoming branch: [summary of change]
Which behavior should we keep?
- Current branch's approach
- Incoming branch's approach
- Combine both (explain how)
- Need more context to decide"
For structural conflicts:
"The file
<file>was restructured differently in both branches:
- Current branch: [describe restructure]
- Incoming branch: [describe restructure]
This requires manual review. Would you like me to show the full diff?"
For semantic conflicts:
"Both branches changed the logic in
<function>:
- Current: [behavior description]
- Incoming: [behavior description]
These may be incompatible. Which business logic is correct?"
Step 5: Apply Resolutions
After understanding all conflicts and getting answers to questions:
For Accept Ours
git checkout --ours <file>
git add <file>For Accept Theirs
git checkout --theirs <file>
git add <file>For Merge Both
Edit the file to combine both changes, then:
git add <file>For Manual Edits
After editing:
# Verify no conflict markers remain
grep -n "^<<<<<<< " <file> && echo "Still has conflict markers!" || git add <file>Step 6: Verify Resolution
After resolving all conflicts:
# Check no unmerged files remain
git diff --name-only --diff-filter=U
# Verify no conflict markers in staged files
git diff --cached | grep -E "^[+](<<<<<<<|=======|>>>>>>>)" && echo "Warning: Conflict markers still present!"
# Show what will be committed
git diff --cached --statStep 7: Complete the Merge/Rebase
For Merge Conflicts
# Commit the merge, citing the conflicted-file list captured in Step 2.
# Do NOT use `git diff --name-only HEAD~1` here — that lists every merged
# file, not just the files whose conflicts were resolved.
git commit -m "Merge origin/main into $(git branch --show-current)
Resolved conflicts in:
$(cat /tmp/conflicted.txt)"For Rebase Conflicts
# Continue the rebase
git rebase --continueIf more conflicts appear during rebase, repeat from Step 3.
Step 8: Summary
After completion, provide:
Resolution Summary
| File | Resolution Type | Notes |
path/to/file1.ts | Accept Theirs | Our changes were outdated |
path/to/file2.ts | Merge Both | Combined feature additions |
path/to/file3.ts | Manual | Required semantic understanding |
Recommendations
- If many conflicts occurred, consider more frequent rebasing/merging
- If semantic conflicts are common, consider better branch coordination
- Document any non-obvious resolution decisions for PR reviewers
Abort Options
If resolution isn't going well:
Abort Merge
git merge --abortAbort Rebase
git rebase --abortTips
- Always fetch first: Ensure you have the latest remote state
- Small conflicts are easier: Merge frequently to avoid large conflicts
- Tests after resolution: Run tests to verify merged code works
- Commit message clarity: Document what conflicts were resolved and how
- When in doubt, ask: Semantic conflicts often need human judgment
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

