Agent Swarm Architecture

Peer-based agent swarm for end-to-end software delivery. Agents communicate via work packets through a shared board, no hierarchy, just structured collaboration.

System Internals, Modules, Functions, Data Flow → Event Log Viewer → Harness and Verification →
Orchestrator
Architect (Mini-Swarm)
Dev Agent
QA / Validation
Cron Agent
Event-Triggered
Third-Party
Human-in-the-Loop
Infra / Deploy
Agent Hierarchy & Swarm Topology
ORCHESTRATOR TIER
Champ (Orchestrator)
Master coordinator. Decomposes PRDs into work packets, dispatches to agents, monitors progress via shared board. Mini-swarm: 3 pre-planning sub-agents.
Mini-Swarm · Opus
│ │ │ │ │
PEER AGENTS, Invoked via Work Packets
Architect Agent
Mini-swarm: 13 sub-agents across 4 phases. System design, API, DB, security, cloud, IA, UX research, and more.
Mini-Swarm · Opus
Dev Agent
Mini-swarm: 12 sub-agents across 4 phases. Design, visual analysis, backend, frontend, quality & testing.
Mini-Swarm · Opus
QA / Test Agent
Mini-swarm: 11 sub-agents across 4 phases. Unit, integration, API, contract, load, security, E2E & architecture review.
Mini-Swarm · Opus
Deploy Agent
Mini-swarm: 11 sub-agents across 4 phases. Packaging, infrastructure, orchestration, deploy & validation.
Mini-Swarm · Opus
PR Review Agent
Mini-swarm: 12 sub-agents across 4 phases. Code quality, security, API, DB, tests, docs, style, architecture & integration review.
Mini-Swarm · Opus
Demo Prep Agent
Prepares demo environment, seed data, script, screenshots. Planned.
Planned
Debugger
Systematic bug investigation, error traces, reproduction steps, root cause analysis.
Sonnet · Medium
Dependency Expert
Package auditing, vulnerability scanning, dependency graph analysis, upgrade safety.
Sonnet · Medium
Researcher
Technology research, documentation lookup, pattern investigation, evidence summarization.
Haiku · Simple
Explore
Codebase exploration, file discovery, architecture mapping, dependency tracing.
Haiku · Simple
Product Manager
PRD authoring, feature prioritization, user story writing, roadmap planning.
Opus · Complex
Build Fixer
Build failure diagnosis, compiler error resolution, dependency conflict fixing.
Sonnet · Medium
Code Simplifier
Complexity reduction, dead code removal, refactoring to cleaner patterns.
Sonnet · Medium
Git Master
Git operations, branching, merging, conflict resolution, history management.
Haiku · Simple
▼ ▼ ▼ ▼ ▼
Shared Board (shared/)
Central State · JSON/JSONL
Work Packets
Instructions, criteria, status
Results
Output files, pass/fail, errors
Agent Registry
Capabilities, models, status
Session Memory
Key-value persistent store
Event Log
Append-only JSONL audit trail
Sub-Agent Explorer
Architect 13 sub-agents
Dev 12 sub-agents
QA 12 sub-agents
Deploy 11 sub-agents
PR Review 12 sub-agents
Champ 3 sub-agents

Mini-Swarm: 13 Specialized Sub-Agents

The Architect is not a single agent, it's a master orchestrator that coordinates 13 domain-specific sub-agents across a 4-phase DAG. Each sub-agent produces structured output (MD or JSON), receives shared architecture context, and has its own knowledge base.

Execution flow: IntentGate classifies which domains are needed → DAG runs sub-agents in phase order → Contradiction Detection checks consistency → Ralph Loop ensures completeness.

