# Roo Conflict Resolution

Provides comprehensive guidelines for resolving merge conflicts intelligently using git...

- Repository: https://github.com/zgsm-ai/costrict (4459 stars)
- Category: Git and review
- License: Apache-2.0
- Last updated: 2026-09-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add zgsm-ai/costrict --skill roo-conflict-resolution -g -a claude-code -y`
Codex: `npx skills add zgsm-ai/costrict --skill roo-conflict-resolution -g -a codex -y`
Cursor: `npx skills add zgsm-ai/costrict --skill roo-conflict-resolution -g -a cursor -y`
Gemini CLI: `npx skills add zgsm-ai/costrict --skill roo-conflict-resolution -g -a gemini-cli -y`

## Description

Provides comprehensive guidelines for resolving merge conflicts intelligently using git history and commit context. Use when tasks involve merge conflicts, rebasing, PR conflicts, or git conflict resolution. This skill analyzes commit messages, git blame, and code intent to make intelligent resolution decisions.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# CoStrict Conflict Resolution Skill

## When to Use This Skill

Use this skill when the task involves:

- Resolving merge conflicts for a specific pull request
- Rebasing a branch that has conflicts with the target branch
- Understanding and analyzing conflicting code changes
- Making intelligent decisions about which changes to keep, merge, or discard
- Using git history to inform conflict resolution decisions

## When NOT to Use This Skill

Do NOT use this skill when:

- There are no merge conflicts to resolve
- The task is about general code review without conflicts
- You're working on fresh code without any merge scenarios

## Workflow Overview

This skill resolves merge conflicts by analyzing git history, commit messages, and code changes to make intelligent resolution decisions. Given a PR number (e.g., "#123"), it handles the entire conflict resolution process.

## Initialization Steps

### Step 1: Parse PR Number

Extract the PR number from input like "#123" or "PR #123". Validate that a PR number was provided.

### Step 2: Fetch PR Information

```bash
gh pr view [PR_NUMBER] --json title,body,headRefName,baseRefName
```

Get PR title and description to understand the intent and identify the source and target branches.

### Step 3: Checkout PR Branch and Prepare for Rebase

```bash
gh pr checkout [PR_NUMBER] --force
git fetch origin main
GIT_EDITOR=true git rebase origin/main
```

- Force checkout the PR branch to ensure clean state
- Fetch the latest main branch
- Attempt to rebase onto main to reveal conflicts
- Use `GIT_EDITOR=true` to ensure non-interactive rebase

### Step 4: Check for Merge Conflicts

```bash
git status --porcelain
git diff --name-only --diff-filter=U
```

Identify files with merge conflicts (marked with 'UU') and create a list of files that need resolution.

## Main Workflow Phases

### Phase 1: Conflict Analysis

Analyze each conflicted file to understand the changes:

The rest: https://github.com/zgsm-ai/costrict/blob/HEAD/.roo/skills/roo-conflict-resolution/SKILL.md
