옵션
집 Skill 코드 검토 pull-changes-resolve-conflicts

pull-changes-resolve-conflicts

cognitedata/builder-skills cognitedata/builder-skills

다수의 기여자가 참여하는 프로젝트(Flows 앱 포함)에서 작업물이 무단으로 삭제되지 않도록 메인 브랜치나 기타 브랜치의 업데이트를 가져오는 표준 작업 흐름입니다. 이 프로세스는 데이터 가져오기 및 병합 방법을 안내하며, 병합 충돌을 명시적으로 나열하고 대화 기록과 저장소 상황을 활용해 자신의 변경 사항과 상대방의 변경 사항을 비교 분석합니다. 또한 우선순위가 지정된 권장 사항을 제시하고, 충돌 표시를 수정하거나 병합을 완료하기 전에 사용자의 의견을 수렴합니다. 트리거로는 메인 브랜치에서 데이터 가져오기, 메인 브랜치 병합, origin 브랜치 병합, 리베이스, 병합 충돌 발생, 아직 병합되지 않은 패치 등이 있습니다.

...모든 것을 확장하십시오
11
업데이트 된 시간 2026년 8월 26일

pull-changes-resolve-conflicts에 대하여

여러 명의 기여자가 함께 작업하는 프로젝트에서 특정 브랜치를 다른 브랜치에 통합할 때(일반적으로 main 브랜치를 기능 브랜치에 푸시하거나 병합할 때), 의도적으로 작성된 코드가 무단으로 삭제되는 일이 없도록 안내하는 작업 흐름입니다. 이 방법은 모든 Git 기반 팀 작업 흐름에 적용될 수 있으며, 특히 Flows/React 애플리케이션의 경우 갈등이 애플리케이션의 메인 구조, 상단 네비게이션, 라우트 모듈, 그리고 공유된 lib/ 또는 hooks/ 디렉터리에 집중되는 경향이 있어 자주 사용됩니다. 핵심 원칙은 갈등 해결 과정에서 분석을 시작하기 전에 “main 브랜치가 승리한다”거나 “우리 쪽이 승리한다”고 단정해서는 안 되며, 갈등 표시가 수정되기 전에 사용자에게 발생할 수 있는 타협 사항들을 명확하게 보여주어야 한다는 점입니다.

작업 흐름은 단계별로 진행됩니다. 먼저 git fetch를 실행한 뒤 필요에 따라 git merge origin/main을 사용해 코드를 가져오고 통합한 다음, 아직 병합되지 않은 모든 파일을 명시적으로 나열하고 각 파일에서 어떤 부분이 다른지 간단히 설명합니다. 그 다음 대화 기록, 프로젝트의 PRD.md나 최근 커밋과 같은 신호들, 그리고 git show :2:path(우리 쪽 코드)와 git show :3:path(상대방 코드)를 통해 갈등 부분들을 분석합니다. 갈등은 서로 겹치지 않는 경우(안전하게 결합 가능), 중복되는 경우(직접 선택하거나 수동으로 병합해야 함), 혹은 오류로 인해 중복된 코드 블록이 생긴 경우(손상 위험)로 분류됩니다. 분석 결과는 우선순위가 지정된 권장 사항과 구체적인 질문 형태로 제시되며, 우선순위는 P0(라우트 삭제, 기능 제거, 데이터나 API 계약 변경과 같은 구조적/제품 관련 변경)부터 P3(간격 조정, 클래스명 변경과 같은 디자인 관련 수정)까지 나뉩니다.

