resolve-conflicts

220
60
Source

Use this skill immediately when the user mentions merge conflicts that need to be resolved. Do not attempt to resolve conflicts directly - invoke this skill first. This skill specializes in providing a structured framework for merging imports, tests, lock files (regeneration), configuration files, and handling deleted-but-modified files with backup and analysis.

Install

mkdir -p .claude/skills/resolve-conflicts && curl -L -o skill.zip "https://mcp.directory/api/skills/download/2048" && unzip -o skill.zip -d .claude/skills/resolve-conflicts && rm skill.zip

Installs to .claude/skills/resolve-conflicts

About this skill

Git Conflict Resolution

Resolve Git merge conflicts by intelligently combining changes from both branches while preserving the intent of both changes. This skill follows a plan-first approach: assess conflicts, create a detailed resolution plan, get approval, then execute.

Core Principles

  1. Plan Before Executing: Always create a structured resolution plan and get user approval before making changes
  2. Prefer Both Changes: Default to keeping both changes unless they directly contradict
  3. Merge, Don't Choose: Especially for imports, tests, and configuration
  4. Regenerate Generated Files: Never manually merge generated files - always regenerate them from their sources
  5. Backup Before Resolving: For deleted-modified files, create backups first
  6. Validate with Tests: Always run tests after resolution
  7. Explain All Resolutions: For each conflict resolved, provide a one-line explanation of the resolution strategy
  8. Ask When Unclear: When the correct resolution isn't clear from the diff, present options to the user and ask for their choice

Workflow

Step 1: Assess the Conflict Situation

Run initial checks to understand the conflict scope:

git status

Identify and categorize all conflicted files:

  • Regular file conflicts (both modified)
  • Deleted-modified conflicts (one deleted, one modified)
  • Generated file conflicts (lock files, build artifacts, generated code)
  • Test file conflicts
  • Import/configuration conflicts
  • Binary file conflicts

For each conflicted file, gather information:

  • File type and purpose
  • Nature of the conflict (content, deletion, type change)
  • Scope of changes (lines changed, sections affected)
  • Whether the file is generated or hand-written

Step 2: Create Merge Resolution Plan

Based on the assessment, create a structured plan before resolving any conflicts. Present the plan in the following markdown format:

## Merge Resolution Plan

### Conflict Summary

- **Total conflicted files**: [N]
- **Deleted-modified conflicts**: [N]
- **Generated files**: [N]
- **Regular conflicts**: [N]

### Resolution Strategy by File

#### 1. [File Path]

**Conflict Type**: [deleted-modified / generated / imports / tests / code logic / config / struct / binary]
**Strategy**: [Brief description of resolution approach]
**Rationale**: [Why this strategy is appropriate]
**Risk**: [Low/Medium/High] - [Brief risk description]
**Action Items**:

- [ ] [Specific action 1]
- [ ] [Specific action 2]

#### 2. [File Path]

...

### Execution Order

1. **Phase 1: Deleted-Modified Files** - Handle deletions and backups first
2. **Phase 2: Generated Files** - Regenerate from source
3. **Phase 3: Low-Risk Merges** - Imports, tests, documentation
4. **Phase 4: High-Risk Merges** - Code logic, configuration, structs
5. **Phase 5: Validation** - Compile, test, verify

### Questions/Decisions Needed

- [ ] **[File/Decision]**: [Question for user] (Options: 1, 2, 3)

### Validation Steps

- [ ] Run conflict validation script
- [ ] Compile project
- [ ] Run test suite
- [ ] Manual verification of high-risk changes

Present this plan to the user and wait for their approval before proceeding with resolution. If there are any unclear conflicts where you need user input, list them in the "Questions/Decisions Needed" section.

For a complete example plan, see references/sample-plan.md.

Step 3: Handle Deleted-Modified Files

Execute this phase only after the plan is approved.

If there are deleted-but-modified files (status: DU, UD, DD, UA, AU):

.forge/skills/resolve-conflicts/scripts/handle-deleted-modified.sh

This script will:

  • Create timestamped backups of modified content
  • Analyze potential relocation targets
  • Generate analysis reports for each file
  • Automatically resolve the deletion status

Review the backup directory and analysis files to understand where changes should be applied.

Step 4: Execute Resolution Plan

Follow the execution order defined in your plan. For each conflicted file, apply the appropriate resolution pattern according to your plan. For every conflict you resolve, provide a one-line explanation of how you're resolving it.

As you complete each action item in your plan, mark it as done and report progress to the user.

When Resolution is Unclear

When you cannot determine the correct resolution from the diff alone (these should already be listed in your plan's "Questions/Decisions Needed" section):

  1. Present the conflict to the user with the conflicting code from both sides
  2. Provide numbered options for resolution (Option 1, Option 2, etc.)
  3. Explain each option clearly with what it would do
  4. Ask the user to choose an option number or provide additional information
  5. Remember their choice and apply similar reasoning to subsequent related conflicts

Example interaction:

I found a conflict in src/main.rs where both branches modify the `calculate_price` function:

<<<<<<< HEAD (Current Branch)
fn calculate_price(item: &Item) -> f64 {
    item.base_price * (1.0 + item.tax_rate)
}
=======
fn calculate_price(item: &Item) -> f64 {
    item.base_price + item.tax_amount
}
>>>>>>> feature-branch (Incoming Branch)

I'm not sure which calculation is correct. Please select an option:

**Option 1**: Keep current branch (multiplies base_price by tax_rate)
**Option 2**: Keep incoming branch (adds tax_amount to base_price)
**Option 3**: Keep both approaches with a new parameter
**Option 4**: Provide more context to help me decide

Please respond with "Option 1", "Option 2", "Option 3", or "Option 4", or provide additional information.

Once the user responds, apply their decision and similar logic to related conflicts.

Resolution Patterns

For each conflicted file, apply the appropriate resolution pattern:

Imports/Dependencies

Goal: Merge all unique imports from both branches.

One-line explanation: "Merging imports by combining unique imports from both branches, removing duplicates, and grouping by module."

Read references/patterns.md section "Import Conflicts" for detailed examples.

Quick approach:

  1. Extract all imports from both sides
  2. Remove duplicates
  3. Group by module/package
  4. Follow language-specific style (alphabetize, group std/external/internal)

Tests

Goal: Include all test cases and test data from both branches.

One-line explanation: "Merging tests by including all test cases from both branches, combining fixtures, and renaming if necessary to avoid conflicts."

Read references/patterns.md section "Test Conflicts" for detailed examples.

Quick approach:

  1. Keep all test functions unless they test the exact same thing
  2. Merge test fixtures and setup functions
  3. Combine assertions from both sides
  4. If test names conflict but test different behaviors, rename to clarify

Generated Files

Goal: Regenerate any generated files to include changes from both branches.

One-line explanation: "Resolving generated file by regenerating it from source files to incorporate changes from both branches."

Recognition: A file is generated if it:

  • Is produced by a build tool, compiler, or code generator
  • Has a source file or configuration that defines it
  • Contains headers/comments indicating it's auto-generated
  • Is listed in .gitattributes as generated
  • Common examples: lock files, protobuf outputs, GraphQL schema files, compiled assets, auto-generated docs

Approach:

  1. Identify the generation source: Determine what command or tool generates the file

  2. Choose either version temporarily (doesn't matter which):

    git checkout --ours <generated-file>    # or --theirs
    
  3. Regenerate from source: Run the appropriate generation command:

    # Package manager lock files
    cargo update                       # for Cargo.lock
    npm install                        # for package-lock.json
    yarn install                       # for yarn.lock
    bundle install                     # for Gemfile.lock
    poetry lock --no-update            # for poetry.lock
    
    # Code generation
    protoc ...                         # for protobuf files
    graphql-codegen                    # for GraphQL generated code
    make generate                      # for Makefile-based generation
    npm run generate                   # for npm script-based generation
    
    # Build artifacts
    npm run build                      # for compiled/bundled assets
    cargo build                        # for Rust build artifacts
    
  4. Stage the regenerated file:

    git add <generated-file>
    

When unsure if a file is generated: Check for auto-generation markers in the file header, or ask the user if you should regenerate or manually merge the file.

Configuration Files

Goal: Merge configuration values from both branches.

One-line explanation: "Merging configuration by including all keys from both branches and choosing appropriate values for conflicts."

Read references/patterns.md section "Configuration File Conflicts" for detailed examples.

Quick approach:

  1. Include all keys from both sides
  2. For conflicting values, choose based on:
    • Newer/more recent value
    • Safer/more conservative value
    • Production requirements
  3. Document choice in commit message

When unclear: Ask the user which configuration value to prefer (current vs incoming)

Code Logic

Goal: Understand intent of both changes and combine if possible.

One-line explanation: "Resolving code logic by analyzing intent: merging if changes are orthogonal, or choosing one approach if they conflict."

Read references/patterns.md section "Code Logic Conflicts" for detailed examples.

Quick approach:

  1. Analyze what each branch is trying to achieve
  2. If changes are orthogonal (different concerns), merge both
  3. If changes conflict (

Content truncated.

create-plan

antinomyhq

Generate detailed implementation plans for complex tasks. Creates comprehensive strategic plans in Markdown format with objectives, step-by-step implementation tasks using checkbox format, verification criteria, risk assessments, and alternative approaches. Use when users need thorough analysis and structured planning before implementation, when breaking down complex features into actionable steps, or when they explicitly ask for a plan, roadmap, or strategy. Strictly planning-focused with no code modifications.

11416

create-agent

antinomyhq

Create new agents for the code-forge application. Agents are stored as .md files in the <cwd>/.forge/agents directory with YAML frontmatter (id, title, description, reasoning, tools, user_prompt) and markdown body containing agent instructions. Use when users need to add new agents, modify existing agents, or understand the agent file structure.

184

create-pr-description

antinomyhq

Generate and create pull request descriptions automatically using GitHub CLI. Use when the user asks to create a PR, generate a PR description, make a pull request, or submit changes for review. Analyzes git diff and commit history to create comprehensive, meaningful PR descriptions that explain what changed, why it matters, and how to test it.

112

execute-plan

antinomyhq

Execute structured task plans with status tracking. Use when the user provides a plan file path in the format `plans/{current-date}-{task-name}-{version}.md` or explicitly asks you to execute a plan file.

21

debug-cli

antinomyhq

Use when users need to debug, modify, or extend the code-forge application's CLI commands, argument parsing, or CLI behavior. This includes adding new commands, fixing CLI bugs, updating command options, or troubleshooting CLI-related issues.

161

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

1,5741,370

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

1,1161,191

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

1,4181,109

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

1,199751

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

1,157685

pdf-to-markdown

aliceisjustplaying

Convert entire PDF documents to clean, structured Markdown for full context loading. Use this skill when the user wants to extract ALL text from a PDF into context (not grep/search), when discussing or analyzing PDF content in full, when the user mentions "load the whole PDF", "bring the PDF into context", "read the entire PDF", or when partial extraction/grepping would miss important context. This is the preferred method for PDF text extraction over page-by-page or grep approaches.

1,322617

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.