IntentGate Phase 1: Foundation Phase 2: Contracts Phase 3: Cross-cutting Phase 4: Operational Contradiction Check Ralph Loop
Model
Opus (complex)
Timeout
900s (15 min)
Sub-Agents
13 total
Output Formats
6 MD + 7 JSON
DAG Phases
4 sequential
Retries
2 (exponential)
Phase 1 Foundation, runs first, everything depends on this
system-designer
System boundaries, data flow, tech stack, deployment topology
MD Complex Opus
▼ ▼ ▼
Phase 2 Contracts, parallel, depends on system-designer
api-designer
API contracts, endpoints, schemas, versioning
JSON Medium Sonnet
db-architect
Entities, relationships, migrations, data lifecycle
JSON Medium Sonnet
component-architect
Modules, layers, dependencies, state management
JSON Medium Sonnet
information-architect
Taxonomy, navigation models, naming consistency, findability design
MD Medium Sonnet
ux-researcher
Heuristic evaluation, accessibility audits, usability risk findings
MD Medium Sonnet
▼ ▼ ▼
Phase 3 Cross-cutting, parallel, depends on Phase 2 agents
integration-architect
Integration patterns, events, messaging, sync/async
MD Complex Opus
security-architect
Auth, authorization, threat modeling, compliance
MD Complex Opus
performance-architect
Budgets, caching, scaling, bottleneck analysis
MD Medium Sonnet
▼ ▼ ▼ ▼
Phase 4 Operational, parallel, depends on Phase 3 agents
cloud-architect
Provider, compute, storage, networking, IAM, cost
JSON Medium Sonnet
devops-architect
CI/CD, environments, deployment, IaC, branching
JSON Medium Sonnet
data-pipeline-architect
ETL, streaming, transformations, data quality
JSON Medium Sonnet
observability-architect
Logging, metrics, tracing, alerting, SLOs
JSON Medium Sonnet
Click any sub-agent above to explore its purpose, dependencies, output schema, and success criteria.

Mini-Swarm: 12 Implementation Sub-Agents

The Dev agent orchestrates 12 specialized sub-agents that cover the full implementation stack, from design interpretation through backend, frontend, mobile, testing, and documentation. Each sub-agent produces structured output and declares its exports for downstream consumers.

Execution flow: IntentGate selects needed domains → feature-context.json initialized → DAG runs sub-agents in 4 phases → Contradiction Detection checks integration → Ralph Loop validates lint + tests.

IntentGate Phase 1: Design Phase 2: Data + Backend Phase 3: Frontend + Mobile Phase 4: Quality + Polish Contradiction Check Ralph Loop
Model
Opus (complex)
Timeout
1200s (20 min)
Sub-Agents
12 total
Output Formats
3 MD + 9 JSON
DAG Phases
4 sequential
Validation
Lint + Tests (Ralph Loop)
Phase 1 Design Foundation, runs first, interprets wireframes into component specs
design-dev
Figma/wireframes → component trees, page layouts, compositions
JSON Medium Sonnet
vision
Visual/image analyzer, wireframes, screenshots, charts, diagrams, PDFs
MD Medium Sonnet
▼ ▼ ▼ ▼ ▼
Phase 2 Data + Backend, parallel, depends on design-dev
db-dev
Migrations, ORM models, queries, seeds, indexing
JSON Medium Sonnet
node-dev
Node.js/Bun services, middleware, utilities, workers
JSON Medium Sonnet
python-dev
Python services, scripts, data processing, ML utilities
JSON Medium Sonnet
fastapi-dev
FastAPI endpoints, Pydantic models, async handlers
JSON Medium Sonnet
integration-dev
API clients, service connectors, webhooks, third-party SDKs
JSON Medium Sonnet
▼ ▼
Phase 3 Frontend + Mobile, parallel, consumes backend exports
react-dev
React components, pages, hooks, state management, routing
JSON Complex Opus
mobile-dev
Flutter widgets, screens, state management, navigation
JSON Complex Opus
▼ ▼ ▼
Phase 4 Quality + Polish, parallel, validates and documents everything
ui-dev
Pixel-perfect review, design tokens, CSS fixes, accessibility (WCAG 2.1 AA)
MD Medium Sonnet
test-dev
Unit/integration tests, fixtures, mocks, collective lint (ESLint + Ruff)
JSON Medium Sonnet
docs-dev
API docs, READMEs, changelogs, developer guides
MD Simple Haiku
Click any sub-agent above to explore its purpose, dependencies, output schema, and success criteria.

Mini-Swarm: 12 QA & Validation Sub-Agents

The QA agent orchestrates 12 specialized sub-agents that cover the full quality spectrum, unit tests, integration tests, API validation, contract tests, schema validation, architecture review, load/stress/spike testing, security scanning, E2E user journeys, visual verification, and coverage analysis. Consumes both architecture-context.json and feature-context.json from upstream agents.

