Skip to content
AI & Agents
Skill

/merge

Use to land the winning AgentHub branch, archive the others and clean up worktrees.

From plugin
claude-skills
30k200 skills127 agents169 commands2 MCP

Claude Code

$ npx -y skills add alirezarezvani/claude-skills --skill merge --agent claude-code

SKILL.md

merge.SKILL.md
name: "merge"
description: "Use to land the winning AgentHub branch, archive the others and clean up worktrees."
metadata:
  command: /agenthub:merge

/agenthub:merge — Merge Winner

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

Usage

/agenthub:merge                                       # Merge winner of latest session
/agenthub:merge 20260317-143022                       # Merge winner of specific session
/agenthub: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 `/agenthub: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`
Read more
@alirezarezvani
Ships withclaude-skills

411 production-ready skills for Claude Code and 12 other coding agents, covering engineering, product, marketing, compliance, finance and the C-suite. We test whether each skill loads when you ask in plain words, and publish the results.

30k200 skills127 agents2 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
29.6k
Star history of alirezarezvani/claude-skills on GitHub, a chart by star-history.com

Other skills on claude-skills.

interview

interview

Use when someone has an agent idea to scope before launch ('help me scope an agent'). Interviews them about the one job and…

More skills from other plugins.

1password

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

openclaw2w393k
@openclaw@openclawInstall Skill

Questions about merge.

Which coding agents can use merge?
merge installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.