merge

alirezarezvani/claude-skills · updated Apr 8, 2026

$npx skills add https://github.com/alirezarezvani/claude-skills --skill merge
0 commentsdiscussion
summary

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

skill.md

/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

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.730 reviews
  • Shikha Mishra· Dec 28, 2024

    We added merge from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Evelyn Abbas· Dec 24, 2024

    merge is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Hassan Khan· Dec 12, 2024

    Useful defaults in merge — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Yash Thakker· Nov 19, 2024

    merge fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Aisha Gupta· Nov 19, 2024

    Keeps context tight: merge is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Evelyn Ramirez· Nov 15, 2024

    Solid pick for teams standardizing on skills: merge is focused, and the summary matches what you get after install.

  • Hassan Zhang· Nov 3, 2024

    I recommend merge for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Aditi Abebe· Oct 22, 2024

    merge reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Dhruvi Jain· Oct 10, 2024

    merge is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Ira Bansal· Oct 10, 2024

    Registry listing for merge matched our evaluation — installs cleanly and behaves as described in the markdown.

showing 1-10 of 30

1 / 3