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

resolve-conflicts

하는 일

이 스킬은 Git 병합 충돌을 신중하고 계획적으로 해결하도록 돕습니다. 가져오기, 테스트, 잠금 파일, 한쪽에서 삭제된 파일을 다룹니다. 병합 충돌을 겪는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓Git 병합이나 리베이스가 해결해야 할 충돌로 멈췄을 때.
  • ✓잠금 파일이나 생성된 파일에 충돌이 있어 다시 생성해야 할 때.
  • ✓한 브랜치가 파일을 삭제했는데 다른 브랜치는 그 파일을 수정했을 때.

스킬 링크

https://github.com/tailcallhq/forgecode/blob/main/.forge/skills/resolve-conflicts/SKILL.md

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

사용 방법

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

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

Use this skill to help me: https://github.com/tailcallhq/forgecode/blob/main/.forge/skills/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에게 요청하는 예시

“이 병합 충돌을 해결하도록 도와주시고, 각 충돌마다 무엇을 했는지 설명해 주실 수 있나요?”

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

작동 방식

에이전트는 충돌 상태를 확인하고, 파일마다 계획을 세운 뒤 승인을 요청합니다. 승인을 받으면 계획을 실행하고, 테스트를 돌리며, 각 선택을 설명합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Git Conflict Resolution

Resolve Git merge conflicts by intelligently combining changes from both branches while preserving the intent of both changes. This skill follows a plan-first approach: assess conflicts, create a detailed resolution plan, get approval, then execute.

Core Principles

  1. Plan Before Executing: Always create a structured resolution plan and get user approval before making changes
  2. Prefer Both Changes: Default to keeping both changes unless they directly contradict
  3. Merge, Don't Choose: Especially for imports, tests, and configuration
  4. Regenerate Generated Files: Never manually merge generated files - always regenerate them from their sources
  5. Backup Before Resolving: For deleted-modified files, create backups first
  6. Validate with Tests: Always run tests after resolution
  7. Explain All Resolutions: For each conflict resolved, provide a one-line explanation of the resolution strategy
  8. Ask When Unclear: When the correct resolution isn't clear from the diff, present options to the user and ask for their choice

Workflow

Step 1: Assess the Conflict Situation

Run initial checks to understand the conflict scope:

git status

Identify and categorize all conflicted files:

  • Regular file conflicts (both modified)
  • Deleted-modified conflicts (one deleted, one modified)
  • Generated file conflicts (lock files, build artifacts, generated code)
  • Test file conflicts
  • Import/configuration conflicts
  • Binary file conflicts

For each conflicted file, gather information:

  • File type and purpose
  • Nature of the conflict (content, deletion, type change)
  • Scope of changes (lines changed, sections affected)
  • Whether the file is generated or hand-written

Step 2: Create Merge Resolution Plan

Based on the assessment, create a structured plan before resolving any conflicts. Present the plan in the following markdown format:

## Merge Resolution Plan

### Conflict Summary

- **Total conflicted files**: [N]
- **Deleted-modified conflicts**: [N]
- **Generated files**: [N]
- **Regular conflicts**: [N]

### Resolution Strategy by File

#### 1. [File Path]

**Conflict Type**: [deleted-modified / generated / imports / tests / code logic / config / struct / binary]
**Strategy**: [Brief description of resolution approach]
**Rationale**: [Why this strategy is appropriate]
**Risk**: [Low/Medium/High] - [Brief risk description]
**Action Items**:

- [ ] [Specific action 1]
- [ ] [Specific action 2]

#### 2. [File Path]

...

### Execution Order

1. **Phase 1: Deleted-Modified Files** - Handle deletions and backups first
2. **Phase 2: Generated Files** - Regenerate from source
3. **Phase 3: Low-Risk Merges** - Imports, tests, documentation
4. **Phase 4: High-Risk Merges** - Code logic, configuration, structs
5. **Phase 5: Validation** - Compile, test, verify

### Questions/Decisions Needed

- [ ] **[File/Decision]**: [Question for user] (Options: 1, 2, 3)

### Validation Steps

- [ ] Run conflict validation script
- [ ] Compile project
- [ ] Run test suite
- [ ] Manual verification of high-risk changes

Present this plan to the user and wait for their approval before proceeding with resolution. If there are any unclear conflicts where you need user input, list them in the "Questions/Decisions Needed" section.

For a complete example plan, see references/sample-plan.md.

Step 3: Handle Deleted-Modified Files

Execute this phase only after the plan is approved.

If there are deleted-but-modified files (status: DU, UD, DD, UA, AU):

.forge/skills/resolve-conflicts/scripts/handle-deleted-modified.sh

This script will:

  • Create timestamped backups of modified content
  • Analyze potential relocation targets
  • Generate analysis reports for each file
  • Automatically resolve the deletion status

Review the backup directory and analysis files to understand where changes should be applied.

Step 4: Execute Resolution Plan

Follow the execution order defined in your plan. For each conflicted file, apply the appropriate resolution pattern according to your plan. For every conflict you resolve, provide a one-line explanation of how you're resolving it.

As you complete each action item in your plan, mark it as done and report progress to the user.

When Resolution is Unclear

When you cannot determine the correct resolution from the diff alone (these should already be listed in your plan's "Questions/Decis

자주 묻는 질문

묻지 않고 충돌을 해결하나요?

아니요. 계획을 세운 뒤 변경 전에 승인을 요청합니다.

잠금 파일은 어떻게 처리하나요?

손으로 병합하지 않고, 원본 파일로부터 다시 생성합니다.

해결 후 테스트를 실행하나요?

네. 결과를 확인하기 위해 해결 후 테스트를 실행합니다.

상세 정보

작성자의 원본 설명

Use this skill immediately when the user mentions merge conflicts that need to be resolved. Do not attempt to resolve conflicts directly - invoke this skill first. This skill specializes in providing a structured framework for merging imports, tests, lock files (regeneration), configuration files, and handling deleted-but-modified files with backup and analysis.

repo: tailcallhq/forgecode

인기도

GitHub 스타
7.6k
순위
#13114
라이선스
Apache-2.0
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