Community编程与开发github.com

mattpocock/resolving-merge-conflicts

用于解决正在进行中的 Git 合并/变基冲突。

resolving-merge-conflicts 是什么?

该技能提供了一套系统化的步骤,帮助开发者高效、安全地解决 Git 合并或变基过程中产生的冲突。它首先指导查看当前合并/变基的状态,包括 Git 历史和有冲突的文件。接着,通过深入理解每个冲突的原始变更意图(比如查阅提交信息、PR 和问题/工单),找到可靠的解决方案。然后,逐段解决冲突,在可能的情况下保留双方意图,并在冲突不可调和时根据合并目标做出选择,同时记录取舍。技能强调不要轻易发明新行为,总是尝试解决冲突而非直接中止操作。最后,它建议运行项目的自动化检查(如类型检查、测试和格式化),再完成合并或变基的提交。此技能适用于大多数支持 Git 的 AI 编码工具(如 Claude Code、Cursor、Codex)。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mattpocock/skills/tree/main/skills/engineering/resolving-merge-conflicts

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

  1. 查看当前 合并/变基的状态。检查 Git 历史以及有冲突的文件。

  2. 找到每个冲突的主要来源。深入理解每个变更的缘由和原始意图。阅读提交信息、检查 PR、查看原问题/工单。

  3. 逐段解决冲突。尽可能保留双方的意图。当意图冲突时,选择与合并的既定目标一致的一侧,并记录下所做的取舍。不要凭空发明新行为。始终解决冲突;切勿使用 --abort。

  4. 发现项目的 自动化检查 并运行它们——通常先做类型检查,然后是测试,最后是格式化。修复合并引入的任何问题。

  5. 完成合并/变基。暂存所有内容并提交。如果是变基,继续变基过程直到所有提交都已完成变基。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

mattpocock/ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

mattpocock/caveman

Ultra-compressed communication mode. Cuts token usage ~75% by dropping filler, articles, and pleasantries while keeping full technical accuracy. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman.

mattpocock/claude-handoff

Hand the current conversation off to a fresh background agent that picks up the work immediately.

mattpocock/codebase-design

Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.

mattpocock/design-an-interface

Generate multiple radically different interface designs for a module using parallel sub-agents. Use when user wants to design an API, explore interface options, compare module shapes, or mentions "design it twice".

mattpocock/diagnose

Disciplined diagnosis loop for hard bugs and performance regressions. Reproduce → minimise → hypothesise → instrument → fix → regression-test. Use when user says "diagnose this" / "debug this", reports a bug, says something is broken/throwing/failing, or describes a performance regression.

mattpocock/diagnosing-bugs

Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.

mattpocock/domain-modeling

Build and sharpen a project's domain model. Use when the user wants to pin down domain terminology or a ubiquitous language, record an architectural decision, or when another skill needs to maintain the domain model.

mattpocock/edit-article

Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.

mattpocock/git-guardrails-claude-code

Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.

mattpocock/grilling

Grill the user relentlessly about a plan or design. Use when the user wants to stress-test a plan before building, or uses any 'grill' trigger phrases.

mattpocock/grill-me

Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".

mattpocock/grill-with-docs

Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise. Use when user wants to stress-test a plan against their project's language and documented decisions.

mattpocock/handoff

Compact the current conversation into a handoff document for another agent to pick up.

mattpocock/implement

Implement a piece of work based on a PRD or set of issues.

mattpocock/implement-spec

Implement a specification in code.

mattpocock/improve-codebase-architecture

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

mattpocock/loop-me

Grill me about specs for the workflows I want to build, within this workspace.

mattpocock/migrate-to-shoehorn

Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.

mattpocock/obsidian-vault

Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.

相关技能