# Annotated Review Pi Extension

Global Pi extension that provides `/annotated-review` in every project.

## What it does

- Registers `/annotated-review` as a global extension command.
- Sends the agent a compact review prompt that points at reusable renderer assets.
- Keeps CSS in `assets/review.css`.
- Keeps browser enhancements in `assets/review-components.js`.
- Keeps HTML rendering helpers in `lib/review-page.mjs` and git collection in `lib/git-context.mjs`.
- Writes self-contained HTML reviews with inline CSS and inline JS.

## Usage

```text
/annotated-review
/annotated-review main
/annotated-review main /tmp/review.html
```

The command resolves output paths to absolute paths before sending the prompt, so the final response should be terminal-clickable.

Security note: tracked diffs are collected from git automatically. Untracked file contents are only rendered when the review JSON explicitly lists the path, and the renderer rejects symlinks, likely secrets, large files, generated output, dependencies, and binaries.

After editing extension files, run `/reload` in Pi.

## Package metadata

This repository is prepared as a public npm Pi package:

- npm package name: `pi-annotated-review`
- Pi package manifest: `package.json` → `pi.extensions: ["./index.ts"]`
- package discovery keyword: `pi-package`
- license: MIT
- publish readiness: `private` has been removed; run the checks below before publishing:

```bash
npm test
npm run pack:dry-run
```

After publishing, users should be able to install it with:

```bash
pi install npm:pi-annotated-review
```
