coordinate-swarm
О программе
Навык coordinate-swarm предоставляет такие паттерны, как стигмергия и кворумное чувство, для построения распределенных систем, которые самоорганизуются без централизованного управления. Он помогает разработчикам проектировать устойчивые, событийно-ориентированные архитектуры, фокусируясь на проектировании сигналов, автономности агентов и настройке эмерджентного поведения. Используйте его, когда необходимо устранить узкие места в координации или заменить хрупкую оркестрацию децентрализованной координацией.
Быстрая установка
Claude Code
Рекомендуетсяnpx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/coordinate-swarmСкопируйте и вставьте эту команду в Claude Code для установки этого навыка
Документация
Coordinate Swarm
Stigmergy + local rules + quorum → coherent collective, no central ctrl.
Use When
- Distributed sys → no central bottleneck
- Self-coord teams → no mgr overhead
- Event-driven arch → shared state, not direct msg
- Works @3 agents → breaks @30 → scale
- Bootstrap new swarm domain (
forage-resources,build-consensus) - Replace fragile central orch → resilient emergent
In
- Required: Agents desc (workers, services, team)
- Required: Collective goal / target behavior
- Optional: Current coord + fail modes
- Optional: Agent count → pattern choice
- Optional: Latency tolerance (realtime vs eventual)
- Optional: Env constraints (shared state, bandwidth)
Do
Step 1: Classify Problem
- Map: who agents, what do, where coord breaks
- Classify:
- Foraging → search distributed res (
forage-resources) - Consensus → agree collective decision (
build-consensus) - Construction → build shared structure
- Defense → detect threats (
defend-colony) - Division of labor → self-organize roles
- Foraging → search distributed res (
- Fail mode:
- Single point fail (central ctrl)
- Comm bottleneck (too many msg)
- Coherence loss (drift, no feedback)
- Rigidity (no adapt)
→ Clear class + fail mode → pattern choice.
If err: no single class → composite → decompose. Heterogeneous → layered coord (homogeneous clusters + inter-cluster stigmergy).
Step 2: Design Signals
Indirect comm channels.
- Shared env (DB, queue, FS, board)
- Signal types:
- Trail: accumulate on success paths (ant pheromone)
- Threshold: counter → behavior switch
- Inhibition: repel from exhausted areas
- Props:
- Decay: fade rate → no stale dominance
- Reinforce: success strengthens
- Radius: propagation range
- Signal → behavior map:
- Signal X > T → action A
- A done → deposit Y
- No signal → default explore
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 │
└──────────────┴───────────────────┴──────────────┴────────────────────┘
→ Signal table: deposit conds + decay + responses. Simple + composable.
If err: too complex → 2 signals (attract/repel). Add nuance after basic works.
Step 3: Local Rules
Simple rules, local info only.
- Perception radius (what sense?)
- 3-7 rules, priority order:
- Rule 1 (safety): danger-flag → flee
- Rule 2 (response): help-signal + idle → move toward
- Rule 3 (exploit): success-trail → follow strongest
- Rule 4 (explore): no signal → random + unexplored bias
- Rule 5 (deposit): task done → deposit success-trail
- Each rule:
- Local: only what agent perceives
- Simple: one if-then
- Stateless (pref): no past mem
- Mental test → does collective behavior emerge?
→ Prioritized rules, independent exec → target behavior emerges.
If err: no emergence → feedback loop needed. Add signal for collective state + adjust rule.
Step 4: Quorum Thresholds
Trigger collective changes when enough agree.
- Collective decisions:
- Explore → exploit mode
- New worksite commit / abandon
- Normal → emergency
- Per decision:
- Threshold: # / % agents agreeing
- Window: signal count period
- Hysteresis: different on/off thresh → no osc
- Quorum = signal accumulation:
- Fav agent → vote-signal
- Votes > thresh in window → activate
- Votes < deact thresh → reverse
→ Leaderless decisions. Hysteresis gap → no rapid osc.
If err: oscillation → widen hyst gap (70/30). Never reaches quorum → lower thresh / widen window. Too slow → shrink window (beware premature).
Step 5: Test + Tune
- Pilot 5-10 agents
- Observe:
- Converges on behavior?
- How long?
- Conditions change mid-task → what?
- Agents fail / added → what?
- Tune params:
- Decay: fast → no memory; slow → stale dominates
- Quorum: low → premature; high → paralysis
- Explore/exploit balance: too explore → inefficient; too exploit → local optima
- Stress:
- Remove 30% agents → recover?
- Double count → still coord?
- Conflict signals → resolve / deadlock?
→ Tuned params, self-organizes, recovers, scales.
If err: stress fails → too tightly coupled. Simplify: fewer signals, faster decay, robust default. Swarm w/ zero-signal default > signal-dependent swarm.
Check
- Problem classified (foraging / consensus / construction / defense / labor)
- Signal table: deposit + decay + response
- Rules simple + local + prioritized (3-7)
- Quorum w/ hysteresis → no osc
- Small test → emergent behavior matches goal
- Stress test → graceful degradation
Traps
- Signal bloat: Too many types → confusion. Start 2 (attract/repel)
- Fake local: Rule needs global state → not local. Refactor
- No decay: Fossilized coord state. Half-life per task scale
- Zero hysteresis: Rapid osc. Deact < act always
- Homogeneity assumed: Diff caps → role-diff rules (
scale-colony)
→
forage-resources— res search + explore-exploitbuild-consensus— distrib agreement deep-divedefend-colony— collective defense on signal frameworkscale-colony— scaling past initial coordadapt-architecture— morphic arch transformdeploy-to-kubernetes— distrib sys deployplan-capacity— capacity + swarm scalingcoordinate-reasoning— AI self-variant; stigmergy → ctx mgmt
GitHub репозиторий
Frequently asked questions
What is the coordinate-swarm skill?
coordinate-swarm is a Claude Skill by pjt222. Skills package instructions and resources that Claude loads on demand, so Claude can perform coordinate-swarm-related tasks without extra prompting.
How do I install coordinate-swarm?
Use the install commands on this page: add coordinate-swarm to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.
What category does coordinate-swarm belong to?
coordinate-swarm is in the Meta category, tagged automation and design.
Is coordinate-swarm free to use?
Yes. coordinate-swarm is listed on AIMCP and free to install. It runs inside Claude, so no separate service account is required to use the skill itself.
Похожие навыки
Этот навык предоставляет проверенную в продакшене настройку для Content Collections — TypeScript-ориентированного инструмента, который преобразует файлы Markdown/MDX в типобезопасные коллекции данных с валидацией Zod. Используйте его при создании блогов, сайтов документации или контентных приложений на Vite + React для обеспечения типобезопасности и автоматической проверки содержимого. Он охватывает всё: от настройки плагина Vite и компиляции MDX до оптимизации развертывания и валидации схем.
Этот навык позволяет разработчикам создавать приложения на платформе прогнозных рынков Polymarket, включая интеграцию с API для торговли и получения рыночных данных. Он также обеспечивает потоковую передачу данных в реальном времени через WebSocket для отслеживания текущих сделок и рыночной активности. Используйте его для реализации торговых стратегий или создания инструментов, обрабатывающих обновления рынка в реальном времени.
Этот навык помогает разработчикам создавать плагины OpenCode, которые подключаются к более чем 25 типам событий, таким как команды, файлы и операции LSP. Он предоставляет структуру плагина, спецификации API событий и шаблоны реализации для модулей на JavaScript/TypeScript. Используйте его, когда вам нужно перехватывать, отслеживать или расширять жизненный цикл ассистента OpenCode AI с помощью пользовательской событийно-ориентированной логики.
SGLang — это высокопроизводительный фреймворк для обслуживания больших языковых моделей (LLM), специализирующийся на быстрой структурированной генерации JSON, regex и рабочих процессов агентов с использованием кэширования префиксов RadixAttention. Он обеспечивает значительно более высокую скорость вывода, особенно для задач с повторяющимися префиксами, что делает его идеальным для сложных структурированных результатов и многократных диалогов. Выбирайте SGLang вместо альтернатив, таких как vLLM, когда вам требуется ограниченное декодирование или вы создаете приложения с интенсивным совместным использованием префиксов.
