Claude
Skills
Sign in
Back

sswarm

Included with Lifetime
$97 forever

Social swarm -- Agent Teams delegate mode 6-phase pipeline with competing agents coordinated via task dependency chains (dispatch ordering) and SendMessage (live coordination overlay), with per-phase lead consolidators

AI Agents

What this skill does


# Social Swarm Pipeline

Agent Teams delegate mode 6-phase development pipeline with **competing parallel agents** and **per-phase lead consolidators**. The command creates a team with dependency-chain task graphs, spawns 5 teammates, then enters a monitoring loop. Phases A1 and A2 feature multiple competing agents whose outputs are consolidated by dedicated lead agents (plan-arbiter, review-lead) via **blockedBy task dependency chains** for dispatch ordering, with **SendMessage as a live coordination overlay** for status broadcasts and handoff signals. Competing agents write to independent temp files (source of truth for hooks); consolidator tasks are blockedBy all competitors and read their output files directly.

## Key Architecture

- `pipeline: "sswarm"` in state.json
- `plugin: "ants"` -- so ants hooks fire
- All agents are `ants:*` prefixed -- they exist in the ants plugin
- **Agent Teams delegate mode** with Command-as-Active-Lead monitoring loop
- Command creates team first (TeamCreate), then populates task graph via TaskCreate with **blockedBy dependency chains**
- Competing agents (3 architects, 3 reviewers) have **no dependencies on each other** -- they run in parallel
- Consolidator tasks (plan-arbiter, review-lead) are **blockedBy all competitors** -- they run after all competitors complete
- A4 verdict is evaluated **inline** by `handle_a3_arbiter()` in the TaskCompleted hook -- no separate agent dispatch
- State schema v6 with additional `phaseLeads` map
- All existing hooks are compatible -- TeammateIdle routes by currentPhase, TaskCompleted validates and advances
- Teammates are routed by the TeammateIdle hook (hook-driven routing, not self-assignment from TaskList)
- Command monitoring loop MUST NOT stop or exit until a terminal condition is met (`<COMPLETION-GATE>` enforcement)

## Key Differences from Swarm

| Feature | swarm | sswarm |
|---------|-------|--------|
| A1 planning | 1 architect | 3 competing architects + plan-arbiter (lead) via blockedBy dependency chain |
| A2 review | 1 blueprint-reviewer | 3 competing reviewers + review-lead (lead) via blockedBy dependency chain |
| Lead agents | None | plan-arbiter (A1), review-lead (A2) -- read competitor output files directly |
| Competitor coordination | N/A | blockedBy task dependencies + SendMessage live overlay |
| Teammate count | 3 | 5 (more parallelism for competing agents) |
| Agent count per run | ~15 agents | ~21 agents (6 more for competing + leads) |
| A0, A3, A4, A5 | Identical | Identical |
| State schema | v6 | v6 + `phaseLeads` map |
| Hooks | All hooks | Same hooks, unchanged |

## 6-Phase Pipeline

```
Phase A0  | EXPLORE | Colony Exploration    | foragers + cartographer + explore-aggregator (lead)
Phase A1  | PLAN    | Competing Architects  | 3 architects (parallel, no deps on each other) → plan-arbiter (blockedBy all 3)
Phase A2  | PLAN    | Competing Reviews     | 3 blueprint-reviewers (parallel) → review-lead (blockedBy all 3)
Phase A3  | BUILD   | Dual-Track Execution  | workers (task pool) + 6 sentinels + guardian + simplifier + arbiter
Phase A4  | SYNC    | Verdict               | TaskCompleted hook evaluates inline (handle_a3_arbiter)
Phase A5  | SHIP    | Documentation + Ship  | nurse + drone
```

### Pipeline Diagram

```
Command creates team (TeamCreate first), then initial sswarm task graph (12 tasks):

  A0-forager-1 ────────┐
  A0-forager-2 ────────┤
  A0-cartographer ─────┤
                        └─► A0-explore-aggregator
                                     |
                        ┌────────────┼────────────┐
                        ▼            ▼            ▼
                 A1-architect-1  A1-architect-2  A1-architect-3   (parallel, no deps on each other)
                        |            |            |
                        └────────────┼────────────┘
                                     ▼
                              A1-plan-arbiter              (blockedBy all 3 architects)
                              reads competitor files, selects/merges -> A1-plan.md + A1-tasks.json
                                     |
                        ┌────────────┼────────────┐
                        ▼            ▼            ▼
                  A2-reviewer-1  A2-reviewer-2  A2-reviewer-3    (parallel, no deps on each other)
                        |            |            |
                        └────────────┼────────────┘
                                     ▼
                              A2-review-lead               (blockedBy all 3 reviewers)
                              consolidates -> A2-review.json
                                     |
                    +────────────────+────────────────+
                    |    Phase A3                      |
                    |  (dual-track)                    |
                    |                                  |
                    | Build Track      | Quality Track (Adversarial)
                    | (task pool)      |
                    |  workers         | sentinel-correctness  \
                    |  claimed from    | sentinel-security      \
                    |  pool by         | sentinel-perf           } parallel
                    |  TeammateIdle    | sentinel-style         /
                    |       |          | guardian              /
                    |  build results   | simplifier           /
                    |                  |       |
                    |                  | review-arbiter consolidates
                    +────────────────+────────────────+
                                     |
                    A4 Verdict (evaluated INLINE by handle_a3_arbiter)
                      /       \
                 ship          loop
                  |              |
               A5 Ship      A1 (needsLoopReset → command creates fresh competing task graph)

Command spawns 5 teammates (hook-driven routing via TeammateIdle), enters monitoring loop
```

### sswarm Task Graph Structure

The sswarm task graph uses **blockedBy dependency chains** for dispatch ordering, with **SendMessage as a live coordination overlay** for status broadcasts and handoff signals (dual-channel model):

- **Competing agents** (architects at A1, reviewers at A2): 3 independent tasks with no dependencies on each other -- they run in parallel when their phase prerequisites complete
- **Consolidator tasks** (plan-arbiter, review-lead): blockedBy all 3 competitors -- they run only after all competing outputs exist
- **File-based input (primary)**: Consolidator agents read competitor output files at known paths (specified in dispatch prompt). Files are the source of truth validated by hooks.
- **SendMessage (overlay)**: Agents send coordination messages (status updates, completion signals) alongside their file output. SendMessage accelerates coordination but is never required for phase gates.
- **No spawn order constraint**: All tasks are created upfront with dependency declarations; the Agent Teams runtime schedules them automatically

## Phase Details

### Phase A0: Colony Exploration

Same as swarm — foragers + cartographer + explore-aggregator.

Output: `.agents/tmp/phases/A0-explore.md`

### Phase A1: Competing Architects

The command creates **3 architect tasks** (A1-architect-1, A1-architect-2, A1-architect-3) all blockedBy the A0 explore-aggregator task -- they run in parallel with no dependencies on each other. Each architect independently explores the context and writes a plan to a unique temp file.

The command also creates an **A1-plan-arbiter** task blockedBy all 3 architect tasks. The plan-arbiter reads all 3 competitor output files (specified in its dispatch prompt), evaluates on five criteria (completeness, feasibility, task count, risk, dependency correctness), selects the best plan or synthesizes a merged plan, and writes the canonical output files.

**Dependency chain (replaces spawn order):**
- `A1-architect-1`, `A1-architect-2`, `A1-architect-3` -- all blockedBy `[A0

Related in AI Agents