Implement — Multi-agent collaboration plugin that spawns N parallel subagents competing on the same task via git worktree isolation. Agents work independently, results are evaluated by metric
Implement — Multi-agent collaboration plugin that spawns N parallel subagents competing on the same task via git worktree isolation. Agents work independently, results are evaluated by metric
[{"name":"code_or_task","type":"string","description":"Code snippet, script, or task description to process","required":true}]
output_schema
[{"name":"result","type":"string","description":"Primary output from agenthub"}]
AgentHub — Multi-Agent Collaboration
Spawn N parallel AI agents that compete on the same task. Each agent works in an isolated git worktree. The coordinator evaluates results and merges the winner.
Slash Commands
Command
Description
/hub:init
Create a new collaboration session — task, agent count, eval criteria
.agenthub/sessions/{session-id}/state.json — state machine
.agenthub/board/ — message board channels
2. Dispatch
Run /hub:spawn to launch agents. For each agent 1..N:
Post task assignment to .agenthub/board/dispatch/
Spawn via Agent tool with isolation: "worktree"
All agents launched in a single message (parallel)
3. Monitor
Run /hub:status to check progress:
dag_analyzer.py --status --session {id} shows branch state
Board progress/ channel has agent updates
4. Evaluate
Run /hub:eval to rank results:
Metric mode: run eval command in each worktree, parse numeric result
Judge mode: read diffs, coordinator ranks by quality
Hybrid: metric first, LLM-judge for ties
5. Merge
Run /hub:merge to finalize:
git merge --no-ff winner into base branch
Tag losers: git tag hub/archive/{session}/agent-{i}
Clean up worktrees
Post merge summary to board
Agent Protocol
Each subagent receives this prompt pattern:
You are agent-{i} in hub session {session-id}.
Your task: {task description}
Instructions:
1. Read your assignment at .agenthub/board/dispatch/{seq}-agent-{i}.md
2. Work in your worktree — make changes, run tests, iterate
3. Commit all changes with descriptive messages
4. Write your result summary to .agenthub/board/results/agent-{i}-result.md
5. Exit when done
Agents do NOT see each other's work. They do NOT communicate with each other. They only write to the board for the coordinator to read.
DAG Model
Branch Naming
hub/{session-id}/agent-{N}/attempt-{M}
Session ID: timestamp-based (YYYYMMDD-HHMMSS)
Agent N: sequential (1 to agent-count)
Attempt M: increments on retry (usually 1)
Frontier Detection
Frontier = branch tips with no child branches. Equivalent to AgentHub's "leaves" query.
Implement — Multi-agent collaboration plugin that spawns N parallel subagents competing on the same task via git worktree isolation. Agents work independently, results are evaluated by metric
When to Use
Use this skill when the task requires agenthub capabilities.
What If Fails
If this skill fails to produce the expected output: (1) verify input completeness, (2) retry with more specific context, (3) fall back to the parent workflow without this skill.