@emiliosp/pi-maestro
A spec-driven multiagent development workflow for Pi.
Package details
Install @emiliosp/pi-maestro from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@emiliosp/pi-maestro- Package
@emiliosp/pi-maestro- Version
0.16.0- Published
- Nov 3, 2026
- Downloads
- 3,110/mo · 717/wk
- Author
- emiliosp
- License
- MIT
- Types
- extension
- Size
- 22.5 MB
- Dependencies
- 1 dependency · 3 peers
Pi manifest JSON
{
"subagents": {
"agents": [
"./agents"
]
},
"extensions": [
"./extensions/maestro.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-maestro
Pi extension for writing a spec and optionally implementing it through a spec-driven multiagent workflow.

The idea
Maestro has two goals:
- Help the
ownerwrite and approve aspecification(spec) for one reversible change. - Implement the approved
specthrough a multiagent workflow.
The owner can use Maestro only to write and approve a spec, leaving implementation to another workflow, or to write the spec and implement it within Maestro.
Spec preparation and approval are required. The entire implementation stage is optional, and each of its phases is optional too:
- The
builderimplements the approvedspec. - The independent
verifierchecks everyacceptance criterion. - The
simplifierrefactors accepted code without changing behavior.
Disabling the builder skips the entire implementation stage. With the builder enabled, the verifier and simplifier can be disabled independently. All three are
enabled by default. See Phase selection.
The owner performs the final review.
Five principles hold the workflow together:
- The approved
specdefines the required work for thebuilderandverifier. - No agent approves its own work.
- When enabled, the
verifierchecks everyacceptance criterionindependently. - The
ownerdecides requirements, scope, and unresolved questions. - Each agent has one and only one role. Specific and with clear instruction.
Inspirations
Pi Maestro is inspired by concepts from OpenSpec and GitHub Spec Kit. It adapts those concepts to a sequential multiagent workflow in Pi.
The following official sources document the conceptual references. The links point to fixed revisions so the cited content remains inspectable.
- The
specificationdrives the code. Spec Kit's philosophy treats thespecificationas the primaryartifactand code as its expression. InMaestro, the approvedspecdefines a working contract for thebuilderandverifier. - Describe behavior, not routine implementation choices. OpenSpec's schema defines a
specificationas a behavior contract, not an implementation plan.Maestrorecords required behavior, constraints, and approved architectural decisions in thespec, leaving routine implementation choices to thebuilder. - Use concrete, testable scenarios. OpenSpec's schema pairs requirements with scenarios; Spec Kit's template uses
Given/When/Then acceptance scenarios. Each
Maestroacceptance criterionincludes aprobe, anexpected result, and a concrete example. - Clarify requirements progressively. Spec Kit's clarify command asks one question at a time and integrates accepted answers into the
specification.Maestrolikewise asks one focused question, waits for the owner's answer, and updates thespecbefore asking the next question. - Review requirements separately from testing code. Spec Kit's checklist command evaluates requirements for completeness, clarity, consistency,
and measurability, not implementation correctness. Before approval,
Maestroreviews thespecfor consistency, missing decisions, measurable outcomes, and reproducible scenarios. The laterverifierchecks the implementation independently. - Separate motivation, behavior, and design. OpenSpec's schema separates these concerns and calls for
design.mdonly when significant technical decisions need recording, including reasons, alternatives, and risks. - Make requirement changes explicit. OpenSpec's schema distinguishes added, modified, removed, and renamed requirements.
Maestroadapts this concept with oneDeltafield per requirement:added,modified, orremoved. Each requirement states the complete required outcome. - Make requirement coverage traceable. Spec Kit's analyze command maps requirements to implementation tasks and identifies coverage gaps.
Maestroapplies a related principle to verification: each requirement has aVerified byfield linking to itsacceptance criteria, existing tests covering exact scenarios, or both. The mapping connects requirements to verification.
The roles
| Role | Responsibility |
|---|---|
Owner |
Brings the problem, approves the spec, decides questions and findings, and reviews the final code. |
Maestro |
Works directly with the owner, prepares the spec, runs the other agents, records decisions, and summarizes results. |
Builder |
Implements the approved spec and checks each acceptance criterion. |
Verifier |
Independently checks the project files against the spec and reports technical issues. |
Simplifier |
Refactors accepted code for clarity without changing behavior or introducing check failures. |
An escalation asks the owner to decide an implementation question. A finding records a technical issue reported by the verifier. The owner discusses both with
Maestro, not directly with the builder or verifier.
Prerequisites
- macOS.
- Node.js 26 or later.
- Pi 1.5.0 or later.
pi-subagentsinstalled and enabled in Pi whenbuilderis enabled.- Access to the models for enabled agents.
- A project directory that Pi trusts.
Installation
The owner installs pi-subagents and Maestro with these commands:
pi install npm:pi-subagents
pi install npm:@emiliosp/pi-maestro
Usage
The owner starts Pi from the project directory:
cd /path/to/project
pi
Activate Maestro:
/maestro
During activation, Maestro checks project trust, configuration, and enabled agent and model availability. With builder disabled, only project trust and configuration
are checked. Model availability comes from Pi's model registry. If a check fails, Maestro stays disabled and reports the problem.
The owner follows this workflow:
- Describes one change to
Maestro. - Reviews the
spec, including itsacceptance criteriaand concrete examples. - Replies
GREEN FLAGwhenMaestroasks for approval.Maestrorecords the approval and starts the selected phases. - Reviews every current
builderescalationand givesMaestroan answer and reason for each question. - Reviews
verifierfindingsand chooses an action for everyfinding. - Reads Maestro's summary at
candidate-readyand performs the final review.
Maestro starts the verifier, when enabled, after a successful builder run. Selected agents run in the foreground: Pi waits for each run to finish and Maestro
shows the current phase in Pi's status, while pi-subagents FleetView and /subagents-fleet show agent activity and transcripts.
The owner must not edit product files while the workflow runs. Maestro can perform temporary experiments with owner agreement during spec preparation and
permitted revisions. See Workflow.
An escalation asks the owner to decide an implementation question, and a finding records a technical issue reported by the verifier. The owner discusses both
with Maestro, never directly with the builder or verifier. Maestro records all current escalation answers or finding decisions in the active handoff before
changing phase.
If any decision requires a spec change, the workflow returns to drafting-spec before the owner and Maestro revise the same spec. The owner reviews the revised
spec and replies GREEN FLAG again. Maestro records renewed approval separately before another builder run.
When enabled, Maestro starts the simplifier after successful verification, rejection of all findings, or builder completion with verification disabled. Only this
step requires Git. If Git readiness cannot be confirmed, Maestro warns and skips simplification. The simplifier selects all uncommitted code changes, including
pre-existing staged, unstaged, and untracked files.
The workflow ends at candidate-ready. Rejected findings retain their reasons and accepted failures can remain. Maestro's summary separates independent verification
from the later simplifier's report. After the final summary finishes successfully, Maestro automatically turns off. The owner controls later review, commits, pull
requests, and merging.
The same /maestro command disables Maestro and leaves project files unchanged. Disabling Maestro, restarting Pi, or using /resume clears live session state. Saved
files do not automatically restore or resume an incomplete workflow. The owner handles it manually.
Configuration
Maestro uses default values when .pi/maestro.json is absent from the project root. The owner can add this file to change the spec directory, models, thinking
levels, or selected phases. Each agent has a required boolean that defaults to true. Set flags before activation and keep configuration unchanged during the workflow.
With builder.required: false, approval finishes with only an approved spec for implementation elsewhere. Otherwise verifier and simplifier can be disabled
independently. Skipped work is identified in the final summary and is not claimed as completed. See Configuration.
Documentation
The reading order is:
- Glossary: terms and identifiers used in
specs, reports, andMaestromessages. Read this before the first workflow. - Workflow: approvals, decisions, and how each
runproducesartifacts. - Configuration: project paths, models, and thinking levels.
- Subagent integration: agent context, execution, and activity tracking.
Project constitution
- Mission: purpose, scope, and
ownerresponsibilities. - Tech stack: runtime technologies and development tools.
- Roadmap: completed outcomes and planned work maintained in the repository.
- Changelog: meaningful codebase changes and breaking changes.
- Architecture decision records: architectural choices, context, consequences, and evidence.