merge-resolve-conflicts
What it does
It guides the AI agent to update your working branch with the default branch and resolve conflicts. It is for developers working on a git branch or worktree.
When to use it
- ✓When your branch is behind main and you want the latest changes merged in.
- ✓When git reports merge conflicts that you need help resolving.
- ✓When you have unsaved changes and need to decide how to stash or commit them before merging.
Skill link
https://github.com/humanlayer/humanlayer/blob/main/.claude/skills/merge-resolve-conflicts/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Merge the latest main into my branch and help me fix any conflicts.”
5 new skills a week. 1 minute to read.
How it works
The agent fetches the latest changes, checks the state of your branch, and asks before touching unsaved work. It then works through the conflicts with you.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
You are either on a branch in a repository, or you are on a git worktree for a specific branch.
You are responsible for ensuring the default branch (usually main or master, but not always) is merged into the current branch.
Begin by running git fetch.
Then:
Step 1: Orientation
First, you must determine if you are on a worktree for a repository OR if you are on a regular branch on a repository OR if you are on the default branch for the repository
Second, you must determine if the branch you are on has changes on upstream / origin (as configured) that you do not have on your local branch
Third, you should determine if there are existing merge conflicts on your branch already by running git status.
Fourth, you should determine if the user has both an origin and an upstream configured.
Important: if the user is working across multiple repositories, you should ask them which repository(ies) they would like help merging in.
Step 2: Action
Depending on the results of your orientation you should take one of the following actions:
- If the user has unstaged changes which do not include merge conflicts or an ongoing merge: offer to either stash and merge, or to commit before merging, Then proceed with the following once the user answers:
- If there are existing merge conflicts on your current branch: proceed to "Conflict Resolution Procedure" and follow those instructions.
- If you are on a worktree or branch which is not for the default branch, and there are no merge conflicts:
- if the user has both upstream and origin configured: fetch the defualt branch from the upstream and then merge it into the current branch. Proceed to the "conflict resolution procedure" steps.
- if the user has only origin configured: fetch the default branch from the origin and merge it into the current branch. Proceed to the "Conflict resolution procedure" steps.
- If you are on the default branch and there are no merge conflicts and no changes on origin/upstream: Indicate this to the user and ask what they would like you to do.
Conflict Resolution Procedure
- Read the
ticket.mdand structure outline artifacts. These should contain sufficient context about the user's task and what they are working on. You may later read the plan file if you determine that more information is needed. - Use sub-agents to analyze the git state on the current branch and on the branch the conflicts come from to understand what was done and why they diverge.
- Use sub-agents to read the entire file for each conflict, as well as key relevant code and modules to understand the scope and nature of each conflict
- For each conflict (not necessarily each individual confict, e.g. group two related conflicts in the same file together e.g. for a function change and an import change for it), provide an analysis to the user of:
a. What is on HEAD
b. What is on the branch that the conflict is coming from (probably
mainor the other default branch) c. Based on the scope of the current task, recent commits to it and to the branch where the source of the conflict is coming from, how you recommend resolving it (keep HEAD, keep other branch, merge them), and why Keep your analysis concise, offer to provide more detail to the user if they ask. - Ask the user how they would like to proceed for each one.
- Work back and forth with the user to resolve all conflicts. Only make changes that the user explicitly asks for - e.g. do not resolve a conflict until the user confirms the approach or instructs you to make the change.
- Once all merge conflicts are resolved, ask the user if they would like you to commit and push. If they confirm, you should write a conventional commit-style message indicating the branch merged in (from what commit hash), and a full body that indicates what each of the conflicts resolved was and how it was resolved and why.
IMPORTANT: Update your todo list to include items 1-7. You MUST stop and ask the user how they would like to proceed after presenting the analysis from step 4. You MUST work back and forth with the user until all conflicts have been resolved before proceeding to stop 7. The user may only give you instructions / guidance on some of the changes at a time - you should use the todo tool to track which ones have been completed and which ones still need resolution in your todo list.
FAQ
Will it commit my changes for me?
It asks first. If you have unsaved changes, it offers to stash them or commit them before merging.
Does it work across several repositories?
If you work across multiple repositories, it asks which ones you want help merging in.
Does it check my remotes first?
Yes. It checks which remotes are configured and whether the remote branch has changes you do not have yet.
Details
Original description by the author
Use to merge in main and resolve open merge conflicts.
repo: humanlayer/humanlayer
Popularity
- GitHub stars
- 13k
- Ranking position
- #11387
- License
- Apache-2.0
- Updated
- 10/31/2026
Comments
- …
More skills from this repository
asd-ste100
13kTeaches your agent to rewrite confusing English into short, one-meaning sentences that are easy for people and other software to read.
better-github-skill
13kHelps your agent check a pull request's status, read its review comments, and find why a CI build failed, using ready-made GitHub scripts.
calldiff
13kHelps your agent compare the chains of function calls in a codebase between two git versions, so a code review can see what behavior changed.
chrome-devtools-cli
13kLets your agent control Chrome from the terminal to open pages, click, fill in forms, and take page snapshots for browser automation and testing.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.