Execution flow: IntentGate selects test domains → qa-context.json initialized → DAG runs sub-agents in 4 phases → Contradiction Detection checks cross-agent consistency → Ralph Loop validates quality gate.

IntentGate Phase 1: Foundation Phase 2: Core Testing Phase 3: Cross-Cutting Phase 4: Quality Gate Contradiction Check Ralph Loop
Model
Opus (complex)
Timeout
1200s (20 min)
Sub-Agents
12 total
Output Formats
2 MD + 10 JSON
DAG Phases
4 sequential
Upstream
Architect + Dev
Phase 1 Foundation, analyzes context, produces test strategy and risk map
test-strategist
Test strategy, risk mapping, priority matrix for all QA sub-agents
JSON Complex Opus
▼ ▼ ▼ ▼ ▼ ▼
Phase 2 Core Testing, parallel, depends on test-strategist
unit-tester
Unit tests for all code modules, functions, classes, services
JSON Medium Sonnet
integration-tester
Cross-service integration tests, workflows, events, transactions
JSON Medium Sonnet
api-tester
API endpoint validation, schemas, status codes, auth scenarios
JSON Medium Sonnet
contract-tester
Consumer-driven contract tests, API compatibility between services
JSON Medium Sonnet
schema-validator
DB, API, ORM schema consistency, drift detection across layers
JSON Medium Sonnet
architecture-reviewer
System design, cloud infra, and architectural decisions review
MD Complex Opus
▼ ▼ ▼
Phase 3 Cross-Cutting, parallel, synthesizes across Phase 2 outputs
load-tester
Load, stress, spike, soak, performance scenarios with k6/Locust
JSON Medium Sonnet
security-tester
OWASP Top 10, injection, auth bypass, vulnerability scanning
JSON Complex Opus
e2e-tester
End-to-end user journey tests, Playwright, smoke suites
JSON Medium Sonnet
visual-verifier
Screenshot-based UI verification against reference designs via cmux-browser
JSON Medium Sonnet
Phase 4 Quality Gate, aggregates all results, produces PASS/FAIL verdict
coverage-analyzer
Aggregate coverage, gap analysis, risk-adjusted quality report
MD Medium Sonnet
Click any sub-agent above to explore its purpose, dependencies, output schema, and success criteria.

Mini-Swarm: 11 Deployment Sub-Agents

The Deploy agent orchestrates 11 specialized sub-agents that take built artifacts through packaging, infrastructure provisioning, deployment orchestration, and post-deploy validation. Consumes architecture-context.json and feature-context.json from upstream agents.

Execution flow: IntentGate selects deployment domains → deploy-context.json initialized → DAG runs sub-agents in 4 phases → Contradiction Detection checks cross-agent consistency → Ralph Loop validates deployment readiness.

IntentGate Phase 1: Analysis Phase 2: Preparation Phase 3: Strategy Phase 4: Execution Contradiction Check Ralph Loop
Model
Opus (complex)
Timeout
1200s (20 min)
Sub-Agents
11 total
Output Formats
1 MD + 10 JSON
DAG Phases
4 sequential
Upstream
Architect + Dev
Phase 1 Analysis, reads upstream context, produces deployment manifest
requirements-analyzer
Reads arch + feature context, produces deployment manifest for all downstream agents
JSON Complex Opus
▼ ▼ ▼ ▼
Phase 2 Preparation, parallel, packaging + config + infra + migrations
package-builder
Docker images, build artifacts, bundling configs
JSON Medium Sonnet
config-manager
Env configs, secrets references, feature flags per environment
JSON Medium Sonnet
infra-provisioner
IaC templates (Terraform/Pulumi), cloud resource definitions
JSON Medium Sonnet
migration-planner
DB migration scripts, data transforms, rollback SQL
JSON Medium Sonnet
▼ ▼ ▼
Phase 3 Strategy, deployment orchestration + quality gate validation
orchestration-planner
Deployment strategy (blue-green/canary/rolling), service ordering, rollout plan
JSON Complex Opus
test-gate
Pre-deploy test validation, coverage gates, security scan checks
JSON Medium Sonnet
▼ ▼ ▼ ▼
Phase 4 Execution, deploy, validate, plan rollback, report
deploy-executor
Deploy scripts, CI/CD pipeline configs (GitHub Actions, GitLab CI)
JSON Medium Sonnet
smoke-validator
Post-deploy health checks, smoke tests, readiness/liveness probes
JSON Medium Sonnet
rollback-planner
Rollback procedures, failure detection triggers, recovery runbooks
JSON Medium Sonnet
deploy-reporter
Deployment report, changelog, Slack/email notifications
MD Simple Haiku
Click any sub-agent above to explore its purpose, dependencies, output schema, and success criteria.

