@emiliosp/pi-maestro

A spec-driven multiagent development workflow for Pi.

Packages

Package details

extension

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.24.0
Published
Nov 26, 2026
Downloads
4,940/mo · 757/wk
Author
emiliosp
License
AGPL-3.0-or-later
Types
extension
Size
410.6 KB
Dependencies
0 dependencies · 3 peers
Pi manifest JSON
{
  "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

Coverage

Pi extension for writing a specification and optionally implementing it through a spec-driven multiagent workflow.

How it works

Every change starts with a spec. Maestro helps the owner to define a specification (spec) for a change, including clear requirements and acceptance criteria.

Two ways of working with Maestro are available:

  • Spec only: Stop after approval and use the spec in another workflow.
  • Spec and implementation: The builder implements the approved spec. Three optional steps can follow: the verifier independently checks every acceptance criterion, the simplifier improves the code without changing its behavior, and the scorer rates the result and the quality of the verification evidence. These steps can be enabled independently. See Phase selection for setup and defaults.

Each agent has a separate job. No agent approves its own work and the owner makes decisions when questions come up and reviews the final code.

Read The Pi Maestro Manifesto for the motivation behind the project.

https://github.com/user-attachments/assets/dffa8bc7-6c79-491f-95df-2ee95b6447aa

Inspirations

Pi Maestro is inspired by concepts from OpenSpec and GitHub Spec Kit. It adapts those concepts to a sequential multiagent workflow in Pi. See Inspirations for details and sources.

The roles

Role Responsibility
Owner Brings the problem, approves the spec, decides questions, 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.
Verifier Independently checks the implementation against the approved spec and reports any technical issues it finds.
Simplifier Refactors accepted code for clarity without changing behavior or introducing check failures.
Scorer Optional classifier invoked by Maestro to score correctness and verification quality.

Prerequisites

  • Node.js 26 or later.
  • Pi 1.5.0 or later.
  • Access to the models for enabled agents.

Installation

The owner installs Maestro:

pi install npm:@emiliosp/pi-maestro

Usage

The owner starts Pi from the project directory:

cd /path/to/project
pi

Activate Maestro:

/maestro

Choose "New spec" to start or "Restart spec" to revisit an existing spec.

If the configuration is invalid or a model for an enabled implementation role is unavailable, Maestro stays off and reports the problem.

The owner follows this workflow:

  1. Describes one change to Maestro.
  2. Reviews the spec, including its acceptance criteria and concrete examples.
  3. Replies GREEN FLAG when Maestro asks for approval.
  4. Answers each builder escalation and gives a reason, if any arise.
  5. Chooses what to do about each verifier finding, if any arise.
  6. Reads Maestro's summary and performs the final review.

The same /maestro command disables Maestro and leaves project files unchanged.

Troubleshooting

If an agent fails, use the session path shown by Maestro, when available, to inspect or export the session.

LLM as Judge

The optional scorer uses an explicitly selected Pi classifier to evaluate the entire workflow against the approved spec after implementation.

It scores:

  • correctness (how well the result meets the requirements)
  • verification quality (how well the evidence supports that result).

Maestro presents the results in the final summary.

See Scorer configuration to choose a classifier.

This automatic grading system gives the owner a level of confidence in the workflow's outcome, not proof of correctness.

See Workflow evaluation for the criteria and scores.

Configuration

On first use, /maestro opens guided setup to select agent models and thinking levels, plus an optional scorer classifier without a thinking level. Choices are saved in .pi/maestro.json.

The owner can edit this file before activation. See Configuration for fields, defaults, and phase selection.

Documentation

  • Glossary: terms and identifiers used in specs, reports, and Maestro messages. Read this before the first workflow.
  • Workflow: approvals, decisions, and how each run produces artifacts.
  • Configuration: project paths, models, and thinking levels.
  • Subagent integration: agent context, execution, and activity tracking.

Project constitution

  • Mission: purpose, scope, and owner responsibilities.
  • 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.

License

Copyright (c) 2026 Emilio Spatola. Licensed under AGPL-3.0-or-later.