merge-conflict-surgeon
Use this skill when resolving Git merge conflicts. Activate when the user mentions merge conflicts, conflicting changes, failed merges, "both modified", HEAD markers, conflict markers (<<<<<<<, =======, >>>>>>>), or asks how to resolve conflicts between branches. Also use when git merge or git rebase fails due to conflicts.
What this skill does
# Merge Conflict Surgeon
Resolve Git merge conflicts systematically and safely.
## When to Use
- `git merge` or `git rebase` fails with conflicts
- You see conflict markers (`<<<<<<<`, `=======`, `>>>>>>>`) in files
- `git status` shows "both modified" files
- Merging feature branches into main/develop
- Rebasing a branch onto updated main
## Workflow
### Step 1: Assess the Damage
```bash
# See all conflicted files
git status
# See the full diff of conflicts
git diff --name-only --diff-filter=U
```
List all conflicted files and categorize them:
- **Simple conflicts**: Same file, different lines (auto-resolvable logic)
- **Overlap conflicts**: Same lines modified differently (needs human decision)
- **Delete/modify conflicts**: One side deleted, other modified
### Step 2: Understand Both Sides
For each conflicted file, understand:
```bash
# See what YOUR branch changed
git diff HEAD~1 -- <file>
# See what the OTHER branch changed
git diff MERGE_HEAD~1 -- <file>
# See common ancestor
git show :1:<file> # Base version
git show :2:<file> # Ours (current branch)
git show :3:<file> # Theirs (merging branch)
```
### Step 3: Resolve Strategically
**For simple conflicts (different functionality):**
- Keep both changes, ensure they don't break each other
- Run the code mentally or actually to verify
**For overlapping conflicts (same code, different changes):**
1. Understand the INTENT of each change
2. Determine which achieves the goal better
3. Sometimes combine logic from both
4. Never blindly pick "ours" or "theirs"
**For delete/modify conflicts:**
- If deleted intentionally (refactoring), ensure the modification isn't needed
- If deleted accidentally, restore and apply modification
### Step 4: Validate Resolution
```bash
# Mark as resolved
git add <resolved-file>
# Verify no remaining conflicts
git diff --check
# Run tests before completing
npm test # or your test command
# Complete the merge
git commit # or git rebase --continue
```
## Resolution Patterns
### Pattern 1: Sequential Changes
```
<<<<<<< HEAD
function processUser(user) {
validateUser(user);
=======
function processUser(user) {
logUserAccess(user);
>>>>>>> feature-branch
```
**Resolution:** Keep both - they're independent additions
```javascript
function processUser(user) {
validateUser(user);
logUserAccess(user);
```
### Pattern 2: Competing Implementations
```
<<<<<<< HEAD
const result = items.filter(x => x.active).map(x => x.name);
=======
const result = items.reduce((acc, x) => x.active ? [...acc, x.name] : acc, []);
>>>>>>> feature-branch
```
**Resolution:** Choose based on readability/performance needs. The `filter().map()` is clearer.
### Pattern 3: Configuration Changes
```
<<<<<<< HEAD
const API_URL = 'https://api.prod.example.com';
=======
const API_URL = 'https://api.staging.example.com';
>>>>>>> feature-branch
```
**Resolution:** This is environment-specific. Use environment variables instead:
```javascript
const API_URL = process.env.API_URL || 'https://api.prod.example.com';
```
## Tools
```bash
# Use a merge tool (if configured)
git mergetool
# Abort if things go wrong
git merge --abort
git rebase --abort
# Accept all of one side (use carefully)
git checkout --ours <file> # Keep your version
git checkout --theirs <file> # Keep their version
```
## Common Mistakes to Avoid
- Never blindly accept "ours" or "theirs" without understanding the changes
- Don't leave conflict markers in code (<<<<<<, =======, >>>>>>>)
- Don't skip running tests after resolution
- Don't force push to shared branches after rebase conflicts
- Don't ignore whitespace or formatting conflicts - they can hide real issues
## Emergency Recovery
```bash
# If you messed up the resolution
git checkout -m <file> # Restore conflict markers
# If you committed a bad resolution
git reset --soft HEAD~1 # Undo commit, keep changes
# Then resolve again
# Nuclear option: start over
git merge --abort # or git rebase --abort
```
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.