Mini-Swarm: 12 Sub-Agents

Orchestrates comprehensive pull request review across code quality, security, API contracts, database changes, test coverage, documentation, style enforcement, architecture compliance, integration impact, and performance. Produces a unified review verdict (APPROVE / REQUEST_CHANGES / COMMENT).

Execution flow: Foundation strategist analyzes the diff → 6 core domain reviewers run in parallel → 3 cross-cutting reviewers synthesize → reporter aggregates into final verdict.

Phase 1: Foundation Phase 2: Core Review Phase 3: Cross-Cutting Phase 4: Quality Gate Contradiction Check Ralph Loop
Model
Opus (complex)
Timeout
1200s (20 min)
Sub-Agents
12 total
Output Formats
5 MD + 7 JSON
DAG Phases
4 sequential
Upstream
Architect + Dev + QA
Phase 1 Foundation, analyzes PR diff, classifies changes, assesses risk, determines review scope
review-strategist
PR diff analysis, change classification, risk assessment, review scope planning
JSON Complex Opus
▼ ▼ ▼
Phase 2 Core Review, parallel, domain-specific review of changed files
code-reviewer
Code quality, readability, maintainability, SOLID/DRY adherence
JSON Medium Sonnet
security-reviewer
Security vulnerability detection, secrets scanning, OWASP compliance
JSON Medium Sonnet
api-reviewer
API contract changes, backwards compatibility, versioning, schema validation
JSON Medium Sonnet
db-reviewer
Database migration safety, query performance, schema change review
JSON Medium Sonnet
test-reviewer
Test coverage assessment, test quality review, missing edge case identification
JSON Medium Sonnet
docs-reviewer
Documentation completeness, changelog accuracy, API docs review
MD Simple Haiku
style-reviewer
Formatting, naming conventions, lint compliance, language idiom adherence
JSON Simple Haiku
▼ ▼ ▼
Phase 3 Cross-Cutting, parallel, synthesizes across Phase 2 outputs
architecture-reviewer
Architectural consistency, pattern adherence, dependency impact analysis
MD Complex Opus
integration-reviewer
Cross-service impact, breaking change detection, contract compatibility
JSON Medium Sonnet
performance-reviewer
Performance regression detection, algorithmic complexity analysis, resource usage
JSON Medium Sonnet
Phase 4 Quality Gate, aggregates all findings, produces final review verdict
review-reporter
Aggregate findings, produce APPROVE / REQUEST_CHANGES / COMMENT verdict
MD Medium Sonnet
Click any sub-agent above to explore its purpose, dependencies, output schema, and success criteria.

Mini-Swarm: 3 Pre-Planning Sub-Agents

Champ's orchestration is backed by 3 pre-planning sub-agents that run before work packets are dispatched. They validate requirements, design success metrics, and gate the work plan, preventing downstream failures caused by ambiguous or incomplete specifications.

Execution flow: analyst audits requirements → product-analyst designs KPI/measurement plan → critic gates the full work plan with OKAY/REJECT verdict before dispatch.

Phase 1: Pre-Planning Dispatch
Model
Opus (complex)
Timeout
240s each
Sub-Agents
3 total
Output Formats
3 MD
DAG Phases
1 pre-planning
Gate
OKAY / REJECT verdict
Phase 1 Pre-Planning, all three run before champ dispatches any work packets
analyst
Requirements gap detection, scope risks, acceptance criteria generation
MD Medium Sonnet
product-analyst
KPI definition, event schema design, funnel analysis, experiment measurement
MD Medium Sonnet
critic
Work plan gatekeeper, clarity, verifiability, completeness, OKAY/REJECT verdict
MD Medium Sonnet
Click any sub-agent above to explore its purpose, dependencies, output schema, and success criteria.
Project Lifecycle, Agent-Driven Pipeline
1. Intake
Champ
2. Design
Architect (11 sub-agents)
3. Decompose
Champ
4. Build
Dev Agent (11 sub-agents)
5. Test
QA Agent (11 sub-agents)
6. Review
PR Review Agent (11 sub-agents)
7. Deploy
Deploy Agent
8. Feedback
Human → Memory
Self-Learning Feedback Loop

