본문으로 건너뛰기
Skillpedia
일반 코딩13k · #11387

merge-resolve-conflicts

하는 일

이 스킬은 작업 브랜치를 기본 브랜치와 맞추고 충돌을 해결하도록 AI 에이전트를 안내합니다. Git 브랜치나 worktree에서 일하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓브랜치가 main보다 뒤처져 최신 변경을 병합하고 싶을 때.
  • ✓Git이 병합 충돌을 보고해서 해결을 도움받아야 할 때.
  • ✓병합 전에 저장되지 않은 변경을 어떻게 보관하거나 커밋할지 정해야 하는 경우.

스킬 링크

https://github.com/humanlayer/humanlayer/blob/main/.claude/skills/merge-resolve-conflicts/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/humanlayer/humanlayer/blob/main/.claude/skills/merge-resolve-conflicts/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“최신 main을 제 브랜치에 병합하고, 충돌이 있으면 함께 고쳐 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 최신 변경을 가져오고, 브랜치 상태를 확인한 뒤, 저장되지 않은 작업을 건드리기 전에 묻습니다. 그다음 충돌을 사용자와 함께 하나씩 해결합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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

  1. Read the ticket.md and 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.
  2. 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.
  3. 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
  4. 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 main or 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.
  5. Ask the user how they would like to proceed for each one.
  6. 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.
  7. 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.

자주 묻는 질문

제 변경을 대신 커밋하나요?

먼저 묻습니다. 저장되지 않은 변경이 있으면 병합 전에 보관하거나 커밋하는 방법을 제안합니다.

여러 저장소에서도 작동하나요?

여러 저장소에서 작업하면, 어느 저장소를 병합할지 묻습니다.

원격 저장소를 먼저 확인하나요?

네. 어떤 원격이 설정되어 있는지, 원격 브랜치에 아직 가져오지 않은 변경이 있는지 확인합니다.

상세 정보

작성자의 원본 설명

Use to merge in main and resolve open merge conflicts.

repo: humanlayer/humanlayer

인기도

GitHub 스타
13k
순위
#11387
라이선스
Apache-2.0
업데이트
2026. 10. 31.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