How tremtec/maestro works
Maestro is a Go CLI for initializing and maintaining an OpenCode-based squad setup, and for submitting workflow prompts to an OpenCode CLI or server. The documented workflow is Discovery → Synthesis → Build → Quality Gate, but the sampled run implementation delegates execution and does not expose those internal stages. The graph therefore shows the real CLI dispatch and scaffold/run behavior, while retaining the documented phase workflow as an unverified subsystem. update, drop, and self-upgrade are separate product capabilities; workflow state is documented as Markdown in .maestro/.
Main entry points: root.go Command dispatch · run.go Run command · scaffold.go Project scaffolder · main.go Program entry
Components 18
CLI entry
- Program entry
main.go - Command dispatch
cmd/root.go
Project setup
- Init command
cmd/init.go - Project scaffolder
internal/scaffold/scaffold.go - Squad templates
internal/scaffold/templates - Project config and agents
Workflow execution
- Markdown state
- Run command
cmd/run.go - Four workflow phases
- Runtime abstraction
internal/runtime/runtime.go - OpenCode runtime adapter
internal/runtime/opencode.go
Maintenance
- Update command
cmd/update.go - Drop command
cmd/drop.go - Upgrade command
cmd/upgrade.go
Other components
- User
- OpenCode CLI
- OpenCode server
- GitHub releases
Connections 20
- User → Program entry: invokes
README.md - Program entry → Command dispatch: executes
main.go - Command dispatch → Init command: dispatches
cmd/init.go - Init command → Project scaffolder: initializes
cmd/init.go - Project scaffolder → Squad templates: reads
internal/scaffold/scaffold.go - Project scaffolder → Project config and agents: writes
internal/scaffold/scaffold.go - User → Run command: submits prompt
README.md - Command dispatch → Run command: dispatches
cmd/run.go - Run command → OpenCode CLI: invokes when available
cmd/run.go - Run command → OpenCode server: posts otherwise
cmd/run.go - OpenCode server → Run command: returns output
cmd/run.go - Run command → Four workflow phases: requests workflow
README.md - Four workflow phases → Markdown state: records artifacts
README.md - Runtime abstraction → OpenCode runtime adapter: registers implementation
internal/runtime/opencode.go - Command dispatch → Update command: dispatches
cmd/update.go - Update command → Project scaffolder: resets agents
cmd/update.go - Command dispatch → Drop command: dispatches
cmd/drop.go - Drop command → Project scaffolder: removes setup
cmd/drop.go - Command dispatch → Upgrade command: dispatches
cmd/upgrade.go - Upgrade command → GitHub releases: checks and downloads
cmd/upgrade.go