Skip to main content

Role Orchestrator

Role Orchestrator is SpecWeave's multi-agent coordination system that sequences specialized AI agents (PM, Architect, Tech Lead, QA, DevOps) to work together on complex tasks.


Architecture


Agent Roles

Strategic Layer

AgentPurposeWhen Used
PM AgentProduct strategy, user stories, prioritizationNew products/features
Architect AgentSystem design, ADRs, technology stackMajor features, architecture

Execution Layer

AgentPurposeWhen Used
Tech Lead AgentTechnical planning, code reviewComplex decisions
Backend AgentsNode.js, Python, .NET implementationServer-side code
Frontend AgentReact/Next.js, UI/UXUser interfaces

Quality Layer

AgentPurposeWhen Used
QA Lead AgentTest strategy, quality assuranceTesting approach
Security AgentSecurity architecture, threat modelingSecurity features
DevOps AgentInfrastructure, CI/CD, deploymentOperations

Orchestration Patterns

Sequential (Default)

PM → Architect → Tech Lead → Backend → Frontend → QA → DevOps

Used when each phase depends on the previous.

Parallel

PM + Architect (parallel)

Backend + Frontend (parallel)

QA + DevOps (parallel)

Used for independent work streams.

Adaptive

PM → Architect → [Discover need] → Security → Tech Lead → ...

Agents inject dynamically based on discovered requirements.


Quality Gates

The orchestrator enforces quality gates between phases:

Gate 1: After PM

  • User stories defined with AC-IDs
  • Success criteria measurable
  • Dependencies identified

Gate 2: After Architect

  • System design documented
  • ADRs created (minimum 3)
  • Technology stack chosen

Gate 3: After Implementation

  • All P1 tasks completed
  • Tests passing (80%+ coverage)
  • Code reviewed

Gate 4: Before Deployment

  • Security review passed
  • Performance acceptable
  • Monitoring configured

Example Workflow

User request: "Build a SaaS for event management"

Orchestrator creates:

  1. Increment structure: .specweave/increments/0001-event-management/
  2. 8-phase workflow plan
  3. Quality gates between phases

User executes:

Phase 1: "Complete spec for increment 0001"
Phase 2: "Design architecture for increment 0001"
Phase 3: "Create technical plan for increment 0001"
...continues through all phases

Safety Rules

The orchestrator follows critical safety patterns:

DO:

  • Create increment structure first
  • Guide user through sequential workflow
  • Enforce quality gates
  • Track progress

DON'T:

  • Spawn all agents at once (context explosion)
  • Skip quality gates
  • Proceed without user confirmation