원클릭으로
cmd-pr-conflict-resolver
// Resolve merge conflicts systematically with context-aware 3-tier classification and escalation protocol
// Resolve merge conflicts systematically with context-aware 3-tier classification and escalation protocol
Ask the agent whether it finished everything or has more to do — a lightweight completeness gate for the end of any task
Audit personal skills for redundancy, verbosity, weak triggers, and overlap. Runs a Claude→Codex review loop, presents per-item approval checkboxes, then applies approved edits and updates README and agent metadata. Use when asked to "review my skills", "audit my skills", "revisit my skills", or "clean up my skills". Accepts an optional skill name to scope the review to a single skill.
Set up or extend golden/snapshot tests for a project. Covers fixture design, Makefile targets, snapshot storage, diff workflow, and update protocol.
Reshape code for readability, naming, structure, TODOs, and reduced surface area across any language
Create or improve Makefiles with minimal complexity. Templates available: base, python-uv, python-fastapi, postgres, nodejs, go, chrome-extension, flutter, electron, static-site.
Build high-signal PR context for review with diff analysis, risk assessment, and discussion questions
| name | cmd-pr-conflict-resolver |
| description | Resolve merge conflicts systematically with context-aware 3-tier classification and escalation protocol |
| disable-model-invocation | false |
| context | fork |
| agent | general-purpose |
Your job is to resolve merge conflicts in the current branch using a structured, context-aware approach. You resolve what you can confidently, explain your reasoning for non-trivial resolutions, and escalate when the correct behavior is ambiguous.
Assume I already ran git merge and there are unresolved conflicts.
git status to confirm conflicts existgit rev-parse MERGE_HEAD (or REBASE_HEAD / CHERRY_PICK_HEAD as applicable)git diff MERGE_HEAD...HEAD -- ":(exclude)*.lock" ":(exclude)package-lock.json" ":(exclude)pnpm-lock.yaml"
This gives you the big picture before touching individual conflicts.
Inventory every conflict before resolving any of them.
git diff --name-only --diff-filter=U
rg "<<<<<<< " --line-number
For each conflict, before classifying or resolving:
Not just the markers. Understand the function/block's role in the file.
git log --oneline MERGE_HEAD -- <file>
git log --oneline HEAD -- <file>
Read commit messages and diffs to understand intent on each side.
Read 20-40 lines around the conflict. Identify invariants:
If the conflict is in a signature, type, constant, or export:
rg "<symbol_name>" --type-add 'src:*.{ts,py,go,rs,java}' -t src
Find all usages to identify downstream impact.
Answer three questions for each conflict:
| Tier | When | Action |
|---|---|---|
| Tier 1 -- Auto-resolve | Non-overlapping additions, formatting-only, one side is strict superset, lock/generated files | Resolve immediately. No developer input needed. |
| Tier 2 -- Resolve + state rationale | Intent is inferable from context, combining both is clearly right but requires care, test file conflicts | Resolve, then present rationale (see format below). Don't block on confirmation. |
| Tier 3 -- Escalate before resolving | Can't determine correct behavior from context, critical path code, silent behavior discard, architectural divergence, cascading multi-file implications | Stop. Show conflict, explain both sides' intent, state the ambiguity, offer 2-3 options with trade-offs. Wait for developer direction. |
Tier 2 rationale format:
Resolved
file:line. [How]. Rationale: [why]. Flag if wrong.
Key balance: Tier 1 keeps you decisive. Tier 3 keeps you consultative when it matters. Tier 2 handles the middle ground -- resolve but make reasoning visible.
<<<<<<<, =======, >>>>>>>)Apply the right merge strategy based on the construct type:
Lists/registries (imports, exports, routes, enum variants):
Function bodies (both added branches/conditions):
Config/struct (both added keys):
Parallel new code (both added new functions/classes):
After combining: Re-read the result as a human would. Check for:
After receiving direction:
When neither side's code is complete and the right answer is a third implementation (not just combining both):
After all conflicts are resolved:
rg "<<<<<<< "
Confirm zero remaining conflict markers.
git add <specific_files> -- not git add .Provide a summary table with a Status emoji column so risky items are impossible to overlook:
| Status | File | Line(s) | Tier | Resolution |
|---|---|---|---|---|
| ... | ... | ... | 1/2/3 | Brief description |
Status emoji meanings (use exactly these):
| Emoji | Meaning | When to use |
|---|---|---|
✅ | Safe / auto-resolved | Tier 1 resolutions, trivial merges, no risk |
🟢 | Resolved with high confidence | Tier 2 where intent was clear from context |
🟡 | Resolved but needs your eyes | Tier 2 with lower confidence, subtle behavior changes, or dropped code |
🔴 | Escalated / blocked | Tier 3, waiting for your direction |
⚠️ | Cascading risk | Auto-merged files or downstream code that may be affected but wasn't in conflict set |
Rules:
🟡 or higher🟡🔴After the table, list flags grouped by severity. Each flag MUST start with its emoji:
🔴 Tier 3 escalations (blocking -- need direction before proceeding)🟡 Tier 2 lower-confidence resolutions (non-blocking but review recommended)⚠️ Cascading implications found during step 3d⚠️ Architectural divergence detected between the two sides⚠️ Files that weren't in the conflict set but may be affected by the mergeAlways close with a 🔴 Cascading Impact section (even if empty). If there are files outside the conflict set that may be broken or need review, present them as a table — not prose:
| 🔴 Risk | File | Why | Action |
|---|---|---|---|
| 🔴 High | path/to/file.py:L42 | Tests written against old handler pattern; may fail with new FastAPI routes | Run make dev-test |
| 🟡 Medium | path/to/other.py | Imports the renamed symbol | Verify import still resolves |
If no cascading impact was found, write: 🟢 No cascading impact detected outside the conflict set.
Never bury cascading risk in a prose paragraph — it must be a labeled section with a table or explicit green all-clear.