Coordinate swarm

From pjt222/agent-almanac · View interactive version

Coordinate swarm is an AI agent skill from the GitHub repository pjt222/agent-almanac. Apply collective intelligence coordination patterns — stigmergy, local rules, and quorum sensing — to organize distributed systems, teams, or workflows without centralized control. Covers signal design, agent autonomy boundaries, emergent behavior cultivation, and feedback loop tuning. Use when desi

How to use this skill

Skill file

Coordinate Swarm

Stigmergy + local rules + quorum → coherent collective, no central ctrl.

Use When

In

Do

Step 1: Classify Problem

  1. Map: who agents, what do, where coord breaks
  2. Classify:
  1. Fail mode:

→ 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.

  1. Shared env (DB, queue, FS, board)
  2. Signal types:
  1. Props:
  1. Signal → behavior map:
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.

  1. Perception radius (what sense?)
  2. 3-7 rules, priority order:
  1. Each rule:
  1. 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.

  1. Collective decisions:
  1. Per decision:
  1. Quorum = signal accumulation:

→ 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

  1. Pilot 5-10 agents
  2. Observe:
  1. Tune params:
  1. Stress:

→ 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

Traps

→

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.