LeoYeAI/agent-master-skills / skills/agenthub
agenthub
VerifiedUse when a task should be attempted by several agents in parallel and the best result kept (code speed, copy variants, research angles). Spawns N agents in git worktrees, ranks results by metric or judge with result_ranker.py and merges the winner.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 8.0 KB |
| references/agent-templates.md | markdown | 7.6 KB |
| references/coordination-strategies.md | markdown | 5.8 KB |
| references/dag-patterns.md | markdown | 4.0 KB |
| scripts/board_manager.py | script | 8.4 KB |
| scripts/dag_analyzer.py | script | 8.7 KB |
| scripts/dry_run.py | script | 11.2 KB |
| scripts/hub_init.py | script | 8.3 KB |
| scripts/result_ranker.py | script | 10.3 KB |
| scripts/session_manager.py | script | 9.8 KB |
references/coordination-strategies.md
View on GitHub# Multi-Agent Coordination Strategies
## Patterns
### Fan-Out / Fan-In
The simplest and most common pattern. One coordinator dispatches the same task to N agents, waits for all to complete, then evaluates.
```
┌─ Agent 1 ─┐
Task ──> ├─ Agent 2 ─┤ ──> Evaluate ──> Merge Winner
└─ Agent 3 ─┘
```
**When to use**: Optimization tasks, competitive solutions, exploring diverse approaches, competing content drafts, vendor evaluation.
**Agent count**: 2-5 (diminishing returns beyond 5 for most tasks).
**Eval**: Metric-based preferred. LLM judge for subjective quality.
### Tournament
Multiple rounds of fan-out/fan-in. Losers are eliminated, winners advance. Each round can refine the task or increase difficulty.
```
Round 1: A1, A2, A3, A4 → Eval → A2, A4 advance
Round 2: A2, A4 → Eval → A2 wins
```
**When to use**: Complex optimization where iterative refinement helps. Each round builds on the previous winner.
**Implementation**:
1. Run `/hub-init` + `/agenthub:spawn` for round 1
2. Eval, merge winner into a new base branch
3. Run `/hub-init` again with the merged branch as base
4. Repeat until convergence or budget exhausted
### Ensemble
All agents' work is combined rather than selecting a winner. Useful when agents solve different parts of a problem.
```
Agent 1: solves auth module
Agent 2: solves API routes ──> Cherry-pick all ──> Combined result
Agent 3: solves database layer
```
**When to use**: Large tasks that decompose into independent subtasks. Each agent gets a different piece.
**Implementation**:
1. In `/hub-init`, give each agent a DIFFERENT task (subtask of the whole)
2. Spawn with unique dispatch posts per agent
3. Instead of `/agenthub:eval` ranking, manually cherry-pick from each
4. Or merge sequentially: merge agent-1, then merge agent-2 on top
### Pipeline
Agents work sequentially — each builds on the previous agent's output. Like a relay race.
```
Agent 1 (design) → Agent 2 (implement) → Agent 3 (test) → Agent 4 (optimize)
```
**When to use**: Tasks with natural phases (design → implement → test). Each phase needs different expertise.
**Implementation**:
1. Spawn agent-1 alone, wait for completion
2. Merge agent-1's work, spawn agent-2 from that base
3. Repeat for each pipeline stage
4. Each agent reads the previous agent's result post for context
## Agent Configuration
### Task Decomposition
For fan-out, all agents get the same task. But you can add variation:
| Strategy | Dispatch Difference | Use Case |
|----------|-------------------|----------|
| **Identical** | Same prompt to all | Pure competition |
| **Constrained** | Same goal, different constraints | "Use caching" vs "Use indexing" |
| **Seeded** | Same goal, different starting hints | Explore different parts of solution space |
| **Role-varied** | Same goal, different personas | "As a performance engineer" vs "As a DBA" |
### Agent Count Guidelines
| Task Complexity | Agents | Rationale |
|----------------|--------|-----------|
| Simple optimization | 2 | Two approaches is usually enough |
| Medium complexity | 3 | Three diverse approaches, manageable eval |
| Complex / creative | 4-5 | More exploration, but eval cost increases |
| Subtask decomposition | N = subtasks | One agent per subtask (ensemble pattern) |
## Evaluation Strategies
### Metric-Based (Objective)
Best when a clear numeric metric exists:
| Metric Type | Example | Direction |
|-------------|---------|-----------|
| Latency | p50_ms, p99_ms | lower |
| Throughput | rps, qps | higher |
| Size | bundle_kb, image_bytes | lower |
| Score | test_pass_rate, accuracy | higher |
| Count | error_count, warnings | lower |
| Word count | word_count | higher |
| Readability | flesch_score | higher |
| Conversion | cta_click_rate | higher |
### LLM Judge (Subjective)
Best when quality is subjective or multi-dimensional:
Judging criteria (in order of importance):
1. **Correctness** — Does it solve the stated task?
2. **Completeness** — Does it handle edge cases?
3. **Simplicity** — Fewer lines changed = less risk
4. **Quality** — Clean execution, good structure, no anti-patterns
5. **Performance** — Efficient algorithms and data structures
### Hybrid
1. Run metric eval to get objective ranking
2. If top-2 agents are within 10% of each other, use LLM judge
3. Weight: 70% metric, 30% qualitative
## Failure Handling
### All Agents Fail
```
Signal: All agents return errors or no improvement
Action:
1. Post failure summary to board
2. Archive session (state → archived)
3. Suggest: "Try with different constraints, more agents, or simplified task"
4. Do NOT auto-retry without user approval
```
### Partial Failure
```
Signal: Some agents fail, others succeed
Action:
1. Evaluate only successful agents
2. Note failures in eval summary
3. Proceed with merge if any agent succeeded
```
### No Improvement
```
Signal: All agents complete but none improve on baseline
Action:
1. Show results with negative deltas
2. Suggest: "Current implementation may already be near-optimal"
3. Archive session
```
## Communication Protocol
### Board Usage by Phase
| Phase | Channel | Content |
|-------|---------|---------|
| Dispatch | `dispatch/` | Task assignment per agent |
| Working | `progress/` | Agent status updates (optional) |
| Complete | `results/` | Final result summary per agent |
| Merge | `results/` | Merge summary from coordinator |
### Result Post Template
Agents should write results in this format:
```markdown
## Result Summary
- **Approach**: {one-line description of strategy}
- **Files changed**: {count}
- **Key changes**: {bullet list of main modifications}
- **Metric**: {value} (baseline: {baseline}, delta: {delta})
- **Tests**: {pass/fail status}
- **Confidence**: {High/Medium/Low} — {reason}
- **Limitations**: {known issues or edge cases}
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |