New: Earn 20% as an AgentAlley affiliate. Share your link and earn on every sale you refer. Join now New: Earn 20% as an affiliate. Join now

Merge the winning agent's branch into base, archive losers

/hub:merge — Merge Winner

by alirezarezvani · MIT license · ★ 26,349 on GitHub · updated Aug 30

/hub:merge — Merge Winner cover

Merge the winning agent's branch into base, archive losers, and clean up worktrees. Use when the user runs /hub:merge or asks to land the winning AgentHub result and tidy the session.

---
name: "merge"
description: "Merge the winning agent's branch into base, archive losers, and clean up worktrees. Use when the user runs /hub:merge or asks to land the winning AgentHub result and tidy the session."
command: /hub:merge
---

# /hub:merge — Merge Winner

Merge the best agent's branch into the base branch, archive losing branches via git tags, and clean up worktrees.

## Usage

```
/hub:merge                                       # Merge winner of latest session
/hub:merge 20260317-143022                       # Merge winner of specific session
/hub:merge 20260317-143022 --agent agent-2       # Explicitly choose winner
```

Overview

Merge the best agent's branch into the base branch, archive losing branches via git tags, and clean up worktrees.

Manual install (npx, ZIP)
Claude Codenpx skills add alirezarezvani/claude-skills --skill merge -g -a claude-code
Claude Code (manual)mkdir -p ~/.claude/skills && curl -sL https://codeload.github.com/alirezarezvani/claude-skills/tar.gz/19392f7a0826 \ | tar -xz -C ~/.claude/skills --strip-components=4 claude-skills-19392f7a0826/engineering/agenthub/skills/merge
Windows (PowerShell)New-Item -ItemType Directory -Force "$HOME\.claude\skills" | Out-Null; Invoke-WebRequest "https://m.agentalley.io/zip/e2e7506403ec8add0b56/merge.zip" -OutFile "$env:TEMP\merge.zip"; Expand-Archive "$env:TEMP\merge.zip" -DestinationPath "$HOME\.claude\skills" -Force
Claude.ai / desktopDownload the ZIP and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md2.3 KB
Read the files here
alirezarezvani/19392f71 file
Shared references1SKILL.md reads these from elsewhere in the repo. Not in the ZIP.Get them on GitHub ↗
SKILL.md
Show the full text95 lines

/hub:merge — Merge Winner

Merge the best agent's branch into the base branch, archive losing branches via git tags, and clean up worktrees.

Usage

/hub:merge                                       # Merge winner of latest session
/hub:merge 20260317-143022                       # Merge winner of specific session
/hub:merge 20260317-143022 --agent agent-2       # Explicitly choose winner

What It Does

1. Identify Winner

If --agent specified, use that. Otherwise, use the #1 ranked agent from the most recent /hub:eval.

2. Merge Winner
git checkout {base_branch}
git merge --no-ff hub/{session-id}/{winner}/attempt-1 \
  -m "hub: merge {winner} from session {session-id}

Task: {task}
Winner: {winner}
Session: {session-id}"
3. Archive Losers

For each non-winning agent:

# Create archive tag (preserves commits forever)
git tag hub/archive/{session-id}/{agent-id} hub/{session-id}/{agent-id}/attempt-1

# Delete branch ref (commits preserved via tag)
git branch -D hub/{session-id}/{agent-id}/attempt-1
4. Clean Up Worktrees
python {skill_path}/scripts/session_manager.py --cleanup {session-id}
5. Post Merge Summary

Write .agenthub/board/results/merge-summary.md:

---
author: coordinator
timestamp: {now}
channel: results
---

## Merge Summary

- **Session**: {session-id}
- **Winner**: {winner}
- **Merged into**: {base_branch}
- **Archived**: {loser-1}, {loser-2}, ...
- **Worktrees cleaned**: {count}
6. Update State
python {skill_path}/scripts/session_manager.py --update {session-id} --state merged

Safety

  • Confirm with user before merging — show the diff summary first
  • Never force-push — merge is always --no-ff for clear history
  • Archive, don't delete — losing agents' commits are preserved via tags
  • Clean worktrees — don't leave orphan directories on disk

After Merge

Tell the user:

  • Winner merged into {base_branch}
  • Losers archived with tags hub/archive/{session-id}/agent-{N}
  • Worktrees cleaned up
  • Session state: merged
1---
2name: "merge"
3description: "Merge the winning agent's branch into base, archive losers, and clean up worktrees. Use when the user runs /hub:merge or asks to land the winning AgentHub result and tidy the session."
4command: /hub:merge
5---
6 
7# /hub:merge — Merge Winner
8 
9Merge the best agent's branch into the base branch, archive losing branches via git tags, and clean up worktrees.
10 
11## Usage
12 
13```
14/hub:merge # Merge winner of latest session
15/hub:merge 20260317-143022 # Merge winner of specific session
16/hub:merge 20260317-143022 --agent agent-2 # Explicitly choose winner
17```
18 
19## What It Does
20 
21### 1. Identify Winner
22 
23If `--agent` specified, use that. Otherwise, use the #1 ranked agent from the most recent `/hub:eval`.
24 
25### 2. Merge Winner
26 
27```bash
28git checkout {base_branch}
29git merge --no-ff hub/{session-id}/{winner}/attempt-1 \
30 -m "hub: merge {winner} from session {session-id}
31 
32Task: {task}
33Winner: {winner}
34Session: {session-id}"
35```
36 
37### 3. Archive Losers
38 
39For each non-winning agent:
40 
41```bash
42# Create archive tag (preserves commits forever)
43git tag hub/archive/{session-id}/{agent-id} hub/{session-id}/{agent-id}/attempt-1
44 
45# Delete branch ref (commits preserved via tag)
46git branch -D hub/{session-id}/{agent-id}/attempt-1
47```
48 
49### 4. Clean Up Worktrees
50 
51```bash
52python {skill_path}/scripts/session_manager.py --cleanup {session-id}
53```
54 
55### 5. Post Merge Summary
56 
57Write `.agenthub/board/results/merge-summary.md`:
58 
59```markdown
60---
61author: coordinator
62timestamp: {now}
63channel: results
64---
65 
66## Merge Summary
67 
68- **Session**: {session-id}
69- **Winner**: {winner}
70- **Merged into**: {base_branch}
71- **Archived**: {loser-1}, {loser-2}, ...
72- **Worktrees cleaned**: {count}
73```
74 
75### 6. Update State
76 
77```bash
78python {skill_path}/scripts/session_manager.py --update {session-id} --state merged
79```
80 
81## Safety
82 
83- **Confirm with user** before merging — show the diff summary first
84- **Never force-push** — merge is always `--no-ff` for clear history
85- **Archive, don't delete** — losing agents' commits are preserved via tags
86- **Clean worktrees** — don't leave orphan directories on disk
87 
88## After Merge
89 
90Tell the user:
91- Winner merged into `{base_branch}`
92- Losers archived with tags `hub/archive/{session-id}/agent-{N}`
93- Worktrees cleaned up
94- Session state: `merged`
95 
View all files on GitHub →

Details

Updated
Aug 30, 2026
License
MIT
Stars on the repo
★ 26,349
Checked
Source
alirezarezvani/claude-skills ↗
Creator
alirezarezvani · 363 listings
View creator

Similar skills