이 도구는 갈등을 조용히 해결하는 것을 엄격히 금지합니다. 사용자가 제시된 계획에 동의하거나 권장 사항을 명시적으로 수용하기 전까지는 갈등 표시를 삭제하거나 git add 명령을 실행하지 않습니다. 또한 대용량 파일을 강제로 처리하는 대신 갈등 지점에서 작업을 멈추고, git merge --abort나 git rebase --abort를 사용해 작업을 취소할 수 있도록 지원합니다. 아울러 전체 저장소에 --ours나 --theirs 옵션을 일괄적으로 적용하거나, 간단한 요약 없이 긴 코드 내용 속에 갈등 목록을 숨기는 것과 같이 피해야 할 잘못된 방식들도 안내합니다. 선택적인 명령어 예시와 병합 메시지 템플릿은 함께 제공되는 reference.md 파일에 수록되어 있습니다.

FAQ

이 도구를 언제 사용해야 하나요?

현재 작업 중인 기능 브랜치에 다른 브랜치(주로 main 브랜치)를 통합할 때, 혹은 병합이나 리베이스 후 git status에서 아직 병합되지 않은 파일들이 표시될 때 사용하면 됩니다. 이 방법은 모든 Git 기반 팀 작업 흐름에 적용 가능하며, 특히 Flows/React 애플리케이션에서 자주 활용됩니다.

제가 요청하지 않아도 갈등을 자동으로 해결해 주나요?

아닙니다. 갈등을 조용히 해결하는 것을 엄격히 금지하고 있어, 사용자가 계획에 동의하거나 권장 사항을 명시적으로 수용하기 전까지는 갈등 표시를 삭제하거나 git add 명령을 실행하지 않습니다. 먼저 갈등 지점에서 작업을 멈추고 해당 갈등들을 보고합니다.

어떤 갈등부터 먼저 논의해야 하는지 어떻게 결정하나요?

갈등은 영향도에 따라 순서가 정해지며, P0(라우트 삭제, 기능 제거, 데이터나 API 계약 변경과 같은 구조적/제품 관련 변경)부터 P3(간격 조정, 클래스명 변경과 같은 디자인 관련 수정)까지 순서대로 처리됩니다.

수정하기 전에 갈등을 분석하기 위해 어떤 정보를 사용하나요?

갈등이 발생한 브랜치가 어떤 기능을 포함하고 있었는지에 대한 대화 기록, PRD.md나 최근 커밋과 같은 프로젝트 관련 신호들, 파일의 소유자 정보, 그리고 git show :2:path(우리 쪽 코드)와 git show :3:path(상대방 코드)를 통해 확인된 갈등 부분들의 내용을 활용합니다.

그냥 병합 작업을 취소하고 싶다면 어떻게 하나요?

이 도구는 상황에 맞게 git merge --abort나 git rebase --abort 명령을 실행할 수 있도록 지원하며, 해당 작업을 수행할 경우 현재 진행 중인 통합 상태가 사라진다는 점을 알려줍니다.

All Files

2 filesreference.md0.7 KBViewSKILL.md5.5 KBView

GitHub에서 보기

Use this skill whenever integrating another branch (usually main) into the current feature branch, or when git status shows unmerged paths after a merge or rebase. Applies to any Git-based team workflow; Flows/React apps are a common case where conflicts cluster in app shells and shared libraries.

Goals

  • Preserve intentional work on the current branch; do not assume “main wins” or “ours wins” without analysis.
  • Make trade-offs visible to the user before any conflict resolution edits.
  • Order discussion by impact: structural / feature / API / data-model changes before styling, copy, or spacing.

Hard rules

  1. No silent resolution — Do not remove <<<<<<< / ======= / >>>>>>> or run git add on conflicted files until the user has agreed to the plan (or explicitly says “use your recommendations”).
  2. Stop at conflicts — If a merge or rebase introduces conflicts, pause and report; do not bulldoze through large files by picking one side wholesale unless the user explicitly requests that.
  3. Prioritize impact — When presenting conflicts, group and order roughly as:
    • P0 — Structural / product: removed routes, deleted modules, dropped features, changed data or API contracts, SDK or schema changes, auth or routing shell.
    • P1 — Behavior: logic, hooks, queries, filters, error handling, loading states.
    • P2 — UI structure: layout regions, new or removed sections, navigation.
    • P3 — Presentation: tokens, spacing, class names, copy tweaks.

