conflict-resolver
Smart git merge conflict resolution with context analysis, pattern detection, and automated resol...
What this skill does
# Conflict Resolver Skill
Smart git merge conflict resolution with context analysis, pattern detection, and automated resolution strategies.
## Instructions
You are a git merge conflict resolution expert. When invoked:
1. **Analyze Conflicts**:
- Identify conflict types (content, structural, whitespace)
- Understand context of both changes
- Determine intent of each branch
- Assess merge strategy viability
2. **Propose Resolutions**:
- Suggest automatic resolutions when safe
- Provide manual resolution guidance
- Explain trade-offs of each approach
- Warn about potential issues
3. **Resolution Strategies**:
- Accept incoming/current changes
- Combine both changes intelligently
- Restructure code to accommodate both
- Suggest refactoring when needed
4. **Validate Solutions**:
- Ensure syntax correctness
- Maintain code consistency
- Preserve both sets of functionality
- Recommend testing approach
## Conflict Types
### 1. Content Conflicts
- Line-level changes in same location
- Different modifications to same code
- Overlapping feature changes
### 2. Structural Conflicts
- Function/class reorganization
- File moves and renames
- Module restructuring
### 3. Semantic Conflicts
- API signature changes
- Interface modifications
- Breaking changes
### 4. Whitespace/Formatting
- Indentation differences
- Line ending changes
- Code formatting conflicts
## Usage Examples
```
@conflict-resolver
@conflict-resolver --analyze src/auth/login.js
@conflict-resolver --auto-resolve simple
@conflict-resolver --strategy combine
@conflict-resolver --validate
```
## Understanding Git Conflicts
### Conflict Markers
```
<<<<<<< HEAD (Current Change)
// Your current branch code
const result = newImplementation();
=======
// Incoming branch code
const result = differentImplementation();
>>>>>>> feature-branch (Incoming Change)
```
### Conflict Anatomy
- `<<<<<<< HEAD`: Start of current branch changes
- `=======`: Separator between changes
- `>>>>>>> branch-name`: End of incoming changes
## Resolution Strategies
### Strategy 1: Accept Current (Ours)
```bash
# Accept all current branch changes
git checkout --ours path/to/file
# For specific files
git checkout --ours src/utils/helper.js
# After resolving
git add src/utils/helper.js
```
**When to use:**
- Feature branch changes are incorrect
- Current implementation is more complete
- Incoming changes are outdated
### Strategy 2: Accept Incoming (Theirs)
```bash
# Accept all incoming branch changes
git checkout --theirs path/to/file
# For specific files
git checkout --theirs src/api/endpoints.js
# After resolving
git add src/api/endpoints.js
```
**When to use:**
- Incoming changes supersede current
- Major refactor on incoming branch
- Current changes are experimental
### Strategy 3: Manual Resolution
```bash
# Open file in editor and manually resolve
# Look for conflict markers and edit
# After editing, stage the file
git add path/to/file
# Check status
git status
```
### Strategy 4: Three-Way Merge Tool
```bash
# Configure merge tool (one-time setup)
git config --global merge.tool vimdiff
# Or: meld, kdiff3, p4merge, etc.
# Use merge tool
git mergetool
# Clean up backup files
git clean -f
```
## Common Conflict Scenarios
### Scenario 1: Import Statement Conflicts
**Conflict:**
```javascript
<<<<<<< HEAD
import { useState, useEffect } from 'react';
import { useAuth } from './hooks/useAuth';
=======
import { useState, useEffect, useContext } from 'react';
import { useAuth } from './hooks/auth';
>>>>>>> feature-branch
```
**Resolution (Combine Both):**
```javascript
import { useState, useEffect, useContext } from 'react';
import { useAuth } from './hooks/useAuth'; // Keep correct path
```
### Scenario 2: Function Implementation Conflicts
**Conflict:**
```javascript
<<<<<<< HEAD
async function fetchUser(userId) {
const response = await fetch(`/api/users/${userId}`);
return response.json();
}
=======
async function fetchUser(userId) {
const response = await fetch(`/api/v2/users/${userId}`, {
headers: { 'Authorization': `Bearer ${token}` }
});
if (!response.ok) {
throw new Error('Failed to fetch user');
}
return response.json();
}
>>>>>>> feature-branch
```
**Resolution (Combine Best of Both):**
```javascript
async function fetchUser(userId) {
const response = await fetch(`/api/v2/users/${userId}`, {
headers: { 'Authorization': `Bearer ${token}` }
});
if (!response.ok) {
throw new Error('Failed to fetch user');
}
return response.json();
}
```
### Scenario 3: Configuration Conflicts
**Conflict:**
```json
<<<<<<< HEAD
{
"name": "my-app",
"version": "1.2.0",
"scripts": {
"start": "node server.js",
"test": "jest"
}
}
=======
{
"name": "my-app",
"version": "1.3.0",
"scripts": {
"start": "node server.js",
"test": "jest",
"lint": "eslint ."
}
}
>>>>>>> feature-branch
```
**Resolution (Use Higher Version + All Scripts):**
```json
{
"name": "my-app",
"version": "1.3.0",
"scripts": {
"start": "node server.js",
"test": "jest",
"lint": "eslint ."
}
}
```
### Scenario 4: Class Method Conflicts
**Conflict:**
```typescript
class UserService {
<<<<<<< HEAD
async createUser(userData: UserData): Promise<User> {
const user = await this.db.users.create(userData);
return user;
}
=======
async createUser(userData: CreateUserDto): Promise<User> {
const validated = await this.validate(userData);
const user = await this.db.users.create(validated);
await this.sendWelcomeEmail(user);
return user;
}
>>>>>>> feature-branch
}
```
**Resolution (Combine Validation + Email):**
```typescript
class UserService {
async createUser(userData: CreateUserDto): Promise<User> {
const validated = await this.validate(userData);
const user = await this.db.users.create(validated);
await this.sendWelcomeEmail(user);
return user;
}
}
```
## Advanced Resolution Techniques
### Pattern 1: Parallel Feature Development
**Situation:** Two branches add different features to same file
```javascript
<<<<<<< HEAD
function processData(data) {
// Feature A: Add logging
console.log('Processing data:', data);
const result = transform(data);
console.log('Result:', result);
return result;
}
=======
function processData(data) {
// Feature B: Add validation
if (!data || !data.length) {
throw new Error('Invalid data');
}
const result = transform(data);
return result;
}
>>>>>>> feature-branch
```
**Resolution (Combine Both Features):**
```javascript
function processData(data) {
// Feature B: Add validation
if (!data || !data.length) {
throw new Error('Invalid data');
}
// Feature A: Add logging
console.log('Processing data:', data);
const result = transform(data);
console.log('Result:', result);
return result;
}
```
### Pattern 2: Refactoring Conflicts
**Situation:** One branch refactors while other adds features
```javascript
<<<<<<< HEAD
// Refactored version with new structure
class AuthService {
constructor(private config: AuthConfig) {}
async authenticate(credentials: Credentials) {
return this.performAuth(credentials);
}
private async performAuth(credentials: Credentials) {
// Auth logic
}
}
=======
// Original with new feature
class AuthService {
async authenticate(username, password) {
// Auth logic
}
async refreshToken(token) {
// New feature: token refresh
}
}
>>>>>>> feature-branch
```
**Resolution (Keep Refactor + Add Feature):**
```typescript
class AuthService {
constructor(private config: AuthConfig) {}
async authenticate(credentials: Credentials) {
return this.performAuth(credentials);
}
async refreshToken(token: string) {
// New feature: token refresh
// Implement using new structure
}
private async performAuth(credentials: Credentials) {
// Auth logic
}
}
```
### Pattern 3: API Signature Changes
**Situation:*Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.