Token导航 LogoToken导航

Agent Skill · 运维和基础设施

resolve-conflicts(解决冲突)

resolve-conflicts 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

resolve-conflicts 是运维和基础设施类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证为 MIT,第三方扫描有未通过项,按安装量在运维和基础设施类的 2,449 个 Skill 里排第 212。

总安装 9,585周安装 384GitHub Stars 7,067下载 3,103核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:resolve-conflicts(解决冲突)
来源仓库:https://github.com/antinomyhq/forge
仓库路径:skills/resolve-conflicts
安装命令:
npx skills add https://github.com/antinomyhq/forge --skill resolve-conflicts
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/antinomyhq/forge --skill resolve-conflicts

这个 Skill 是做什么的

运维和基础设施类 Skill 处理部署、监控、日志和云资源,多数需要较高的执行权限。

解决 GitHub 仓库、Issue、Pull Request 和代码协作中的冲突问题。适用于需要整理仓库状态、代码变更或协作事项的场景。通过 npx skills add 命令从指定仓库安装并使用。需确认权限范围、维护状态,注意是否触发联网或文件操作。

resolve-conflicts 属于运维和基础设施类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/resolve-conflicts

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/antinomyhq/forge --skill resolve-conflicts;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

resolve-conflicts 怎么安装?

在终端执行 npx skills add https://github.com/antinomyhq/forge --skill resolve-conflicts。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

resolve-conflicts 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

resolve-conflicts 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

resolve-conflicts 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

resolve-conflicts 用的人多吗?

公开数据是累计安装 9,585 次,近一周安装 384 次,下载 3,103 次,GitHub 7,067 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

resolve-conflicts 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 来源仓库有 7,067 星,维护活跃度相对可查。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理运维和基础设施类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

运维和基础设施类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
brainstorming

头脑风暴 · Codex、Claude

3,148,776173,131操作浏览器MIT通过
copywriting

文案写作 · Codex、Claude

1,996,72425,583需要联网MIT通过
openclaw-secure-linux-cloud

OpenClaw secure linux cloud 命令行 · Codex、Claude

1,853,08840接触敏感数据未明确未通过
xget

xget 命令行 · Codex、Claude

1,799,28040执行命令未明确未通过
requesting-code-review

代码审查请求 · Codex、Claude

1,590,144173,103权限未标注MIT通过
resolve-conflicts

解决冲突 · 本页

9,5857,067只读MIT未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

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/Decisions Needed" section):

  1. Present the conflict to the user with the conflicting code from both sides
  2. Provide numbered options for resolution (Option 1, Option 2, etc.)
  3. Explain each option clearly with what it would do
  4. Ask the user to choose an option number or provide additional information
  5. Remember their choice and apply similar reasoning to subsequent related conflicts

Example interaction:

I found a conflict in src/main.rs where both branches modify the `calculate_price` function:

<<<<<<< HEAD (Current Branch)
fn calculate_price(item: &Item) -> f64 {
    item.base_price * (1.0 + item.tax_rate)
}
=======
fn calculate_price(item: &Item) -> f64 {
    item.base_price + item.tax_amount
}
>>>>>>> feature-branch (Incoming Branch)

I'm not sure which calculation is correct. Please select an option:

**Option 1**: Keep current branch (multiplies base_price by tax_rate)
**Option 2**: Keep incoming branch (adds tax_amount to base_price)
**Option 3**: Keep both approaches with a new parameter
**Option 4**: Provide more context to help me decide

Please respond with "Option 1", "Option 2", "Option 3", or "Option 4", or provide additional information.

Once the user responds, apply their decision and similar logic to related conflicts.

Resolution Patterns

For each conflicted file, apply the appropriate resolution pattern:

Imports/Dependencies

Goal: Merge all unique imports from both branches.

One-line explanation: "Merging imports by combining unique imports from both branches, removing duplicates, and grouping by module."

Read references/patterns.md section "Import Conflicts" for detailed examples.

Quick approach:

  1. Extract all imports from both sides
  2. Remove duplicates
  3. Group by module/package
  4. Follow language-specific style (alphabetize, group std/external/internal)
Tests

Goal: Include all test cases and test data from both branches.

One-line explanation: "Merging tests by including all test cases from both branches, combining fixtures, and renaming if necessary to avoid conflicts."

Read references/patterns.md section "Test Conflicts" for detailed examples.

Quick approach:

  1. Keep all test functions unless they test the exact same thing
  2. Merge test fixtures and setup functions
  3. Combine assertions from both sides
  4. If test names conflict but test different behaviors, rename to clarify
Generated Files

Goal: Regenerate any generated files to include changes from both branches.

One-line explanation: "Resolving generated file by regenerating it from source files to incorporate changes from both branches."

Recognition: A file is generated if it:

  • Is produced by a build tool, compiler, or code generator
  • Has a source file or configuration that defines it
  • Contains headers/comments indicating it's auto-generated
  • Is listed in .gitattributes as generated
  • Common examples: lock files, protobuf outputs, GraphQL schema files, compiled assets, auto-generated docs

Approach:

  1. Identify the generation source: Determine what command or tool generates the file
  2. Choose either version temporarily (doesn't matter which): git checkout --ours <generated-file> # or --theirs
  3. Regenerate from source: Run the appropriate generation command: # Package manager lock files cargo update # for Cargo.lock npm install # for package-lock.json yarn install # for yarn.lock bundle install # for Gemfile.lock poetry lock --no-update # for poetry.lock # Code generation protoc... # for protobuf files graphql-codegen # for GraphQL generated code make generate # for Makefile-based generation npm run generate # for npm script-based generation # Build artifacts npm run build # for compiled/bundled assets cargo build # for Rust build artifacts
  4. Stage the regenerated file: git add <generated-file>

When unsure if a file is generated: Check for auto-generation markers in the file header, or ask the user if you should regenerate or manually merge the file.

Configuration Files

Goal: Merge configuration values from both branches.

One-line explanation: "Merging configuration by including all keys from both branches and choosing appropriate values for conflicts."

Read references/patterns.md section "Configuration File Conflicts" for detailed examples.

Quick approach:

  1. Include all keys from both sides
  2. For conflicting values, choose based on:

- Newer/more recent value - Safer/more conservative value - Production requirements

  1. Document choice in commit message

When unclear: Ask the user which configuration value to prefer (current vs incoming)

Code Logic

Goal: Understand intent of both changes and combine if possible.

One-line explanation: "Resolving code logic by analyzing intent: merging if changes are orthogonal, or choosing one approach if they conflict."

Read references/patterns.md section "Code Logic Conflicts" for detailed examples.

Quick approach:

  1. Analyze what each branch is trying to achieve
  2. If changes are orthogonal (different concerns), merge both
  3. If changes conflict (same concern, different approach):

- Review commit messages/PRs for context - Choose the approach that matches requirements - Test both approaches if unclear - Document the decision

When unclear: Present both approaches as options to the user with context about what each does

Struct/Type Definitions

Goal: Include all fields from both branches.

One-line explanation: "Merging struct by including all fields from both branches and choosing appropriate types for any conflicting field definitions."

Quick approach:

  1. Merge all fields
  2. If field types conflict, analyze which is more appropriate
  3. Fix all compilation errors from updated struct
  4. Update tests to use new fields

When unclear: Ask the user which type definition is correct if field types conflict

Step 5: Validate Resolution

After completing all resolution phases in your plan, validate that all conflicts are resolved:

.forge/skills/resolve-conflicts/scripts/validate-conflicts.sh

This script checks for:

  • Remaining conflict markers (<<<<<<<, =======, >>>>>>>)
  • Unmerged paths in git status
  • Deleted-modified conflicts
  • Merge state files

Step 6: Compile and Test

Build and test to ensure the resolution is correct (as defined in your plan's validation steps):

# For Rust projects
cargo test

# For other projects, use appropriate test command
# npm test
# pytest
# etc.

If tests fail:

  1. Review the failure - is it from merged code or conflict resolution?
  2. Check if both branches' tests pass individually
  3. Fix integration issues between the merged changes
  4. Re-run tests until all pass

Step 7: Finalize

Once all conflicts are resolved and tests pass, review your completed plan and commit:

# Review the changes
git diff --cached

# Commit with descriptive message that references the plan
git commit -m "Resolve merge conflicts: [describe key decisions]

Executed merge resolution plan:
- [Phase 1 summary]
- [Phase 2 summary]
- [Phase 3+ summaries]

Key decisions:
- Merged imports from both branches
- Combined test cases
- Regenerated lock files
- [other significant decisions from plan]

Co-Authored-By: ForgeCode <noreply@forgecode.dev>"

Decision Tracking

When you ask the user to choose between options, track their decision and apply similar reasoning to subsequent conflicts:

Example scenario:

  1. First conflict: User chooses Option 1 (prefer current branch's validation logic)
  2. Second similar conflict: Apply the same reasoning (prefer current branch's validation approach)
  3. Mention: "Resolving by keeping current branch's approach (consistent with your earlier choice)"

Key principles:

  • Remember user preferences within the same conflict resolution session
  • Apply consistent patterns when conflicts are similar
  • Mention the consistency: "Following the same pattern as before..."
  • Ask again if a new conflict is sufficiently different from previous ones

Common Patterns Reference

For detailed resolution patterns, read:

  • references/patterns.md - Comprehensive examples for all conflict types

Quick pattern lookup:

  • Imports: Combine all unique imports, group by module
  • Tests: Keep all tests unless identical, merge fixtures
  • Generated files: Choose either version, regenerate from source
  • Config: Merge all keys, choose newer/safer values for conflicts
  • Code: Analyze intent, merge if orthogonal, choose one if conflicting
  • Structs: Include all fields from both branches
  • Docs: Combine all documentation sections

Special Scenarios

Binary Files in Conflict

Binary files cannot be merged. Choose one version:

git checkout --ours path/to/binary    # keep our version
# or
git checkout --theirs path/to/binary  # keep their version

Mass Rename/Refactoring Conflicts

If one branch renamed/refactored many files while another modified them:

  1. Accept the rename/refactoring (structural change)
  2. Apply the modifications to the new structure
  3. Use backups from handle-deleted-modified.sh to guide the application

Submodule Conflicts

# Check submodule status
git submodule status

# Update to the correct commit
cd path/to/submodule
git checkout <desired-commit>
cd ../..
git add path/to/submodule

Troubleshooting

"Both Added" Conflicts (AA)

Both branches added a new file with the same name but different content:

  1. Review both versions
  2. If they serve the same purpose, merge their content
  3. If they serve different purposes, rename one

Whitespace-Only Conflicts

If conflicts are only whitespace differences:

git merge -Xignore-space-change <branch>

Persistent Conflict Markers

If validation shows conflict markers but you think you resolved them:

  1. Search for the exact marker strings: git grep -n "<<<<<<< HEAD"
  2. Some markers might be in strings or comments - resolve those too
  3. Check for hidden characters or encoding issues

Tests Fail After Resolution

  1. Test each branch individually to confirm they pass
  2. The failure is likely from interaction between the merged changes
  3. Debug the interaction issue, not the individual changes
  4. Update code to make both changes work together

Quick Reference Card

Conflict TypeStrategyOne-line Explanation Template
ImportsMerge all, deduplicate, group by module"Merging imports by combining unique imports from both branches and grouping by module"
TestsKeep all, merge fixtures"Including all test cases from both branches and combining test fixtures"
Generated filesRegenerate from source"Regenerating [file] from source to include changes from both branches"
ConfigMerge keys, choose newer values"Merging all config keys and choosing [current/incoming] value for [key]"
Code logicAnalyze intent, merge if orthogonal"Merging both changes as they address different concerns" OR "Choosing [current/incoming] approach for [reason]"
StructsInclude all fields"Including all fields from both branches in struct definition"
DocsCombine all sections"Combining documentation from both branches"
Deleted-modifiedBackup, analyze, apply to new location"Applying modifications to new location after file was moved/renamed"
Binary filesChoose one version"Keeping [current/incoming] version of binary file"

Remember:

  • Always provide a one-line explanation for each conflict resolution
  • When unclear, present numbered options to the user
  • Track user decisions and apply consistently to similar conflicts
  • The goal is to preserve the intent and functionality of both branches while creating a cohesive merged result

平台分布

Claude Code

28.34%
按下载量换算879

Cursor

22.91%
按下载量换算711

OpenCode

17.77%
按下载量换算551

Antigravity

11.43%
按下载量换算355

Codex

6.69%
按下载量换算208

Gemini CLI

3.05%
按下载量换算95

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills