skills/autonomous-ai-agents/merge-reconciler/SKILL.md
Resolve a git merge conflict between two AGENTS' branches as an impartial third party. Agents resolving conflicts against a peer's work reliably either overwrite the peer or abandon their own change — they lack the peer's context and are biased toward their own side. This skill is the fix: a neutral reconciler that receives both diffs plus both sides' stated intents and produces a merged result, like a merge-queue arbiter.
git merge or git rebase halts on conflicts between two agents' work and
neither original agent should self-adjudicate.terminal running
hermes kanban show <task-id>), PR bodies, or at minimum each branch's
commit messages.Standalone — a human (or agent) invokes this skill inside the conflicted repo: load the skill, then follow the Procedure top to bottom.
Spawned neutral agent — the preferred shape in multi-agent campaigns:
delegate_task: spawn a subagent whose task message contains the repo path,
both branch names, and both sides' intent summaries verbatim, plus an
instruction to follow this skill.kanban_create(title="reconcile branch-a x branch-b", assignee="reconciler", parents=["t_a", "t_b"]). The parent links carry both sides' completion
summaries into the reconciler's context automatically; the card body should
name the repo path and the two branches.| Hunk class | Definition | Resolution |
|---|---|---|
| disjoint-intent | The two changes serve different goals and can coexist | Combine both |
| same-question-different-answer | Both sides answered one design question differently | Pick ONE per stated intents; surface the decision |
| superseded | One side's premise no longer holds after the other's change | Keep the surviving side; note why |
Impartiality contract: never favor the side that spawned you; touch ONLY conflicted regions (no drive-by edits); every design-question pick must appear explicitly in the hand-back summary.
terminal: git status (confirm the conflicted state and list
conflicted files), git merge-base <A> <B>, then for each side
git log --oneline <base>..<side> and git diff <base>..<side> -- <file>
for every conflicted file. In a halted merge, HEAD is one side and
MERGE_HEAD is the other.hermes kanban show <task-id> for completion
summaries/metadata, or the PR body, or the commit messages from the log
above. Write down one sentence of intent per side before touching any file.read_file and locate each
<<<<<<</=======/>>>>>>> block.patch (or write_file for whole-file rewrites):
git add each resolved file via terminal.search_files finds no <<<<<<< markers in the repo and every
resolved file is staged.terminal; at minimum import/execute the
touched modules. Both intents must be observable in the merged behavior
(e.g., side A's new semantics AND side B's disjoint addition both present).git commit (the default merge message plus a body
listing hunk decisions is fine).file:lines — class — which side(s) kept — rationale. For every
same-question-different-answer hunk, state the design question and the
answer you picked so a human can veto it — never bury a design call.kanban_complete(summary=...). Standalone: print the summary.hotspot: <path> — <reason> kanban comment) so the orchestrator decomposes
that file, rather than serially reconciling every new collision on it.git status shows a clean tree on the target branch with a merge commit.search_files pattern <<<<<<<).