agentleFS
Baba01hacker666Baba01hacker666/dummyskills/skills/git/git-conflict-resolver/SKILL.md

git-conflict-resolver

Skill0 starsChanged 2 months agoMITView on GitHub

Guides agents through inspecting, parsing, and resolving three-way git merge conflicts without dropping changes or leaving markers.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 6 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when:

    line 14
  2. Very specific:

    Do not use for general code review.

    line 19
  3. Very specific:

    If no file is specified: run git status --short | grep '^UU\|^AA\|^UD' to locate all conflicted files.

    line 25
  4. Distinctive:

    Never delete both sides of a conflict without verifying where functionality moved.

    line 26
  5. Distinctive:

    Follow these numbered actions:

    line 29
  6. Very specific:

    Search file for <<<<<<<.

    line 31
  7. Distinctive:

    Remove conflict markers completely.

    line 36
  8. Very specific:

    Run linter and tests (npm test, pytest).

    line 39
  9. Distinctive:

    If both sides added new imports: keep both imports in sorted order.

    line 44
  10. Very specific:

    Always verify zero <<<<<<< or >>>>>>> markers remain in the file.

    line 45
  11. Distinctive:

    Stop and ask the user when:

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Git Conflict Resolver

Safely resolves Git merge conflicts (<<<<<<< HEAD, =======, >>>>>>> branch). Identifies conflicting intent from both branches, reconciles changes, and verifies with tests.

1. Purpose

Resolve file merge conflicts cleanly without discarding either side's valid code or leaving stray conflict markers.

2. When to Use

Use this skill when:

  • A git merge, git rebase, or git pull results in CONFLICT (content): Merge conflict in <file>.
  • Files contain conflict markers (<<<<<<<, =======, >>>>>>>).

3. When Not to Use

  • Do not use for general code review; use diff-reviewer.

4. Required Inputs

  • conflicted_file: Path to the file with conflict markers.

5. Missing-Input Behavior

  1. If no file is specified: run git status --short | grep '^UU\|^AA\|^UD' to locate all conflicted files.
  2. Never delete both sides of a conflict without verifying where functionality moved.

6. Procedure

Follow these numbered actions:

  1. Action 1: Identify Conflicted Hunks
    • Search file for <<<<<<<.
    • Identify "OURS" (current branch) vs "THEIRS" (incoming branch).
  2. Action 2: Analyze Semantic Intent of Both Changes
    • Determine whether changes can be combined (e.g. imports from both branches).
  3. Action 3: Apply Clean Reconciliation
    • Remove conflict markers completely.
    • Combine changes so neither feature is broken.
  4. Action 4: Verify Syntax & Run Tests
    • Run linter and tests (npm test, pytest).
  5. Action 5: Stage Resolved File
    • Run git add <conflicted_file>.

7. Decision Rules

  • If both sides added new imports: keep both imports in sorted order.
  • Always verify zero <<<<<<< or >>>>>>> markers remain in the file.

8. Output Format

Emit the report using this template:

### Git Conflict Resolution: [File Name]

- **File**: `[path]`
- **Conflict Hunks Resolved**: [Count]
- **Verification**: [PASS | FAIL]

#### Resolution Details
- Combined `[branch A feature]` with `[branch B feature]`.
- Removed all conflict markers.

#### Verification Evidence
- Ran test command: `[command]` -> Clean PASS.

9. Verification Checklist

  • Zero conflict markers (<<<<<<<, =======, >>>>>>>) remain.
  • File compiles cleanly without syntax errors.
  • Test suite passes.
  • File staged with git add.

10. Common Failures and Recovery

Failure SymptomCauseRecovery Action
Stray marker left in codeIncomplete manual editRun `grep -nE "^<<<<<<<^=======^>>>>>>>" <file>` to verify.

11. Stop or Escalation Conditions

Stop and ask the user when:

  • Both branches made contradictory architectural changes that cannot be reconciled automatically.

12. Examples

Example 1: Successful Execution

Input:

File: src/routes.ts
Hunk:
<<<<<<< HEAD
import { getUser } from './user';
=======
import { getProfile } from './profile';
>>>>>>> feature

Output:

### Git Conflict Resolution: src/routes.ts

- **File**: `src/routes.ts`
- **Conflict Hunks Resolved**: 1
- **Verification**: PASS

#### Resolution Details
- Combined imports from both branches:
  ```typescript
  import { getProfile } from './profile';
  import { getUser } from './user';
  • Staged file with git add src/routes.ts.

Verification Evidence

  • npx tsc --noEmit exited code 0.

### Example 2: Ambiguous or Missing Input
**Input:**
```text
Fix conflict.

Output:

### Git Conflict Resolution: Checking Git Status

Running `git status` to locate conflicted files across the repository.

Example 3: Expected Final Output

Output:

### Git Conflict Resolution: package.json

- **File**: `package.json`
- **Conflict Hunks Resolved**: 1
- **Verification**: PASS

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.

Reviews can't be read right now.

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.