@eliya-oss/agent-diff 0.1.0-alpha.5 → 0.1.0-alpha.51
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/.agents/adr/README.md +3 -0
- package/.agents/prd/README.md +2 -2
- package/CHANGELOG.md +306 -0
- package/README.md +119 -48
- package/bin/adiff.js +3 -2
- package/dist/main.js +14566 -13523
- package/package.json +6 -4
- package/skills/adiff/SKILL.md +111 -38
package/.agents/adr/README.md
CHANGED
|
@@ -15,6 +15,9 @@ the way it is, why it is tested the way it is. ADRs explain choices that outlive
|
|
|
15
15
|
| [ADR-002](ADR-002-effect-v4-and-module-boundaries.md) | Effect v4, and modules sealed behind `index.ts` |
|
|
16
16
|
| [ADR-003](ADR-003-blackbox-testdriver.md) | Black-box tests through a TestDriver, and no unit tests |
|
|
17
17
|
| [ADR-004](ADR-004-pnpm-native-releases.md) | pnpm's own release tooling instead of Changesets |
|
|
18
|
+
| [ADR-005](ADR-005-a-mechanical-style-contract.md) | Style is a lint rule, not a document |
|
|
19
|
+
| [ADR-006](ADR-006-the-terminal-runs-on-effect.md) | The terminal runs on Effect |
|
|
20
|
+
| [ADR-007](ADR-007-model-with-effect-not-only-run-on-it.md) | Model with Effect, not only run on it |
|
|
18
21
|
|
|
19
22
|
## Writing one
|
|
20
23
|
|
package/.agents/prd/README.md
CHANGED
|
@@ -16,7 +16,7 @@ PRDs are not the place for every implementation detail. Use the split below:
|
|
|
16
16
|
- Read `CONTEXT.md` next. The glossary defines the vocabulary every PRD reuses. adiff has a short
|
|
17
17
|
language on purpose; a synonym invented in a PRD is a defect.
|
|
18
18
|
- Read the PRD that owns the behavior. Follow its links to ADRs for durable choices and issues for
|
|
19
|
-
implementation
|
|
19
|
+
implementation layers.
|
|
20
20
|
|
|
21
21
|
## How to write a new PRD
|
|
22
22
|
|
|
@@ -64,7 +64,7 @@ Before treating a PRD as ready:
|
|
|
64
64
|
|
|
65
65
|
- [ ] Problem stated from the reviewer's or the agent's perspective, not the code's.
|
|
66
66
|
- [ ] Solution stated as observable behavior, before any implementation choice is named.
|
|
67
|
-
- [ ] User
|
|
67
|
+
- [ ] User layers cover the happy path, the empty result, the refusal, and the stale case.
|
|
68
68
|
- [ ] Implementation Decisions are concrete enough that two engineers would build interchangeable
|
|
69
69
|
implementations.
|
|
70
70
|
- [ ] File paths, helper names, and rollout order live in GitHub issues.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,311 @@
|
|
|
1
1
|
# @eliya-oss/agent-diff
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.51
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- The file list stops ending without saying so. It reserved a row for `… N more` whether or not one was needed, and that row paid for the pane's padding instead, so the count was clipped and the list just stopped. `h` now closes the folder the cursor's file is in and then walks outward one folder per press, with `l` opening them again from the outside in, so a deep tree can be folded down to something that fits.
|
|
8
|
+
|
|
9
|
+
## 0.1.0-alpha.50
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- `adiff upgrade` says the command it ran and the version it landed on, and stops there. It used to open with which package manager installed the build, which registry tag mattered and what it was about to do, which is four paragraphs standing between you and the one fact you asked for. Upgrading now also rewrites the adiff skill wherever it is already installed, so an agent is not left reading last month's instructions; `adiff skill refresh` does that on its own, and neither installs a skill that was not already there.
|
|
14
|
+
|
|
15
|
+
## 0.1.0-alpha.49
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- `z` gives the diff the whole window: it clears the review panel as well as the file list, and pressing it again brings back whatever was there before. The key that hides the panel on its own, `a`, is named in the footer instead of only in the sheet of keys.
|
|
20
|
+
|
|
21
|
+
## 0.1.0-alpha.48
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- `review open` and `review pane` take `--branch`, so an agent handing over a review can name the branch and land the reviewer on its diff rather than on the worktree list. `F` shows the whole file the change sits in and `F` again gives the diff back, returning to whatever context width you had chosen.
|
|
26
|
+
|
|
27
|
+
- A wide terminal now carries the whole review beside the diff: what you have staged, what the agent already has, and what it has answered, in one panel you can walk with `tab` and open with `enter`. When an answer lands while you are reading, the panel names the comment it answers instead of only counting it, so you can tell whether pulling is worth doing before you press `r`.
|
|
28
|
+
|
|
29
|
+
- The wheel scrolls the sheet of keys you are looking at rather than the diff behind it. Reading the branch again with `r` keeps the lines you were looking at where they were, instead of moving them to an edge of the pane.
|
|
30
|
+
|
|
31
|
+
- Writing a comment has a caret: `left` and `right` move it, `alt` with either moves a word, `home` and `end` reach the ends of the line, and typing, `backspace` and `delete` all act where it stands, so fixing a typo near the start of a sentence no longer costs the rest of it.
|
|
32
|
+
|
|
33
|
+
## 0.1.0-alpha.47
|
|
34
|
+
|
|
35
|
+
### Minor Changes
|
|
36
|
+
|
|
37
|
+
- `adiff upgrade` upgrades. It runs the command for the install it found instead of printing it, shows the package manager working, and ends by naming the version you now have. `--check` reports without running, `--run` still works and does nothing, and a route adiff cannot do for you, a downloaded binary or a checkout, explains why and exits 1.
|
|
38
|
+
|
|
39
|
+
## 0.1.0-alpha.46
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- Make the pull request reachable: p opens it from the review as well as the worktree list, the footer names the key where there is one to open, the review header says which state it is in, and a list that could not ask says so instead of looking like nobody has a pull request.
|
|
44
|
+
|
|
45
|
+
## 0.1.0-alpha.45
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- Use the room a wide terminal has: panels keep a whole command title and a whole match, a tall screen lists more keys, and a long worktree name is read to its end.
|
|
50
|
+
|
|
51
|
+
## 0.1.0-alpha.44
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- A file buried deep in a nested tree can be read: the file list keeps both ends of a name that does not fit, so two files whose names end the same way no longer draw as one row, and the header names the file you are on instead of letting the path run off the edge of the terminal.
|
|
56
|
+
|
|
57
|
+
## 0.1.0-alpha.43
|
|
58
|
+
|
|
59
|
+
### Patch Changes
|
|
60
|
+
|
|
61
|
+
- Build the Linux release binaries again. The terminal library ships one native package per platform and libc, and pnpm skips the musl ones on a glibc runner, so the compiler could not find the musl library it still has to bundle and both Linux builds stopped there. Installs now take both libc flavours, and every pull request compiles all four binaries and checks they answer with no runtime on PATH, so a broken binary shows up before a release does. The release also tracks the newest Bun rather than a pinned one.
|
|
62
|
+
|
|
63
|
+
## 0.1.0-alpha.42
|
|
64
|
+
|
|
65
|
+
### Minor Changes
|
|
66
|
+
|
|
67
|
+
- Renames on the merits, now that nothing depends on the old names: `comment threads` is `comment list`, `comment add` is `comment send`, `review submit` is `review send`, `file vouch` is `file review`, and `--asks` is `--question`. `comment drop` is gone, folded into `comment remove`. Every command that acts on a review now takes either `--worktree`, or `--repo` with `--branch`.
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- `--help` works on every command and every noun, the top-level list is grouped by what you are trying to do, a mistyped command names the one you meant, and a missing option says which command wanted it.
|
|
72
|
+
|
|
73
|
+
## 0.1.0-alpha.41
|
|
74
|
+
|
|
75
|
+
### Patch Changes
|
|
76
|
+
|
|
77
|
+
- Build the release binaries with a version of Bun that exists. The workflow asked for 1.4.0, which was never published, so every binary download answered 404. No release since the workflow landed has carried binaries or updated the Homebrew formula.
|
|
78
|
+
|
|
79
|
+
## 0.1.0-alpha.40
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- `adiff upgrade` answers in plain english, starting with what happened: already the newest build, a newer one is out, or the registry never answered. `--json` gives the envelope back to a caller.
|
|
84
|
+
|
|
85
|
+
## 0.1.0-alpha.39
|
|
86
|
+
|
|
87
|
+
### Patch Changes
|
|
88
|
+
|
|
89
|
+
- `adiff upgrade` works out how this copy was installed and names the one command that updates it, and the terminal mentions a newer version once in the footer without ever checking on a command's path.
|
|
90
|
+
|
|
91
|
+
## 0.1.0-alpha.38
|
|
92
|
+
|
|
93
|
+
### Patch Changes
|
|
94
|
+
|
|
95
|
+
- adiff --version answers from a version built into the bundle rather than a package.json found beside it, and a Bun runtime opens the terminal itself instead of going looking for a Node it does not need.
|
|
96
|
+
|
|
97
|
+
## 0.1.0-alpha.37
|
|
98
|
+
|
|
99
|
+
### Patch Changes
|
|
100
|
+
|
|
101
|
+
- The footer carries the keys a review is made of, and ? lists every key the screen answers to.
|
|
102
|
+
|
|
103
|
+
## 0.1.0-alpha.36
|
|
104
|
+
|
|
105
|
+
### Patch Changes
|
|
106
|
+
|
|
107
|
+
- A review belongs to the branch it describes, the worktree list names the repository it opened and marks where you are, and the pull request opens from the list.
|
|
108
|
+
|
|
109
|
+
## 0.1.0-alpha.35
|
|
110
|
+
|
|
111
|
+
### Patch Changes
|
|
112
|
+
|
|
113
|
+
- A comment can be removed from the review and restored, and the record keeps it either way.
|
|
114
|
+
|
|
115
|
+
## 0.1.0-alpha.34
|
|
116
|
+
|
|
117
|
+
### Patch Changes
|
|
118
|
+
|
|
119
|
+
- A file name too long for the tree keeps its end, where the extension and the distinguishing word live.
|
|
120
|
+
|
|
121
|
+
## 0.1.0-alpha.33
|
|
122
|
+
|
|
123
|
+
### Patch Changes
|
|
124
|
+
|
|
125
|
+
- The store reports a damaged file instead of failing unexpectedly.
|
|
126
|
+
|
|
127
|
+
## 0.1.0-alpha.32
|
|
128
|
+
|
|
129
|
+
### Patch Changes
|
|
130
|
+
|
|
131
|
+
- The skill publishes a reading order on request, and tells the reviewer how to open the review.
|
|
132
|
+
|
|
133
|
+
## 0.1.0-alpha.31
|
|
134
|
+
|
|
135
|
+
### Patch Changes
|
|
136
|
+
|
|
137
|
+
- Coverage counts the changed lines a layer claims, not the hunks a span touches.
|
|
138
|
+
|
|
139
|
+
## 0.1.0-alpha.30
|
|
140
|
+
|
|
141
|
+
### Patch Changes
|
|
142
|
+
|
|
143
|
+
- The palette keeps a command's name clear of its category.
|
|
144
|
+
|
|
145
|
+
## 0.1.0-alpha.29
|
|
146
|
+
|
|
147
|
+
### Patch Changes
|
|
148
|
+
|
|
149
|
+
- First contact teaches the loop, an empty collection says what to do next, and a worktree error explains the path.
|
|
150
|
+
|
|
151
|
+
## 0.1.0-alpha.28
|
|
152
|
+
|
|
153
|
+
### Patch Changes
|
|
154
|
+
|
|
155
|
+
- An agent can open the review in a split pane beside the conversation.
|
|
156
|
+
|
|
157
|
+
## 0.1.0-alpha.27
|
|
158
|
+
|
|
159
|
+
### Minor Changes
|
|
160
|
+
|
|
161
|
+
- adiff init writes the review loop into a repository's agent instructions.
|
|
162
|
+
|
|
163
|
+
## 0.1.0-alpha.26
|
|
164
|
+
|
|
165
|
+
### Patch Changes
|
|
166
|
+
|
|
167
|
+
- A branch with no files left to read says so.
|
|
168
|
+
|
|
169
|
+
## 0.1.0-alpha.25
|
|
170
|
+
|
|
171
|
+
### Patch Changes
|
|
172
|
+
|
|
173
|
+
- The terminal names the key that sends a review, and counts what is waiting.
|
|
174
|
+
|
|
175
|
+
- The repository's own working tree is reviewable and marked here.
|
|
176
|
+
|
|
177
|
+
## 0.1.0-alpha.24
|
|
178
|
+
|
|
179
|
+
### Patch Changes
|
|
180
|
+
|
|
181
|
+
- A selection can be copied, or searched for across the branch's worktree with the matches listed and peeked at.
|
|
182
|
+
|
|
183
|
+
## 0.1.0-alpha.23
|
|
184
|
+
|
|
185
|
+
### Patch Changes
|
|
186
|
+
|
|
187
|
+
- A pinned scope wider than the pane can be panned into view, and the command palette opens over the review list.
|
|
188
|
+
|
|
189
|
+
## 0.1.0-alpha.22
|
|
190
|
+
|
|
191
|
+
### Patch Changes
|
|
192
|
+
|
|
193
|
+
- A selection reaching over hidden lines reports the range it will actually comment on.
|
|
194
|
+
|
|
195
|
+
- Composing on a row that carries no line says so instead of opening a panel that cannot send.
|
|
196
|
+
|
|
197
|
+
- The stale mark on the layer rail reads in full at any width.
|
|
198
|
+
|
|
199
|
+
## 0.1.0-alpha.21
|
|
200
|
+
|
|
201
|
+
### Patch Changes
|
|
202
|
+
|
|
203
|
+
- The store answers with the settings effect directly.
|
|
204
|
+
|
|
205
|
+
## 0.1.0-alpha.20
|
|
206
|
+
|
|
207
|
+
### Patch Changes
|
|
208
|
+
|
|
209
|
+
- Homebrew tracks each release.
|
|
210
|
+
|
|
211
|
+
## 0.1.0-alpha.19
|
|
212
|
+
|
|
213
|
+
### Patch Changes
|
|
214
|
+
|
|
215
|
+
- The house style lives in the linter, and a thread can be settled and folded from the terminal.
|
|
216
|
+
|
|
217
|
+
## 0.1.0-alpha.18
|
|
218
|
+
|
|
219
|
+
### Patch Changes
|
|
220
|
+
|
|
221
|
+
- The cursor stops on a thread so it can be settled directly, and a settled thread folds to one row.
|
|
222
|
+
|
|
223
|
+
## 0.1.0-alpha.17
|
|
224
|
+
|
|
225
|
+
### Patch Changes
|
|
226
|
+
|
|
227
|
+
- Say when an agent answers, settle a thread with d, and hold the comments still while the code pans.
|
|
228
|
+
|
|
229
|
+
## 0.1.0-alpha.16
|
|
230
|
+
|
|
231
|
+
### Patch Changes
|
|
232
|
+
|
|
233
|
+
- r reads the worktree list again, and notices reach the home screen.
|
|
234
|
+
|
|
235
|
+
## 0.1.0-alpha.15
|
|
236
|
+
|
|
237
|
+
### Patch Changes
|
|
238
|
+
|
|
239
|
+
- Pan the diff sideways to read past the right edge.
|
|
240
|
+
|
|
241
|
+
- The footer keeps the way out visible on a narrow terminal.
|
|
242
|
+
|
|
243
|
+
- Wrapping keeps every character and is remembered between sessions.
|
|
244
|
+
|
|
245
|
+
## 0.1.0-alpha.14
|
|
246
|
+
|
|
247
|
+
### Patch Changes
|
|
248
|
+
|
|
249
|
+
- V selects the change under the cursor, o grows a selection from its other end, and g and G reach the ends of the worktree list.
|
|
250
|
+
|
|
251
|
+
- w wraps long lines in the diff, and the cursor gutter stops at the last line.
|
|
252
|
+
|
|
253
|
+
## 0.1.0-alpha.13
|
|
254
|
+
|
|
255
|
+
### Patch Changes
|
|
256
|
+
|
|
257
|
+
- Reword or withdraw a staged comment, and see when a thread describes an older commit.
|
|
258
|
+
|
|
259
|
+
## 0.1.0-alpha.12
|
|
260
|
+
|
|
261
|
+
### Patch Changes
|
|
262
|
+
|
|
263
|
+
- An agent can answer a comment, and a reviewer can settle the thread.
|
|
264
|
+
|
|
265
|
+
## 0.1.0-alpha.11
|
|
266
|
+
|
|
267
|
+
### Patch Changes
|
|
268
|
+
|
|
269
|
+
- r reads the branch again, so the agent's newest work appears without leaving the review.
|
|
270
|
+
|
|
271
|
+
## 0.1.0-alpha.10
|
|
272
|
+
|
|
273
|
+
### Patch Changes
|
|
274
|
+
|
|
275
|
+
- The rail shows a layer's prose block by block, each above the file it introduces.
|
|
276
|
+
|
|
277
|
+
- layers show says a stale layer set needs a new revision.
|
|
278
|
+
|
|
279
|
+
## 0.1.0-alpha.9
|
|
280
|
+
|
|
281
|
+
### Patch Changes
|
|
282
|
+
|
|
283
|
+
- A seeded layer covers two files, so the demo shows what a layer spanning files looks like.
|
|
284
|
+
|
|
285
|
+
## 0.1.0-alpha.8
|
|
286
|
+
|
|
287
|
+
### Patch Changes
|
|
288
|
+
|
|
289
|
+
- The simulator seeds layers, so a demo run shows them.
|
|
290
|
+
|
|
291
|
+
- The worktree list says whether a branch already has a pull request.
|
|
292
|
+
|
|
293
|
+
## 0.1.0-alpha.7
|
|
294
|
+
|
|
295
|
+
### Patch Changes
|
|
296
|
+
|
|
297
|
+
- A layer's prose reads in the diff, above the code it introduces.
|
|
298
|
+
|
|
299
|
+
## 0.1.0-alpha.6
|
|
300
|
+
|
|
301
|
+
### Patch Changes
|
|
302
|
+
|
|
303
|
+
- The diff holds still when a trackpad gesture drifts sideways.
|
|
304
|
+
|
|
305
|
+
- The reading order an agent writes is called layers. adiff layers set and adiff layers show replace the story verbs, and the JSON carries layers where it carried steps.
|
|
306
|
+
|
|
307
|
+
- A layer lists the files it covers, and the footer says how to switch between layers and files.
|
|
308
|
+
|
|
3
309
|
## 0.1.0-alpha.5
|
|
4
310
|
|
|
5
311
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -2,76 +2,143 @@
|
|
|
2
2
|
|
|
3
3
|
# adiff
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
An agent finishes a piece of work and leaves you a diff. You read it without knowing why any of it
|
|
6
|
+
was written that way, and asking means describing a line back in prose and reading the reply
|
|
7
|
+
somewhere far from the code it concerns. On a large change you carry the whole review in your head,
|
|
8
|
+
and it ends when your patience does.
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
adiff puts the conversation on the code. You comment on the lines in a terminal, the agent that
|
|
11
|
+
wrote them answers under your words, and a point stays open until you settle it.
|
|
12
|
+
|
|
13
|
+
The agent can also hand you a reading order: its own diff in layers, a note on each, and a coverage
|
|
14
|
+
check so nothing is quietly left out of the story.
|
|
15
|
+
|
|
16
|
+
<pre align="center">npm i -g @eliya-oss/agent-diff@alpha</pre>
|
|
17
|
+
|
|
18
|
+
<p align="center"><a href="docs/install.md">Other ways to install</a></p>
|
|
19
|
+
|
|
20
|
+
<img src="assets/terminal.webp" alt="The adiff worktree list, showing seven branches with their sizes, layers and review state" width="820">
|
|
11
21
|
|
|
12
22
|
</div>
|
|
13
23
|
|
|
14
|
-
##
|
|
24
|
+
## The loop
|
|
25
|
+
|
|
26
|
+
You comment on a line:
|
|
15
27
|
|
|
16
28
|
```bash
|
|
17
|
-
adiff
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
adiff comment stage --repo . --branch add-teammate-invitations --file src/api/invitations.ts --start 4 --end 5 --body "why"
|
|
21
|
-
adiff review submit --repo . --branch add-teammate-invitations
|
|
22
|
-
adiff file vouch --repo . --branch add-teammate-invitations --file src/api/invitations.ts
|
|
23
|
-
adiff story show --worktree . --fields covered,total,uncovered
|
|
24
|
-
adiff describe
|
|
29
|
+
adiff comment send --repo . --branch add-teammate-invitations \
|
|
30
|
+
--file src/api/invitations.ts --start 12 --end 13 \
|
|
31
|
+
--body "Three status checks in a row. One error shape would do."
|
|
25
32
|
```
|
|
26
33
|
|
|
27
|
-
|
|
28
|
-
sends the whole set as one wake-up, so the agent reads a review rather than a stream of remarks.
|
|
34
|
+
The agent in that worktree collects it, carrying the code it was written against:
|
|
29
35
|
|
|
30
|
-
|
|
36
|
+
```bash
|
|
37
|
+
adiff comment take --worktree .
|
|
38
|
+
{"ok":true,"comments":[{"id":"1c43cb55-6a09-406d-95ad-f048c43e05f5","file":"src/api/invitations.ts",
|
|
39
|
+
"side":"new","start":12,"end":13,"head":"63c11ce3",
|
|
40
|
+
"snippet":" if (res.status === 409) throw new AlreadyInvited(email)\n ...",
|
|
41
|
+
"body":"Three status checks in a row. One error shape would do."}]}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
It does the work, then answers the comment it was handed:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
adiff comment answer --worktree . --id 1c43cb55-6a09-406d-95ad-f048c43e05f5 \
|
|
48
|
+
--body "Folded them into one InviteRejected carrying the reason."
|
|
49
|
+
{"ok":true,"answered":1}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
You see that answer under your own words the next time you read the branch, and the thread waits
|
|
53
|
+
there until you settle it with `d`:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
adiff comment list --repo . --branch add-teammate-invitations
|
|
57
|
+
{"ok":true,"comments":[{"id":"1c43cb55-6a09-406d-95ad-f048c43e05f5","state":"answered",
|
|
58
|
+
"stale":false,"answers":[{"body":"Folded them into one InviteRejected carrying the reason.",
|
|
59
|
+
"asks":false}]}]}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`--question` on an answer marks the thread as waiting on you, for a decision the agent needs before
|
|
63
|
+
it can carry on. Settling is yours alone: the agent that raised the answer cannot close the point.
|
|
31
64
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
a comment, `ctrl+s` sends it and `ctrl+a` adds it to the review instead. `m` marks a file reviewed,
|
|
35
|
-
`ctrl+p` finds any command by name, and the footer lists the keys for wherever you are.
|
|
65
|
+
Every command that acts on a review takes either `--worktree <path>` or `--repo <path>` with
|
|
66
|
+
`--branch <name>`, so the same command works from your checkout and from the agent's worktree.
|
|
36
67
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
as it was. Opened lines are ordinary lines: you can select them and comment on them.
|
|
68
|
+
A comment is handed over exactly once, so a second `take` returns only what was written since. Add
|
|
69
|
+
`--wait 300` and it blocks until something arrives, which costs nothing while it waits.
|
|
40
70
|
|
|
41
|
-
## The
|
|
71
|
+
## The reading order
|
|
42
72
|
|
|
43
|
-
|
|
73
|
+
An agent knows the order it built a change in. Rebuilding that order by reading forty files is the
|
|
74
|
+
expensive way to learn something it already has, so it can publish the reading itself when you ask
|
|
75
|
+
for one:
|
|
44
76
|
|
|
45
77
|
```bash
|
|
46
|
-
adiff
|
|
47
|
-
adiff comment take --worktree . --wait 300 # block until something arrives
|
|
78
|
+
adiff layers set --worktree . --json -
|
|
48
79
|
```
|
|
49
80
|
|
|
50
|
-
Each
|
|
51
|
-
|
|
81
|
+
Each layer is a claim over spans of the diff, with a note saying what the layer is for. The terminal
|
|
82
|
+
lists them in the sidebar and scopes the diff to the layer you are on, with the prose sitting above
|
|
83
|
+
the code it describes.
|
|
52
84
|
|
|
53
|
-
|
|
54
|
-
files, set with `adiff story set --worktree . --json -`. Where a branch has one, the terminal lists
|
|
55
|
-
its steps and scopes the diff to the step you are on. adiff computes the coverage itself, so a story
|
|
56
|
-
cannot hide code:
|
|
85
|
+
adiff computes the coverage itself, so the reading cannot hide code:
|
|
57
86
|
|
|
58
87
|
```bash
|
|
59
|
-
adiff
|
|
60
|
-
{"ok":true,"
|
|
88
|
+
adiff layers show --worktree . --fields covered,total,uncovered
|
|
89
|
+
{"ok":true,"layers":{"covered":3,"total":3,"uncovered":[]}}
|
|
61
90
|
```
|
|
62
91
|
|
|
63
|
-
|
|
92
|
+
Any hunk no layer claims is reported here and shown to you under "not in any layer". The layers
|
|
93
|
+
record the commit they were written for, and adiff marks them stale once the branch moves past it.
|
|
94
|
+
|
|
95
|
+
## Reviewing
|
|
96
|
+
|
|
97
|
+
`adiff review open --repo .` lists the worktrees with something to review, including the checkout
|
|
98
|
+
you are standing in. Enter opens one.
|
|
99
|
+
|
|
100
|
+
`j` and `k` move down the diff, `[` and `]` between files, `v` starts a selection and `c` writes a
|
|
101
|
+
comment. `ctrl+s` sends it on its own, `ctrl+a` adds it to a review you send in one go with `S`. `m`
|
|
102
|
+
marks a file reviewed, `d` settles the thread you are on, `s` swaps the sidebar between layers and
|
|
103
|
+
files, `w` wraps long lines, `/` searches for what you selected, `r` reads the branch again, and
|
|
104
|
+
`ctrl+p` finds any command by name. The footer lists the keys for wherever you are.
|
|
105
|
+
|
|
106
|
+
Where the diff leaves lines out, a row says how many. Put the cursor on it and `l` brings ten of them
|
|
107
|
+
back where you stand, `h` puts them away, and the rest of the file stays as small as it was. Opened
|
|
108
|
+
lines are ordinary lines: select them and comment on them.
|
|
109
|
+
|
|
110
|
+
## Setting up a repository
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
adiff init # shows what it would write
|
|
114
|
+
adiff init --write # writes it
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Writes a short passage into `AGENTS.md` and a `CLAUDE.md` that imports it, telling any agent working
|
|
118
|
+
in that repository how the handover runs. It sits between `<!-- adiff:begin -->` and
|
|
119
|
+
`<!-- adiff:end -->`, so a second run changes nothing and removing it is deleting a block you can
|
|
120
|
+
see. `--skill` also writes the full skill into `.claude/skills/adiff/`.
|
|
121
|
+
|
|
122
|
+
For a per-machine install instead:
|
|
64
123
|
|
|
65
124
|
```bash
|
|
66
125
|
npx skills add Newbie012/agent-diff --skill adiff
|
|
67
126
|
```
|
|
68
127
|
|
|
69
|
-
|
|
128
|
+
When someone asks for a review, the agent can put it in front of them:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
adiff review pane --repo .
|
|
132
|
+
{"ok":true,"opened":true,"pane":"tmux","command":"adiff review open --repo /work/api"}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
It splits tmux, Zellij, WezTerm or kitty. Anywhere else it answers `opened:false` and carries the
|
|
136
|
+
command to run, so the agent quotes one line rather than a paragraph.
|
|
70
137
|
|
|
71
138
|
## Requirements
|
|
72
139
|
|
|
73
|
-
Either install gives you an `adiff` on your PATH. Brew brings a Node 26 along with it, so
|
|
74
|
-
|
|
140
|
+
Either install gives you an `adiff` on your PATH. Brew brings a Node 26 along with it, so everything
|
|
141
|
+
works the moment it finishes.
|
|
75
142
|
|
|
76
143
|
The commands run on Node 22 or newer. The terminal is the one part that wants Node 26: it draws
|
|
77
144
|
through opentui, which reaches its native renderer over `node:ffi`, a module Node exposes behind
|
|
@@ -79,6 +146,8 @@ through opentui, which reaches its native renderer over `node:ffi`, a module Nod
|
|
|
79
146
|
Node 26 among your fnm, nvm, asdf, volta and Homebrew installs and runs the terminal on that, so a
|
|
80
147
|
global npm install keeps working across a version switch.
|
|
81
148
|
|
|
149
|
+
## Trying it
|
|
150
|
+
|
|
82
151
|
pnpm 12 is a Rust rewrite and still in beta, so
|
|
83
152
|
[corepack cannot install it](https://pnpm.io/installation):
|
|
84
153
|
|
|
@@ -90,19 +159,21 @@ pnpm install
|
|
|
90
159
|
|
|
91
160
|
`pnpm simulate` builds a throwaway repository with seven branches an agent has already worked on,
|
|
92
161
|
from a three-file error type up to a 42-file migration of just over a thousand lines each way, and
|
|
93
|
-
opens the terminal on it. Your real repos and `~/.adiff` are untouched, and the workspace
|
|
94
|
-
|
|
162
|
+
opens the terminal on it. Your real repos and `~/.adiff` are untouched, and the workspace goes when
|
|
163
|
+
you quit. `pnpm simulate --probe` runs the whole round trip headless and prints it:
|
|
95
164
|
|
|
96
165
|
```
|
|
97
|
-
branches {"ok":true,"branches":[{"branch":"add-teammate-invitations","files":3,"added":27,"removed":2,...
|
|
98
|
-
|
|
99
|
-
agent takes {"ok":true,"comments":[{"file":"src/api/
|
|
100
|
-
"snippet":" if (res.status ===
|
|
101
|
-
"body":"
|
|
166
|
+
branches {"ok":true,"branches":[{"branch":"add-teammate-invitations","files":3,"added":27,"removed":2,"layers":2,...
|
|
167
|
+
reviewed {"ok":true,"reviewed":["src/api/invitations.ts"],"total":3}
|
|
168
|
+
agent takes {"ok":true,"comments":[{"id":"a83fc98c-8397-44f5-9c37-731a1cf3cb4c","file":"src/api/invitations.ts",
|
|
169
|
+
"side":"new","start":12,"end":13,"snippet":" if (res.status === 409) throw new AlreadyInvited(email)...",
|
|
170
|
+
"body":"Three status checks in a row. One error shape would do."}]}
|
|
102
171
|
```
|
|
103
172
|
|
|
104
173
|
## Notes
|
|
105
174
|
|
|
175
|
+
adiff is alpha, and one person's tool. Every release goes out under the `alpha` tag.
|
|
176
|
+
|
|
106
177
|
Everything the terminal does is also a command, so nothing is trapped in the UI. Each command prints
|
|
107
178
|
one compact JSON line on stdout and exits 0, and `--fields` trims the answer to what you read:
|
|
108
179
|
|
|
@@ -114,7 +185,7 @@ adiff branch list --repo . --fields branch,files
|
|
|
114
185
|
Failures go to stderr as `{"ok":false,"error":{...}}`, so stdout is always parseable, with an exit
|
|
115
186
|
code saying what to do about it: `2` malformed request, `3` not found, `1` unexpected. Every error
|
|
116
187
|
carries a `suggestion` naming the command that resolves it, and `adiff describe` returns the whole
|
|
117
|
-
catalog as JSON so a caller can discover the
|
|
188
|
+
catalog as JSON so a caller can discover the rest.
|
|
118
189
|
|
|
119
190
|
Project docs live in `.agents/`. `AGENTS.md` covers making a change, `ARCHITECTURE.md` how the code
|
|
120
191
|
is laid out.
|
package/bin/adiff.js
CHANGED
|
@@ -33,8 +33,9 @@ const drawsTerminal = (argv) => {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
const rendersHere = () =>
|
|
36
|
-
|
|
37
|
-
process.getBuiltinModule
|
|
36
|
+
process.versions.bun !== undefined ||
|
|
37
|
+
(typeof process.getBuiltinModule === "function" &&
|
|
38
|
+
process.getBuiltinModule("node:ffi") !== undefined)
|
|
38
39
|
|
|
39
40
|
const NODE_DIRECTORY = /^(?:v?\d|node)/
|
|
40
41
|
|