Maestro orchestrates a squad of AI agents through a structured 4-phase workflow. It acts as a Product Owner (PO) — receiving objectives, coordinating discovery, synthesizing learnings, and driving delivery.
Maestro never writes code. It only orchestrates.
The squad is organized into three functional groups aligned with the workflow phases.
| Role | Responsibility |
|---|---|
| Architect | Technical feasibility, system design, tradeoffs, component boundaries |
| Researcher | Documentation lookup, dependency analysis, prior art, API references |
| UX Designer | User flows, accessibility, UI patterns, interaction design |
| Role | Responsibility |
|---|---|
| Frontend Engineer | UI components, client-side logic, state management |
| Backend Engineer | API routes, database schemas, server logic, integrations |
| DevOps / SRE | Infrastructure, CI/CD pipelines, deployment, monitoring |
| Role | Responsibility |
|---|---|
| QA Engineer | Automated tests, linting, integration checks |
| Code Reviewer | API validation, standards compliance, hallucination detection |
Maestro receives an objective and fans out to the Discovery team in parallel. Each agent investigates the problem from their perspective.
Objective
│
├──▶ Architect → architecture proposal, component diagram
├──▶ Researcher → relevant docs, API references, dependencies
└──▶ UX Designer → user flows, UI patterns, accessibility notes
Inputs: User objective (plain text).
Outputs: Each agent produces a structured findings report. These are collected by Maestro for the next phase.
Maestro consolidates all discovery findings into a single summary and generates a task plan with agent assignments.
- Summarize learnings — merge architecture proposals, research findings, and UX recommendations into a coherent brief.
- Generate plan — break the objective into ordered milestones, each assigned to a Build team agent.
- Present for approval — the user reviews the plan and can adjust scope, priorities, or assignments before proceeding.
Inputs: Discovery findings from Phase 1.
Outputs: An approved execution plan with milestones and agent assignments.
Maestro delegates tasks to the Build team following a dependency graph (DAG). Independent tasks run in parallel; dependent tasks wait for their prerequisites.
Plan
│
├──▶ Backend Engineer (no deps)
├──▶ DevOps / SRE (no deps)
└──▶ Frontend Engineer (depends_on: backend)
Each agent works within an isolated session managed by OpenCode. Maestro monitors progress via the event stream and coordinates handoffs between agents.
Inputs: Approved plan from Phase 2.
Outputs: Implemented code changes across the codebase.
The Quality team verifies all changes before delivery.
- Automated checks — QA Engineer runs test and lint commands.
- Code review — Code Reviewer validates API usage against documentation, checks for hallucinated or deprecated methods.
- Feedback loop — failures are routed back to the responsible
Build agent with corrective instructions. The cycle repeats until
all checks pass or
max_retriesis reached.
Changes
│
├──▶ QA Engineer → go test, go vet
└──▶ Code Reviewer → API validation, standards check
│
├── ✅ Pass → Deliver to user
└── ❌ Fail → Route back to Build agent → retry
Inputs: Code changes from Phase 3.
Outputs: Verified, tested, deliverable code.
The workflow is defined in maestro.yaml at the project root.
name: my-project
description: Project description
# Supported tools — agent runtimes to scaffold and use
tools:
- opencode
# Squad definition — maps roles to agent configurations
agents:
architect:
role: architect
phase: discovery
researcher:
role: researcher
phase: discovery
ux-designer:
role: ux-designer
phase: discovery
frontend-engineer:
role: frontend-engineer
phase: build
backend-engineer:
role: backend-engineer
phase: build
devops-sre:
role: devops-sre
phase: build
qa-engineer:
role: qa-engineer
phase: quality
code-reviewer:
role: code-reviewer
phase: quality
# Workflow phases
workflow:
discovery:
parallel: true
synthesis:
approval: true # pause for user approval before build
build:
parallel: true
tasks:
- agent: backend-engineer
depends_on: []
- agent: devops-sre
depends_on: []
- agent: frontend-engineer
depends_on: [backend-engineer]
quality_gate:
commands:
- go test ./...
- go vet ./...
on_failure: fix_and_retry
max_retries: 3Agent definitions are composed from shared role files and tool-specific wrappers. The role content (instructions, responsibilities, output format) is shared across all tools — only the frontmatter and file structure differ.
OpenCode — agents are markdown files in .opencode/agent/:
---
description: Brief description of the agent's expertise
mode: subagent
tools:
write: true
edit: true
---
Role instructions...Maestro drives the workflow through a Runtime interface that abstracts the underlying AI tool. OpenCode provides the execution backend:
┌──────────────┐ Runtime interface ┌──────────────────┐
│ Maestro CLI │ ◀──────────────────────▶ │ OpenCode Runtime│
│ (Go) │ RunAgent(prompt) → │ (HTTP API) │
└──────────────┘ ← Result └──────────────────┘
Uses the OpenCode HTTP API:
- Start server —
opencode serveexposes the OpenAPI endpoint. - Create sessions — each agent task runs in an isolated session.
- Send prompts —
POST /session/:id/messagewith the task description and context from previous phases. - Monitor events —
GET /event(SSE) streams real-time progress. - Collect results —
GET /session/:id/messageretrieves agent output for synthesis and review.
Or use the CLI directly:
opencode "Your prompt here"Maestro tracks all objective state in the .maestro/ directory
(git-ignored). Each objective gets a timestamped folder with a phase
report for each completed step.
.maestro/
└── 2026-03-12-user-management-api/
├── discovery-report.md
├── synthesis-report.md
├── build-report.md
└── quality-gate-report.md
Objective lifecycle:
initiated → discovery → synthesis → [human approval] → build → quality-gate → done
- Maestro never writes code. It plans, delegates, and verifies.
- Discovery before building. Every objective starts with research and architecture review.
- Human in the loop. The user approves the plan before build begins.
- Fail fast, retry smart. Quality gate failures route back to the responsible agent with specific corrective instructions.
- Parallel by default. Independent tasks run concurrently to minimize wall-clock time.
- DAG-based ordering. Dependencies between tasks are explicit, ensuring correct sequencing.