@eliya-oss/agent-diff 0.1.0-alpha.16 β 0.1.0-alpha.160
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/.claude/skills/create-pr/SKILL.md +137 -0
- package/.claude/skills/release-notes/SKILL.md +283 -0
- package/CHANGELOG.md +1465 -0
- package/README.md +27 -99
- package/bin/adiff.js +6 -2
- package/dist/main.js +20816 -14528
- package/package.json +13 -7
- package/skills/adiff/SKILL.md +182 -32
package/README.md
CHANGED
|
@@ -2,121 +2,49 @@
|
|
|
2
2
|
|
|
3
3
|
# adiff
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
An agent finishes a piece of work and leaves you a diff. adiff puts the conversation on the code:
|
|
6
|
+
you comment on the lines in a terminal, the agent that wrote them answers under your words, and a
|
|
7
|
+
point stays open until you settle it.
|
|
8
8
|
|
|
9
|
-
<pre align="center">brew install Newbie012/tap/adiff
|
|
10
|
-
|
|
9
|
+
<pre align="center">brew install Newbie012/tap/adiff</pre>
|
|
10
|
+
<pre align="center">npx skills add Newbie012/agent-diff --skill adiff -g</pre>
|
|
11
11
|
|
|
12
|
-
</
|
|
13
|
-
|
|
14
|
-
## Usage
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
adiff review open --repo .
|
|
18
|
-
adiff branch list --repo . --fields branch,files
|
|
19
|
-
adiff comment add --repo . --branch add-teammate-invitations --file src/api/invitations.ts --start 4 --end 5 --body "why"
|
|
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 layers show --worktree . --fields covered,total,uncovered
|
|
24
|
-
adiff describe
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
`comment add` reaches the agent right away. `comment stage` holds a comment until `review submit`
|
|
28
|
-
sends the whole set as one wake-up, so the agent reads a review rather than a stream of remarks.
|
|
29
|
-
|
|
30
|
-
## Reviewing
|
|
31
|
-
|
|
32
|
-
`adiff review open --repo .` lists the worktrees that have something to review. Enter opens one,
|
|
33
|
-
`j` and `k` move down the diff, `[` and `]` move between files, `v` starts a selection, `c` writes
|
|
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.
|
|
12
|
+
<p align="center"><a href="docs/install.md">Other ways to install</a></p>
|
|
36
13
|
|
|
37
|
-
|
|
38
|
-
them back where you are standing, `h` puts them away again, and the rest of the file stays as small
|
|
39
|
-
as it was. Opened lines are ordinary lines: you can select them and comment on them.
|
|
14
|
+
<img src="assets/terminal.webp" alt="The adiff worktree list, showing seven branches with their sizes, layers and review state" width="820">
|
|
40
15
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
In the worktree being reviewed:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
adiff comment take --worktree . # everything written since the last take
|
|
47
|
-
adiff comment take --worktree . --wait 300 # block until something arrives
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Each comment carries the exact snippet it was written against, the side of the diff, and the commit
|
|
51
|
-
the diff was read at, so the agent needs no other reference. A comment is handed over once.
|
|
52
|
-
|
|
53
|
-
An agent can also record the reading order for its own work as a layers: ordered layers over spans of
|
|
54
|
-
files, set with `adiff layers set --worktree . --json -`. Where a branch has one, the terminal lists
|
|
55
|
-
its layers and scopes the diff to the layer you are on. adiff computes the coverage itself, so a layers
|
|
56
|
-
cannot hide code:
|
|
16
|
+
</div>
|
|
57
17
|
|
|
58
|
-
|
|
59
|
-
adiff layers show --worktree . --fields covered,total,uncovered
|
|
60
|
-
{"ok":true,"layers":{"covered":1,"total":3,"uncovered":[{"path":"docs/incidents.md","start":1,"end":6},{"path":"src/api/errors.ts","start":1,"end":11}]}}
|
|
61
|
-
```
|
|
18
|
+
### Features
|
|
62
19
|
|
|
63
|
-
|
|
20
|
+
- β‘ **Live review** - A comment reaches the agent at once, and it starts work.
|
|
21
|
+
- π¬ **Answers in place** - The agent replies under your comment, or asks you to decide.
|
|
22
|
+
- πΏ **Review in parallel** - Keep several agents going from one list of branches.
|
|
23
|
+
- π **Pull request remarks** - Turn them on, then accept or dismiss each one without leaving the terminal.
|
|
24
|
+
- πΊοΈ **Read in layers** - Follow the agent's own order, or read the diff by file.
|
|
64
25
|
|
|
65
|
-
|
|
66
|
-
npx skills add Newbie012/agent-diff --skill adiff
|
|
67
|
-
```
|
|
26
|
+
### Usage
|
|
68
27
|
|
|
69
|
-
|
|
28
|
+
1. Install adiff and its skill with the two commands above.
|
|
29
|
+
2. In your agent, run `/adiff layer this work and hand it over for review`.
|
|
30
|
+
3. Comment on the lines. The agent answers under your words, and `?` lists every key.
|
|
70
31
|
|
|
71
32
|
## Requirements
|
|
72
33
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
through opentui, which reaches its native renderer over `node:ffi`, a module Node exposes behind
|
|
78
|
-
`--experimental-ffi` from 26 onward. When you open the terminal on an older Node, adiff looks for a
|
|
79
|
-
Node 26 among your fnm, nvm, asdf, volta and Homebrew installs and runs the terminal on that, so a
|
|
80
|
-
global npm install keeps working across a version switch.
|
|
81
|
-
|
|
82
|
-
pnpm 12 is a Rust rewrite and still in beta, so
|
|
83
|
-
[corepack cannot install it](https://pnpm.io/installation):
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
corepack disable pnpm
|
|
87
|
-
npm install -g --allow-scripts=pnpm pnpm@next-12
|
|
88
|
-
pnpm install
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
`pnpm simulate` builds a throwaway repository with seven branches an agent has already worked on,
|
|
92
|
-
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 is removed
|
|
94
|
-
when you quit. `pnpm simulate --probe` runs the whole round trip headless and prints it:
|
|
95
|
-
|
|
96
|
-
```
|
|
97
|
-
branches {"ok":true,"branches":[{"branch":"add-teammate-invitations","files":3,"added":27,"removed":2,...
|
|
98
|
-
vouch {"ok":true,"vouched":["src/api/incidents.ts"],"total":3}
|
|
99
|
-
agent takes {"ok":true,"comments":[{"file":"src/api/incidents.ts","side":"new","start":12,"end":13,
|
|
100
|
-
"snippet":" if (res.status === 404) throw new IncidentNotFound(id)\n if (!res.ok) ...",
|
|
101
|
-
"body":"Two throws where one union would do."}]}
|
|
102
|
-
```
|
|
34
|
+
The Homebrew formula installs one compiled binary, which draws the terminal itself and needs no Node
|
|
35
|
+
at all. A global npm install runs on Node 22 or newer, and the terminal there needs Node 26: adiff
|
|
36
|
+
finds one among your fnm, nvm, asdf, volta and Homebrew installs and runs the terminal on that, and
|
|
37
|
+
says so when there is none, while every other command runs where you are.
|
|
103
38
|
|
|
104
39
|
## Notes
|
|
105
40
|
|
|
106
|
-
|
|
107
|
-
one compact JSON line on stdout and exits 0, and `--fields` trims the answer to what you read:
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
adiff branch list --repo . --fields branch,files
|
|
111
|
-
{"ok":true,"branches":[{"branch":"add-teammate-invitations","files":3}]}
|
|
112
|
-
```
|
|
41
|
+
adiff is alpha, and one person's tool. Every release goes out under the `alpha` tag.
|
|
113
42
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
catalog as JSON so a caller can discover the commands.
|
|
43
|
+
The [wiki](https://github.com/Newbie012/agent-diff/wiki) is the documentation: installing adiff, a
|
|
44
|
+
walkthrough of one review, every key, the commands an agent runs, and what to do when something goes
|
|
45
|
+
wrong. Its pages are written in `wiki/` in this repository and published from there.
|
|
118
46
|
|
|
119
|
-
|
|
47
|
+
The project docs live in `.agents/`: `AGENTS.md` covers making a change, `ARCHITECTURE.md` how the code
|
|
120
48
|
is laid out.
|
|
121
49
|
|
|
122
50
|
## License
|
package/bin/adiff.js
CHANGED
|
@@ -27,14 +27,18 @@ const MESSAGE = [
|
|
|
27
27
|
"Every other adiff command runs here. Install Node 26 to open the terminal.",
|
|
28
28
|
].join("\n")
|
|
29
29
|
|
|
30
|
+
const watched = () => process.stdout.isTTY && process.stdin.isTTY
|
|
31
|
+
|
|
30
32
|
const drawsTerminal = (argv) => {
|
|
31
33
|
const words = argv.filter((token) => !token.startsWith("--"))
|
|
34
|
+
if (argv.length === 0) return watched()
|
|
32
35
|
return words[0] === "review" && words[1] === "open"
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
const rendersHere = () =>
|
|
36
|
-
|
|
37
|
-
process.getBuiltinModule
|
|
39
|
+
process.versions.bun !== undefined ||
|
|
40
|
+
(typeof process.getBuiltinModule === "function" &&
|
|
41
|
+
process.getBuiltinModule("node:ffi") !== undefined)
|
|
38
42
|
|
|
39
43
|
const NODE_DIRECTORY = /^(?:v?\d|node)/
|
|
40
44
|
|