merge-orchestrator
Merge Orchestrator Skill
Local Git, Not Remote VCS
This skill performs local git merge of a subagent's worktree branch into the integration branch, recording a rollback SHA so a git reset --hard can undo 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 during the synthesize phase, see @skills/synthesis/SKILL.md (merge_pr action).
The mental model and the rationale for why these are two separate concerns are documented in references/local-git-semantics.md.
Overview
Closes the loop between /exarchos:delegate (which spawns subagents into worktrees) and the integration branch that needs their work. After a delegated task completes inside a worktree, this skill:
- Composes preflight guards (ancestry, current-branch protection, main-worktree assertion, working-tree drift).
- Records pre-merge
HEADof the integration branch as a rollback anchor. - Performs a local
git mergeof the source (subagent) branch into the target (integration) branch. - On any failure, runs
git reset --hard <rollbackSha>and surfaces a categorized failure reason. - Emits dedicated event types so the merge timeline is reconstructable from the event log alone.
Resumable: terminal phases (completed / rolled-back / aborted) short-circuit on re-entry without re-emitting events. Idempotent: re-dispatch with the same taskId collapses via the next_actions idempotency key.