Agent skill

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.

Stars 17
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/OutlineDriven/odin-claude-plugin/tree/main/skills/pr-merge-base

SKILL.md

Smart Merge to Base Branch

Merge one or more PRs into the base branch (main/master) using queue-like sequencing.

Process

  1. Detect base branch: Identify the default branch (main, master, or repo-specific) via git remote show origin or repo conventions.

  2. Enumerate PRs: List all PRs to merge. For each, fetch the latest HEAD.

  3. Create checkpoint: Record the current base branch tip as a rollback point.

    CHECKPOINT=$(git rev-parse HEAD)
    
  4. Create integration branch: Work on a temporary branch to validate before touching base.

    git checkout -b merge-queue/<timestamp> <base>
    
  5. 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.
  6. Sequential merge with conflict handling — for each PR in order: a. Attempt git merge --no-ff <pr-branch> into the integration branch. b. If merge succeeds cleanly, continue to next PR. c. If conflicts occur:

    • Analyze each conflict file using difft and codebase context.
    • Apply resolution using structural understanding (prefer base for formatting, PR for logic).
    • If a conflict cannot be resolved with confidence, abort this merge (git merge --abort), 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).
  7. Validate integration branch: Once all PRs are merged on the integration branch, run full build/test suite if available.

  8. 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.

  9. 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: git checkout <base> && git branch -D merge-queue/<timestamp> — base remains untouched at checkpoint.

Output

Report for each PR: merged successfully, conflicts resolved (with details), or blocked (with reason).

Expand your agent's capabilities with these related and highly-rated skills.

OutlineDriven/odin-claude-plugin

refactor-break-bw-compat

Refactor by removing backward compatibility and legacy layers. Use when modernizing APIs, cleaning up migration debt, removing compat shims, or eliminating stale feature flags.

17 0
Explore
OutlineDriven/odin-claude-plugin

pr-merge-temporal

Merge multiple PRs into a temporal integration branch before merging to base, with ordered conflict resolution. Use when you want to validate a set of PRs together on a staging branch before advancing the base branch.

17 0
Explore
OutlineDriven/odin-claude-plugin

tests-adversarial

Write adversarial tests that intentionally stress failure paths. Use when hardening error handling, stress-testing assumptions, validating boundary behavior, or hunting silent failures.

17 0
Explore
OutlineDriven/odin-claude-plugin

srgn-cli

Practical guide for building safe, syntax-aware srgn CLI commands for source-code search and transformation. Use when users ask for srgn commands, scoped refactors (comments/docstrings/imports/functions), multi-file rewrites with --glob, custom tree-sitter query usage, or CI-style checks with --fail-any/--fail-none.

17 0
Explore
OutlineDriven/odin-claude-plugin

askme

Verbalized Sampling (VS) protocol for deep intent exploration before planning. Use when starting ambiguous or complex tasks, when multiple interpretations exist, or when you need to explore diverse intent hypotheses and ask maximum clarifying questions before committing to an approach.

17 0
Explore
OutlineDriven/odin-claude-plugin

gh-fix-ci

Inspect GitHub PR checks with gh, pull failing GitHub Actions logs, summarize failure context, then create a fix plan and implement after user approval. Use when a user asks to debug or fix failing PR CI/CD checks on GitHub Actions and wants a plan + code changes; for external checks (e.g., Buildkite), only report the details URL and mark them out of scope.

17 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results