@tduyng/pi-review 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -40
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,51 +1,30 @@
|
|
|
1
1
|
# @tduyng/pi-review
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`/review` reviews from git ground truth. It resolves the target from the repository, sends one prompt with the diff attached, and advances a checkpoint so the next run covers only what moved.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
A review from memory covers code the model remembers writing, and re-reviews the parts already fixed.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## How it works
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
A bare `/review` asks git what changed since the last checkpoint. With nothing there it takes what is uncommitted, and with nothing there either, this branch against its merge base.
|
|
10
10
|
|
|
11
|
-
The
|
|
11
|
+
The command writes its snapshot through a throwaway `GIT_INDEX_FILE`. That produces a dangling tree with no ref and no commit, so repository history stays untouched. The checkpoint is that same tree, and a review moves it.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
A `--staged` review, or one with a described target, leaves the checkpoint where it was, so unstaged work is not skipped next time.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
1. The staged changes with `--staged`, which names the target outright, whatever the snapshot says.
|
|
18
|
-
2. What moved since the last snapshot, if that snapshot still exists.
|
|
19
|
-
3. Any uncommitted work, untracked files included.
|
|
20
|
-
4. This branch against its merge base with the default branch.
|
|
21
|
-
|
|
22
|
-
## What it adds
|
|
23
|
-
|
|
24
|
-
- `/review [target]`. Bare resolves as above, anything else is passed through.
|
|
25
|
-
- `--lean`. Adds a second pass for removable implementation complexity in the same change, and prints `Lean already.` when there is none.
|
|
26
|
-
- `--extra "<text>"`. Acceptance criteria for the review. Repeatable, last wins.
|
|
27
|
-
- `--model provider/model`. Runs the review on that model through the `subagent` tool. Without that tool the review runs inline and says the override could not be honored.
|
|
28
|
-
- `--staged`. Reviews only the staged changes.
|
|
29
|
-
|
|
30
|
-
Anything you type is the reviewer's request and goes to the prompt as written: `/review the change between main and HEAD`, `/review src/auth`, `/review first commit on this branch`. The prompt caps target resolution at three commands and tells the reviewer not to narrate them.
|
|
31
|
-
|
|
32
|
-
## Focused review contract
|
|
33
|
-
|
|
34
|
-
The extension resolves the diff and hands it over with two lines of context around each change, so the reviewer spends no tool calls on git. The diff is capped at 12,000 characters. Past that the stat still lists every file, and the reviewer is told how many characters it did not read.
|
|
35
|
-
|
|
36
|
-
The reviewer writes the change's intent in one line first and judges the implementation against it. Supplied criteria replace that line. It reads the diff before opening any file, opens at most two files the diff does not already show, and runs at most one targeted command, all inside a budget of eight tool calls including any target resolution.
|
|
37
|
-
|
|
38
|
-
The response is under 15 lines: a verdict, the intent line, one line per finding with a P0 to P3 severity and a concrete fix, and one `Checks:` line.
|
|
39
|
-
|
|
40
|
-
## Examples
|
|
15
|
+
## Commands
|
|
41
16
|
|
|
17
|
+
```text
|
|
18
|
+
/review what moved since the last review, else uncommitted, else the branch base
|
|
19
|
+
/review src/session.ts a target you describe, passed to the prompt as written
|
|
20
|
+
/review --staged the index only
|
|
21
|
+
/review --lean the review prompt without the rubric
|
|
22
|
+
/review --model provider/id run the review on another model
|
|
23
|
+
/review --extra "check error paths" add an instruction
|
|
24
|
+
/review --base main compare against another base
|
|
42
25
|
```
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
/review the change between main and HEAD # any target you describe
|
|
46
|
-
/review --lean --extra "retries must not double-charge" src/auth
|
|
47
|
-
/review --model opencode-go/gpt-6-luna the retry logic
|
|
48
|
-
```
|
|
26
|
+
|
|
27
|
+
The command caps the reply at 15 lines and eight tool calls in total, including the calls that resolve the target. A review that needs more than eight calls has started refactoring.
|
|
49
28
|
|
|
50
29
|
## Install
|
|
51
30
|
|
|
@@ -55,6 +34,11 @@ pi install npm:@tduyng/pi-review
|
|
|
55
34
|
|
|
56
35
|
Local checkout: `pi install /path/to/dotfiles/pi/agent/extensions/pi-review`
|
|
57
36
|
|
|
58
|
-
|
|
37
|
+
It needs `git` on PATH and a git repository. Outside one, the command says so and stops. `--model` uses the `subagent` tool when it is installed, and runs inline on the current model when it is not.
|
|
38
|
+
|
|
39
|
+
## Limits
|
|
59
40
|
|
|
60
|
-
|
|
41
|
+
- The diff is capped at 12,000 characters. A larger change needs two reviews or a narrower target.
|
|
42
|
+
- A review is one pass. A model asked to re-review its own findings mostly finds its earlier findings.
|
|
43
|
+
- The checkpoint lives as a session entry, so a new session starts from the last one in the same repository. A fresh clone starts from nothing.
|
|
44
|
+
- Snapshot trees are unreferenced by design, so git's pruning collects them after about two weeks. A checkpoint older than that resolves to a full review.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tduyng/pi-review",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.4",
|
|
4
|
+
"description": "Review only the delta. /review snapshots the worktree, so the next run pays for what moved since.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi",
|
|
7
7
|
"pi-package",
|