Agent Anatomy, Each Agent Has

ComponentPurpose
agent.yamlManifest, name, model, complexity, capabilities, dependencies
prompt.mdSystem prompt / persona (updated by feedback loop)
knowledge/Domain knowledge files (.md) injected into prompts
sub-agents/Optional, nested agents for mini-swarm patterns (e.g. Architect)

Shared Board Schema (shared/)

StoreFormatUpdated By
packets.jsonJSON, work packets with statusAll agents
results/JSON, per-packet resultsCompleting agent
memory/JSON, key-value persistent storeAny agent
event_log.jsonlAppend-only JSONLHarness (auto)

Harness Modules (the harness), 24 Modules

ModulePurpose
protocol.tsWorkPacket & WorkResult types, FSM transitions, packet creation
board.tsRead/write shared board (packets, results, events, memory)
registry.tsAgent discovery, Zod-validated manifest parsing
runner.tsExecute agents via Claude Code CLI with fix loop & worktree isolation
sub-registry.tsSub-agent discovery for mini-swarms
sub-runner.tsSub-agent execution with architecture context injection
prompt-utils.tsPrompt assembly, anti-scope injection, workresult parsing
prompt-enricher.tsEnrich prompts with verification feedback, memory, board context, sibling status
model-resolver.tsComplexity → model mapping (simple→haiku, medium→sonnet, complex→opus)
tmux-runner.tsAsync tmux pane execution, DAG-based parallel sub-agent orchestration
planner.tsPlan creation, approval/rejection, codebase mapping
pipeline.tsMulti-stage pipeline execution & resume
verifier.tsRun verification checks on agent outputs
role-router.tsScore-based task routing to best-fit agent
task-classifier.tsClassify task size (trivial/explore/small/medium/large)
skill-loader.tsLoad & resolve {{skill:name}} template refs in prompts
cost-tracker.tsParse token usage, calculate cost per invocation
session-metrics.tsCompute session-level metrics & summaries
worktree.tsGit worktree create/remove for agent isolation
mcp-registry.tsLoad MCP server registry, validate availability
concurrency.tsSlot-based concurrency cap (default 4 parallel agents)
contracts.tsDerive contracts, validate inputs/outputs per agent manifest
stall-detector.tsDetect stalled agents, nudge or block
escalation.tsCreate & execute escalation plans for blocked agents
turn-tracker.tsAppend & summarize conversation turns per packet
team-state.tsPer-agent state writes, team-wide state aggregation
progress-ledger.tsAppend-only progress ledger with trim support
stage-roster.tsLoad pipeline stage rosters & config
notify.tsNotification dispatch for agent events

Model Complexity Routing

ComplexityPrimary ModelFallback
ComplexOpusSonnet
MediumSonnetOpus, Haiku
SimpleHaikuSonnet
Key Design Principles

1. No Hierarchy

All agents are independent peers. They invoke each other via work packets, structured envelopes with instruction, context, and success criteria.

2. Shared Board as Truth

All state lives in shared/ as JSON/JSONL. No agent holds exclusive knowledge. Any agent can react to state changes via the board.

3. Mini-Swarms

Complex agents (like Architect) can contain private sub-agents. Sub-agents are invisible to the top-level registry but follow the same patterns.

4. Complexity-Based Routing

Agents declare complexity (simple/medium/complex). The model resolver maps this to the right Claude model with fallback chains.

5. Phased DAG Execution

Sub-agents run in dependency order. Within a phase, agents are independent and can run in parallel. Context accumulates across phases.

6. Human at the Edges

Humans set direction, review, and approve. The swarm does the work. Two orchestration modes: manual CLI or autopilot via Champ.

Champ Agent Swarm Architecture · Updated April 2026