- Home
- Skills
- Code Quality & Review
- Git Merge and Rebase Conflict Resolver with zdiff3
Works with the AI Agents you already use
Git Merge and Rebase Conflict Resolver with zdiff3
Resolves git merge, rebase and cherry-pick conflicts using the base version and both sides' intent, regenerates lockfiles, verifies. Verdict RESOLVED / NEEDS REVIEW / ABORT RECOMMENDED
$5
Git Merge and Rebase Conflict Resolver with zdiff3
Example session with this skill installed
My rebase of feature/retry-backoff onto main stopped with conflicts in src/http/client.ts and package-lock.json. main renamed fetchWithTimeout to request() and bumped axios, and my branch added retry logic. Fix it without losing either change.
- Read your context and instructions
- Compiled the git merge
Conflict resolution: rebase feature/retry-backoff onto main
Operation: rebase (stopped at commit 2/3, REBASE_HEAD = "add retry with backoff")
Sides: ours (stage 2) = main plus already-replayed commits; theirs (stage 3) = your retry commit. During a rebase these labels are swapped compared with a merge.
Conflict style switched to zdiff3 (git 2.43 installed) and markers re-created for src/http/client.ts before editing.
| File | Class | Ours intent (main) | Theirs intent (your branch) | Resolution |
|---|---|---|---|---|
| src/http/client.ts | Same-lines edit | Renamed fetchWithTimeout to request(), added a signal option | Wrapped fetchWithTimeout in a retry loop with backoff | Kept request() and the signal option, moved the retry loop around request(), passed signal through so aborts stop retries |
| package.json | Same-lines edit | Bumped axios | Added p-retry | Kept both dependency lines |
| package-lock.json | Lockfile | Regenerated by main | Regenerated by your branch | Not hand-merged. Ran npm install --package-lock-only after fixing package.json |
| src/http/upload.ts | Semantic (merged cleanly) | none | Still called fetchWithTimeout | Updated the call to request(); would have failed type-check |
export async function request(url: string, opts: RequestOpts = {}) {
return retry(() => rawRequest(url, opts), {
retries: opts.retries ?? 3,
signal: opts.signal,
});
}
Verification
- Markers: git diff --cached --check clean; git grep for marker lines: 0 hits
- Build: npm run build -> pass
- Tests: npm test -> pass (all suites, including the two new retry tests from your branch)
- Diff vs ours: 3 files changed. Diff vs theirs: 4 files changed (adds the request() rename)
Verdict: NEEDS REVIEW
Everything builds and tests pass, but the default of 3 retries now applies to every caller of request(), including uploads that main did not retry before. Confirm that is intended.
Next command
git add src/http/client.ts src/http/upload.ts package.json package-lock.json
git rebase --continue
No force-push run. Pushing the rebased branch needs git push --force-with-lease, and I will only run it after your yes.
How to undo
git rebase --abort returns the branch to where it was. After the rebase finishes, git reflog shows the old tip.
Connects securely to your tools. The creator never sees your data.
About this skill
A merge or rebase stops with CONFLICT, and the quick fix is to keep one side. That is how a teammate's change disappears, a lockfile ends up half-merged, or code compiles but calls a function the other branch renamed. During a rebase it is worse, because ours and theirs are swapped and "keep mine" picks the wrong side.
This skill gives your coding agent a fixed procedure and a reference file of facts checked against the git-scm.com manual. It:
- Detects which operation is in progress (merge, rebase, cherry-pick, revert) from the state files, and states which side is which, including the rebase swap
- Lists conflicted files with their porcelain status codes and classifies each conflict: same-lines edit, add/add, modify/delete, rename, lockfile, generated file, formatting-only, or semantic
- Switches to the zdiff3 conflict style (Git 2.35 and later, diff3 on older Git) and reads the base, ours and theirs stages directly
- Uses git log --merge and per-side history to write down what each side meant before editing
- Regenerates lockfiles with the package manager and rebuilds generated files instead of hand-merging them
- Verifies with git diff --check, a marker grep, the build, the tests, and a diff against both sides
- Returns a table explaining every resolution and a verdict: RESOLVED, NEEDS REVIEW or ABORT RECOMMENDED
- Suggests git rerere when the same conflict keeps coming back
Who it is for: developers who rebase often, maintainers merging long-lived branches, and anyone who wants an agent to fix conflicts without losing work.
Safety: it never force-pushes, hard-resets, cleans or skips commits without your yes, and every report includes the abort command and how to recover through the reflog.
Honesty note: it reports only build and test results it actually ran, and it cannot judge business intent the commits do not explain. Those hunks are marked NEEDS REVIEW.
The skill works on a local repository through the terminal and depends on git, your package manager and your build and test commands being available. It cannot infer intent that is not visible in commits or code, so judgment calls are flagged for review rather than decided. Some features need newer Git (zdiff3 in 2.35, git log --merge for rebase and cherry-pick in 2.45); older versions get the fallback steps.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 29 days ago
Requires