# Plannotator for Pi Plannotator integration for the [Pi coding agent](https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent). Adds a single tool — `plannotator_review_plan` — that opens a plan file in a browser-based review UI and returns the user's decision without changing agent behavior. ## Install **From npm** (recommended): ```bash pi install npm:@plannotator/pi-extension ``` **From source:** ```bash git clone https://github.com/backnotprop/plannotator.git pi install ./plannotator/apps/pi-extension ``` **Try without installing:** ```bash pi -e npm:@plannotator/pi-extension ``` ## Build from source If installing from a local clone, build the HTML assets first: ```bash cd plannotator bun install bun run build:pi ``` This builds the plan review and code review UIs and copies them into `apps/pi-extension/`. ## Usage The extension registers a single tool: `plannotator_review_plan`. When the agent calls this tool with a file path, the Plannotator UI opens in your browser. You can: - **Approve** the plan — the tool returns the plan content and any approval notes, and tells the agent to **wait for your instructions** before proceeding. - **Deny with feedback** — the tool returns the feedback so the agent can revise and re-submit. - **Annotate** — add inline comments on specific parts of the plan. The tool does **not**: - Enter any planning mode or change agent behavior - Restrict tools, switch models, or adjust thinking levels - Automatically begin execution after approval - Track `[DONE:n]` progress markers - Send follow-up messages on your behalf After the tool returns, **you decide** what happens next — switch agents, give the go-ahead, or leave the plan for later. ## Example workflow 1. Ask the agent to write a plan file (e.g. `PLAN.md`) 2. The agent calls `plannotator_review_plan` with the file path 3. Review the plan in your browser — approve, deny, or annotate 4. The tool returns the decision to the agent 5. You give your instructions: "go ahead", "switch to codex", "save it for later", etc. ## Shared event API Plannotator listens on the shared `plannotator:request` event channel so other extensions can reuse the same browser review flows without importing Plannotator internals. Supported actions and payloads: - `plan-review`: `{ planContent, planFilePath? }` - `review-status`: `{ reviewId }` - `code-review`: `{ cwd?, defaultBranch?, diffType? }` - `annotate`: `{ filePath, markdown?, mode?, folderPath? }` - `annotate-last`: `{ markdown? }` - `archive`: `{ customPlanPath? }` ## Tool reference | Tool | Description | |------|-------------| | `plannotator_review_plan` | Open a plan file in the browser review UI. Returns the user's decision (approved/denied with feedback) without changing agent behavior. | ## Requirements - [Pi](https://github.com/mariozechner/pi) >= 0.53.0