@tduyng/pi-review 0.0.2 → 0.0.3

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.
Files changed (2) hide show
  1. package/README.md +29 -27
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,45 +1,41 @@
1
1
  # @tduyng/pi-review
2
2
 
3
- A `/review` command that works out what to review and sends one focused review prompt.
3
+ `/review` that works out what changed and pays only for that. Every run snapshots the worktree, so the next one reviews the delta instead of the branch.
4
+
5
+ ## What it costs
6
+
7
+ No tool, no schema, no system prompt block. A slash command and a snapshot object that git prunes on its own.
8
+
9
+ The saving is the second review of the same code. A branch reviewed after every commit costs one diff the first time and one commit's diff after that, rather than the whole branch four times.
4
10
 
5
11
  ## The incremental loop
6
12
 
7
- Every bare `/review` snapshots the whole worktree (tracked and untracked) as a dangling git commit. No ref, no stash change, no branch commit. The snapshot sha sits in the session as a custom entry that never enters model context.
13
+ Every bare `/review` snapshots the worktree, tracked and untracked, as a dangling git commit. No ref, no stash entry, no branch commit. The snapshot sha sits in the session as a custom entry that never enters model context.
8
14
 
9
- Run `/review` and the agent reviews what moved since the last run. The delta is a tree-to-tree diff, so it covers edits to files that were untracked at checkpoint time and deletions of tracked files. When nothing moved, the command says so and sends nothing.
15
+ The next `/review` reviews what moved since. The delta is a tree-to-tree diff, so it covers edits to files that were untracked at checkpoint time and deletions of tracked files. When nothing moved, the command says so and sends nothing, which is the cheapest review there is.
10
16
 
11
- The checkpoint moves only after a review has read that work. `--staged` and a described target leave it alone, so their unstaged work is still waiting for the next bare `/review`. A branch review records HEAD, not the worktree, so uncommitted edits stay in the next delta. Git prunes the snapshot objects after roughly two weeks, and a pruned snapshot falls back to the default below. In an ephemeral `--no-session` run the snapshot lasts only for that process.
17
+ The checkpoint moves only after a review has read that work. `--staged` and a described target leave it alone, so their unstaged work is still waiting for the next bare `/review`. A branch review records HEAD rather than the worktree, so uncommitted edits stay in the next delta. Git prunes the snapshot objects after about two weeks, and a pruned snapshot falls back to the default target. In an ephemeral `--no-session` run the snapshot lasts only for that process.
12
18
 
13
19
  ## Targets
14
20
 
15
- A bare `/review` is resolved in code, with no model in the loop:
21
+ A bare `/review` resolves in code, with no model in the loop:
16
22
 
17
- 1. The staged changes with `--staged`, which names the target outright, whatever the snapshot says.
23
+ 1. The staged changes, with `--staged`.
18
24
  2. What moved since the last snapshot, if that snapshot still exists.
19
25
  3. Any uncommitted work, untracked files included.
20
26
  4. This branch against its merge base with the default branch.
21
27
 
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.
28
+ ## Options
35
29
 
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.
30
+ - `/review [target]`. Bare resolves as above, anything else passes through.
31
+ - `--lean` adds a second pass for removable implementation complexity in the same change, and prints `Lean already.` when there is none.
32
+ - `--extra "<text>"` gives acceptance criteria, repeatable, last wins.
33
+ - `--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.
34
+ - `--staged` reviews only the staged changes.
37
35
 
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.
36
+ Anything you type is the reviewer's request and reaches the prompt as written: `/review the change between main and HEAD`, `/review src/auth`, `/review first commit on this branch`. Target resolution is capped at three commands, and the reviewer is told not to narrate them.
39
37
 
40
- ## Examples
41
-
42
- ```
38
+ ```text
43
39
  /review # what moved, or the branch default
44
40
  /review --staged # staged changes only
45
41
  /review the change between main and HEAD # any target you describe
@@ -47,6 +43,14 @@ The response is under 15 lines: a verdict, the intent line, one line per finding
47
43
  /review --model opencode-go/gpt-6-luna the retry logic
48
44
  ```
49
45
 
46
+ ## The contract
47
+
48
+ 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.
49
+
50
+ The reviewer writes the change's intent in one line first and judges the implementation against it, unless you supplied criteria. 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 target resolution.
51
+
52
+ The reply 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.
53
+
50
54
  ## Install
51
55
 
52
56
  ```bash
@@ -55,6 +59,4 @@ pi install npm:@tduyng/pi-review
55
59
 
56
60
  Local checkout: `pi install /path/to/dotfiles/pi/agent/extensions/pi-review`
57
61
 
58
- ## Configure
59
-
60
- None. It works out of the box inside a git repository.
62
+ No configuration. It works inside any git repository.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tduyng/pi-review",
3
- "version": "0.0.2",
4
- "description": "/review resolves a target from git, collects project ground truth, and sends a structured review prompt inline or through a subagent.",
3
+ "version": "0.0.3",
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",