borghei/Claude-Skills / engineering/agenthub
agenthub
VerifiedRuns a multi-agent job as a dependency graph: validates the DAG, tracks each agent's state on a board, then ranks and merges their outputs. Use when spawning parallel agents, monitoring a run, or merging results.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 9.8 KB |
| assets/sample_session.json | config | 4.5 KB |
| assets/sample_workflow.json | config | 1.5 KB |
| references/multi-agent-patterns.md | markdown | 5.6 KB |
| references/operations-and-quality.md | markdown | 2.9 KB |
| references/orchestration-core.md | markdown | 4.9 KB |
| scripts/board_manager.py | script | 10.9 KB |
| scripts/dag_analyzer.py | script | 13.5 KB |
| scripts/result_ranker.py | script | 11.0 KB |
| scripts/session_manager.py | script | 12.7 KB |
| skills/board.md | markdown | 2.2 KB |
| skills/eval.md | markdown | 2.2 KB |
| skills/init.md | markdown | 2.0 KB |
| skills/merge.md | markdown | 2.3 KB |
| skills/run.md | markdown | 2.1 KB |
| skills/spawn.md | markdown | 1.9 KB |
| skills/status.md | markdown | 2.1 KB |
references/multi-agent-patterns.md
View on GitHub# Multi-Agent Orchestration Patterns Reference
## DAG Patterns
### 1. Fan-Out / Fan-In (Most Common)
```
┌── Agent A ──┐
Input ───┼── Agent B ──┼──> Merge ──> Output
└── Agent C ──┘
```
**When to use:** Task decomposes into independent sub-tasks that can run in parallel, then need to be combined.
**Examples:**
- Research from multiple sources, then synthesize
- Generate multiple drafts, then pick the best
- Analyze different aspects of a dataset, then combine findings
**Merge strategy:** Synthesize (each agent contributes different aspects)
### 2. Pipeline (Sequential)
```
Extract ──> Transform ──> Enrich ──> Validate ──> Output
```
**When to use:** Each step depends on the previous step's output and transforms it further.
**Examples:**
- Data processing: extract -> clean -> transform -> load
- Content: research -> outline -> draft -> edit -> polish
- Code: spec -> implement -> test -> review -> deploy
**Merge strategy:** Chain (final agent output is the result)
### 3. Reducer (Competitive)
```
Agent 1 ──┐
Agent 2 ──┼──> Rank ──> Best Output
Agent 3 ──┘
```
**When to use:** Multiple agents attempt the same task independently, and you pick the best result.
**Examples:**
- Multiple code solutions ranked by test pass rate
- Multiple summaries ranked by completeness
- Multiple designs ranked by criteria scores
**Merge strategy:** Rank-select (pick highest scoring output)
### 4. Validator Chain
```
Generate ──> Review ──> Fix ──> Re-Review ──> Approve
```
**When to use:** Quality is critical and each step validates/improves the previous step's work.
**Examples:**
- Code generation with review and fix cycle
- Document drafting with editorial review
- Test generation with coverage validation
**Merge strategy:** Chain (final validated output)
### 5. Map-Reduce
```
Split ──> [Agent per chunk] ──> Reduce ──> Output
```
**When to use:** Input is large and can be split into independent chunks processed in parallel.
**Examples:**
- Analyzing a large codebase file-by-file
- Processing multiple documents in a corpus
- Running tests across multiple environments
**Merge strategy:** Synthesize with deduplication
### 6. Diamond Dependency
```
Agent A ──> Agent B ──┐
└────> Agent C ──┼──> Agent D
```
**When to use:** Two paths share a common ancestor and a common descendant.
**Warning:** Ensure Agent D correctly handles inputs from both B and C without duplication.
## Agent Design Principles
### Single Responsibility
Each agent should have ONE clear objective. If you cannot describe the agent's job in one sentence, split it.
**Good:**
- "Research competitor pricing data"
- "Generate TypeScript test code from spec"
- "Review code for security vulnerabilities"
**Bad:**
- "Research competitors, analyze pricing, and write a report" (3 agents)
- "Generate and review tests" (2 agents)
### Explicit Contracts
Every agent must declare:
- **Inputs:** What data it needs (with types/schemas)
- **Outputs:** What data it produces (with types/schemas)
- **Constraints:** Time limit, quality threshold, format requirements
### Idempotency
Given the same inputs, an agent should produce the same outputs. This enables:
- Safe retries on failure
- Caching of completed work
- Deterministic debugging
### Context Isolation
Agents should not share mutable state. All data flows through declared inputs and outputs. This prevents:
- Race conditions in parallel execution
- Hidden dependencies between agents
- State corruption from failed agents
## Quality Gate Patterns
### Threshold Gate
```
Output Score >= 0.7 → PASS
Output Score >= 0.55 → REVISE (retry with feedback)
Output Score < 0.55 → FAIL
```
### Rubric Gate
Define specific criteria and grade each:
```
Completeness: 0-1 (all required fields present)
Accuracy: 0-1 (claims supported by evidence)
Format: pass/fail (matches expected schema)
Relevance: 0-1 (addresses the assigned task)
```
### Consensus Gate
Multiple evaluators must agree:
```
If 2/3 evaluators rate PASS → PASS
If 2/3 evaluators rate FAIL → FAIL
Otherwise → HUMAN_REVIEW
```
## Failure Handling
### Retry with Context
When an agent fails, retry with additional context:
```
Retry 1: Original prompt + error message
Retry 2: Original prompt + error message + hint from evaluator
Retry 3: FAIL (escalate to human)
```
### Skip and Continue
If a non-critical agent fails, skip it and continue the workflow. Downstream agents must handle missing inputs gracefully.
### Fallback Agent
If the primary agent fails, a simpler fallback agent takes over:
```
Primary Agent (complex) ──> FAIL ──> Fallback Agent (simple) ──> Output
```
### Circuit Breaker
After N consecutive failures across agents, halt the workflow:
```
If 3+ agents fail → HALT workflow → notify human
```
## Scaling Considerations
| Agents | Max Parallel | Strategy |
|--------|-------------|----------|
| 2-4 | All parallel | Simple fan-out |
| 5-10 | 3-5 parallel | Batched execution with priority |
| 10-20 | 5-8 parallel | Phased execution with checkpoints |
| 20+ | Consider decomposing into sub-workflows | Hierarchical orchestration |
## Metrics
| Metric | Definition | Target |
|--------|-----------|--------|
| Parallelization efficiency | parallel_time / sequential_time | > 0.6 |
| Quality gate pass rate | first_attempt_passes / total_attempts | > 0.8 |
| Workflow completion rate | completed_workflows / started_workflows | > 0.95 |
| Critical path ratio | critical_path_time / total_wall_time | < 0.7 |
| Retry rate | retried_agents / total_agents | < 0.15 |
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: 471k | 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 |