agentleFS
ForeverAProgrammerForeverAProgrammer/claude-devflow/skills/resolve-conflicts/SKILL.md

resolve-conflicts

Skill0 starsChanged 9 months agoMITView on GitHub

Rebase the current branch onto the target branch to resolve PR conflicts.

  • Deletes or force-pushes
  • Commits and pushes

8 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 6 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run gh pr view --json baseRefName,url 2>/dev/null to get the PR's target branch and URL (requires gh and GitHub).

    line 10
  2. Very specific:

    Run git remote show origin 2>/dev/null | grep 'HEAD branch' to detect the default branch from the remote config (works with any git host).

    line 11
  3. Very specific:

    Check which of main, master, or develop exist on the remote with git branch -r.

    line 12
  4. Distinctive:

    If none of the above work, ask the user to specify the target branch and stop until they do.

    line 13
  5. Distinctive:

    Run git fetch origin to ensure the latest remote changes are available.

    line 14
  6. Distinctive:

    If the rebase succeeds with no conflicts, confirm to the user and skip to step 8.

    line 16
  7. Distinctive:

    If the rebase stops with conflicts:

    line 17
  8. Very specific:

    Run git diff --name-only --diff-filter=U to list conflicting files.

    line 18
  9. Very specific:

    Prefer the incoming change (theirs) if it supersedes the current change.

    line 21
  10. Very specific:

    Prefer the current change (ours) if the incoming change is unrelated.

    line 22
  11. Very specific:

    After editing each file, run git add <file> to mark it resolved.

    line 24
  12. Distinctive:

    If at any point a conflict is too ambiguous to resolve safely, run git rebase --abort, explain what was ambiguous, and ask the user to …

    line 26
  13. Distinctive:

    Run git push --force-with-lease to update the remote branch.

    line 27

“Common” is measured: kept by at least 6 in 10 of the 8 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

Rebase the current branch onto the target branch to resolve PR conflicts.

Steps:

  1. Determine the target branch using the first method that succeeds:
    • Run gh pr view --json baseRefName,url 2>/dev/null to get the PR's target branch and URL (requires gh and GitHub).
    • Run git remote show origin 2>/dev/null | grep 'HEAD branch' to detect the default branch from the remote config (works with any git host).
    • Check which of main, master, or develop exist on the remote with git branch -r.
    • If none of the above work, ask the user to specify the target branch and stop until they do.
  2. Run git fetch origin to ensure the latest remote changes are available.
  3. Run git rebase origin/<target-branch>.
  4. If the rebase succeeds with no conflicts, confirm to the user and skip to step 8.
  5. If the rebase stops with conflicts:
    • Run git diff --name-only --diff-filter=U to list conflicting files.
    • For each conflicting file, read the file and show the conflict markers clearly.
    • Resolve each conflict by choosing the correct code based on context:
      • Prefer the incoming change (theirs) if it supersedes the current change.
      • Prefer the current change (ours) if the incoming change is unrelated.
      • Merge both sides if both changes are needed.
    • After editing each file, run git add <file> to mark it resolved.
  6. Once all conflicts are resolved, run git rebase --continue to proceed. If more conflicts arise, repeat step 5.
  7. If at any point a conflict is too ambiguous to resolve safely, run git rebase --abort, explain what was ambiguous, and ask the user to resolve it manually.
  8. Run git push --force-with-lease to update the remote branch.
  9. Report the result: confirm the branch is rebased and print the PR URL if one was found in step 1, otherwise just confirm the branch is up to date with the target.

$ARGUMENTS

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.