See all →
SkillAutomates CI/CD pipeline setupCI/CD and Automationaddyosmani/agent-skills · by addyosmaniAutomates CI/CD pipeline setup. Use when setting up or modifying build and deployment pipelines. Use when you need to automate quality gates, configure test runners in CI, or establish deployment strategies.★ 98.7k GitHub starsSkillAutomated semantic versioning and release workflowVersion Bump & Release Workflowthedotmack/claude-mem · by thedotmackAutomated semantic versioning and release workflow for Claude Code plugins. Handles version increments across package.json, marketplace.json, plugin.json manifests, build verification, git tagging, GitHub releases, and changelog generation. NPM publishing is the final human-required handoff because the maintainer raised npm security.★ 95.6k GitHub starsSkillOperate Orca-managed worktrees, folder contexts, terminalsOrca CLIstablyai/orca · by stablyaiOperate Orca-managed worktrees, folder contexts, terminals, repos, automations, artifacts, skill sharing, worktree comments, and Orca's embedded browser through the `orca` CLI. Use when the user says "$orca-cli", "Orca worktree", "child worktree", "spawn codex/claude in a worktree", "read/wait/send Orca terminal", "handoff" / "handover" / "give this to another agent", "Orca browser", "orca artifacts", or "share skills". Prefer it over raw git worktree, ad hoc PTYs, or Computer Use when Orca state is involved. Use Computer Use only when a visible window needs GUI control that a CLI, filesystem, or API cannot do.★ 84.5k GitHub starsSkillThreaded messages, blocking ask/reply, task dispatchOrca Orchestrationstablyai/orca · by stablyaiCoordinate supervised Orca workers: threaded messages, blocking ask/reply, task dispatch, worker_done/escalation waits, task DAGs, decision gates, coordinator loops, and decomposing work across agents. Use `orca-cli` for full ownership handoffs — "hand off", "handoff", "handover", "give this to another agent", "another worktree" — unless asked to supervise, monitor, or coordinate a DAG, and for terminal control, lightweight terminal prompts, shell commands, Orca worktree management, and reading or waiting on terminals.★ 84.5k GitHub starsSkillDeploy applications and websites to VercelVercel deploybytedance/deer-flow · by bytedanceDeploy applications and websites to Vercel. Use this skill when the user requests deployment actions such as "Deploy my app", "Deploy this to production", "Create a preview deployment", "Deploy and give me the link", or "Push this live". No authentication required - returns preview URL and claimable deployment link.★ 83.5k GitHub starsSkillOpen or update a pull request on pascalorg/editorOpen PRpascalorg/editor · by pascalorgOpen or update a pull request on pascalorg/editor from the current branch, describing only what the branch actually did. Use when the user asks to open/create a PR, push and PR, or ship a branch in the editor repo.★ 24.6k GitHub stars

More from alirezarezvani

SkillResume a paused experiment/ar:ar-resume — Resume Experimentalirezarezvani/claude-skills · by alirezarezvaniResume a paused experiment. Checkout the experiment branch, read results history, continue iterating. Use when the user runs /ar:ar-resume or asks to pick up a previously started autoresearch experiment.★ 26.3k GitHub starsSkillShow experiment dashboard with results, active loops/ar:ar-status — Experiment Dashboardalirezarezvani/claude-skills · by alirezarezvaniShow experiment dashboard with results, active loops, and progress. Use when the user runs /ar:ar-status or asks how an autoresearch experiment is going.★ 26.3k GitHub starsSkillStart an autonomous experiment loop with user-selected/ar:loop — Autonomous Experiment Loopalirezarezvani/claude-skills · by alirezarezvaniStart an autonomous experiment loop with user-selected interval (10min, 1h, daily, weekly, monthly). Uses CronCreate for scheduling. Use when the user runs /ar:loop or asks to run an autoresearch experiment continuously on a schedule.★ 26.3k GitHub starsSkillRun a single experiment iteration/ar:run — Single Experiment Iterationalirezarezvani/claude-skills · by alirezarezvaniRun a single experiment iteration. Edit the target file, evaluate, keep or discard. Use when the user runs /ar:run or asks for one manual autoresearch iteration.★ 26.3k GitHub starsSkillSet up a new autoresearch experiment interactively/ar:setup — Create New Experimentalirezarezvani/claude-skills · by alirezarezvaniSet up a new autoresearch experiment interactively. Collects domain, target file, eval command, metric, direction, and evaluator. Use when the user runs /ar:setup or asks to start optimizing a file with the autoresearch loop.★ 26.3k GitHub starsSkill/cs:boardroom <brief/cs:boardroom — Multi-Role Boardroom Deliberationalirezarezvani/claude-skills · by alirezarezvani/cs:boardroom <brief> — 6-phase multi-role deliberation across the C-suite with Phase 2 isolation, critic pre-screen, and synthesis. Outputs a board memo. Use when a decision spans multiple executive domains — e.g. a pricing change touching finance, positioning, and product, or a raise-vs-cut runway call.★ 26.3k GitHub stars