Resolve Pr Conflicts

jssblck/agents/skills/resolve-pr-conflicts

by jssblck8715dcc8a572No licenseListed Oct 9, 2026Updated Oct 9, 2026Repository updated today

Use when a PR has merge conflicts with its base branch, including conflicts found during babysitting or merging.

Instructions onlySoftware Development
AI-generated overview

Guides an agent through updating a pull request branch to resolve merge conflicts with its base branch.

What it does
This skill provides a step-by-step procedure for resolving merge conflicts on an open pull request. It covers inspecting the PR, working in a temporary worktree, fetching the PR head and base, merging or rebasing onto the base, resolving conflict hunks, and running build, format, lint, and test checks on the combined tree. It also covers pushing the verified update with force-with-lease when authorized, rechecking mergeability, and reporting the outcome.
When to use it
Use it when a pull request has merge conflicts with its base branch, including conflicts discovered while babysitting or merging a PR. It is intended for updating the PR's own branch, not for merging the PR or retargeting it to another base.
Requirements
Requires the GitHub CLI (gh) and Git, plus network access to the relevant repositories. It needs repository guidance on merge versus rebase, fork permissions, and explicit approval before rewriting a branch the user does not own. It ships no scripts; it references a conflict guidance document.

Resolve PR conflicts

Update the PR's own branch against its current base. This skill does not authorize merging the PR or retargeting it to another base.

Inspect and update

sh
gh pr view <n> -R <owner/repo> --json state,headRefName,headRefOid,baseRefName,mergeable,isCrossRepository,maintainerCanModify
  1. Confirm the PR is open and record its head SHA and base branch.
  2. Work in a temporary worktree, preserving existing local edits.
  3. Fetch the PR head and base from their actual repositories; record the base tip.
  4. Confirm fork permissions and the destination remote before updating the PR branch.
  5. Merge or rebase onto the fetched base according to the repository's guidance.

Get explicit approval before rewriting a branch you do not own, unless already authorized in the session. Disclose every rewrite. Use an explicit --force-with-lease=<branch>:<recorded-head-sha> for an authorized rewrite. If another contributor moved the PR head, stop and reconcile with its owner. Never push to the base branch.

Resolve and verify

Read the conflict guidance [blocked] before resolving hunks. Preserve both changes' intent and check for semantic conflicts even when Git merges cleanly. Ask when the resolution requires a product decision.

  1. Resolve the conflicts and complete the merge or rebase.
  2. Run the repository's relevant build, format, lint, and tests on the combined tree.
  3. Recheck the remote head and base before pushing.
  4. If the base moved, recheck for conflicts and apply the repository's freshness requirements. Preserve concurrent head changes and verify any changed result.
  5. Push the verified update to the PR branch within the user's authorized scope.
  6. Re-read the PR head and mergeability after the push.
  7. Remove the temporary worktree after preserving the completed work.

Report the resolved conflicts, any rewrite, checks run, and remaining blockers. Return to the calling workflow for CI watching or an authorized merge.

Source and attribution

Source:jssblck/agentsinskills/resolve-pr-conflictsat commit8715dcc

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal