MCP HubMCP Hub
스킬 목록으로 돌아가기

coordinate-swarm

pjt222
업데이트됨 2 days ago
5 조회
17
2
17
GitHub에서 보기
메타automationdesign

정보

이 스킬은 집단 지성 개념인 스티그머지(stigmergy)와 쿼럼 센싱(quorum sensing)을 활용하여 분산 시스템에서 탈중앙화 조정을 위한 패턴을 제공합니다. 이를 통해 개발자는 중앙 집중식 제어가 아닌 지역적 규칙과 공유 신호를 통해 자율 에이전트가 자체 조정하는 시스템을 설계할 수 있습니다. 복원력 있는 이벤트 기반 아키텍처를 구축하거나 취약한 오케스트레이션을 창발적 조정으로 대체할 때 활용하세요.

빠른 설치

Claude Code

추천
기본
npx skills add pjt222/agent-almanac -a claude-code
플러그인 명령대체
/plugin add https://github.com/pjt222/agent-almanac
Git 클론대체
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/coordinate-swarm

Claude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요

문서

Coordinate Swarm

Set up coordination across distributed agents. Use stigmergy (indirect talk through environment), local rules, quorum sensing. Coherent group behavior, no central boss.

When Use

  • Designing distributed system, no single node should be bottleneck
  • Organizing teams, workflows must self-coordinate, no constant boss oversight
  • Building event-driven architecture, parts talk through shared state, not direct messages
  • Scaling process works fine with 3 agents, breaks at 30
  • Bootstrapping coordination for new swarm domain (see forage-resources, build-consensus)
  • Replacing fragile central orchestration with resilient emergent coordination

Inputs

  • Required: Description of agents (workers, services, team members) needing coordination
  • Required: Collective goal or wanted emergent behavior
  • Optional: Current coordination method and its failure modes
  • Optional: Agent count (affects pattern choice — small swarm vs. big colony)
  • Optional: Latency tolerance (real-time vs. eventual)
  • Optional: Environment limits (shared state, bandwidth)

Steps

Step 1: Identify Coordination Problem Class

Classify challenge. Pick right patterns.

  1. Map current state: who are agents, what do they do alone, where does coordination break?
  2. Classify problem:
    • Foraging — agents search for, exploit distributed resources (see forage-resources)
    • Consensus — agents must agree on collective decision (see build-consensus)
    • Construction — agents build, maintain shared structure step by step
    • Defense — agents detect, respond to threats collectively (see defend-colony)
    • Division of labor — agents must self-organize into specialized roles
  3. Identify failure mode of current coordination:
    • Single point of failure (central controller)
    • Communication bottleneck (too many direct messages)
    • Coherence loss (agents drift apart, no feedback)
    • Rigidity (cannot adapt to change)

Got: Clear classification of coordination problem type and specific failure mode to fix. Picks swarm patterns to use.

If fail: Problem does not fit single class? May be mixed. Break into sub-problems, address each with own pattern. Agents too heterogeneous for single model? Consider layered coordination — homogeneous clusters coordinated via inter-cluster stigmergy.

Step 2: Design Stigmergic Signals

Build indirect talk channels. Agents influence each other through them.

  1. Define shared environment (database, message queue, file system, physical space, shared board)
  2. Design signals agents drop into environment:
    • Trail signals: markers pile up along good paths (like ant pheromones)
    • Threshold signals: counters trigger behavior change when crossing threshold
    • Inhibition signals: markers push agents away from exhausted areas
  3. Define signal properties:
    • Decay rate: how fast signals fade (stops stale state dominating)
    • Reinforcement: how good outcomes strengthen signals
    • Visibility radius: how far signal spreads
  4. Map signals to agent behaviors:
    • Agent senses signal X above threshold T → does action A
    • Agent finishes action A well → drops signal Y
    • No signal sensed → agent does default exploration
Signal Design Template:
┌──────────────┬───────────────────┬──────────────┬────────────────────┐
│ Signal Name  │ Deposited When    │ Decay Rate   │ Agent Response     │
├──────────────┼───────────────────┼──────────────┼────────────────────┤
│ success-trail│ Task completed OK │ 50% per hour │ Follow toward      │
│ busy-marker  │ Agent starts task │ On completion│ Avoid / pick other │
│ help-signal  │ Agent stuck >5min │ 25% per hour │ Assist if nearby   │
│ danger-flag  │ Error detected    │ 10% per hour │ Retreat & report   │
└──────────────┴───────────────────┴──────────────┴────────────────────┘

Got: Signal table mapping environment markers to deposit conditions, decay rates, response behaviors. Signals simple, composable, each meaningful alone.

If fail: Signal design feels too complex? Drop to two signals: one positive (success trail), one negative (danger flag). Most coordination bootstraps with attract/repel. Add nuance only after basic system works.

Step 3: Define Local Interaction Rules

Write simple rules each agent follows. Only local info (own state + nearby signals).

  1. Define agent's perception radius (what can sense?)
  2. Write 3-7 local rules in priority order:
    • Rule 1 (safety): Danger-flag sensed → move away
    • Rule 2 (response): Help-signal sensed and idle → move toward
    • Rule 3 (exploitation): Success-trail sensed → follow toward strongest signal
    • Rule 4 (exploration): No signals sensed → move random, bias toward unexplored
    • Rule 5 (deposit): After task done → drop success-trail at spot
  3. Each rule must be:
    • Local: depends only on what agent sees
    • Simple: one if-then statement
    • Stateless (preferred): no need to remember past states
  4. Test rules in head: every agent follows these rules → wanted collective behavior emerges?

Got: Ranked rule set each agent runs alone. Applied across swarm → target collective behavior (foraging, construction, defense, etc.).

If fail: Mental sim does not produce wanted emergent behavior? Rules likely need feedback loop — agents must see consequences of collective actions. Add signal for collective state (e.g., "task completion rate") and rule adjusting behavior from it.

Step 4: Calibrate Quorum Sensing

Set thresholds triggering collective state changes when enough agents agree.

  1. Find decisions needing collective agreement (not just individual response):
    • Switching from exploration to exploitation mode
    • Committing to new work site or abandoning old one
    • Escalating from normal to emergency response
  2. For each collective decision, define:
    • Quorum threshold: count or percent of agents must signal agreement
    • Sensing window: time period signals counted over
    • Hysteresis: different thresholds for activation vs. deactivation (stops oscillation)
  3. Implement quorum as signal accumulation:
    • Each agent favoring decision drops vote-signal
    • Accumulated votes exceed quorum within sensing window → decision activates
    • Votes drop below deactivation threshold → decision reverses

Got: Quorum thresholds let swarm make collective decisions, no leader. Hysteresis gap stops fast oscillation between states.

If fail: Swarm oscillates between states? Widen hysteresis gap (e.g., activate at 70%, deactivate at 30%). Swarm never reaches quorum? Lower threshold or grow sensing window. Decisions too slow? Shrink sensing window — but watch for premature consensus.

Step 5: Test and Tune Emergent Behavior

Validate local rules produce wanted collective behavior, then tune params.

  1. Run sim or pilot with small agent count (5-10)
  2. Observe:
    • Swarm converges on intended behavior?
    • How long convergence takes?
    • What happens when conditions change mid-task?
    • What happens when agents fail or get added?
  3. Tune params:
    • Signal decay rate: too fast → no coordination memory; too slow → stale signals dominate
    • Quorum threshold: too low → premature collective decisions; too high → paralysis
    • Exploration-exploitation balance: too much exploration → wasteful; too much exploitation → local optima
  4. Stress test:
    • Remove 30% of agents fast — swarm recovers?
    • Double agent count — swarm still coordinates?
    • Inject conflicting signals — swarm resolves or deadlocks?

Got: Tuned param set. Swarm self-organizes toward target behavior, recovers from shocks, scales clean.

If fail: Swarm fails stress tests? Signal design likely too tightly coupled. Simplify: fewer signals, higher decay rates (fresh info), agents have robust default behavior when no signals present. Swarm that does something reasonable with zero signals is more resilient than one depending on signal availability.

Checks

  • Coordination problem classified into known pattern (foraging, consensus, construction, defense, division of labor)
  • Stigmergic signal table defined: deposit conditions, decay rates, agent responses
  • Local interaction rules simple, local, prioritized (3-7 rules)
  • Quorum thresholds set with hysteresis to stop oscillation
  • Small-scale test shows emergent behavior matching collective goal
  • Stress test (agent removal, addition, signal disruption) shows graceful degradation

Pitfalls

  • Over-engineering signals: Too many signal types upfront → confusion. Start with 2 signals (attract/repel), add only when proven needed
  • Centralized thinking in disguise: "Local rule" needs agent to know global state → not local. Refactor until each rule depends only on what agent senses directly
  • Ignoring decay: Signals never decaying → fossilized coordination state. Every signal needs half-life fitting task time scale
  • Zero hysteresis: Quorum thresholds with no gap between activation and deactivation → fast state oscillation. Always set deactivation lower than activation
  • Assuming homogeneity: Agents have different abilities → single rule set may fail. Consider role-differentiated rules (see scale-colony)

See Also

  • forage-resources — applies swarm coordination to resource search and explore-exploit tradeoffs
  • build-consensus — deep dive into distributed agreement, extends quorum sensing from this skill
  • defend-colony — collective defense patterns built on signal and rule framework here
  • scale-colony — scaling when swarm outgrows initial coordination design
  • adapt-architecture — morphic skill for transforming system architecture, pairs with swarm coordination triggering structural change
  • deploy-to-kubernetes — practical distributed system deployment where swarm patterns apply
  • plan-capacity — capacity planning informed by swarm scaling dynamics
  • coordinate-reasoning — AI self-application variant; maps stigmergic signals to context management with info decay rates and local protocols

GitHub 저장소

pjt222/agent-almanac
경로: i18n/caveman/skills/coordinate-swarm
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

연관 스킬

content-collections

메타

이 스킬은 콘텐츠 콜렉션(Content Collections)을 위한 프로덕션 검증된 설정을 제공합니다. 콘텐츠 콜렉션은 Markdown/MDX 파일을 Zod 검증이 포함된 타입 안전한 데이터 콜렉션으로 변환해주는 TypeScript 최우선 도구입니다. 블로그, 문서 사이트 또는 콘텐츠 중심의 Vite + React 애플리케이션을 구축할 때 타입 안전성과 자동 콘텐츠 검증을 보장하기 위해 사용하세요. Vite 플러그인 구성과 MDX 컴파일부터 배포 최적화 및 스키마 검증에 이르기까지 모든 것을 다룹니다.

스킬 보기

polymarket

메타

이 스킬은 개발자들이 Polymarket 예측 시장 플랫폼을 활용한 애플리케이션을 구축할 수 있도록 지원하며, 거래 및 시장 데이터를 위한 API 통합 기능을 포함합니다. 또한 WebSocket을 통한 실시간 데이터 스트리밍을 제공하여 실시간 거래와 시장 활동을 모니터링할 수 있습니다. 이를 통해 거래 전략을 구현하거나 실시간 시장 업데이트를 처리하는 도구를 생성하는 데 활용할 수 있습니다.

스킬 보기

creating-opencode-plugins

메타

이 스킬은 개발자들이 명령어, 파일, LSP 작업 등 25개 이상의 이벤트 유형에 연결되는 OpenCode 플러그인을 만들 수 있도록 돕습니다. JavaScript/TypeScript 모듈을 위한 플러그인 구조, 이벤트 API 명세, 구현 패턴을 제공합니다. OpenCode AI 어시스턴트의 라이프사이클을 사용자 정의 이벤트 기반 로직으로 가로채거나, 모니터링하거나, 확장해야 할 때 사용하세요.

스킬 보기

sglang

메타

SGLang은 RadixAttention 프리픽스 캐싱을 활용하여 JSON, 정규식, 에이전트 워크플로우를 위한 고속 구조화 생성에 특화된 고성능 LLM 서빙 프레임워크입니다. 특히 반복되는 프리픽스가 있는 작업에서 상당히 빠른 추론 속도를 제공하여 복잡한 구조화 출력 및 다중 턴 대화에 이상적입니다. 제약 디코딩이 필요하거나 광범위한 프리픽스 공유가 있는 애플리케이션을 구축할 때는 vLLM과 같은 대안보다 SGLang을 선택하십시오.

스킬 보기