@mrclrchtr/supi-review
v1.7.0
Published
SuPi Review extension — structured code review via /supi-review command
Maintainers
Readme
@mrclrchtr/supi-review
Adds an interactive /supi-review command to the pi coding agent for session-aware code review.
Install
pi install npm:@mrclrchtr/supi-reviewThis is a beta package. It is not bundled in @mrclrchtr/supi.
For local development:
pi install ./packages/supi-reviewAfter editing the source, run /reload.
What you get
After install, pi gets one command:
/supi-review— launch a guided review flow over a concrete git snapshot
The reviewer runs in managed child agent sessions:
- a brief synthesizer creates a structured review brief from the active session branch
- a read-only reviewer inspects the selected snapshot and submits structured findings
Review flow
/supi-review walks you through:
- choose a review target
- choose the reviewer model
- optionally add a short note
- resolve the snapshot
- synthesize a review brief from the current session history
- preview the synthesized brief + prompt coverage
- run the review with a live progress widget
- show the structured result as a custom message
- if findings exist, hand off to the main agent so it can ask what to do next
Review targets
Current targets:
- working tree
- branch diff vs a selected local base branch
- one recent commit
Session-aware brief synthesis
The generated review prompt is not just a static diff wrapper.
Before the actual review starts, the package:
- resolves the active session branch into the current LLM-visible context
- extracts high-signal user/assistant/custom/compaction context from that resolved view
- synthesizes a structured brief with:
- summary
- intended outcome
- constraints to preserve
- focus areas
- risky files
- unresolved questions
The synthesizer also receives a bounded diff excerpt from the snapshot so it can reason about actual code changes, not just filenames.
That synthesized brief is then combined with the git snapshot into the final reviewer prompt.
Model selection
Every /supi-review run asks you to choose the reviewer model.
- the picker only shows scoped models from Pi's
enabledModelsconfiguration - the current session model is preselected only when it is inside that scoped set
- the selected model is used for both brief synthesis and the final review
- no review model is persisted in settings
Result shape
A successful review includes:
- overall correctness verdict
- overall explanation
- overall confidence score
- structured findings with title, body, priority, confidence score, and code location
- the synthesized brief that drove the review
The renderer also handles failed, canceled, and timed-out reviews.
When a successful review contains findings, supi-review also injects an agent-visible hidden follow-up message that asks the main agent to decide the next step with the user. If ask_user is available, the main agent is instructed to use it and offer:
- Done
- Fix all
- Fix selected
- Verify findings
Source
src/review.ts— command orchestration and interactive flowsrc/model.ts— explicit model selection helperssrc/git.ts— git snapshot resolutionsrc/history/collect.ts— active-branch evidence extractionsrc/history/synthesize.ts— brief synthesis orchestrationsrc/target/packet.ts— final reviewer packet buildersrc/tool/brief-runner.ts— brief synthesis child sessionsrc/tool/review-runner.ts— read-only reviewer child sessionsrc/ui/renderer.ts— structured result rendering
