Catalog
Yeachan-Heo/fix-merge-conflicts

Yeachan-Heo

fix-merge-conflicts

Resolve merge conflicts non-interactively: start the integration, read both sides' intent from their commits, preserve both intents, validate on the resolved tree. Never force-pushes shared branches.

v1.0LATEST
NewUpdated Nov 8, 2026

Fix Merge Conflicts

A conflict is two intents meeting in one file. Resolution that flattens either intent is a bug with a clean git status.

Workflow

  1. Establish ownership: you resolve conflicts on a branch you own, against a base others own. Conflicts on a shared branch get reported to the owner, not resolved unilaterally.
  2. Start the approved integration first: fetch the remote base (git fetch origin <base>) and merge the fetched SHA — git merge FETCH_HEAD (or the project's rebase convention, when the caller has not constrained it) — so the conflicts you inspect match what GitHub reported; a local base ref can be absent or behind origin/<base>, and git merge never refreshes it implicitly. A mergeable: conflicting answer from the remote, or a clean local branch, has no MERGE_HEAD — git log --merge before integrating exits 128.
  3. Read both intents: git log --merge -p -- <file> for each conflicted file once the merge is in progress — what did each side change and why (commit messages are evidence). Conflict markers show the what; the commits show the why. On the rebase path there is no MERGE_HEAD — git log --merge reads nothing there; read the topic side with git show REBASE_HEAD -- <file> (the dotted range REBASE_HEAD..HEAD excludes the topic commit itself, so it shows only the base side) and the base side with git log -p HEAD -- <file> until the rebase continues. When the caller forbids starting an integration at all (e.g. read-only inspection), compare explicit ranges instead: git log -p <base>...HEAD -- <file>.
  4. Resolve: the default is both-intent-preserving — base side's change and branch side's change both survive, composed. When the intents are genuinely incompatible, the base (upstream) intent wins on shared surfaces and the branch adapts, and the override is reported with its reason.
  5. Validate: run the project's checks (build/test/lint at minimum) on the resolved tree. A resolution that compiles but breaks a test took the wrong side somewhere. If intent analysis, resolution, or validation cannot complete after a merge starts, run git merge --abort; after a rebase starts, run git rebase --abort. If abort is unsafe or unavailable, stop and hand off the repository with the active MERGE_HEAD/REBASE_HEAD and conflict list explicitly reported.
  6. Finalize: for a rebase, stage each resolved file and run git rebase --continue repeatedly until git status shows no active rebase. Validate that final tree before pushing. Then commit the resolution with a message naming what each side wanted. No force-push to shared branches, ever; a rebased own-branch uses --force-with-lease — unless a caller (e.g. babysit) forbids rebase and force-push entirely, in which case merge-commit resolution is the only path.

Rules

  • Never resolve by "take ours/theirs" wholesale; that is choosing a winner, not resolving.
  • Generated files (lockfiles, snapshots) regenerate rather than hand-merge.
  • The resolution commit's message states the two intents it composed — the next archaeologist (why) will need it.
Files1
1 files · 1.0 KB

Select a file to preview

Overall Score

88/100

Grade

A

Excellent

Grades are signals, not a certification. Always review a skill yourself before use.

Safety

87

Quality

92

Clarity

88

Completeness

82

Summary

This skill guides an AI agent through resolving merge conflicts by understanding both sides' intents, composing solutions that preserve both changes when possible, and validating the result. It emphasizes reading commit history to understand *why* changes were made, not just what was changed, and defaults to both-intent-preserving resolution with explicit escalation for incompatible changes.

Detected Capabilities

git command executionfile reading (merge conflict markers and git diffs)process invocation (build, test, lint)repository state inspectionmerge/rebase state management

Trigger Keywords

Phrases that agents use to match this skill to user intent.

merge conflictsresolve conflictsmerge integrationconflict resolutionrebase conflictsmerge abortintent-preserving merge

Risk Signals

INFO

Git merge/rebase operations on user-specified branches

Workflow steps 2, 6
INFO

Project build/test/lint execution

Workflow step 5
INFO

Force-push with explicit guardrail (--force-with-lease, no shared branches)

Workflow step 6

Referenced Domains

External domains referenced in skill content, detected by static analysis.

github.com

Use Cases

  • Resolve merge conflicts while preserving both upstream and branch intents
  • Analyze conflicting changes through commit history and messages
  • Compose non-destructive conflict resolutions that satisfy both sides' goals
  • Validate resolved code against project tests and lints before finalizing
  • Hand off complex conflicts that cannot be automatically resolved

Quality Notes

  • Clear ownership and branching scope: resolves on user's branch against owned base; escalates shared branch conflicts to owner
  • Excellent intent-focused documentation: emphasizes reading commit history to understand *why* changes conflict, not just the markers
  • Comprehensive error handling: explicit abort procedures for both merge and rebase states; unsafe-abort detection and handoff guidance
  • Well-defined resolution philosophy: both-intent-preserving default with documented override rules (upstream wins on shared surfaces)
  • Validation requirement enforced: build/test/lint must pass before finalization, preventing silent breakage
  • Addresses edge cases: generated files regenerate rather than hand-merge; rebase vs. merge path differences explained
  • Strong commit message guidance: resolution commits must name both intents for future archaeology
  • Protective constraint: no force-push to shared branches; force-with-lease only on own branches
  • Logical workflow structure: 6 clear steps with prerequisites and abort conditions at each stage
Model: claude-haiku-4-5-20251001Analyzed: Nov 8, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Use Yeachan-Heo/fix-merge-conflicts in your dev environment

Command Palette

Search for a command to run...