PluginBench
Skill
Pass
Audit score 90

resolve-merge-conflicts

warpdotdev/common-skills

Extract conflict hunks and compact diffs to resolve Git merge conflicts without loading full files.

What is resolve-merge-conflicts?

Resolve Git merge conflicts efficiently by viewing only unresolved paths, conflict markers, and compact diffs instead of entire files. Use this when a merge, rebase, cherry-pick, or stash pop stops on conflicts, or when `git status` shows unmerged paths.

  • Summarize all unresolved files and their conflict hunk counts
  • Extract conflict hunks with nearby context for a single file
  • Generate compact unified diffs between conflicting versions
  • Handle both marker-based text conflicts and index-only conflicts (add/add, modify/delete)
  • Output conflict data as JSON for programmatic processing
  • Tune context window and output size to keep context minimal

How to install resolve-merge-conflicts

npx skills add https://github.com/warpdotdev/common-skills --skill resolve-merge-conflicts
Prerequisites
  • Python 3 installed
  • Git repository with active merge conflict state
Claude Code
Cursor
Windsurf
Cline

How to use resolve-merge-conflicts

  1. 1.Run the summary command to see all unresolved files and conflict counts
  2. 2.For each conflicted file, run the detailed view command with --file to inspect conflict hunks
  3. 3.Decide whether to take one side wholesale (git checkout --ours/--theirs) or edit manually
  4. 4.Remove conflict markers and resolve the file
  5. 5.Re-run the summary command to confirm no unresolved files remain
  6. 6.Validate no conflict markers remain in resolved files and run tests
  7. 7.Stage the resolved files

Use cases

Good for
  • Resolve conflicts after a failed merge with multiple conflicted files
  • Inspect a single conflicted file without reading the entire codebase
  • Validate that all conflict markers have been removed after manual resolution
  • Compare ours vs. theirs versions in a compact format before deciding which to keep
  • Automate conflict detection and reporting in CI/CD pipelines
Who it's for
  • Developers resolving merge conflicts during collaborative work
  • Code reviewers handling complex rebases or cherry-picks
  • Teams using agents or automation to assist with conflict resolution

resolve-merge-conflicts FAQ

What if the compact output isn't enough to decide the correct merge?

Read more of the file directly or use git show to inspect the full context. The script is designed to handle most cases; fall back to full file inspection only when necessary.

Can I resolve all conflicted files at once?

Use --all to view all conflicted files at once, but the workflow recommends resolving one file at a time to keep context small and manageable.

Does this handle non-text conflicts?

Yes. The script handles both marker-based text conflicts and index-only conflicts like add/add or modify/delete by falling back to index-stage previews when the worktree file has no conflict markers.

How do I tune the output size?

Use --context to adjust surrounding lines and --max-lines to cap total output. For example: --context 3 --max-lines 60.

Can I get machine-readable output?

Yes. Use --json to output conflict data in JSON format for programmatic processing or integration with other tools.

Full instructions (SKILL.md)

Source of truth, from warpdotdev/common-skills.


name: resolve-merge-conflicts description: Resolve Git merge conflicts by extracting only unresolved paths, conflict hunks, and compact diffs instead of loading whole files into context. Use when a merge, rebase, cherry-pick, or stash pop stops on conflicts, when git status shows unmerged paths, or when files contain conflict markers.

Resolve Merge Conflicts

Overview

Resolve conflicts without opening full files unless the compact view is insufficient. Start with a summary, then inspect one conflicted file at a time.

Workflow

  1. Start with a summary.
python3 .agents/skills/resolve-merge-conflicts/scripts/extract_conflict_context.py

Use the summary to identify which files are unresolved, which index stages exist, and how many text hunks each file contains.

  1. Drill into one file.
python3 .agents/skills/resolve-merge-conflicts/scripts/extract_conflict_context.py --file path/to/file

Prefer this over reading the whole file. The script prints only nearby context, the ours / base / theirs sections for each hunk, and a compact unified diff between ours and theirs.

  1. Resolve the file.
  • Take one side wholesale with git checkout --ours -- path/to/file or git checkout --theirs -- path/to/file when appropriate.
  • Otherwise edit the file directly and remove the conflict markers.
  • Read more of the file only if the compact output is not enough to decide the correct merge.
  1. Re-check unresolved files.
python3 .agents/skills/resolve-merge-conflicts/scripts/extract_conflict_context.py
git diff --name-only --diff-filter=U
  1. Validate the resolution.
  • Ensure no unmerged paths remain.
  • Ensure no <<<<<<<, =======, or >>>>>>> markers remain in the resolved files.
  • Run targeted tests, builds, or linters for the touched area.
  • Stage the resolved files.

Commands

Summary only

python3 .agents/skills/resolve-merge-conflicts/scripts/extract_conflict_context.py

Detailed view for one file

python3 .agents/skills/resolve-merge-conflicts/scripts/extract_conflict_context.py --file path/to/file

Detailed view for all conflicted files

python3 .agents/skills/resolve-merge-conflicts/scripts/extract_conflict_context.py --all

JSON output

python3 .agents/skills/resolve-merge-conflicts/scripts/extract_conflict_context.py --file path/to/file --json

Tune output size

python3 .agents/skills/resolve-merge-conflicts/scripts/extract_conflict_context.py \
  --file path/to/file \
  --context 3 \
  --max-lines 60

Notes

  • Use the script before opening conflicted files directly.
  • Resolve one file at a time to keep context small.
  • Expect marker-based text conflicts and index-only conflicts such as add/add or modify/delete. The script summarizes both, and it falls back to index-stage previews when the worktree file has no conflict markers.