resolve-merge-conflicts
Resolve Merge Conflicts
Use this skill when a user wants merge conflicts on an active PR resolved all the way through, not just inspected.
The goal is:
- identify the PR base branch
- merge the base into the current branch locally
- resolve the conflicted files without discarding intentional branch work
- validate the merged result
- commit the merge
- push the updated branch
Preconditions
- the current branch should already be the PR branch you intend to update
ghshould be authenticated for the repo if you need to inspect PR metadata- do not assume a conflict is already present locally; check first
Workflow
- Inspect the current branch and PR context.
Start with:
git status --short --branch
git diff --name-only --diff-filter=U
gh pr view --json number,title,baseRefName,headRefName,url
Notes:
- if
git diff --name-only --diff-filter=Uis empty, there may be no active conflicted merge in the worktree yet - if needed, verify the branch matches
headRefNamefrom the PR
- Fetch the latest base branch state.
Typical command:
git fetch origin
- Merge the PR base branch into the current branch locally.
Typical command:
git merge --no-edit origin/<base-branch>
Examples:
git merge --no-edit origin/main
git merge --no-edit origin/develop
If the merge reports conflicts, capture the conflicted files:
git diff --name-only --diff-filter=U
- Read each conflicted file before editing.
Look for conflict markers:
rg -n "^(<<<<<<<|=======|>>>>>>>)" <file>
Guidance:
- keep the current branch's feature intent intact
- absorb compatible changes from the base branch
- prefer the newer shared API or wiring from base when it does not invalidate the feature branch's design
- remove conflict markers completely
- do not blindly take one side for large files; reconcile the behavior
- Resolve the conflicts carefully.
When reconciling:
- preserve branch-specific feature work
- preserve legitimate upstream fixes from base
- adapt old single-file assumptions if the branch has moved to package-level or directory-level behavior
- update tests when upstream added coverage that still assumes old shapes
After edits, verify there are no remaining conflict markers:
rg -n "^(<<<<<<<|=======|>>>>>>>)" src
- Run the smallest useful validation for the merged surfaces.
Recommended baseline:
pnpm typecheck
Then add focused tests for the files or systems touched by the conflict resolution. Examples:
pnpm exec vitest run src/main/issue-resolution.test.ts
pnpm exec vitest run src/main/skill-inventory.test.ts
pnpm exec vitest run src/renderer/src/views/InventoryViewChrome.test.tsx
If the conflict changes visible UI, also run a real browser check with Playwright.
- Stage the resolved files and complete the merge commit.
Typical flow:
git add <resolved-files>
git status
git commit --no-edit
Notes:
- during a merge,
git commit --no-editwill usually finish the merge commit using the default merge message - only use a custom commit message if there is a clear reason
- Push the updated PR branch.
Typical command:
git push origin <current-branch>
Example:
git push origin codex/skills-are-directories-not-files
- Report back clearly.
Include:
- which files had conflicts
- the core reconciliation decisions
- the exact validation you ran
- whether the branch was pushed successfully
Decision Standards
- Do not throw away either side without understanding what behavior it carried.
- Prefer the feature branch's architectural direction when that is the purpose of the PR.
- Prefer the base branch's new shared APIs, tests, and wiring when they can be integrated cleanly.
- If upstream changed assumptions that conflict with the PR's design, reconcile the newer code to the PR's model instead of silently reverting the feature.
- Keep the result coherent; conflict resolution is integration work, not line-level arbitration.
Common Pitfalls
- assuming conflicts already exist locally when they do not
- resolving only the compile errors and missing test expectation drift
- leaving one file still marked
UUbecause it was edited but not staged - forgetting that merge commits are still in progress until
git commit - pushing before re-running targeted validation
Final Response To The User
Report back with:
- what conflicted
- what you chose in the reconciliation
- what checks passed
- confirmation that the branch was pushed
More from arjitj2/arjit-skills
creating-skills
Use when creating a new skill, adding a skill to the user's setup, or the user says "make this a skill". All personal skills live in the arjit-skills monorepo and are symlinked into place.
2adding-a-project
Use when adding a new project to the user's personal site and resume, or when the user says to make something "live". Covers updating both arjit-me and arjit-resume, compiling the PDF, and pushing.
2frontend-slides
Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.
2address-copilot-review
Handle GitHub Copilot PR review comments end-to-end. Use when the user asks to read Copilot's review on a pull request, decide which comments to act on, implement appropriate fixes, push follow-up commits, reply on each review thread with either the fix or the rationale for not changing code, and resolve threads that are fully addressed.
2ios-simulator-testing
End-to-end iOS simulator testing using blitz-iphone MCP and XcodeBuildMCP. Use this skill when testing an iOS app on the simulator — building, launching, interacting with the UI, and verifying state. Covers which MCP to use and when, gesture mechanics, and interaction patterns learned from real test runs.
2swiftui-design-principles
Design principles for building polished, native-feeling SwiftUI apps and widgets. Use this skill when creating or modifying SwiftUI views, iOS widgets (WidgetKit), or any native Apple UI. Ensures proper spacing, typography, colors, and widget implementations that look and feel like quality apps rather than AI-generated slop.
2