# resolve-pr-conflicts

Guides coding assistants through resolving pull request merge conflicts inside an isolated Git worktree without touching main branches or breaking local edits.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 666 installs
- Author: jssblck
- License: GPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/jssblck/agents/tree/HEAD/skills/resolve-pr-conflicts/SKILL.md
- Updated: 2026-10-09
- HTML: https://affpapa.org/en/nevibecode/skills/resolve-pr-conflicts

## What it does

The skill establishes a strict procedure for rebasing or merging PR branches. It starts by reading pull request metadata, head SHAs, and repository permissions using GitHub CLI. Operations run inside a temporary `git worktree`, keeping your current uncommitted working directory intact.

Branch updates follow the target repository's preferred strategy. Rewriting commit history requires clear confirmation, and any force push must use `--force-with-lease` targeting the recorded head SHA. Pushing directly to the base branch is explicitly prohibited.

After conflict hunks are resolved, the assistant runs repository linters, formatting, and test suites on the merged tree. Without a functioning `gh` CLI installation, the assistant cannot inspect PR state or verify remote permissions.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add jssblck/agents --skill resolve-pr-conflicts -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/resolve-pr-conflicts/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/resolve-pr-conflicts/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add jssblck/agents --skill resolve-pr-conflicts -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/resolve-pr-conflicts/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add jssblck/agents --skill resolve-pr-conflicts -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/resolve-pr-conflicts/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install jssblck/agents resolve-pr-conflicts
```

2. **Manually: put the files in place**
- File: `.github/skills/resolve-pr-conflicts/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add jssblck/agents --skill resolve-pr-conflicts -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/jssblck/agents --path skills/resolve-pr-conflicts
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/resolve-pr-conflicts/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add jssblck/agents --skill resolve-pr-conflicts -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/jssblck/agents/tree/HEAD/skills/resolve-pr-conflicts/SKILL.md

## When to use it
- update conflicting pull request branches against an updated base
- prevent corruption of uncommitted local edits via temporary worktrees
- run project linters and test suites before pushing resolutions
- guard against race conditions during force pushes using `--force-with-lease`

## Example prompts
- Resolve the merge conflicts in PR #42 against main
- Sync PR branch 18 with its base and run the tests
- Update this PR with the latest changes from upstream and fix any conflicts

## Similar
- [triage](https://affpapa.org/en/nevibecode/skills/triage.md) — skill · 990453 installs
- [code-review](https://affpapa.org/en/nevibecode/skills/code-review.md) — skill · 789521 installs
- [implement](https://affpapa.org/en/nevibecode/skills/implement.md) — skill · 774700 installs
- [git-guardrails-claude-code](https://affpapa.org/en/nevibecode/skills/git-guardrails-claude-code.md) — skill · 499069 installs
- [setup-pre-commit](https://affpapa.org/en/nevibecode/skills/setup-pre-commit.md) — skill · 489289 installs
- [scaffold-exercises](https://affpapa.org/en/nevibecode/skills/scaffold-exercises.md) — skill · 480196 installs

From the same set: [jssblck/agents](https://affpapa.org/en/nevibecode/by/jssblck/agents.md) — 10 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
