merge-orchestrator

Installation
SKILL.md

Merge Orchestrator Skill

Local Git, Not Remote VCS

This skill performs local git merge of a source (subagent) worktree branch into a target (integration) branch, recording a recovery point SHA so the INV-14 recovery ladder (git merge --abortgit reset --keep, never --hard) can rewind the merge on any failure. It does not call the VCS provider (GitHub / GitLab / Azure DevOps) and does not require a PR id. For remote PR merging, see the companion skill that wraps the merge_pr action.

The mental model and the rationale for why these are two separate concerns are documented in references/local-git-semantics.md.

Single-Writer Entry Point: serialize_merge

For a shared integration branch — landing a subagent worktree branch onto the integration ref during the delegate → merge-pending → delegate loop, where a sibling worktree merge can race — serialize_merge is THE integration-merge path. It acquires an optimistic per-integrationRef lease (at most one in-flight merge per integration ref), then composes this action UNCHANGED under that lease. Route integration merges through serialize_merge; do not dispatch raw merge_orchestrate for them.

Invoke merge_orchestrate directly only where no concurrent merge can race the target:

  • Non-integration merge — the target is a private / scratch / solo branch no other agent will touch.
  • Crash-resumed caller — a new pid finishing a merge it already leased, re-presenting the ORIGINAL claim's leaseOperationId.
  • The composed executor call that serialize_merge itself makes (it threads its lease operationId so its own call passes the guard).

DR-2 lease guard. Raw merge_orchestrate against an integration ref that carries a live foreign lease (holder operationId ≠ the presented leaseOperationId, holder liveness ∈ {alive, unknown}) fails closed with a structured MERGE_LEASE_HELD error and no git side effect — the message names serialize_merge as the path. A no-lease or provably-dead-holder target proceeds exactly as before (back-compat; a dead holder is not a blocker). So the routing above is enforced at the handler chokepoint, not merely by convention — reach for serialize_merge.

Installs
80
GitHub Stars
28
First Seen
May 6, 2026
merge-orchestrator — lvlup-sw/exarchos