Разрешение merge-конфликтов
Разрешает конфликты merge и rebase, разбираясь в намерениях обеих сторон и их коммитов, без слепого выбора ours или theirs, затем собирает проект и гоняет тесты; при настоящем конфликте намерений спрашивает пользователя. Используйте, когда merge или rebase остановился на конфликтах.
merge-conflict-resolverУстановка
Выполните одну команду — она сохранит SKILL.md в папку скиллов агента. Перезапустите агента, и он подхватит скилл сам.
mkdir -p ~/.claude/skills/merge-conflict-resolver && curl -fsSL https://anymodel.org/en/skills/git-workflow/merge-conflict-resolver/SKILL.md -o ~/.claude/skills/merge-conflict-resolver/SKILL.md
mkdir -p ~/.agents/skills/merge-conflict-resolver && curl -fsSL https://anymodel.org/en/skills/git-workflow/merge-conflict-resolver/SKILL.md -o ~/.agents/skills/merge-conflict-resolver/SKILL.md
New-Item -ItemType Directory -Force "$HOME\.claude\skills\merge-conflict-resolver" | Out-Null; Invoke-WebRequest https://anymodel.org/en/skills/git-workflow/merge-conflict-resolver/SKILL.md -UseBasicParsing -OutFile "$HOME\.claude\skills\merge-conflict-resolver\SKILL.md"
New-Item -ItemType Directory -Force "$HOME\.agents\skills\merge-conflict-resolver" | Out-Null; Invoke-WebRequest https://anymodel.org/en/skills/git-workflow/merge-conflict-resolver/SKILL.md -UseBasicParsing -OutFile "$HOME\.agents\skills\merge-conflict-resolver\SKILL.md"
Другой агент: сохраните файл в его папку скиллов или дайте ему ссылку на файл: https://anymodel.org/en/skills/git-workflow/merge-conflict-resolver/SKILL.md
SKILL.md
Merge Conflict Resolver
A conflict means two people changed the same place for different reasons. The correct result keeps both intents, and picking one side blindly silently deletes somebody's work.
1. Look at the state
git status # which operation (merge, rebase, cherry-pick) and which files
git diff --name-only --diff-filter=U # files still unmerged
git log --oneline --left-right --merge # commits on each side touching the conflict
Know which operation is running, because "ours" and "theirs" swap meaning in a rebase: during git rebase, "ours" is the branch you are rebasing onto and "theirs" is your own commit being replayed. Say this to yourself before touching any file.
2. Understand each side before editing
For every conflicted file:
git diff # shows the conflict hunks (combined diff)
git show :1:path/to/file # common ancestor
git show :2:path/to/file # ours
git show :3:path/to/file # theirs
git log -p --merge -- path/to/file
Answer:
- What did the base version do?
- What did each side change, and why? Read the commit messages and related issue or PR.
- Are the changes independent (different concerns in nearby lines) or contradictory (same behavior changed two ways)?
3. Resolve by intent
- Independent changes: keep both; merge them into one coherent result.
- One side moved or renamed code, the other edited it: apply the edit to the new location.
- One side deleted code the other modified: find out whether the deletion made the edit moot; do not resurrect deleted code without reason.
- Same lines, same goal, different implementation: choose one, keep any extra behavior (tests, edge cases) from the other.
- Contradictory behavior: this is a decision for the user. Stop, summarize both intents in two lines each, give your recommendation and ask.
- Generated files and lockfiles: do not hand-edit. Resolve the source (manifest, schema), then regenerate (
npm install,poetry lock,go mod tidy), and check the result.
Remove every conflict marker (<<<<<<<, =======, >>>>>>>) and check none remain:
git diff --check
git grep -nE '^(<<<<<<<|>>>>>>>) |^=======$'
4. Verify the result
A conflict-free file is not a correct file.
- Build, lint and type-check the project.
- Run the tests, especially those touching the resolved files and anything both sides tested.
- Read the final diff of each resolved file against both parents to confirm nothing from either side was lost:
git diff HEAD -- path/to/file # merge: what the resolution changes vs ours
git diff MERGE_HEAD -- path/to/file # merge: vs theirs
5. Finish the operation
git add path/to/file
git merge --continue # or: git rebase --continue / git cherry-pick --continue
Do not create the commit if build or tests fail; fix first, or tell the user. If the resolution is going badly, git merge --abort or git rebase --abort returns to the state before the operation; recommend it and ask before running it if there is manual work in progress.
6. Report
Operation: merge main into feature/x (N files conflicted)
path/a.ts: kept both - <what each side contributed>
path/b.py: took the rebased version of the function, ported X from the other side
Needs your decision: <contradictions with your recommendation>
Checks run: <build/test commands and results>
Pitfalls
- Never run
git checkout --ours .or--theirs .over everything; it discards one side wholesale. - Do not resolve by deleting the conflicting block "to make it compile".
- Do not force-push after a rebase without asking the user; it rewrites shared history.
- Do not
git reset --hardorgit cleanto "start over" without asking; uncommitted resolution work is lost. - Do not forget non-textual conflicts: both sides added a function with the same name in different places, or changed an API that the other side calls. Only the build and tests reveal these.
Source: AnyModel skills catalog · License: CC BY 4.0
Подключить через AnyModel API
Скилл работает на той модели, которую использует агент. Подключите Claude Code, Codex или Cursor к AnyModel и запускайте его на Claude, GPT, Gemini и других моделях по одному ключу — оплата за токены, без подписки.
AnyModel