Pi Reference
This page describes the @maestria/pi runtime extension. The Oh My Pi integration uses the shared portable package and has different activation and lifecycle behavior; see maestria for OMP.
Workflow Modes
Section titled “Workflow Modes”| Command | Behavior |
|---|---|
/fein |
Full method: recon and architecture-plan before implementing in the main loop, with required blind review |
/sonar |
Research-only route that stops before implementation; change no files and dispatch no subagents |
/blitz |
Fast path that skips optional recon and architecture-plan loads while preserving required safeguards and review |
The modes are defined by ModeKeyword in packages/shared/mode/src/index.ts. A mode keyword anywhere in a message, outside code, sets the mode and applies it to that message; when several appear, the most restrictive wins (full-method over research-only over fast). A slash command sets the mode without a task. Either way the mode stays active for the session until another mode is set or you run /mode-clear.
Reviewer Dispatch
Section titled “Reviewer Dispatch”The main loop investigates, designs, and implements each outcome itself; its maestria_subagent tool dispatches only the reviewer, for independent blind review, through @gotgenes/pi-subagents; without that extension, dispatch reports that it is unavailable. The main loop loads diagnose for a bug, regression, failure, or crash with an unknown cause, implements the fix, and sends meaningful changes to the reviewer for validation.
{ "agent": "reviewer", "task": "Review the authentication change at <commit or branch> against <acceptance criteria> without editing"}The reviewer inherits parent context. Treat handoff prompts as guidance and include the goal, constraints, acceptance evidence, and next step needed by each child.
Session State
Section titled “Session State”The extension records subagent runs and handoff history in the session. /maestria-status shows the active mode and handoff history. State handling across compaction and resumed sessions follows Pi’s host lifecycle.
Review Mode
Section titled “Review Mode”/review <target> enters the extension’s review-only path. /review-model <id> selects a review model, and /restore-model returns to the previous model and tools. Review-mode tool availability is an extension behavior; do not use a reviewer persona as a substitute for checking the active tools.
Project Instructions
Section titled “Project Instructions”The extension checks .maestria/workflow.md and then .maestria/rules.md from the session working directory. Missing or empty files are skipped. A present but unusable file triggers a notification and a STOP banner in the system prompt that tells the agent not to execute the request until the file is fixed. See Workflow Patterns for precedence and carry-over.