PluginBench
Skill
Pass
Audit score 90

merge

alirezarezvani/claude-skills

Merge winning agent branch into base, archive losers, and clean up worktrees after AgentHub evaluation.

What is merge?

Merges the best-performing agent's branch into your base branch after an AgentHub session, preserves losing branches as git tags for posterity, and removes temporary worktrees. Use this when you want to land the winning result and tidy up your session.

  • Identifies the winning agent from the most recent /hub:eval or accepts explicit agent selection
  • Merges winner's branch into base with a descriptive commit message preserving task and session context
  • Archives all losing agents' branches as git tags (preserving commits while removing branch refs)
  • Cleans up temporary worktrees created during the session
  • Generates a merge summary document in .agenthub/board/results/merge-summary.md
  • Updates session state to 'merged' in the session manager

How to install merge

npx skills add https://github.com/alirezarezvani/claude-skills --skill merge
Prerequisites
  • An active AgentHub session with completed /hub:eval
  • Git repository with base branch and hub/* session branches
  • Python environment with session_manager.py available
Claude Code
Cursor
Windsurf
Cline

How to use merge

  1. 1.Run /hub:merge to merge the top-ranked agent from the latest session, or /hub:merge {session-id} for a specific session
  2. 2.Optionally specify --agent {agent-name} to explicitly choose the winner instead of using the ranked result
  3. 3.Review the diff summary presented before confirming the merge
  4. 4.Confirm the merge when prompted — the skill will merge with --no-ff for clear history
  5. 5.The skill archives all losing agents as tags, removes their branches, cleans worktrees, and updates session state
  6. 6.Check .agenthub/board/results/merge-summary.md for a record of what was merged and archived

Use cases

Good for
  • Land the best agent's work after running /hub:eval to compare multiple implementations
  • Archive experimental branches safely without losing commit history while cleaning up disk space
  • Consolidate results from a multi-agent coding session into your main branch with full traceability
  • Clean up temporary git worktrees and session artifacts after evaluating agent performance
  • Preserve losing agent attempts as tagged references for later review or comparison
Who it's for
  • Developers using AgentHub to run multi-agent coding competitions
  • Teams evaluating multiple AI agent implementations and selecting the best result
  • Engineers managing complex branching workflows with temporary experimental branches
  • Anyone needing safe archival of git branches with automatic cleanup

merge FAQ

What happens to the losing agents' code?

Losing branches are archived as git tags (hub/archive/{session-id}/{agent-id}) preserving all commits forever, then the branch refs are deleted to clean up. You can always recover them via the tags.

Can I choose which agent to merge instead of the top-ranked one?

Yes, use /hub:merge {session-id} --agent {agent-name} to explicitly select the winner instead of using the ranked result.

Is the merge forced or destructive?

No. The merge always uses --no-ff (no fast-forward) for a clear merge commit, and nothing is deleted without being archived first. It's safe and traceable.

What does 'clean up worktrees' mean?

During /hub:eval, temporary git worktrees are created for each agent. After merge, this step removes those temporary directories from disk to free up space.

Can I undo a merge?

Yes, you can revert the merge commit or reset to the previous state. The archived tags preserve all agent code, so nothing is lost.

Full instructions (SKILL.md)

Source of truth, from alirezarezvani/claude-skills.


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

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

Related skills

More from alirezarezvani/claude-skills and the wider catalog.

MImigrate logo

migrate

alirezarezvani/claude-skills

Migrate Cypress or Selenium test suites to Playwright with file-by-file conversion.

1.5k installsAudited
MSms365-tenant-manager logo

ms365-tenant-manager

alirezarezvani/claude-skills

Microsoft 365 tenant administration for Global Administrators. Automate M365 tenant setup, Office 365 admin tasks, Azure AD user management, Exchange Online configuration, Teams administration, and security policies. Generate PowerShell scripts for bulk operations, Conditional Access policies, license management, and compliance reporting. Use for M365 tenant manager, Office 365 admin, Azure AD users, Global Administrator, tenant configuration, or Microsoft 365 automation.

745 installs
PMpm-skills logo

pm-skills

alirezarezvani/claude-skills

Router for 8 bundled PM skills: pick the right one for sprint health, Jira workflows, Confluence, admin, templates, meetings, or comms.

1.9k installs
POpostmortem logo

postmortem

alirezarezvani/claude-skills

Blameless 5-Whys analysis to extract learning from failures and build a change register.

1.4k installsAudited
PRproduct-manager-toolkit logo

product-manager-toolkit

alirezarezvani/claude-skills

Comprehensive toolkit for product managers including RICE prioritization, customer interview analysis, PRD templates, discovery frameworks, and go-to-market strategies. Use when prioritizing features, synthesizing user research, writing requirement documentation, or developing product strategy.

831 installs
PRproduct-skills logo

product-skills

alirezarezvani/claude-skills

Router for 12 product skills: prioritization, OKRs, UX research, design, analytics, experiments, discovery, roadmaps, and scaffolding.

1.9k installs