pr-merge-conflicts
Enumerate a GitHub pull request's actual merge conflicts against its base — the conflicting files and hunks — by trial-merging in a throwaway worktree that is aborted and removed afterwards. Resolves, commits and pushes nothing; in the primary clone it fetches the head and base into the origin/* refs — or, for another repository's PR, into refs of its own that it deletes — and runs git worktree prune, and leaves its tracked files and index as it found them.
- License 许可
- GPL-3.0
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- pr-merge-conflicts
- description
- Enumerate a GitHub pull request's actual merge conflicts against its base — the conflicting files and hunks — by trial-merging in a throwaway worktree that is aborted and removed afterwards. Resolves, commits and pushes nothing; in the primary clone it fetches the head and base into the origin/* refs — or, for another repository's PR, into refs of its own that it deletes — and runs git worktree prune, and leaves its tracked files and index as it found them.
03 SKILL.md 正文
PR Merge Conflicts
Enumerate the conflicts a pull request's branch has with its base
branch, and nothing else. GitHub reports mergeStateStatus: DIRTY
without saying which files or hunks conflict; this skill performs the
merge in a throwaway worktree, collects what conflicts, then aborts
the merge and removes the worktree. It resolves nothing, commits
nothing, pushes nothing, and leaves the primary clone's tracked files
and index as it found them; what it does change there is the fetched
origin/* refs and the git worktree prune described below.
A PR of another repository than the checkout's is fetched from that
repository's https://<host>/<owner>/<repo>.git into
refs/pr-merge-conflicts/<host>+<owner>+<repo>/<N>/head and
refs/pr-merge-conflicts/<host>+<owner>+<repo>/<N>/base, the names
lowercased, which the script deletes on every exit, so no origin/*
ref changes for it. The fetch authenticates as git does for that
URL.
Invocation
/pr-merge-conflicts <PR>
<PR>(required): the pull request, in any formskills/lib/pr-reference.mdlists.
Execution
Run the bundled script from inside a git checkout, spelled as a bare name:
pr-merge-conflicts <PR>
The script reads the PR's head and base branches, fetches both, and
adds a detached worktree at the head under
.claude/worktrees/pr-merge-conflicts-<N> — for another repository's
PR, .claude/worktrees/pr-merge-conflicts-<host>+<owner>+<repo>-<N>,
lowercased — so no branch claim is taken and nothing lands in the
primary clone's working tree. It trial-merges
the base there without committing, collects the conflicting files and
each one's hunks, then aborts the merge and removes the worktree on
every exit, so a failed run leaves nothing for the next one to trip
on. A worktree an interrupted earlier run left at that path is cleared
before the add, and git worktree prune runs there too, dropping every
registration in the clone whose directory is gone — not only this
skill's own.
Output and exit status
- Exit 0 — stdout is the whole report. Its first line names the PR,
its head and its base. Then either a line saying the trial merge is
clean — the PR is not
DIRTYagainst this base at this moment — or the conflicting files, one per line, followed by a=== <file>section per file holding that file's conflicting hunks verbatim. Report it back as it stands: what to do about each conflict is the caller's to decide, and the resolution is whoever the caller hands it to. - Exit 1 — a command the script ran failed: the PR could not be
read, the fetch or the worktree add failed, the merge failed without
leaving a conflicted file, or a later
gitstep failed. Stderr names the step, with the tool's own error above it where the tool printed one. Surface it verbatim. - Exit 2 — a usage error; nothing was read or created.
04 同仓库更多 Skills
mask-inappropriate-language
Replace inappropriate language (profanity, slurs, strong insults) in provided text or a file with asterisks, character-for-character, preserving everything else.
theorem-agents-interface
The interface between the sdlc reviewer and the theorem agents it spawns — what each double-dash brief parameter means, and what each consequence class means. Preloaded into every theorem agent (sdlc:theorem-generator, the disprover, and the verifier) via its skills frontmatter, and read by name by the sdlc:theorem-based-pr-reviewer agent for what its briefs' parameters mean; not invoked from the user's slash menu.
sdlc-config-user
Interactively create or merge-update the repo user sdlc config, `<repo-root>/.sdlc/user-config.yml` (tier 3 — this user, this repo, never committed), and add it to the repo's tracked `.gitignore`.
sdlc-config-repo
Interactively create or merge-update the shared repo sdlc config, `<repo-root>/.sdlc/repo-config.yml` (tier 2 — tracked, every user of this repo).
sdlc-config-global
Interactively create or merge-update the global user sdlc config, `$XDG_CONFIG_HOME/sdlc/user-config.yml` (tier 1 — this user, every repo on this machine).
pr-read-cli-interface
The contract for sdlc's PR-read CLIs — sdlc-pr-round, sdlc-pr-adjustments, sdlc-fixer-brief and sdlc-records-chain — their arguments, exit codes and output grammar. Preloaded into sdlc:theorem-based-pr-reviewer, sdlc:issue-fixer, sdlc:docs-writer and sdlc:pr-finalizer via their skills frontmatter; not invoked from the user's slash menu.