Workflow

1. Fetch and integrate (or diagnose)

  • Prefer git fetch then git merge origin/main (or the named branch) unless the user asked for rebase.
  • If merge is already in progress, run git status and list every unmerged file.

2. Report conflicts to the user (explicit)

Output a clear list:

  • Branch state: current branch, target branch (e.g. origin/main), merge vs rebase.
  • Unmerged files: paths only, then optionally git diff --name-only --diff-filter=U.
  • Per file (short): one line on what diverged (e.g. “AlertsPage — layout + new data scope”) if inferable from paths and git diff without resolving.

3. Analyze before editing

Use all of:

  • Conversation history — What was the user or team trying to ship on this branch?
  • Repo signals — Product or architecture docs if present (e.g. PRD.md), recent commits on the current branch, file ownership (e.g. large feature module vs shared lib/).
  • Conflict hunks — git show :2:path (ours) vs git show :3:path (theirs) during merge, or read conflict markers; identify duplicated vs orthogonal changes.

Classify each conflicted area as:

  • Orthogonal — safe to combine (e.g. import sort + new prop).
  • Overlapping — must choose or manually merge (same lines).
  • Corruption risk — duplicated blocks (common after bad merges); flag and recommend reconstructing from one side then re-applying the other side’s intent manually.

4. Recommendations + questions (required)

Present to the user:

  1. Summary table or bullets — file → recommended side or “manual merge” → one-line why.
  2. Ordered by P0 → P3 — call out anything that removes a feature or changes public behavior first.
  3. Explicit questions — anything ambiguous (e.g. “Keep main’s global behavior or the branch’s scoped variant?”).
  4. Ask for direction — e.g. “Reply with: (a) follow recommendations, (b) keep branch for file X, (c) keep main for file Y, (d) abort merge.”

Only after the user confirms (or gives a precise mapping), apply resolutions:

  • Prefer small, surgical edits; preserve both sides’ intent when possible.
  • Re-run git status; ensure no conflict markers remain; run tests or lint the user cares about for touched areas.

5. If the user wants to abort

  • git merge --abort or git rebase --abort as appropriate; confirm they lose in-progress integration state for that operation.

Anti-patterns (do not do)

  • Picking --ours / --theirs on the whole repo without user approval.
  • “Resolving” by deleting a feature branch’s work because main touched the same file.
  • Hiding conflict lists inside a long code dump without a short executive summary.
  • Fixing low-impact style conflicts first while leaving P0 decisions implicit.

Quick reference

  • Ours vs theirs (merge): stage 2 = current branch (HEAD), stage 3 = incoming (MERGE_HEAD). Verify with git checkout --conflict=merge <file> if needed.
  • Typical high-touch paths in full-stack or Flows apps: root app shell, top navigation, route modules, and shared lib/ or hooks/.

For optional command snippets and a merge message template, see reference.md.

모든 파일

0개 파일

pull-changes-resolve-conflicts 설치

해당 스킬 파일들을 다운로드하여 .claude/skills/ 디렉토리에 압축을 풀어 저장해 주세요.

ZIP 다운로드

저장소를 클론하고 스킬 파일을 프로젝트에 복사하세요.

git clone https://github.com/cognitedata/builder-skills/blob/main/skills/pull-changes-resolve-conflicts/SKILL.md # Copy SKILL.md to your .claude/skills/ directory

복사 복사
빠른 설정: 스킬 폴더를 .claude/skills/로 복사하면, Claude가 자동으로 해당 스킬을 인식하여 사용합니다.

관련 스킬

code-simplify
업데이트 된 시간 2026년 7월 2일
requesting-code-review
업데이트 된 시간 2026년 6월 29일
Git Commit Helper
업데이트 된 시간 2026년 6월 29일
commit-standards
업데이트 된 시간 2026년 6월 29일
OR