Core Components

Swarm Coordination

The SwarmCoordinator manages agent lifecycle, work distribution, and health monitoring. Each agent runs through the model-agnostic AgentHarness, supporting Claude Code, Codex, Gemini, browser agents, or custom models. Default claim strategy is best-fit.

SwarmCoordinator + AgentHarness Lifecycle

SwarmCoordinator.start()
├── Register agents with skills and session_id
├── Start heartbeat monitoring (30s interval)
├── Select claim strategy (first-fit | best-fit | round-robin
│                          load-balanced | graph-prioritized)
└── Begin work distribution loop

AgentHarness work loop:
├── Register → Heartbeat + Poll → Claim Task → Execute
├── getReadyTasks() from DataLayer (dependencies satisfied, leaf-only)
├── Apply claim strategy to select best task
├── Atomic claimTask() (prevents race conditions)
└── claimAndExecuteTask() for selected task

claimAndExecuteTask()
├── Broadcast agent.intent.announce (files I'll touch)
├── Reserve files (advisory — always succeeds)
├── Retrieve relevant memories for context
├── Execute via model (Claude Code / Codex / custom)
│   ├── Build prompt from task + system context + memories
│   ├── Spawn model CLI process
│   ├── Capture stdout/stderr
│   └── Detect success/failure from exit code
├── On success: store learnings in memories, release reservations
├── On failure: publish task.failed, mark for retry
└── Return to work loop after 1s delay

5 Claim Strategies

StrategyDescription
first-fitFirst idle agent matching skills
best-fitHighest skill match score
round-robinRotate through agents
load-balancedDistribute by current agent load
graph-prioritizedCritical path (+100) + fan-out (+10/dep) + depth scoring

Model-Agnostic AgentHarness

Wraps any LLM for task execution:

// Prompt structure sent to Claude Code
`You are ${agentName}, an AI agent with skills in: ${skills}.

## Task
**Title:** ${task.title}
**Priority:** ${task.priority}
**Description:** ${task.description}

## Relevant Context from Previous Work
${memories.map(m => `- ${m.content}`).join('\n')}

## Instructions
Complete this task by making the necessary code changes...`

Command

claude --print --dangerously-skip-permissions "<task prompt>"

Agent Skills

type AgentSkill =
  | 'typescript' | 'javascript' | 'python' | 'rust' | 'go'
  | 'react' | 'vue' | 'angular' | 'svelte'
  | 'backend' | 'frontend' | 'database' | 'devops'
  | 'testing' | 'documentation' | 'security';