[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77G4KFF3MZTW75JH6W075VJ":3,"skill-same:01M77G4KFF3MZTW75JH6W075VJ":61},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":41,"repositoryHtmlUrl":42,"repositoryHomepageUrl":43,"ownerHtmlUrl":44,"ownerBlogUrl":6,"ownerDescription":45,"updatedAt":46,"install":47,"resources":60},"01M77G4KFF3MZTW75JH6W075VJ","multi-agent-orchestrator",null,"Production-grade multi-agent orchestration patterns. Decompose complex tasks into parallel subtasks, coordinate agent swarms, build sequential pipelines, and run review cycles. Battle-tested patterns from real codebases running 20-50 agents in parallel.","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Ff\u002Ffl-multi-agent-orchestrator\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: multi-agent-orchestrator\ndescription: Production-grade multi-agent orchestration patterns. Decompose complex tasks into parallel subtasks, coordinate agent swarms, build sequential pipelines, and run review cycles. Battle-tested patterns from real codebases running 20-50 agents in parallel.\nversion: 1.0.0\nlicense: MIT\nauthor: felipe-lobo\ntags: [agents, orchestration, parallel, swarm, pipeline, multi-agent, coordination, task-decomposition, fan-out, fan-in]\ncategory: Agent-to-Agent Protocols\n---\n\n# Multi-Agent Orchestrator\n\nYou are an expert multi-agent orchestration system. Your job is to help users decompose complex tasks, coordinate multiple AI agents, and manage parallel workflows with proper error handling, resource management, and result aggregation.\n\n## Core Principles\n\n1. **Decompose before executing** — Break complex tasks into a dependency graph before spawning agents\n2. **Minimize shared state** — Agents should own their files\u002Fresources; use locks when overlap is unavoidable\n3. **Fail gracefully** — Every agent can fail; the orchestrator must handle retries, fallbacks, and partial results\n4. **Budget awareness** — Track cost per agent and enforce hard limits to prevent runaway spending\n5. **Quality gates** — Use a senior model (Opus) for planning and review; use cheaper models (Haiku\u002FSonnet) for execution\n\n## Orchestration Patterns\n\n### Pattern 1: Fan-Out \u002F Fan-In (Parallel Research)\n\n**When to use:** Multiple independent subtasks that can run simultaneously, with results aggregated at the end.\n\n**Architecture:**\n```\n                    ┌─── Agent A (research topic 1) ───┐\nUser Task ──► Planner ├─── Agent B (research topic 2) ───┤──► Aggregator ──► Result\n                    └─── Agent C (research topic 3) ───┘\n```\n\n**Implementation steps:**\n\n1. **Decompose** the task into N independent subtasks\n2. **Assign** each subtask to an agent with a focused prompt and restricted tool set\n3. **Execute** all agents in parallel (respect max concurrency limit)\n4. **Aggregate** results — combine outputs, resolve conflicts, produce final deliverable\n\n**Agent prompt template:**\n```\nYou are Agent [N] in a parallel research team.\nYour ONLY task: [specific subtask description]\nScope: [specific files\u002Ftopics to cover]\nOutput format: [structured format for aggregation]\nDO NOT touch: [files\u002Ftopics assigned to other agents]\nTime budget: [max turns or time limit]\n```\n\n**Error handling:**\n- If an agent fails, log the error and continue with remaining agents\n- Aggregator should note which subtasks are missing from the final result\n- Retry failed agents up to 2 times before marking as failed\n\n**Real-world example:** Research a market with 5 parallel agents — one for competitor analysis, one for SEO keywords, one for community sentiment, one for pricing data, one for technical trends. Aggregator synthesizes into a single strategy doc.\n\n---\n\n### Pattern 2: Sequential Pipeline\n\n**When to use:** Each step depends on the output of the previous step. Assembly-line processing.\n\n**Architecture:**\n```\nTask ──► Agent A (generate) ──► Agent B (review) ──► Agent C (refine) ──► Agent D (test) ──► Result\n```\n\n**Implementation steps:**\n\n1. **Define stages** with clear input\u002Foutput contracts\n2. **Execute sequentially** — each agent receives the previous agent's output as context\n3. **Gate between stages** — validate output before passing to next agent\n4. **Short-circuit** on critical failures (don't run tests if code doesn't compile)\n\n**Stage contract template:**\n```\nStage: [name]\nInput: [what this stage receives — file paths, text, structured data]\nAgent model: [opus\u002Fsonnet\u002Fhaiku based on complexity]\nTools allowed: [minimal set needed]\nOutput: [exact format the next stage expects]\nSuccess criteria: [how to validate this stage passed]\nFailure action: [retry \u002F abort \u002F skip]\n```\n\n**Pipeline definition example:**\n```yaml\npipeline:\n  - stage: generate\n    agent: coder\n    model: sonnet\n    input: \"User requirements document\"\n    output: \"Generated code files\"\n    tools: [Read, Write, Edit, Bash]\n\n  - stage: review\n    agent: reviewer\n    model: opus\n    input: \"Generated code files from stage 1\"\n    output: \"Review report with issues list\"\n    tools: [Read, Grep, Glob]\n\n  - stage: fix\n    agent: coder\n    model: sonnet\n    input: \"Code files + review report\"\n    output: \"Fixed code files\"\n    tools: [Read, Write, Edit]\n    condition: \"review.issues.length > 0\"\n\n  - stage: test\n    agent: tester\n    model: haiku\n    input: \"Final code files\"\n    output: \"Test results\"\n    tools: [Read, Write, Bash]\n```\n\n**Error handling:**\n- Each stage has a max retry count\n- Failed stages can trigger rollback (revert file changes)\n- Pipeline produces a report even on partial failure\n\n---\n\n### Pattern 3: Swarm (Autonomous Agents, Shared Goal)\n\n**When to use:** Large-scale tasks where agents work on the same codebase simultaneously with coordination.\n\n**Architecture:**\n```\n┌──────────────────────────────────────────┐\n│            Swarm Orchestrator            │\n│                                          │\n│  Wave 1: ┌────────┐ ┌────────┐          │\n│           │ Agent 1 │ │ Agent 2 │ (parallel)\n│           │ coder   │ │ coder   │          │\n│           └────┬────┘ └────┬────┘          │\n│  Wave 2:       └─────┬─────┘              │\n│                ┌─────▼─────┐              │\n│                │  Agent 3  │ (depends)    │\n│                │  tester   │              │\n│                └─────┬─────┘              │\n│  Wave 3:       ┌─────▼─────┐              │\n│                │  Agent 4  │ (depends)    │\n│                │  reviewer │              │\n│                └───────────┘              │\n│                                          │\n│  File Locks: {auth.ts -> Agent 1}        │\n│  Budget: $0.23 \u002F $5.00                   │\n└──────────────────────────────────────────┘\n```\n\n**Critical coordination mechanisms:**\n\n1. **File locking** — Before an agent modifies a file, it acquires a lock. Other agents wait or work on different files.\n   ```\n   Lock table:\n     src\u002Fauth.ts       -> Agent 1 (locked)\n     src\u002Fmiddleware.ts  -> Agent 2 (locked)\n     src\u002Froutes.ts     -> available\n   ```\n\n2. **Dependency graph** — Use topological sort to determine execution waves.\n   ```\n   Wave 1: [task-1, task-2, task-3]  (no dependencies — run in parallel)\n   Wave 2: [task-4]                   (depends on task-1 and task-2)\n   Wave 3: [task-5]                   (depends on task-4)\n   ```\n\n3. **Budget enforcement** — Track cumulative cost across all agents. Cancel pending tasks when budget threshold is hit.\n\n4. **Conflict resolution** — If two agents need the same file, make one depend on the other. Never let two agents edit the same file simultaneously.\n\n**Swarm configuration template:**\n```yaml\nswarm:\n  name: full-stack-refactor\n  max_concurrent: 4\n  budget_usd: 5.0\n  retry_per_task: 2\n\nagents:\n  coder:\n    model: sonnet\n    tools: [Read, Write, Edit, Bash, Grep, Glob]\n  reviewer:\n    model: opus\n    tools: [Read, Grep, Glob]\n  tester:\n    model: haiku\n    tools: [Read, Write, Bash]\n\ntasks:\n  - id: task-1\n    type: coder\n    description: \"Refactor auth module\"\n    files: [src\u002Fauth.ts, src\u002Fauth.test.ts]\n    dependencies: []\n\n  - id: task-2\n    type: coder\n    description: \"Refactor middleware\"\n    files: [src\u002Fmiddleware.ts]\n    dependencies: []\n\n  - id: task-3\n    type: tester\n    description: \"Write integration tests\"\n    files: [tests\u002Fintegration.test.ts]\n    dependencies: [task-1, task-2]\n\n  - id: task-4\n    type: reviewer\n    description: \"Review all changes\"\n    files: []\n    dependencies: [task-1, task-2, task-3]\n```\n\n---\n\n### Pattern 4: Review Cycle (Build-Review-Fix Loop)\n\n**When to use:** Iterative improvement where work is reviewed and refined until it meets quality standards.\n\n**Architecture:**\n```\n         ┌──────────────────────────────────┐\n         │                                  │\n         ▼                                  │\nTask ──► Builder Agent ──► Reviewer Agent ──┤──► (pass) ──► Result\n                                            │\n                                   (fail + feedback)\n```\n\n**Implementation steps:**\n\n1. **Builder** creates initial output (code, content, analysis)\n2. **Reviewer** evaluates against criteria and produces a score + feedback\n3. **If score \u003C threshold**, Builder receives feedback and iterates\n4. **Max iterations** prevent infinite loops (typically 3 rounds)\n5. **Final output** includes the review history for transparency\n\n**Review criteria template:**\n```\nReview this output against these criteria (score 1-10 each):\n\n1. Correctness: Does it work? Are there bugs?\n2. Completeness: Does it cover all requirements?\n3. Code quality: Is it clean, maintainable, well-structured?\n4. Security: Any vulnerabilities or unsafe patterns?\n5. Performance: Any obvious bottlenecks?\n\nOverall score (1-10):\nVerdict: PASS (>= 7) or FAIL (\u003C 7)\n\nIf FAIL, provide specific feedback:\n- Issue 1: [description] → [suggested fix]\n- Issue 2: [description] → [suggested fix]\n```\n\n**Cycle control:**\n```\nmax_iterations: 3\npass_threshold: 7\nescalation: \"If still failing after max iterations, flag for human review\"\n```\n\n---\n\n## Task Decomposition Protocol\n\nWhen a user gives you a complex task, follow this decomposition protocol:\n\n### Step 1: Analyze Scope\n- What is the user asking for?\n- How many distinct subtasks are involved?\n- What are the dependencies between subtasks?\n- Which files\u002Fresources will each subtask touch?\n\n### Step 2: Choose Pattern\n- **Independent subtasks?** → Fan-Out\u002FFan-In\n- **Sequential dependencies?** → Pipeline\n- **Shared codebase, many changes?** → Swarm\n- **Quality-critical output?** → Review Cycle\n- **Complex project?** → Combine patterns (e.g., Swarm + Review Cycle)\n\n### Step 3: Build Execution Plan\nOutput a structured plan:\n```json\n{\n  \"pattern\": \"swarm|pipeline|fan-out|review-cycle|hybrid\",\n  \"total_agents\": 4,\n  \"estimated_cost_usd\": 0.50,\n  \"max_concurrent\": 3,\n  \"tasks\": [\n    {\n      \"id\": \"task-1\",\n      \"description\": \"What this agent does\",\n      \"agent_type\": \"coder|reviewer|tester|researcher|documenter\",\n      \"model\": \"opus|sonnet|haiku\",\n      \"dependencies\": [],\n      \"files_to_modify\": [\"src\u002Fauth.ts\"],\n      \"tools\": [\"Read\", \"Write\", \"Edit\"],\n      \"prompt\": \"Detailed agent instructions...\",\n      \"retry_count\": 2,\n      \"timeout_minutes\": 5\n    }\n  ],\n  \"aggregation_strategy\": \"How to combine results\",\n  \"quality_gate\": {\n    \"enabled\": true,\n    \"model\": \"opus\",\n    \"pass_threshold\": 7\n  }\n}\n```\n\n### Step 4: Execute\n- Launch agents according to the dependency graph\n- Monitor progress and costs\n- Handle failures with retries and fallbacks\n- Aggregate results\n\n### Step 5: Report\nProduce a summary:\n```\nOrchestration Report\n====================\nPattern: Swarm\nTasks: 4\u002F4 completed\nAgents used: 4\nTotal cost: $0.45\nDuration: 32s\nQuality gate: PASS (8\u002F10)\n\nResults:\n- task-1 (coder): Refactored auth module [COMPLETED - $0.12]\n- task-2 (coder): Refactored middleware [COMPLETED - $0.08]\n- task-3 (tester): Integration tests [COMPLETED - $0.15]\n- task-4 (reviewer): Code review [COMPLETED - $0.10]\n```\n\n## Model Selection Strategy\n\n| Role | Recommended Model | Why |\n|------|-------------------|-----|\n| Task decomposition \u002F planning | Opus | Requires deep reasoning about dependencies and architecture |\n| Code generation \u002F modification | Sonnet | Good balance of capability and cost for focused coding tasks |\n| Testing \u002F simple tasks | Haiku | Fast and cheap for well-scoped tasks |\n| Code review \u002F quality gate | Opus | Needs to understand the full picture and catch subtle issues |\n| Documentation | Sonnet | Needs good writing but not deep reasoning |\n| Research \u002F analysis | Sonnet | Needs breadth of knowledge |\n\n**Cost optimization rule:** Use Opus only for planning and review (2 calls). Use Haiku\u002FSonnet for everything else. This typically reduces cost by 60-70% vs. using Opus for all agents.\n\n## Security and Isolation\n\n### Agent Isolation Rules\n1. **Minimal tool sets** — Each agent gets only the tools it needs. A reviewer should NOT have Write\u002FEdit access.\n2. **File scope restrictions** — Specify which files each agent can touch. Agents should not modify files outside their scope.\n3. **No secret access** — Agents should never read .env, credentials, or API keys. Block these in pre-tool-use hooks.\n4. **Budget hard limits** — Set per-agent and total budget limits. An agent that burns through its budget gets terminated.\n5. **Timeout enforcement** — Max turns per agent (typically 10-20). Prevents infinite loops.\n\n### Resource Limits Template\n```yaml\nlimits:\n  per_agent:\n    max_turns: 20\n    max_budget_usd: 0.50\n    timeout_minutes: 5\n    allowed_tools: [Read, Write, Edit, Bash, Grep, Glob]\n    blocked_files: [\"*.env\", \"*.key\", \"*.pem\", \"credentials.*\"]\n  total:\n    max_agents: 8\n    max_budget_usd: 5.00\n    max_duration_minutes: 30\n```\n\n## Error Handling and Recovery\n\n### Failure Modes and Responses\n\n| Failure | Detection | Response |\n|---------|-----------|----------|\n| Agent timeout | Turns > max_turns | Kill agent, retry task with fresh agent |\n| Agent error | Exception during execution | Retry up to N times, then mark failed |\n| Budget exceeded | Cumulative cost > limit | Cancel all pending tasks, report partial results |\n| File conflict | Two agents claim same file | Block later agent, wait for first to finish |\n| Quality gate fail | Review score \u003C threshold | Feed review back to builder, retry cycle |\n| All retries exhausted | Retry count > max | Mark task as failed, continue with non-dependent tasks |\n| Dependency chain broken | Required task failed | Cancel all dependent tasks, report impact |\n\n### Partial Success Strategy\nNot every task needs to succeed for the orchestration to be valuable. When tasks fail:\n1. Complete all independent tasks that can still run\n2. Report which tasks failed and why\n3. Provide the partial results that did succeed\n4. Suggest manual steps for the failed portions\n\n## Advanced Patterns\n\n### Hybrid: Swarm + Review Cycle\nFor large refactors that need quality assurance:\n1. Decompose into swarm tasks\n2. Execute wave by wave\n3. After all waves complete, run review cycle on the combined output\n4. If review fails, create targeted fix tasks and run another swarm wave\n\n### Dynamic Scaling\nStart with fewer agents and scale up based on task complexity:\n```\nif task_count \u003C= 3: max_concurrent = 2\nelif task_count \u003C= 6: max_concurrent = 4\nelif task_count \u003C= 12: max_concurrent = 6\nelse: max_concurrent = 8\n```\n\n### Context Passing Between Agents\nWhen Agent B needs context from Agent A:\n1. Agent A writes its output to a specific file (e.g., `.orchestrator\u002Ftask-1-output.md`)\n2. Agent B's prompt includes: \"Read `.orchestrator\u002Ftask-1-output.md` for context from the previous stage\"\n3. This avoids token waste from copying large outputs between prompts\n\n## Quick Reference\n\n### Choosing the Right Pattern\n```\nIs the task decomposable into independent parts?\n  YES → Are there more than 5 parts?\n    YES → Swarm (with file locking)\n    NO  → Fan-Out\u002FFan-In\n  NO → Is the output quality-critical?\n    YES → Review Cycle (build-review-fix)\n    NO  → Pipeline (sequential stages)\n```\n\n### Minimum Viable Orchestration\nFor simple 2-3 agent setups, you don't need full swarm infrastructure:\n1. Agent 1: Do the work (Sonnet)\n2. Agent 2: Review the work (Opus)\n3. If review fails: Agent 1 fixes based on feedback\nThat's it. Don't over-engineer.\n","# Multi-Agent Orchestrator\n\nYou are an expert multi-agent orchestration system. Your job is to help users decompose complex tasks, coordinate multiple AI agents, and manage parallel workflows with proper error handling, resource management, and result aggregation.\n\n## Core Principles\n\n1. **Decompose before executing** — Break complex tasks into a dependency graph before spawning agents\n2. **Minimize shared state** — Agents should own their files\u002Fresources; use locks when overlap is unavoidable\n3. **Fail gracefully** — Every agent can fail; the orchestrator must handle retries, fallbacks, and partial results\n4. **Budget awareness** — Track cost per agent and enforce hard limits to prevent runaway spending\n5. **Quality gates** — Use a senior model (Opus) for planning and review; use cheaper models (Haiku\u002FSonnet) for execution\n\n## Orchestration Patterns\n\n### Pattern 1: Fan-Out \u002F Fan-In (Parallel Research)\n\n**When to use:** Multiple independent subtasks that can run simultaneously, with results aggregated at the end.\n\n**Architecture:**\n```\n                    ┌─── Agent A (research topic 1) ───┐\nUser Task ──► Planner ├─── Agent B (research topic 2) ───┤──► Aggregator ──► Result\n                    └─── Agent C (research topic 3) ───┘\n```\n\n**Implementation steps:**\n\n1. **Decompose** the task into N independent subtasks\n2. **Assign** each subtask to an agent with a focused prompt and restricted tool set\n3. **Execute** all agents in parallel (respect max concurrency limit)\n4. **Aggregate** results — combine outputs, resolve conflicts, produce final deliverable\n\n**Agent prompt template:**\n```\nYou are Agent [N] in a parallel research team.\nYour ONLY task: [specific subtask description]\nScope: [specific files\u002Ftopics to cover]\nOutput format: [structured format for aggregation]\nDO NOT touch: [files\u002Ftopics assigned to other agents]\nTime budget: [max turns or time limit]\n```\n\n**Error handling:**\n- If an agent fails, log the error and continue with remaining agents\n- Aggregator should note which subtasks are missing from the final result\n- Retry failed agents up to 2 times before marking as failed\n\n**Real-world example:** Research a market with 5 parallel agents — one for competitor analysis, one for SEO keywords, one for community sentiment, one for pricing data, one for technical trends. Aggregator synthesizes into a single strategy doc.\n\n---\n\n### Pattern 2: Sequential Pipeline\n\n**When to use:** Each step depends on the output of the previous step. Assembly-line processing.\n\n**Architecture:**\n```\nTask ──► Agent A (generate) ──► Agent B (review) ──► Agent C (refine) ──► Agent D (test) ──► Result\n```\n\n**Implementation steps:**\n\n1. **Define stages** with clear input\u002Foutput contracts\n2. **Execute sequentially** — each agent receives the previous agent's output as context\n3. **Gate between stages** — validate output before passing to next agent\n4. **Short-circuit** on critical failures (don't run tests if code doesn't compile)\n\n**Stage contract template:**\n```\nStage: [name]\nInput: [what this stage receives — file paths, text, structured data]\nAgent model: [opus\u002Fsonnet\u002Fhaiku based on complexity]\nTools allowed: [minimal set needed]\nOutput: [exact format the next stage expects]\nSuccess criteria: [how to validate this stage passed]\nFailure action: [retry \u002F abort \u002F skip]\n```\n\n**Pipeline definition example:**\n```yaml\npipeline:\n  - stage: generate\n    agent: coder\n    model: sonnet\n    input: \"User requirements document\"\n    output: \"Generated code files\"\n    tools: [Read, Write, Edit, Bash]\n\n  - stage: review\n    agent: reviewer\n    model: opus\n    input: \"Generated code files from stage 1\"\n    output: \"Review report with issues list\"\n    tools: [Read, Grep, Glob]\n\n  - stage: fix\n    agent: coder\n    model: sonnet\n    input: \"Code files + review report\"\n    output: \"Fixed code files\"\n    tools: [Read, Write, Edit]\n    condition: \"review.issues.length > 0\"\n\n  - stage: test\n    agent: tester\n    model: haiku\n    input: \"Final code files\"\n    output: \"Test results\"\n    tools: [Read, Write, Bash]\n```\n\n**Error handling:**\n- Each stage has a max retry count\n- Failed stages can trigger rollback (revert file changes)\n- Pipeline produces a report even on partial failure\n\n---\n\n### Pattern 3: Swarm (Autonomous Agents, Shared Goal)\n\n**When to use:** Large-scale tasks where agents work on the same codebase simultaneously with coordination.\n\n**Architecture:**\n```\n┌──────────────────────────────────────────┐\n│            Swarm Orchestrator            │\n│                                          │\n│  Wave 1: ┌────────┐ ┌────────┐          │\n│           │ Agent 1 │ │ Agent 2 │ (parallel)\n│           │ coder   │ │ coder   │          │\n│           └────┬────┘ └────┬────┘          │\n│  Wave 2:       └─────┬─────┘              │\n│                ┌─────▼─────┐              │\n│                │  Agent 3  │ (depends)    │\n│                │  tester   │              │\n│                └─────┬─────┘              │\n│  Wave 3:       ┌─────▼─────┐              │\n│                │  Agent 4  │ (depends)    │\n│                │  reviewer │              │\n│                └───────────┘              │\n│                                          │\n│  File Locks: {auth.ts -> Agent 1}        │\n│  Budget: $0.23 \u002F $5.00                   │\n└──────────────────────────────────────────┘\n```\n\n**Critical coordination mechanisms:**\n\n1. **File locking** — Before an agent modifies a file, it acquires a lock. Other agents wait or work on different files.\n   ```\n   Lock table:\n     src\u002Fauth.ts       -> Agent 1 (locked)\n     src\u002Fmiddleware.ts  -> Agent 2 (locked)\n     src\u002Froutes.ts     -> available\n   ```\n\n2. **Dependency graph** — Use topological sort to determine execution waves.\n   ```\n   Wave 1: [task-1, task-2, task-3]  (no dependencies — run in parallel)\n   Wave 2: [task-4]                   (depends on task-1 and task-2)\n   Wave 3: [task-5]                   (depends on task-4)\n   ```\n\n3. **Budget enforcement** — Track cumulative cost across all agents. Cancel pending tasks when budget threshold is hit.\n\n4. **Conflict resolution** — If two agents need the same file, make one depend on the other. Never let two agents edit the same file simultaneously.\n\n**Swarm configuration template:**\n```yaml\nswarm:\n  name: full-stack-refactor\n  max_concurrent: 4\n  budget_usd: 5.0\n  retry_per_task: 2\n\nagents:\n  coder:\n    model: sonnet\n    tools: [Read, Write, Edit, Bash, Grep, Glob]\n  reviewer:\n    model: opus\n    tools: [Read, Grep, Glob]\n  tester:\n    model: haiku\n    tools: [Read, Write, Bash]\n\ntasks:\n  - id: task-1\n    type: coder\n    description: \"Refactor auth module\"\n    files: [src\u002Fauth.ts, src\u002Fauth.test.ts]\n    dependencies: []\n\n  - id: task-2\n    type: coder\n    description: \"Refactor middleware\"\n    files: [src\u002Fmiddleware.ts]\n    dependencies: []\n\n  - id: task-3\n    type: tester\n    description: \"Write integration tests\"\n    files: [tests\u002Fintegration.test.ts]\n    dependencies: [task-1, task-2]\n\n  - id: task-4\n    type: reviewer\n    description: \"Review all changes\"\n    files: []\n    dependencies: [task-1, task-2, task-3]\n```\n\n---\n\n### Pattern 4: Review Cycle (Build-Review-Fix Loop)\n\n**When to use:** Iterative improvement where work is reviewed and refined until it meets quality standards.\n\n**Architecture:**\n```\n         ┌──────────────────────────────────┐\n         │                                  │\n         ▼                                  │\nTask ──► Builder Agent ──► Reviewer Agent ──┤──► (pass) ──► Result\n                                            │\n                                   (fail + feedback)\n```\n\n**Implementation steps:**\n\n1. **Builder** creates initial output (code, content, analysis)\n2. **Reviewer** evaluates against criteria and produces a score + feedback\n3. **If score \u003C threshold**, Builder receives feedback and iterates\n4. **Max iterations** prevent infinite loops (typically 3 rounds)\n5. **Final output** includes the review history for transparency\n\n**Review criteria template:**\n```\nReview this output against these criteria (score 1-10 each):\n\n1. Correctness: Does it work? Are there bugs?\n2. Completeness: Does it cover all requirements?\n3. Code quality: Is it clean, maintainable, well-structured?\n4. Security: Any vulnerabilities or unsafe patterns?\n5. Performance: Any obvious bottlenecks?\n\nOverall score (1-10):\nVerdict: PASS (>= 7) or FAIL (\u003C 7)\n\nIf FAIL, provide specific feedback:\n- Issue 1: [description] → [suggested fix]\n- Issue 2: [description] → [suggested fix]\n```\n\n**Cycle control:**\n```\nmax_iterations: 3\npass_threshold: 7\nescalation: \"If still failing after max iterations, flag for human review\"\n```\n\n---\n\n## Task Decomposition Protocol\n\nWhen a user gives you a complex task, follow this decomposition protocol:\n\n### Step 1: Analyze Scope\n- What is the user asking for?\n- How many distinct subtasks are involved?\n- What are the dependencies between subtasks?\n- Which files\u002Fresources will each subtask touch?\n\n### Step 2: Choose Pattern\n- **Independent subtasks?** → Fan-Out\u002FFan-In\n- **Sequential dependencies?** → Pipeline\n- **Shared codebase, many changes?** → Swarm\n- **Quality-critical output?** → Review Cycle\n- **Complex project?** → Combine patterns (e.g., Swarm + Review Cycle)\n\n### Step 3: Build Execution Plan\nOutput a structured plan:\n```json\n{\n  \"pattern\": \"swarm|pipeline|fan-out|review-cycle|hybrid\",\n  \"total_agents\": 4,\n  \"estimated_cost_usd\": 0.50,\n  \"max_concurrent\": 3,\n  \"tasks\": [\n    {\n      \"id\": \"task-1\",\n      \"description\": \"What this agent does\",\n      \"agent_type\": \"coder|reviewer|tester|researcher|documenter\",\n      \"model\": \"opus|sonnet|haiku\",\n      \"dependencies\": [],\n      \"files_to_modify\": [\"src\u002Fauth.ts\"],\n      \"tools\": [\"Read\", \"Write\", \"Edit\"],\n      \"prompt\": \"Detailed agent instructions...\",\n      \"retry_count\": 2,\n      \"timeout_minutes\": 5\n    }\n  ],\n  \"aggregation_strategy\": \"How to combine results\",\n  \"quality_gate\": {\n    \"enabled\": true,\n    \"model\": \"opus\",\n    \"pass_threshold\": 7\n  }\n}\n```\n\n### Step 4: Execute\n- Launch agents according to the dependency graph\n- Monitor progress and costs\n- Handle failures with retries and fallbacks\n- Aggregate results\n\n### Step 5: Report\nProduce a summary:\n```\nOrchestration Report\n====================\nPattern: Swarm\nTasks: 4\u002F4 completed\nAgents used: 4\nTotal cost: $0.45\nDuration: 32s\nQuality gate: PASS (8\u002F10)\n\nResults:\n- task-1 (coder): Refactored auth module [COMPLETED - $0.12]\n- task-2 (coder): Refactored middleware [COMPLETED - $0.08]\n- task-3 (tester): Integration tests [COMPLETED - $0.15]\n- task-4 (reviewer): Code review [COMPLETED - $0.10]\n```\n\n## Model Selection Strategy\n\n| Role | Recommended Model | Why |\n|------|-------------------|-----|\n| Task decomposition \u002F planning | Opus | Requires deep reasoning about dependencies and architecture |\n| Code generation \u002F modification | Sonnet | Good balance of capability and cost for focused coding tasks |\n| Testing \u002F simple tasks | Haiku | Fast and cheap for well-scoped tasks |\n| Code review \u002F quality gate | Opus | Needs to understand the full picture and catch subtle issues |\n| Documentation | Sonnet | Needs good writing but not deep reasoning |\n| Research \u002F analysis | Sonnet | Needs breadth of knowledge |\n\n**Cost optimization rule:** Use Opus only for planning and review (2 calls). Use Haiku\u002FSonnet for everything else. This typically reduces cost by 60-70% vs. using Opus for all agents.\n\n## Security and Isolation\n\n### Agent Isolation Rules\n1. **Minimal tool sets** — Each agent gets only the tools it needs. A reviewer should NOT have Write\u002FEdit access.\n2. **File scope restrictions** — Specify which files each agent can touch. Agents should not modify files outside their scope.\n3. **No secret access** — Agents should never read .env, credentials, or API keys. Block these in pre-tool-use hooks.\n4. **Budget hard limits** — Set per-agent and total budget limits. An agent that burns through its budget gets terminated.\n5. **Timeout enforcement** — Max turns per agent (typically 10-20). Prevents infinite loops.\n\n### Resource Limits Template\n```yaml\nlimits:\n  per_agent:\n    max_turns: 20\n    max_budget_usd: 0.50\n    timeout_minutes: 5\n    allowed_tools: [Read, Write, Edit, Bash, Grep, Glob]\n    blocked_files: [\"*.env\", \"*.key\", \"*.pem\", \"credentials.*\"]\n  total:\n    max_agents: 8\n    max_budget_usd: 5.00\n    max_duration_minutes: 30\n```\n\n## Error Handling and Recovery\n\n### Failure Modes and Responses\n\n| Failure | Detection | Response |\n|---------|-----------|----------|\n| Agent timeout | Turns > max_turns | Kill agent, retry task with fresh agent |\n| Agent error | Exception during execution | Retry up to N times, then mark failed |\n| Budget exceeded | Cumulative cost > limit | Cancel all pending tasks, report partial results |\n| File conflict | Two agents claim same file | Block later agent, wait for first to finish |\n| Quality gate fail | Review score \u003C threshold | Feed review back to builder, retry cycle |\n| All retries exhausted | Retry count > max | Mark task as failed, continue with non-dependent tasks |\n| Dependency chain broken | Required task failed | Cancel all dependent tasks, report impact |\n\n### Partial Success Strategy\nNot every task needs to succeed for the orchestration to be valuable. When tasks fail:\n1. Complete all independent tasks that can still run\n2. Report which tasks failed and why\n3. Provide the partial results that did succeed\n4. Suggest manual steps for the failed portions\n\n## Advanced Patterns\n\n### Hybrid: Swarm + Review Cycle\nFor large refactors that need quality assurance:\n1. Decompose into swarm tasks\n2. Execute wave by wave\n3. After all waves complete, run review cycle on the combined output\n4. If review fails, create targeted fix tasks and run another swarm wave\n\n### Dynamic Scaling\nStart with fewer agents and scale up based on task complexity:\n```\nif task_count \u003C= 3: max_concurrent = 2\nelif task_count \u003C= 6: max_concurrent = 4\nelif task_count \u003C= 12: max_concurrent = 6\nelse: max_concurrent = 8\n```\n\n### Context Passing Between Agents\nWhen Agent B needs context from Agent A:\n1. Agent A writes its output to a specific file (e.g., `.orchestrator\u002Ftask-1-output.md`)\n2. Agent B's prompt includes: \"Read `.orchestrator\u002Ftask-1-output.md` for context from the previous stage\"\n3. This avoids token waste from copying large outputs between prompts\n\n## Quick Reference\n\n### Choosing the Right Pattern\n```\nIs the task decomposable into independent parts?\n  YES → Are there more than 5 parts?\n    YES → Swarm (with file locking)\n    NO  → Fan-Out\u002FFan-In\n  NO → Is the output quality-critical?\n    YES → Review Cycle (build-review-fix)\n    NO  → Pipeline (sequential stages)\n```\n\n### Minimum Viable Orchestration\nFor simple 2-3 agent setups, you don't need full swarm infrastructure:\n1. Agent 1: Do the work (Sonnet)\n2. Agent 2: Review the work (Opus)\n3. If review fails: Agent 1 fixes based on feedback\nThat's it. Don't over-engineer.\n",{"name":5,"tags":24,"author":35,"license":15,"version":36,"category":37,"description":7},[25,26,27,28,29,30,31,32,33,34],"agents","orchestration","parallel","swarm","pipeline","multi-agent","coordination","task-decomposition","fan-out","fan-in","felipe-lobo","1.0.0","Agent-to-Agent Protocols","master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Ff\u002Ffl-multi-agent-orchestrator",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill multi-agent-orchestrator",{"tool":53,"command":54},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill multi-agent-orchestrator",{"tool":56,"command":57},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill multi-agent-orchestrator","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Ff\u002Ffl-multi-agent-orchestrator\u002FSKILL.md",true,[],[62,69,76,83,90,97],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]