resolve-conflicts
Installation
SKILL.md
Resolve conflicts
Resolve every conflict in an in-progress rebase or merge. Preserve the target branch's current structure, then reapply the incoming change's intent where it is still relevant.
Treat a branch supplied in the request, such as /resolve-conflict on dev or /resolve-conflicts dev, as the expected target branch. Verify that expectation against the active Git operation. Do not start a new rebase or merge.
Establish the Git state
- Read repository instructions and run
git status --short --branchplusgit status. - Confirm that a rebase or merge is active. Stop and report if neither operation is active.
- Record all initial staged, unstaged, and untracked paths. Preserve unrelated user changes.
- List unresolved index entries with
git diff --name-only --diff-filter=Uandgit ls-files -u. Do not rely on conflict markers alone; modify/delete, rename, binary, mode, and submodule conflicts might have none. - Identify the commits and their roles before editing:
- For a merge, inspect
HEAD,MERGE_HEAD, their branch names when available, and their merge base. - For a rebase, inspect
HEAD,REBASE_HEAD, the rebase status, and the configured onto/upstream commit when available. During a rebase, Git'soursis normally the rebased upstream state andtheirsis the commit being replayed. - Resolve the expected target branch from the user's argument when one was supplied. Verify that it exists and matches the operation's target or onto history.
- For a merge, inspect
- Do not infer semantic roles from the labels
ours,theirs,current, orincoming. If the target and incoming roles remain ambiguous, stop and ask the user.