agent-merge-conflict-arbiter
它能做什么
它让一个中立的智能体审阅双方的更改及其所声明的目标,生成合并后的结果。它适合在同一代码仓库上并行运行多个 AI 智能体的团队。
适用场景
- ✓并行任务期间两个智能体分支发生冲突的时候。
- ✓两个智能体修改了同一段代码,导致 git 合并中止的时候。
- ✓不应由任何一个智能体单独决定冲突结果的时候。
技能链接
https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/autonomous-ai-agents/agent-merge-conflict-arbiter/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我们的两个智能体修改了同样的文件,合并因此停止。请以中立立场解决冲突,并完成合并。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体审阅两边的差异以及各自声明的意图,然后生成一个合并版本。如果项目中有构建或测试,它会运行这些检查。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Agent Merge-Conflict Arbiter
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.
When to Use
- Two agent branches/worktrees collide during a parallel campaign (kanban engineering pipeline, parallel-PR wave, multi-worktree refactor).
git mergeorgit rebasehalts on conflicts between two agents' work and neither original agent should self-adjudicate.- Do NOT use for conflicts within a single agent's own work, or for trivial lockfile/generated-file conflicts (regenerate those instead).
Prerequisites
- A repo checkout containing the halted merge, or the two branch names plus permission to run the merge yourself.
- Both sides' intent sources: kanban completion summaries (
terminalrunninghermes kanban show <task-id>), PR bodies, or at minimum each branch's commit messages. - The project's build/test command, if one exists.
How to Run
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-native: create a reconciliation card assigned to a third profile
(not either worker's profile) with BOTH conflicted cards linked as parents —
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.
Quick Reference
| 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.
Procedure
1. Gather both sides
- Run via
terminal:git status(confirm the conflicted state and list conflicted files),git merge-base <A> <B>, then for each sidegit log --oneline <base>..<side>andgit diff <base>..<side> -- <file>for every conflicted file. In a halted merge,HEADis one side andMERGE_HEADis the other. - Collect each side's intent:
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. - Done when: you can state both intents in your own words and have both diffs for every conflicted file.
2. Classify every conflicted hunk
- Open each conflicted file with
read_fileand locate each<<<<<<</=======/>>>>>>>block. - Assign each hunk exactly one class from the Quick Reference table, judging by the stated intents — not by which change looks nicer.
- If a single hunk contains multiple independent decisions (e.g., new logic that combines cleanly PLUS a styling/rounding choice both sides answered differently), decompose it into sub-decisions and classify each one.
- A single file often mixes classes: one hunk may be a design collision while a neighboring hunk is disjoint. Classify per hunk, not per file.
- Done when: every hunk has a written class and a one-line rationale.
3. Resolve under the impartiality contract
- Edit each hunk with
patch(orwrite_filefor whole-file rewrites):- disjoint-intent → merge both changes so each intent is fully served.
- same-question-different-answer → pick the answer that best serves the STATED intents (e.g., an intent of "strict validation" beats "quick default" if the task required correctness). Ne
常见问题
什么时候不应使用它?
对于单个智能体自身工作内的冲突,或锁文件等琐碎的生成文件,应当重新生成,而不应使用它。
开始时需要提供什么?
存在中止合并的代码仓库,或两个分支的名称,以及从提交信息或拉取请求说明中获得的双方意图。
为什么要使用中立的智能体?
技能说明,如果由一方智能体去解决与同伴工作的冲突,往往会覆盖同伴的改动,或丢弃自己的改动。
详情
热度
- GitHub 星标
- 260k
- 排名
- #438
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
antigravity-cli
260k指导你安装、更新和排查 Antigravity 命令行工具,包括其插件、登录和沙盒。
blackbox
260k让你的智能体把编程任务交给 Blackbox AI 命令行工具,它会运行多个 AI 模型并挑选最佳结果。
dynamic-workflow
260k教你的智能体把大量相似的工作保存为脚本批量运行,使只有经过验证的结果才返回主对话。
grok
260k让你的智能体把编程工作交给 xAI 的 Grok Build CLI,用于构建功能、重构、审阅拉取请求或批量修复议题。