merge – skill Agent & Tự động hóa cho agent AI
Hợp nhất nhánh của agent thắng cuộc vào base, lưu trữ các nhánh thua và dọn dẹp worktree. Dùng khi người dùng chạy /hub:merge hoặc muốn áp dụng kết quả AgentHub thắng cuộc và dọn dẹp phiên làm việc.
Cài skill merge bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/merge-2742b.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /merge – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/merge-2742b.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $merge – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/merge-2742b.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /merge – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/merge-2742b.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /merge – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
/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
Skill liên quan
- datadog-automation – Tự động hóa tác vụ Datadog qua Rube MCP (Composio): truy vấn metric, tìm log, quản lý…
- datawebot – Tìm sản phẩm bán trên các cửa hàng trực tuyến, liệt kê giá của người bán kèm liên kết…
- spark-memory-thermal-ops – Quản lý bộ nhớ hợp nhất và nhiệt độ trong các tác vụ ML chạy lâu trên NVIDIA DGX Spark…
- notebooklm – Skill tự động hóa trình duyệt để điều khiển NotebookLM của Google. Dùng khi người dùng…
- delegating-to-agents – Ủy thác công việc có ranh giới rõ ràng cho các AI agent khác, đồng thời giữ ngữ cảnh…
- office-hours – /c-level-agents:office-hours [topic] — Phỏng vấn founder kiểu YC gồm 6 câu hỏi trước khi…
- onboard – /cs-onboard — Phỏng vấn founder để điền ~/.claude/company-context.md theo schema chuẩn 7…
- design-orchestration – Điều phối quy trình thiết kế bằng cách định tuyến công việc qua brainstorming, review đa…