merge-resolve
Resolve merge conflicts, rebase conflicts, and cherry-pick failures using mergiraf (AST-aware structural merge), git rerere, and kdiff3.
Skill by paulnsorensen
Chalk Labs
Need help deploying merge-resolve?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/paulnsorensen-merge-resolve
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/merge-resolve
Tools it pre-approves 1
From allowed-tools in SKILL.md: the agent may use these without asking you each time.
bash
What's inside
- Skill name
merge-resolve- Description
- Resolve merge conflicts, rebase conflicts, and cherry-pick failures using mergiraf (AST-aware structural merge), git rerere, and kdiff3. Activate when: merge failed, rebase conflict, cherry-pick failed, CONFLICT in file, "resolve conflicts", "fix merge", "merge conflict", "conflict resolution", or git output shows CONFLICT markers. Also use for mergiraf diagnostics, rerere management, gitattributes regeneration, or batch conflict resolution across multiple files. Covers the full resolution chain: mergiraf (structural auto-resolve) → rerere (replay remembered fixes) → kdiff3 (manual). Do NOT use for general git operations without conflicts — those go to the commit or gh skills. Examples: "resolve the merge conflicts", "fix the rebase conflicts", "what's conflicting after the merge?", "resolve conflicts in src/auth.ts".
- License
- MIT
- Compatibility
- Requires tilth MCP server (delegates file IO to cheez-read/cheez-write/cheez-search)
- Allowed tools
- bash
- Instructions
- 256 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (6)
- SKILL.md
- batch-resolve.py · scripts/
- conflict-pick.py · scripts/
- conflict-summary.py · scripts/
- git_utils.py · scripts/
- lockfile-resolve.py · scripts/
SKILL.md (first lines)
# merge-resolve
Resolve merge conflicts using the structural merge chain: mergiraf → rerere → kdiff3.
> **File IO delegation**: This skill does NOT hold `Read`, `Edit`, `Write`, or `Glob`. For
> per-file conflict inspection or manual edits, delegate to:
> - **cheez-read** — inspect conflicted files, view conflict hunks, list directory contents
> - **cheez-search** — locate conflict markers, search for related symbols across the tree
> - **cheez-write** — apply resolved content with hash anchors
>
> The bash-driven flows below (git, mergiraf, python scripts) handle the bulk of resolution.
> Drop into the cheez skills only when you need to inspect or rewrite a specific file.
---
## Resolution Chain
The three tools form a cascade — each handles what the previous couldn't:
1. **mergiraf** runs automatically as a git merge driver. It parses all three file versions
(base, ours, theirs) into Tree-sitter ASTs and merges structurally. Independent additions
(imports, functions, struct fields) merge cleanly even when text-based merge would conflict.
Falls back to text merge if parsing fails — never makes things worse.
2. **rerere** ("reuse recorded resolution") activates after mergiraf. If you manually resolved
the same conflict before, rerere replays that resolution automatically. Especially valuable
during long rebases where the same conflict recurs across commits.
3. **kdiff3** is the manual fallback for conflicts neither tool could resolve. Launch with
`git mergetool` — it opens a 3-way diff view for human decision-making.
---
## Protocol
### 1. Diagnose the Conflict State
Run the summary script first — it replaces the need for `grep -n '<<<<<<<'` and ad-hoc parsers:
```bash
python3 skills/merge-resolve/scripts/conflict-summary.py
```
Default output is terse and LLM-oriented: one metadata line per file, then minimally-framed
hunks. Each hunk shows up to 5 lines of ours/theirs and 3 of base, capped to keep token cost low.
Flags:
- `--json` — structured output for scripting
- `--verbose` — markdown-formatted human view (the previous default)
- `--context N` — context lines around each hunk (default 3)
If you need raw git info too:
```bash
git log --merge --oneline # What commits are involved?
```
### 2. Attempt Structural Resolution
For files where mergiraf is configured but conflicts remain (meaning the structural merge
already ran and couldn't fully resolve), you can inspect what mergiraf produced vs text merge:
```bash
# Extract the 3-way inputs from git's stage slots
git show :1:<path> > /tmp/base # Stage 1 = common ancestor
git show :2:<path> > /tmp/ours # Stage 2 = current branch (HEAD)
git show :3:<path> > /tmp/theirs # Stage 3 = incoming branch
# Preview what mergiraf would produce (writes to -o, doesn't touch working copy)
mergiraf merge /tmp/base /tmp/ours /tmp/theirs -o /tmp/merged -p <path>
# Check if clean (no conflict markers)
grep -c '<<<<<<' /tmp/merged # 0 = clean
```
If the merged output has no conflict markers, mergiraf resolved it cleanly — the git
merge driver may have fallen back to text merge due to a parse error or size limit.
Apply the clean output:
```bash
cp /tmp/merged <path>
git add <path>
```
### 3. Batch Resolution
For repos with many conflicted files, use the batch script:
```bash
# Preview what can be resolved (no file changes; dry-run is the default)
python3 skills/merge-resolve/scripts/batch-resolve.py
# Apply all clean resolutions
python3 skills/merge-resolve/scripts/batch-resolve.py --apply
# Markdown-formatted output and mergiraf debug logs
python3 skills/merge-resolve/scripts/batch-resolve.py --verbose
```
The script extracts 3-way inputs for every conflicted file, runs `mergiraf merge`
on them, and reports which files resolved cleanly vs which need manual intervention.
### 4. Handle Remaining Conflicts
After structural resolution, for files that still have conflict markers:
**Check rerere first:**
```bash
git rerere status # Files with recorded resolutions
git rerere diff # Show what rerere would apply
```
If rerere has a resolution, it was already applied. If not, guide the user to manual resolution:
```bash
git mergetool # Opens kdiff3 for each conflicted file
# Or for a specific file:
git mergetool <path>
```From paulnsorensen/cheese-flow, MIT.
More from paulnsorensen/cheese-flow
- 0.498score
nih-audit
paulnsorensen
Scan a codebase for custom code that duplicates what open-source libraries already do, then recommend which libraries to adopt.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
cheez-search
paulnsorensen
AST-aware code search using tilth MCP.
SkillCFreshness: C★ 1Claude Code +9 - 0.495score
age
paulnsorensen
Staff Engineer code review orchestrator.
SkillCFreshness: C★ 1Claude Code +9 - 0.495score
cleanup
paulnsorensen
Mechanical apply of /age's hash-anchored sidecar fixes via tilth_edit.
SkillCFreshness: C★ 1Claude Code +9 - 0.495score
cure
paulnsorensen
Finish what /age started.
SkillCFreshness: C★ 1Claude Code +9 - 0.494score
mold
paulnsorensen
Iterative thinking amplifier for fuzzy ideas.
SkillCFreshness: C★ 1Claude Code +9 - 0.490score
research
paulnsorensen
Multi-source research orchestrator that routes questions across Context7 library docs, Tavily web research, codebase analysis, and GitHub examples, then…
SkillCFreshness: C★ 1Claude Code +9 - 0.490score
milknado-execute
paulnsorensen
Use the Milknado MCP tools to pick and execute the next ready node from the Mikado graph, apply file changes, and run quality gates.
SkillCFreshness: C★ 1Claude Code +9 - 0.432score
cheez-write
paulnsorensen
Hash-anchored file editing using tilth MCP.
SkillDFreshness: D★ 1Claude Code +9 - 0.432score
cheez-read
paulnsorensen
Smart code reading using tilth MCP.
SkillDFreshness: D★ 1Claude Code +9 - 0.432score
gh
paulnsorensen
Complete GitHub tasks using the gh CLI.
SkillDFreshness: D★ 1Claude Code +9 - 0.425score
milknado-plan
paulnsorensen
Use the Milknado MCP tools to decompose a goal into a Mikado-style change graph and produce a token-budgeted batch plan.
SkillDFreshness: D★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 1
- Open issues
- 25
- Last commit (this folder)
- Apr 27, 2026 (6 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/paulnsorensen/cheese-flow
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from paulnsorensen
- 0.603score
build-optimize
paulnsorensen
Optimize local build, test, and check commands with measured wall-time evidence.
SkillAFreshness: A★ 2Claude Code +9 - 0.603score
chezmoi
paulnsorensen
Guides dotfile management with chezmoi when the user says "set up dotfiles", "manage my dotfiles", "bootstrap a new machine", "chezmoi", "encrypt my SSH key…
SkillAFreshness: A★ 2Claude Code +9 - 0.603score
bin-doctor
paulnsorensen
Audit and repair installed binaries so each tool has one install path, a clean cache, and a current pin, across mise, Homebrew, cargo, uv, npm, pnpm, bun…
SkillAFreshness: A★ 2Claude Code +9 - 0.600score
ci-optimize
paulnsorensen
Optimize GitHub Actions workflow wait time with measured evidence.
SkillAFreshness: A★ 2Claude Code +9 - 0.598score
cheese-board-loop
paulnsorensen
Runs the cheese-board workflow and asks the user each question it raises.
SkillAFreshness: A★ 2Claude Code +9 - 0.592score
skillz
paulnsorensen
Add, improve, audit, wedge, or autoimprove a skill.
SkillAFreshness: A★ 1Claude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get merge-resolve running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
merge-resolve skill. Agent Mart. https://agentmart.dev/skills/paulnsorensen-merge-resolve (last updated 2026-10-24)