Command Palette

Search for a command to run...

Назад к скиллам
скилл № 09695

choosing-swarm-patterns

Use when coordinating multiple AI agents and need to pick the right orchestration pattern - covers 10 patterns (fan-out, pipeline, hub-spoke, consensus, mesh…

БесплатноБез исполняемых скриптов
AgentWorkforceот AgentWorkforce★ 33 звезды на GitHub

Установить choosing-swarm-patterns в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Choosing Swarm Patterns

Overview

10 orchestration patterns for multi-agent workflows. Pick the simplest pattern that solves the problem — add complexity only when the system proves it's insufficient.

Quick Decision Framework

Is the task independent per agent?
  YES → fan-out (parallel workers)

Does each step need the previous step's output?
  YES → Is it strictly linear?
    YES → pipeline
    NO  → dag (parallel where possible)

Does a coordinator need to stay alive and adapt?
  YES → Is there one level of management?
    YES → hub-spoke
    NO  → hierarchical (multi-level)

Is the task about making a decision?
  YES → Do agents need to argue opposing sides?
    YES → debate (adversarial)
    NO  → consensus (cooperative voting)

Does the right specialist emerge during processing?
  YES → handoff (dynamic routing)

Do all agents need to freely collaborate?
  YES → mesh (peer-to-peer)

Is cost the primary concern?
  YES → cascade (cheap model first, escalate if needed)

Pattern Reference

# Pattern Topology Agents Best For
1 fan-out Star (SDK center) N parallel Independent subtasks (reviews, research, tests)
2 pipeline Linear chain Sequential Ordered stages (design → implement → test)
3 hub-spoke Star (live hub) 1 lead + N workers Dynamic coordination, lead reviews/adjusts
4 consensus Broadcast + vote N voters Architecture decisions, approval gates
5 mesh Fully connected N peers Brainstorming, collaborative debugging
6 handoff Routing chain 1 active at a time Triage, specialist routing, support flows
7 cascade Tiered escalation Cheapest → most capable Cost optimization, production workloads
8 dag Dependency graph Parallel + joins Complex projects with mixed dependencies
9 debate Adversarial rounds 2+ debaters + judge Rigorous evaluation, architecture trade-offs
10 hierarchical Tree (multi-level) Lead → coordinators → workers Large teams, domain separation

Pattern Details

1. fan-out — Parallel Workers

fanOut([
  { task: "Review auth.ts", name: "AuthReviewer" },
  { task: "Review db.ts", name: "DbReviewer" },
], { cli: "claude" });
  • Workers run independently, no inter-agent communication
  • SDK collects all DONE messages
  • Use when: tasks are embarrassingly parallel

2. pipeline — Sequential Stages

pipeline([
  { task: "Design the API schema", name: "Designer" },
  { task: "Implement the endpoints", name: "Implementer" },
  { task: "Write integration tests", name: "Tester" },
]);
  • Stage N+1 receives Stage N's DONE summary as context
  • Pipeline halts on failure
  • Use when: clear linear dependency chain

3. hub-spoke — Persistent Coordinator

hubAndSpoke({
  hub: { task: "Coordinate building a REST API", name: "Lead" },
  workers: [
    { task: "Build database models", name: "DbWorker" },
    { task: "Build route handlers", name: "ApiWorker" },
  ],
});
  • Hub stays alive, receives ACK/DONE from workers
  • Hub can spawn additional workers dynamically
  • Use when: lead needs to review, adjust, and make decisions

4. consensus — Cooperative Voting

consensus({
  proposal: "Should we migrate to Fastify?",
  voters: [
    { task: "Evaluate performance", name: "PerfExpert" },
    { task: "Evaluate DX", name: "DxExpert" },
  ],
  consensusType: "majority",
});
  • Agents independently evaluate, then VOTE: approve/reject
  • Supports majority, supermajority, unanimous, weighted, quorum
  • Use when: need a decision with diverse perspectives

5. mesh — Peer Collaboration

mesh({
  goal: "Debug the auth flow returning 500",
  agents: [
    { task: "Check server logs", name: "LogAnalyst" },
    { task: "Review auth code", name: "CodeReviewer" },
    { task: "Write repro test", name: "Tester" },
  ],
});
  • All agents on same channel, free communication
  • Round tracking detects stalls
  • Use when: collaborative exploration without hierarchy

6. handoff — Dynamic Routing

handoff({
  entryPoint: { task: "Triage the request", name: "Triage" },
  routes: [
    { agent: { task: "Handle billing", name: "Billing" }, condition: "billing, payment" },
    { agent: { task: "Handle tech issues", name: "TechSupport" }, condition: "error, bug" },
  ],
  maxHandoffs: 3,
});
  • One active agent at a time; transfers control dynamically
  • Circuit breaker prevents infinite routing loops
  • Use when: right specialist isn't known upfront

7. cascade — Cost-Aware Escalation

cascade({
  tiers: [
    { agent: { task: "Answer this", cli: "claude" }, confidenceThreshold: 0.7, costWeight: 1 },
    { agent: { task: "Answer this", cli: "claude" }, confidenceThreshold: 0.85, costWeight: 5 },
    { agent: { task: "Answer this", cli: "claude" }, costWeight: 20 },
  ],
});
  • Start cheap, escalate if confidence < threshold
  • Agent
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл choosing-swarm-patterns?

Use when coordinating multiple AI agents and need to pick the right orchestration pattern - covers 10 patterns (fan-out, pipeline, hub-spoke, consensus, mesh, handoff, cascade, dag, debate, hierarchical) with decision framework and reflection protocol

Как установить скилл choosing-swarm-patterns?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл choosing-swarm-patterns запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить choosing-swarm-patterns с