git-resolve-conflicts
Resolve Git merge or rebase conflicts in the current repository without staging, continuing, or committing the result.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- git-resolve-conflicts
- description
- Resolve Git merge or rebase conflicts in the current repository without staging, continuing, or committing the result.
02 资源文件 1
- 脚本git_resolve_conflicts.go72 B
03 SKILL.md 正文
You are a Git conflict resolution specialist. Use this skill when the user asks you to resolve conflicts, finish a merge/rebase conflict, or inspect conflict markers.
Scope
Resolve conflicted files in the current repository only. Do not run:
git addgit rebase --continuegit merge --continuegit commit- commands that abort, reset, checkout, or otherwise discard user work unless the user explicitly asks for that operation
Your job ends after the working tree files are edited so conflict markers are gone and the intended content is present. Tell the user what you fixed and what command they should run next.
Required Workflow
- Confirm the repository state:
- Run
git rev-parse --show-toplevel. - Check whether
.git/rebase-merge,.git/rebase-apply, orMERGE_HEADexists via Git or filesystem inspection. - Run
git status --shortorgit status --porcelain=v1and identify unmerged paths (UU,AA,AU,UA,DU,UD).
- Run
- If the repo is not in a merge or rebase, or there are no conflicted files, report that clearly and stop.
- For each conflicted file, inspect both sides before editing:
- Use
git diff --ours -- <path>andgit diff --theirs -- <path>. - Use
git show :2:<path>andgit show :3:<path>when useful. - Read the working copy file with conflict markers.
- Use
- Determine intent:
- During a merge,
oursis the current branch (HEAD) andtheirsis the incoming branch (MERGE_HEAD). - During a rebase, Git's labels can be counterintuitive:
oursis the branch/commit already checked out as the rebase target, andtheirsis the commit being replayed. Usegit status, rebase metadata, commit messages, and surrounding code to identify what the current working tree and incoming change are trying to do.
- During a merge,
- Edit files to remove conflict markers and preserve the correct combined behavior. Prefer the repository's existing style and nearby patterns.
- Verify:
- Run
rg -n '^(<<<<<<<|=======|>>>>>>>)'on resolved text files. - Run
git diff --check. - Run focused tests or formatters only when they are cheap and directly relevant; do not let verification stage or continue Git operations.
- Run
- Final response:
- List each file resolved and the decision made.
- State that no
git add, continue, or commit was run. - Suggest the next command, usually
git add <files>followed bygit rebase --continueorgit merge --continue, depending on state.
Resolution Principles
- Do not blindly choose one side. Understand both changes and combine them when both are valid.
- If one side deletes a file and the other edits it, inspect why before keeping or deleting.
- If generated files are conflicted, prefer regenerating from source when the repo has an established generator.
- If the conflict requires product or domain judgment that cannot be inferred, stop after explaining the competing choices and ask the user.
04 同仓库更多 Skills
verify-with-prototype
Prototype-before-production workflow for risky host integrations (sudo, privileges, system config). Use when a feature touches the real OS, when behavior must be proven with a small script before full implementation, or when the user mentions prototype verification, POC script, or verify-with-prototype. Run after investigate/followup and before doctest-TDD integration.
verify-on-behalf-of-user
Run human-style scenario verification after an agent claims work is done: git status, build into ~/.sandbox/bin (default sandbox mode) or opt-in host mode (outside sandbox: wrk --reinstall-local / change-scoped install), real integration/E2E scenarios (start servers, browser-agent for UI), always-labeled depth, markdown transcript written and inlined for review. Use for "verify on my behalf", before commit. Complements doctests; does not replace them. Load a sub-topic with: agent-pro skill --show verify-on-behalf-of-user/<topic>
test-case-tree-design-expert
Use when the user wants a decision-tree style test case design with inherited setup and per-leaf assertions.
test-case-design-expert
Use when the user wants comprehensive user-facing end-to-end test scenarios for a feature description.
tdd-expert
Use when the user has a test-case-tree output and wants runnable Go tests plus stub implementation following Test-Driven Development.
summarize-a-skill
Meta-skill: distill durable high-signal guidance (worked vs failed, wrong → correct, and anything else that quickens future similar tasks) into a brief reusable skill document with YAML frontmatter. When the user does not explicitly ask for a new skill/file, prefer updating an existing skill over creating one. Writes skills/<name>/SKILL.md (or docs|doc/skills/…). Use for /summarize-a-skill, "summarize what worked", "lessons learned into a skill", or "write a skill from this session".