plugins/gh-workflow/skills/merge-conflict-resolution/SKILL.md
Detect, classify, and resolve git merge conflicts through structured analysis of conflict markers, per-file strategy selection, and post-resolution verification. Use when a branch has conflicts with its merge target, when rebasing onto an updated base, or when gh-merge detects an unmergeable PR.
npx skillsauth add synaptiai/synapti-marketplace merge-conflict-resolutionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Domain skill for detecting, classifying, and resolving git merge conflicts systematically.
NEVER silently drop changes. Every conflict resolution must account for both sides. If lines from either side are excluded, the rationale must be documented. When in doubt, ask the user rather than guess.
Detect conflicted files and their conflict types:
# List files with unmerged entries
git diff --name-only --diff-filter=U
# Full status with conflict markers
git status --porcelain
Classify each file by its porcelain status prefix.
| Status | Type | Description | |--------|------|-------------| | UU | Content | Both sides modified the same file | | AA | Add-add | Both sides added a file with the same name | | UD | Delete-modify (ours deleted) | We deleted, they modified | | DU | Delete-modify (theirs deleted) | They deleted, we modified | | AU | Rename-related (add/unmerged) | Rename collision | | UA | Rename-related (unmerged/add) | Rename collision |
Assess each conflicted file's complexity before choosing a strategy:
| Complexity | Description | Example | |------------|-------------|---------| | Trivial | Non-overlapping changes in different sections | Import added at top + function added at bottom | | Semantic | Changes to the same logical unit | Both sides modify the same function | | Structural | File was refactored on one side | Moved code, renamed variables, changed structure | | Delete-modify | One side deleted what the other modified | Feature removed vs feature enhanced |
| Strategy | When to Use | Risk | Autonomy | |----------|-------------|------|----------| | accept-ours | Their change is superseded by ours | Low | Auto for trivial | | accept-theirs | Our change is superseded by theirs | Low | Auto for trivial | | manual-merge | Both changes are needed | Medium | Show rationale | | rebase | Clean linear history needed, few conflicts | Medium | Show rationale |
For each conflict hunk in a file:
<<<<<<< to =======) and theirs block (======= to >>>>>>>)When one side deletes a file (or section) that the other side modifies:
After resolving all conflicts, run these checks in order:
# Must return zero results
grep -rn '^<<<<<<<\|^=======\|^>>>>>>>' . 2>/dev/null | grep -v '.git/' | grep -v 'node_modules/'
If any markers remain, resolution is incomplete. Fix before proceeding.
# Stage resolved files
git add <resolved-files>
# Complete the merge or rebase
git commit --no-edit # or GIT_EDITOR=true git rebase --continue
Run the project's quality commands (lint, test, typecheck) to verify the resolution didn't break anything. Use capability-discovery to find available commands.
Show a summary of what was resolved:
# Show what changed in the resolution
git diff HEAD~1 --stat
Watch for these shortcuts that lead to incorrect resolutions:
| Rationalization | Correct Response | |----------------|-----------------| | "Just take ours for everything" | Analyze each conflict individually — theirs may contain important changes | | "Too complex, just reset and start over" | Read both sides first — most conflicts are simpler than they appear | | "Tests pass so the resolution is correct" | Review the diff too — passing tests don't guarantee semantic correctness | | "This file isn't important" | Every file in the conflict list matters — verify or explicitly document why it's safe to skip | | "Same change on both sides" | Verify they're truly identical — similar-looking changes may have subtle differences |
Read conflict resolution settings using the three-tier cascade:
# Read conflictResolution.autoResolveTrivial (local > project > user > default)
AUTO_RESOLVE=$(jq -r '.conflictResolution.autoResolveTrivial // empty' .claude/settings.gh-workflow.local.json 2>/dev/null)
[ -z "$AUTO_RESOLVE" ] && AUTO_RESOLVE=$(jq -r '.conflictResolution.autoResolveTrivial // empty' .claude/settings.gh-workflow.json 2>/dev/null)
[ -z "$AUTO_RESOLVE" ] && AUTO_RESOLVE=$(jq -r '.conflictResolution.autoResolveTrivial // empty' "$HOME/.claude/settings.gh-workflow.json" 2>/dev/null)
[ -z "$AUTO_RESOLVE" ] && AUTO_RESOLVE="true"
# Read conflictResolution.maxConflictFiles
MAX_FILES=$(jq -r '.conflictResolution.maxConflictFiles // empty' .claude/settings.gh-workflow.local.json 2>/dev/null)
[ -z "$MAX_FILES" ] && MAX_FILES=$(jq -r '.conflictResolution.maxConflictFiles // empty' .claude/settings.gh-workflow.json 2>/dev/null)
[ -z "$MAX_FILES" ] && MAX_FILES=$(jq -r '.conflictResolution.maxConflictFiles // empty' "$HOME/.claude/settings.gh-workflow.json" 2>/dev/null)
[ -z "$MAX_FILES" ] && MAX_FILES="20"
This skill provides domain knowledge for:
gh-resolve — conflict analysis, classification, resolution strategies, and verification (loaded as context)gh-merge — conflict detection triggers handoff to gh-resolveThe skill's content informs:
| Missing Capability | Fallback | |-------------------|----------| | No capability-discovery | Detect quality commands from tech stack indicators | | No quality commands found | Skip build/test verification, warn user | | AskUserQuestion unavailable | Default to manual-merge for all non-trivial conflicts | | Config files missing | Use defaults (autoResolveTrivial: true, maxConflictFiles: 20) |
tools
Validate a FlowWorkflow YAML at `plugins/flow/workflows/<id>.workflow.yaml` against `schemas/v1/workflow.schema.json` AND cross-reference the referenced skills/agents exist + every Tier 3 action is confirm-gated + no native /goal or /loop dependency is declared. Use when /flow:workflow validate is invoked, when CI runs the workflow schema gates, or when a new workflow is being authored. This skill MUST be consulted because schema validation alone catches shape errors; cross-reference validation catches the silent-correctness failures (typo'd skill name, Tier 3 escape, /goal dependency) that would otherwise ship to users.
tools
Verify UI-facing changes by running a screenshot-analyze-verify loop across configured viewports, with a browser-tool priority cascade (Playwright MCP → Chrome DevTools MCP → CLI fallback → external skill fallback) and bounded iteration. Use after build/runtime verification passes and the diff includes `.tsx`/`.jsx`/`.vue`/`.html`/`.css`/`.scss`/`.svelte` files OR the acceptance criteria mention UI/page/render/display/visual. This skill MUST be consulted because UI changes that pass build and unit tests can still ship blank pages, render-blocking console errors, or broken responsive layouts that no other verification phase catches.
data-ai
Coordinate agent teams for adversarial review (paired skeptic/verifier per facet, challenge round with disposition vocabulary, consolidated findings with confidence) or parallel implementation (task sizing 5-6 per teammate, non-overlapping files). Enforces independent analysis before shared conclusions. Reference only (`disable-model-invocation: true`); loaded only when `agentTeams: true` in settings.
development
Conduct two-stage code review: Stage 1 verifies spec compliance (criterion-to-code mapping), Stage 2 evaluates security, correctness, performance, and maintainability across 6 parallel facets with P1/P2/P3 synthesis and deduplication by file:line. Use when reviewing code changes or pull requests. This skill MUST be consulted because reviewing quality on broken logic is wasted effort, and unmet acceptance criteria must block merge.