Odin-claude-plugin pr-merge-base
Merge one or more PRs into the base branch with queue-like sequencing and conflict resolution. Use when merging PRs that may conflict with each other or the base, requiring ordered application and intelligent conflict handling.
git clone https://github.com/OutlineDriven/odin-claude-plugin
T=$(mktemp -d) && git clone --depth=1 https://github.com/OutlineDriven/odin-claude-plugin "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/pr-merge-base" ~/.claude/skills/outlinedriven-odin-claude-plugin-pr-merge-base && rm -rf "$T"
skills/pr-merge-base/SKILL.mdSmart Merge to Base Branch
Merge one or more PRs into the base branch (main/master) using queue-like sequencing.
Process
-
Detect base branch: Identify the default branch (
,main
, or repo-specific) viamaster
or repo conventions.git remote show origin -
Enumerate PRs: List all PRs to merge. For each, fetch the latest HEAD.
-
Create checkpoint: Record the current base branch tip as a rollback point.
CHECKPOINT=$(git rev-parse HEAD) -
Create integration branch: Work on a temporary branch to validate before touching base.
git checkout -b merge-queue/<timestamp> <base> -
Determine merge order:
- If the user specifies an order, use that.
- Otherwise, compute dependency/topological order (if PR B depends on PR A, merge A first).
- If PRs are independent with no clear ordering, present the list and ask the user to confirm or reorder before proceeding.
-
Sequential merge with conflict handling — for each PR in order: a. Attempt
into the integration branch. b. If merge succeeds cleanly, continue to next PR. c. If conflicts occur:git merge --no-ff <pr-branch>- Analyze each conflict file using
and codebase context.difft - Apply resolution using structural understanding (prefer base for formatting, PR for logic).
- If a conflict cannot be resolved with confidence, abort this merge (
), stop and report the conflict to the user with both sides and a recommended resolution. d. After each successful merge, verify the build still passes (if build commands are available).git merge --abort
- Analyze each conflict file using
-
Validate integration branch: Once all PRs are merged on the integration branch, run full build/test suite if available.
-
Report results: Present the validated integration branch to the user. Do NOT advance the base branch automatically — only update base if the user explicitly requests it.
-
Abort conditions — stop the queue and report if:
- A conflict cannot be safely auto-resolved.
- A post-merge build/test fails.
- A PR has been superseded or closed.
Roll back:
— base remains untouched at checkpoint.git checkout <base> && git branch -D merge-queue/<timestamp>
Output
Report for each PR: merged successfully, conflicts resolved (with details), or blocked (with reason).