Skip to content

drzero-swarm

Distribute work across multiple domain specialist agents in parallel for complex multi-domain tasks

experimental
IDE:
codex
Version:
0.1.0
Owner:epic-platform-sre
drzero
swarm
parallel
multi-agent
orchestration

DrZero Swarm Mode

Distribute work across multiple domain specialists simultaneously. The orchestrator coordinates parallel execution and synthesizes results.

Installation Prerequisite

Install the DrZero Codex bundle before using this skill:

make codex-install-drzero SCOPE=repo

Workflow

1. Task Decomposition

  • Dispatch agent: drzero-orchestrator
  • Break complex task into domain-specific subtasks
  • Identify dependencies between subtasks
  • Plan execution order (parallel where possible)

2. Parallel Dispatch

  • Launch independent subtasks in parallel (up to 6 concurrent)
  • Codex agents.max_threads = 6 controls parallelism
  • Each subtask dispatches to its domain specialist

3. Dependency Resolution

  • Wait for prerequisite subtasks to complete
  • Pass outputs from completed tasks to dependent tasks
  • Handle failures with retry or escalation

4. Result Synthesis

  • Orchestrator collects all specialist outputs
  • Merge changes (resolve conflicts if any)
  • Generate unified summary

5. Review

  • Dispatch agent: drzero-security on combined output
  • Verify cross-domain consistency
  • Run integration checks

Orchestration Patterns

Sequential Chain

Task A -> Task B -> Task C (each depends on prior)

Parallel Fan-Out

Task A, Task B, Task C all run simultaneously, then merge

Bounded Batch

Process N items with max M concurrent (e.g., 20 files, 6 at a time)

Coordination Detail

Domain Routing

The orchestrator maps each subtask to one of 16 canonical domain specialist agents (e.g., drzero-architecture, drzero-security, drzero-performance, drzero-testing, drzero-documentation, drzero-database, drzero-frontend, drzero-backend, etc.). Routing uses keyword matching on the subtask description and file-path heuristics (e.g., files under tests/ route to the testing specialist).

Parallel Execution Strategy

  • The orchestrator builds a dependency DAG from the decomposed subtasks.
  • Independent subtasks (no shared file writes) are dispatched immediately, up to the parallel_threads limit (default: 6, configurable via drzero-config).
  • Dependent subtasks wait in a ready queue until prerequisites complete.
  • If a specialist fails or times out, the orchestrator retries once before marking the subtask as failed and continuing with remaining work.

Conflict Resolution

When two specialists propose changes to the same file:

  1. The orchestrator detects the overlap during result collection.
  2. It applies changes sequentially in priority order (security > architecture > other).
  3. If the second patch cannot apply cleanly, the orchestrator re-dispatches the lower-priority specialist with the updated file content as context.

Result Aggregation

After all subtasks complete, the orchestrator:

  1. Merges file-level diffs into a unified changeset.
  2. Runs the drzero-security agent on the combined output for cross-domain review.
  3. Produces a summary listing each specialist's contribution, files changed, and any conflicts that were resolved.

Use Cases

  • Multi-component refactoring (architecture + implementation + testing)
  • Full-stack feature (frontend + backend + database + infrastructure)
  • Cross-cutting concerns (security + compliance + documentation)
  • Large-scale migrations (process files in batches)

Related Assets