merge – Agents & Automation skill for AI agents
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.
Install the merge skill with one command
Pick the tool you use, copy the command and paste it in your terminal. The skill lands in that tool's skills folder and is ready in your next session.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/merge-2742b.tgz | tar xz -C ~/.claude/skills
Call it in Claude Code: /merge – then describe the task you want done.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/merge-2742b.tgz | tar xz -C ~/.codex/skills
Call it in Codex: $merge – then describe the task you want done.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/merge-2742b.tgz | tar xz -C ~/.hermes/skills
Call it in Hermes Agent: /merge – then describe the task you want done.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/merge-2742b.tgz | tar xz -C ~/.deepcode/skills
Call it in DeepSeek: /merge – then describe the task you want done.
SKILL.md content
/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 winnerWhat 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-14. 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 mergedSafety
- Confirm with user before merging — show the diff summary first
- Never force-push — merge is always
--no-fffor 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
- datadog-automation – Automate Datadog tasks via Rube MCP (Composio): query metrics, search logs, manage…
- datawebot – Find products for sale across online shops, list returned sellers' prices with direct…
- spark-memory-thermal-ops – Manage unified memory and thermals during long-running ML jobs on NVIDIA DGX Spark. Use…
- notebooklm – Browser automation skill for controlling Google's NotebookLM. Use when the user wants…
- delegating-to-agents – Delegate bounded work to other AI agents while preserving context, ownership, and…
- office-hours – /c-level-agents:office-hours [topic] — YC-style 6-question founder interrogation before…
- onboard – /cs-onboard — Founder interview that populates ~/.claude/company-context.md using the…
- design-orchestration – Orchestrates design workflows by routing work through brainstorming, multi-agent review…