agentleFS
igorkulmanigorkulman/pi-skills/skills/resolve-merge-conflicts/SKILL.md

resolve-merge-conflicts

Skill3 starsChanged 2 months agoMITView on GitHub

Resolve every conflict in an ongoing Git rebase or merge and continue the operation to completion without routine confirmation prompts.

12 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use diagnose-ci-failures, write-product-spec and 6 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • zerx-labSkill

    diagnose-ci-failures

    Diagnose CI failures for a PR using the GitHub CLI, extract error logs, and generate a plan to fix them. Use when the user asks to check CI status, pull CI issues, triage test failures, or investigate PR build failures.

    Also in 3 projects that use this

  • zerx-labSkill

    write-product-spec

    Write a PRODUCT.md spec for a significant user-facing feature in Zap, focused on detailed behavior and validation. Use when the user asks for a product spec, desired behavior doc, or PRD, wants to define feature behavior before implementation, or when the feature is substantial or behaviorally ambiguous enough that a written spec would improve implementation or review.

    Also in 3 projects that use this

  • charlesmatteSkill

    write-tech-spec

    Generate a technical specification document from an existing PRD through relentless technical interview and codebase exploration. Use when user wants to write a tech spec, technical specification, technical design document, TDD (technical design doc), or go deeper on the technical details of a PRD.

    Also in 3 projects that use this

  • gitpod-ioSkill

    fix-errors

    Guidelines for fixing unhandled errors from the VS Code error telemetry dashboard. Use when investigating error-telemetry issues with stack traces, error messages, and hit/user counts. Covers tracing data flow through call stacks, identifying producers of invalid data vs. consumers that crash, enriching error messages for telemetry diagnosis, and avoiding common anti-patterns like silently swallowing errors.

    Also in 3 projects that use this

  • busybutlazySkill

    update-skill

    Use this skill when the user wants to modify an existing public skill in this repository's canonical-skills, revise its workflow, or update its package metadata and version.

    Also in 3 projects that use this

  • DockerSkill

    review-pr

    Review one or more incoming Docker documentation pull requests as a maintainer. Independently validate technical claims, assess editorial fit and information architecture, choose a verdict, and draft exact inline or PR-wide feedback behind a confirmation gate. Use for requests such as "review PR 123", "is this PR correct?", "does this information belong here?", "validate this PR", or "help review backlog PRs". Do not use to maintain or fix a PR you own; use maintain-pr for that.

    Also in 3 projects that use this

  • +2 more from zerx-lab

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 9 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 12 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ask only when competing behaviors are materially incompatible and primary sources do not establish which one is intended, or when …

    line 15
  2. Distinctive:

    If a decision is required, ask all currently known blocking questions together.

    line 16
  3. Distinctive:

    Do not start a new rebase or merge.

    line 18
  4. Distinctive:

    Read the complete conflict and enough surrounding code to understand both behaviors.

    line 32
  5. Distinctive:

    Remove conflict markers and verify that Git reports no unmerged entries.

    line 36
  6. Distinctive:

    Use git diff --check and the unmerged-path list as gates before continuing.

    line 39
  7. Distinctive:

    If Git stops on another conflict, return immediately to step 2.

    line 53
  8. Distinctive:

    If a replayed commit becomes empty, verify that all of its intended behavior is already present in the rebased result.

    line 55
  9. Distinctive:

    Do not bypass failing hooks or use destructive recovery commands.

    line 57

“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Resolve Merge Conflicts

Complete an already-running rebase or merge. Invocation is authorization to resolve its conflicts, stage the resolved conflict files, and repeatedly continue until Git reports that the operation has finished. Do not pause for confirmation between conflict rounds.

Automation contract

  • Infer routine resolutions from the code, the replayed commit, target-branch history, tests, and project guidance.
  • Ask only when competing behaviors are materially incompatible and primary sources do not establish which one is intended, or when completion would require a destructive choice unrelated to normal conflict resolution.
  • If a decision is required, ask all currently known blocking questions together. After the user answers, resume the loop automatically without requesting another general confirmation.
  • Preserve unrelated working-tree changes. Never stash, reset, abort, force-push, or stage unrelated files.
  • Do not start a new rebase or merge. If none is in progress, stop and report that clearly.

1. Establish the operation

Inspect Git status, the in-progress rebase/merge metadata, unmerged paths, and applicable repository instructions. Determine why Git stopped without asking the user for information already recorded by Git.

For a rebase, inspect the commit currently being replayed with git rebase --show-current-patch and relevant history. Remember that during a rebase Git's ours/theirs labels are counterintuitive: the current rebased target is one side and the commit being replayed is the other. Reason from intent and content, not the labels.

Completion criterion: the operation type, current replayed change, conflicted paths, and any unrelated work are accounted for.

2. Resolve the current stop

For every unmerged path:

  1. Read the complete conflict and enough surrounding code to understand both behaviors.
  2. Trace each side to primary sources where useful: commit messages and diffs, nearby history, Jira/MR context already available, tests, and project documentation.
  3. Preserve both intents when compatible. When they conflict, choose the behavior consistent with the target branch's current contracts and the replayed commit's actual purpose. Do not invent unrelated behavior.
  4. Handle modify/delete, rename, generated-file, and binary conflicts according to the same intent, rather than selecting a side mechanically.
  5. Remove conflict markers and verify that Git reports no unmerged entries.
  6. Stage exactly the files resolved for this conflict round. Avoid broad staging commands such as git add -A.

Use git diff --check and the unmerged-path list as gates before continuing. A clean marker check alone is not proof that the semantic resolution is correct; inspect the resulting staged diff as well.

Completion criterion: every conflict in the current round is semantically resolved, no unmerged entries remain, and only operation-related paths were staged.

3. Continue until finished

Continue non-interactively so Git reuses the existing commit message instead of opening an editor:

GIT_EDITOR=true git rebase --continue
# or, for an ongoing merge
GIT_EDITOR=true git merge --continue

If Git stops on another conflict, return immediately to step 2. Repeat for every conflict round without asking for routine permission.

If a replayed commit becomes empty, verify that all of its intended behavior is already present in the rebased result. When it is, skip that now-redundant commit and continue automatically. If behavior would be lost, resolve that discrepancy instead of skipping.

Do not bypass failing hooks or use destructive recovery commands. Stop only when an error cannot be resolved within the ongoing operation, and report the exact blocker and Git state.

Completion criterion: Git reports the rebase or merge completed and no operation metadata or unmerged entries remain.

4. Verify and report

Inspect final status and recent history. Run focused verification appropriate to the resolved behavior when practical; when invoking xcodebuild, use the xcodebuild-xcsift workflow. Do not amend, create an extra commit, push, or force-push unless separately requested.

Report concisely:

  • that the operation completed, or the exact blocker if it did not
  • conflicts resolved and any meaningful resolution choices
  • empty commits skipped, if any, and why they were redundant
  • verification run and its result
  • final Git status

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.