@eliya-oss/agent-diff 0.1.0-alpha.146 → 0.1.0-alpha.147

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/CHANGELOG.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.147
4
+
5
+ ### Patch Changes
6
+
7
+ - breaking(CLI): `adiff skill refresh` is gone, and `npx skills update adiff` updates the skill instead.
8
+
9
+ <details><summary>What changed</summary>
10
+
11
+ `skill refresh` looked in `.claude/skills/adiff/SKILL.md` and nowhere else. On Codex, Cursor,
12
+ OpenCode or anything else it found nothing and reported no changes rather than saying it had not
13
+ looked. The skills CLI also installs a symlink by default, so on an ordinary install there was
14
+ nothing there to rewrite that the next `skills update` would not undo.
15
+
16
+ Keeping a second updater working meant matching a registry of seventy-seven agent directories that
17
+ the skills CLI already maintains. `npx skills update adiff` works for every agent and every install.
18
+ An agent holding a skill a version behind gets a refused command with a `suggestion` naming the fix,
19
+ which is what `describe` is for.
20
+
21
+ </details>
22
+
23
+ fix(upgrade): an upgrade names the command that brings the skill up with it.
24
+
25
+ <details><summary>What was wrong</summary>
26
+
27
+ Upgrading adiff left the skill describing the older build, and the line that used to say otherwise
28
+ only ever appeared for a Claude Code install that had been copied rather than linked. The version
29
+ installed is still the second-to-last line; under it sits the one thing left to do.
30
+
31
+ </details>
32
+
33
+ fix(README): the install command no longer picks an agent for you.
34
+
35
+ <details><summary>What was wrong</summary>
36
+
37
+ The documented command was `npx skills add … -g -y -a claude-code`, which installed the skill for
38
+ Claude Code whatever agent the reader actually used, and `-y` suppressed the question that would
39
+ have asked them. The question is the agent picker. `--agent codex`, repeated, or `--agent '*'`
40
+ answers it up front.
41
+
42
+ </details>
43
+
3
44
  ## 0.1.0-alpha.146
4
45
 
5
46
  ### Patch Changes
package/README.md CHANGED
@@ -21,14 +21,15 @@ pick up your comments:
21
21
 
22
22
  ```bash
23
23
  brew install Newbie012/tap/adiff
24
- npx skills add Newbie012/agent-diff --skill adiff -g -y -a claude-code
24
+ npx skills add Newbie012/agent-diff --skill adiff -g
25
25
  ```
26
26
 
27
- The flags matter. `-g` puts the skill in your home directory rather than in the repository you are
28
- standing in, which is what reaches an agent working in a worktree; `-y` and `-a claude-code` answer
29
- the questions the skills CLI asks otherwise. Nothing lands in the repository, so there is nothing to
30
- commit and nothing a teammate inherits — drop `-g` if your team has adopted adiff and wants the skill
31
- in the repo.
27
+ It asks which agent you use — Claude Code, Codex, Cursor, OpenCode and seventy-odd others — or you
28
+ can name it up front with `--agent codex`, more than once for more than one, or `--agent '*'` for all
29
+ of them. `-g` is the flag worth keeping: it puts the skill in your home directory rather than in the
30
+ repository you are standing in, and a skill written into the repository is invisible to an agent
31
+ working in a worktree of it unless you commit it. Drop `-g` if your team has adopted adiff and wants
32
+ it committed.
32
33
 
33
34
  Your agent finds the skill on its own from there.
34
35
 
package/dist/main.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { randomUUID } from "node:crypto";
2
2
  import { appendFile, mkdir, readFile, realpath, rename, rm, stat, writeFile } from "node:fs/promises";
3
- import { homedir, hostname, platform } from "node:os";
4
3
  import { text } from "node:stream/consumers";
5
4
  import { execFile, spawn } from "node:child_process";
6
- import { dirname, join, resolve } from "node:path";
5
+ import { join, resolve } from "node:path";
6
+ import { homedir, hostname, platform } from "node:os";
7
7
  import { promisify } from "node:util";
8
- import { existsSync, lstatSync, mkdirSync, realpathSync, watch } from "node:fs";
9
8
  import { fileURLToPath } from "node:url";
10
9
  import { ASCIIFontRenderable, BoxRenderable, CodeRenderable, LineNumberRenderable, RGBA, StyledText, SyntaxStyle, TextRenderable, TextareaRenderable, bg, createCliRenderer, defaultTextareaKeyBindings, fg, getTreeSitterClient, pathToFiletype, stripAnsiSequences, t } from "@opentui/core";
10
+ import { mkdirSync, watch } from "node:fs";
11
11
  //#region \0rolldown/runtime.js
12
12
  var __defProp = Object.defineProperty;
13
13
  var __esmMin = (fn, res, err) => () => {
@@ -2647,7 +2647,7 @@ var CurrentStackFrame, TracerEnabled, TracerTimingEnabled, TracerSpanAnnotations
2647
2647
  };
2648
2648
  };
2649
2649
  spanCleaner = /*#__PURE__*/ makeStackCleaner(3);
2650
- })), Interrupt, causeInterrupt, findFail, findError$1, hasInterrupts, causeFilterInterruptors, causeCombine, causeMap, causePartition, causeSquash, causePrettyErrors, causePrettyError, causePrettyMessage, locationRegExp, cleanErrorStack, addStackAnnotations, interruptCauseStack, currentStackTrace, causePretty, renderPrettyError, renderErrorCause, FiberTypeId, fiberVariance, fiberIdStore, getCurrentFiber, FiberImpl, deferredInterruptCont, fiberMiddleware, fiberStackAnnotations, fiberAwait, fiberAwaitAll, fiberJoin, fiberInterrupt, fiberInterruptAs, fiberInterruptAll, succeed$5, failCause$3, fail$2, sync$2, suspend$1, yieldNowWith, yieldNow, succeedNone$1, failCauseSync$1, die, failSync, void_$2, try_$1, promise$1, tryPromise$1, withFiberId, callbackOptions, asyncFinalizer, callback$2, never, gen$1, fnUntraced$1, defineFunctionLength, fnStackCleaner, fn$1, makeFn, fnUntracedEager$1, fromIteratorEagerUnsafe, fromIteratorUnsafe, as$1, asSome, andThen$1, tap$1, asVoid$1, raceAllFirst, raceFirst$1, flatMap$1, OnSuccessProto, effectIsExit, flatMapEager$1, map$2, mapEager$1, exitInterrupt$1, exitIsSuccess, exitFilterCause, exitHasInterrupts, exitVoid, exitMap, exitAsVoidAll, updateContext, updateService, contextWith$1, provideContext, provideService, provideServiceImpl, when$1, forever$2, catchCause$1, OnFailureProto, catchCauseFilter, catch_, catchIf, catchTag$1, mapError$1, orElseSucceed$1, ignore$1, option$2, result, matchCauseEffect, OnSuccessAndFailureProto, matchEffect$1, match, matchEager, exit$1, exitPrimitive, ScopeTypeId, ScopeCloseableTypeId, scopeTag, scopeClose, scopeCloseUnsafe, scopeCloseFinalizers, scopeForkUnsafe, scopeAddFinalizerExit, scopeAddFinalizer, scopeAddFinalizerUnsafe, scopeRemoveFinalizerUnsafe, scopeMakeUnsafe, constScopeEmpty, scope, provideScope, scopedWith, acquireRelease$1, onExitPrimitive, onExit$1, ensuring$1, onExitFilter, onError$1, onErrorFilter, onInterrupt$1, acquireUseRelease$1, interrupt$2, uninterruptible$1, setInterruptible, setInterruptibleTrue, setInterruptibleFalse, setFiberInterruptible, interruptible, uninterruptibleMask, all$1, whileLoop$1, forEach$1, forEachSequential, iterateEagerImpl, iterateEager, forEachConcurrent, forkUnsafe$1, forkDetach$1, forkIn$1, runForkWith, runFork$1, runPromiseExitWith, runPromiseWith, runPromise$1, runSyncExitWith, runSyncExit$1, runSyncWith, runSync$1, succeedTrue, succeedFalse, Latch, makeLatchUnsafe, bigint0, NoopSpanProto, noopSpan, filterDisablePropagation, makeSpanUnsafe, provideSpanStackFrame, endSpan, useSpan, provideParentSpan, withParentSpan, withSpan$1, ClockRef, MAX_TIMER_MILLIS, ClockImpl, nanosPerMilli, monotonicNowNanos, wallTimeNanos, clockWith, sleep$1, AsyncFiberErrorTypeId, AsyncFiberError, UnknownErrorTypeId, UnknownError, ConsoleRef, logLevelToOrder, LogLevelOrder, isLogLevelGreaterThan, CurrentLoggers, LogToStderr, LoggerTypeId, LoggerProto, loggerMake, formatLabel, formatLogSpan, logWithLevel, colors, defaultDateFormat, defaultLogger, tracerLogger, init_effect = __esmMin((() => {
2650
+ })), Interrupt, causeInterrupt, findFail, findError$1, hasInterrupts, causeFilterInterruptors, causeCombine, causeMap, causePartition, causeSquash, causePrettyErrors, causePrettyError, causePrettyMessage, locationRegExp, cleanErrorStack, addStackAnnotations, interruptCauseStack, currentStackTrace, causePretty, renderPrettyError, renderErrorCause, FiberTypeId, fiberVariance, fiberIdStore, getCurrentFiber, FiberImpl, deferredInterruptCont, fiberMiddleware, fiberStackAnnotations, fiberAwait, fiberAwaitAll, fiberJoin, fiberInterrupt, fiberInterruptAs, fiberInterruptAll, succeed$5, failCause$3, fail$2, sync$2, suspend$1, yieldNowWith, yieldNow, succeedNone$1, failCauseSync$1, die, failSync, void_$2, try_$1, promise$1, tryPromise$1, withFiberId, callbackOptions, asyncFinalizer, callback$2, never, gen$1, fnUntraced$1, defineFunctionLength, fnStackCleaner, fn$1, makeFn, fnUntracedEager$1, fromIteratorEagerUnsafe, fromIteratorUnsafe, as$1, asSome, andThen$1, tap$1, asVoid$1, raceAllFirst, raceFirst$1, flatMap$1, OnSuccessProto, effectIsExit, flatMapEager$1, map$2, mapEager$1, exitInterrupt$1, exitIsSuccess, exitFilterCause, exitHasInterrupts, exitVoid, exitMap, exitAsVoidAll, updateContext, updateService, contextWith$1, provideContext, provideService, provideServiceImpl, when$1, forever$2, catchCause$1, OnFailureProto, catchCauseFilter, catch_, catchIf, catchTag$1, mapError$1, orElseSucceed$1, ignore$1, result, matchCauseEffect, OnSuccessAndFailureProto, matchEffect$1, match, matchEager, exit$1, exitPrimitive, ScopeTypeId, ScopeCloseableTypeId, scopeTag, scopeClose, scopeCloseUnsafe, scopeCloseFinalizers, scopeForkUnsafe, scopeAddFinalizerExit, scopeAddFinalizer, scopeAddFinalizerUnsafe, scopeRemoveFinalizerUnsafe, scopeMakeUnsafe, constScopeEmpty, scope, provideScope, scopedWith, acquireRelease$1, onExitPrimitive, onExit$1, ensuring$1, onExitFilter, onError$1, onErrorFilter, onInterrupt$1, acquireUseRelease$1, interrupt$2, uninterruptible$1, setInterruptible, setInterruptibleTrue, setInterruptibleFalse, setFiberInterruptible, interruptible, uninterruptibleMask, all$1, whileLoop$1, forEach$1, forEachSequential, iterateEagerImpl, iterateEager, forEachConcurrent, forkUnsafe$1, forkDetach$1, forkIn$1, runForkWith, runFork$1, runPromiseExitWith, runPromiseWith, runPromise$1, runSyncExitWith, runSyncExit$1, runSyncWith, runSync$1, succeedTrue, succeedFalse, Latch, makeLatchUnsafe, bigint0, NoopSpanProto, noopSpan, filterDisablePropagation, makeSpanUnsafe, provideSpanStackFrame, endSpan, useSpan, provideParentSpan, withParentSpan, withSpan$1, ClockRef, MAX_TIMER_MILLIS, ClockImpl, nanosPerMilli, monotonicNowNanos, wallTimeNanos, clockWith, sleep$1, AsyncFiberErrorTypeId, AsyncFiberError, UnknownErrorTypeId, UnknownError, ConsoleRef, logLevelToOrder, LogLevelOrder, isLogLevelGreaterThan, CurrentLoggers, LogToStderr, LoggerTypeId, LoggerProto, loggerMake, formatLabel, formatLogSpan, logWithLevel, colors, defaultDateFormat, defaultLogger, tracerLogger, init_effect = __esmMin((() => {
2651
2651
  init_Array();
2652
2652
  init_Context();
2653
2653
  init_Duration();
@@ -3464,10 +3464,6 @@ var CurrentStackFrame, TracerEnabled, TracerTimingEnabled, TracerSpanAnnotations
3464
3464
  onSuccess: (_) => void_$2
3465
3465
  });
3466
3466
  });
3467
- option$2 = (self) => match(self, {
3468
- onFailure: none,
3469
- onSuccess: some
3470
- });
3471
3467
  result = (self) => matchEager(self, {
3472
3468
  onFailure: fail$3,
3473
3469
  onSuccess: succeed$6
@@ -4690,7 +4686,7 @@ var retryOrElse, retry$1, passthroughForever, buildFromOptions, init_schedule =
4690
4686
  if (options.times !== void 0) schedule = while_(schedule, ({ attempt }) => succeed$5(attempt <= options.times));
4691
4687
  return schedule;
4692
4688
  };
4693
- })), all, forEach, whileLoop, promise, tryPromise, succeed$1, succeedNone, suspend, sync, void_, callback$1, gen, fail, failCause, failCauseSync, try_, withFiber, flatMap, andThen, tap, option$1, exit, map, as, asVoid, catchTag, catchCause, mapError, retry, ignore, orElseSucceed, sleep, raceFirst, when, contextWith, provide, acquireRelease, acquireUseRelease, ensuring, onError, onExit, interrupt$1, onInterrupt, uninterruptible, forever, withSpan, forkIn, forkDetach, runFork, runPromise, runSync, runSyncExit, fnUntraced, fn, mapEager, flatMapEager, fnUntracedEager;
4689
+ })), all, forEach, whileLoop, promise, tryPromise, succeed$1, succeedNone, suspend, sync, void_, callback$1, gen, fail, failCause, failCauseSync, try_, withFiber, flatMap, andThen, tap, exit, map, as, asVoid, catchTag, catchCause, mapError, retry, ignore, orElseSucceed, sleep, raceFirst, when, contextWith, provide, acquireRelease, acquireUseRelease, ensuring, onError, onExit, interrupt$1, onInterrupt, uninterruptible, forever, withSpan, forkIn, forkDetach, runFork, runPromise, runSync, runSyncExit, fnUntraced, fn, mapEager, flatMapEager, fnUntracedEager;
4694
4690
  var init_Effect = __esmMin((() => {
4695
4691
  init_Context();
4696
4692
  init_core();
@@ -4717,7 +4713,6 @@ var init_Effect = __esmMin((() => {
4717
4713
  flatMap = flatMap$1;
4718
4714
  andThen = andThen$1;
4719
4715
  tap = tap$1;
4720
- option$1 = option$2;
4721
4716
  exit = exit$1;
4722
4717
  map = map$2;
4723
4718
  as = as$1;
@@ -10265,10 +10260,7 @@ var init_model$2 = __esmMin((() => {
10265
10260
  //#region src/domain/preferences/index.ts
10266
10261
  var init_preferences = __esmMin((() => {
10267
10262
  init_model$2();
10268
- }));
10269
- //#endregion
10270
- //#region src/cli/error.ts
10271
- var UnknownBranch, UnknownBase, UnknownFile, UnknownComment, UnknownPreference, UnknownPreferenceValue, UnselectableRange, UnknownCommand, MissingOption, UnknownWorktree, MalformedLayers, UnknownField, UnknownOption, BadOption, UnknownDraft, NothingDrafted, PartlySent, PullMoved, NoLayers, InitUnwritable;
10263
+ })), UnknownBranch, UnknownBase, UnknownFile, UnknownComment, UnknownPreference, UnknownPreferenceValue, UnselectableRange, UnknownCommand, MissingOption, UnknownWorktree, MalformedLayers, UnknownField, UnknownOption, BadOption, UnknownDraft, NothingDrafted, PartlySent, PullMoved, NoLayers;
10272
10264
  var init_error = __esmMin((() => {
10273
10265
  init_dist();
10274
10266
  UnknownBranch = class extends TaggedError("UnknownBranch") {};
@@ -10290,7 +10282,7 @@ var init_error = __esmMin((() => {
10290
10282
  PartlySent = class extends TaggedError("PartlySent") {};
10291
10283
  PullMoved = class extends TaggedError("PullMoved") {};
10292
10284
  NoLayers = class extends TaggedError("NoLayers") {};
10293
- InitUnwritable = class extends TaggedError("InitUnwritable") {};
10285
+ TaggedError("InitUnwritable");
10294
10286
  }));
10295
10287
  //#endregion
10296
10288
  //#region src/cli/commands.ts
@@ -10936,398 +10928,6 @@ var init_drafts = __esmMin((() => {
10936
10928
  });
10937
10929
  }));
10938
10930
  //#endregion
10939
- //#region src/cli/shipped-skill.ts
10940
- var SHIPPED_SKILL;
10941
- var init_shipped_skill = __esmMin((() => {
10942
- SHIPPED_SKILL = [
10943
- "---",
10944
- "name: adiff",
10945
- "description: Pick up review comments left on this worktree's diff in the adiff terminal, act on them, and answer them by id. Use when the user says they left comments, asks you to check adiff, asks you to watch for review feedback, or asks you to hand work over for review.",
10946
- "---",
10947
- "",
10948
- "# adiff",
10949
- "",
10950
- "A human is reviewing your work in the adiff terminal. When they select lines and comment, the",
10951
- "comment is filed against this worktree. This skill is how you collect those comments.",
10952
- "",
10953
- "## Collect what is waiting",
10954
- "",
10955
- "```bash",
10956
- "adiff comment take --worktree .",
10957
- "```",
10958
- "",
10959
- "Returns one JSON line:",
10960
- "",
10961
- "```json",
10962
- "{\"ok\":true,\"comments\":[{\"at\":\"2026-07-30T09:12:04.881Z\",\"head\":\"8e67f663\",\"file\":\"src/api.ts\",\"side\":\"new\",\"start\":4,\"end\":5,\"snippet\":\" const third = 3\\n return first + second + third\",\"body\":\"third is unused outside this sum\"}]}",
10963
- "```",
10964
- "",
10965
- "Each comment carries the code it is about. `snippet` is the exact text the reviewer had selected,",
10966
- "`side` says whether the line numbers are in the new file (`new`) or the version being replaced",
10967
- "(`old`), and `head` is the commit the diff was read at.",
10968
- "",
10969
- "A comment keeps coming back until it is answered. A second `take` returns it again, so answer what",
10970
- "you take. Settling or removing it also retires it: those are the reviewer saying they no longer",
10971
- "need one.",
10972
- "",
10973
- "## Wait for the next one",
10974
- "",
10975
- "```bash",
10976
- "adiff comment take --worktree . --wait 300",
10977
- "```",
10978
- "",
10979
- "Blocks until a comment arrives or the timeout in seconds elapses, then returns the same envelope.",
10980
- "An empty `comments` array means the wait expired with nothing new — that is not an error.",
10981
- "",
10982
- "`--wait` takes a whole number of seconds from 1 to 86400. A value outside that is refused on",
10983
- "stderr with exit 2, because an instant empty answer would read exactly like a wait that expired:",
10984
- "if a wait comes back at once, you are not waiting.",
10985
- "",
10986
- "Arm the wait as the first thing you do in a turn, before the work. A turn that is interrupted",
10987
- "half-way then still leaves a listener running, and a wait armed at the end of a turn is a wait that",
10988
- "often never gets armed.",
10989
- "",
10990
- "Run the wait in the background, not in the foreground. A foreground wait holds the turn, so you",
10991
- "cannot do anything else and the person you are working with cannot talk to you. Backgrounded, the",
10992
- "harness brings you back the moment a comment lands.",
10993
- "",
10994
- "Keep one wait per worktree. A second wait returns the same comments as the first, so two of them",
10995
- "running at once is two of you answering the same comment. Before starting one, check whether one is",
10996
- "already running.",
10997
- "",
10998
- "Re-arm it after each comment you handle, and keep it running while you work. A reviewer reads at",
10999
- "their own pace, so comments arrive minutes apart, and the whole point is that they reach you as",
11000
- "events rather than by you asking. When you finish a piece of work, say you are still listening.",
11001
- "",
11002
- "A backgrounded wait that is killed rather than expiring is not the reviewer going quiet, and not a",
11003
- "reason to stop listening. A kill loses whatever the wait would have handed you, so take once",
11004
- "without `--wait` to collect what landed, then arm a new wait.",
11005
- "",
11006
- "## Answering a comment",
11007
- "",
11008
- "Say what you did, against the comment you were handed:",
11009
- "",
11010
- "```bash",
11011
- "adiff comment answer --worktree . --id <id> --body \"Dropped it, and the import with it.\"",
11012
- "```",
11013
- "",
11014
- "The id comes from `comment take`. The reviewer sees the answer under their own words the next time",
11015
- "they read the branch, so this is how they learn a point was addressed rather than ignored.",
11016
- "",
11017
- "Answer when the change alone does not carry the reasoning: what you did instead of what was asked,",
11018
- "what you found while doing it, or why the comment does not apply. A comment that asked a question",
11019
- "deserves an answer even when nothing changed.",
11020
- "",
11021
- "Add `--question` when you need the reviewer to decide before you continue:",
11022
- "",
11023
- "```bash",
11024
- "adiff comment answer --worktree . --id <id> --question --body \"Drop it, or keep it and map the error?\"",
11025
- "```",
11026
- "",
11027
- "That marks the thread as waiting on them rather than on you. Do not use it to check in; use it when",
11028
- "the work genuinely stops without an answer.",
11029
- "",
11030
- "## When the reviewer writes back",
11031
- "",
11032
- "A reviewer can reply to an answer, and the reply arrives through `comment take` like any other",
11033
- "comment — with an `id` of its own that you answer against, and a `thread` carrying what was said",
11034
- "before it, oldest first:",
11035
- "",
11036
- "```json",
11037
- "{\"body\":\"the imports\",\"replyTo\":\"c1\",\"thread\":[{\"voice\":\"reviewer\",\"body\":\"why two of these\"},{\"voice\":\"agent\",\"body\":\"which two did you mean\"}]}",
11038
- "```",
11039
- "",
11040
- "Read the thread before answering. A reply is usually short because it is the rest of a sentence you",
11041
- "already have: \"the imports\" only means something next to the question it answers. Answer it against",
11042
- "its own id, not the id of the comment that started the thread.",
11043
- "",
11044
- "Settling a thread is the reviewer's to do, not yours. They raised the point, so they decide it is",
11045
- "closed.",
11046
- "",
11047
- "## Acting on a comment",
11048
- "",
11049
- "Read `snippet` before opening the file: the reviewer commented on the diff, and the file may have",
11050
- "moved on since. If `head` no longer matches `git rev-parse --short HEAD`, the change you are being",
11051
- "asked about may already be gone — say so rather than guessing at what they meant.",
11052
- "",
11053
- "Answer the comment by doing the work, not by replying. The reviewer is watching the diff; your",
11054
- "next commit is the reply. When a comment is a question rather than a request, answer it in the",
11055
- "commit message of the change it concerns, or plainly in chat if no change is needed.",
11056
- "",
11057
- "Handle every comment in the batch before taking again.",
11058
- "",
11059
- "## Failure",
11060
- "",
11061
- "Failures go to **stderr**, never stdout, so stdout is always safe to parse. The shape is",
11062
- "`{\"ok\":false,\"error\":{\"type\":\"...\",\"retriable\":false,\"suggestion\":\"...\"}}`, and the exit code says",
11063
- "what kind of problem it is: `2` the request was malformed, `3` the branch or file does not exist,",
11064
- "`1` something unexpected.",
11065
- "",
11066
- "Every command that acts on a review takes either `--worktree <path>` or `--repo <path>` with",
11067
- "`--branch <name>`. Standing in the worktree, `--worktree .` is always enough.",
11068
- "",
11069
- "Read `suggestion` before doing anything else — it names the command that resolves the failure.",
11070
- "Retry only when `retriable` is true. `UnknownBranch` means this worktree is not one adiff knows",
11071
- "about, because the reviewer has not opened it; report that rather than looping.",
11072
- "",
11073
- "## Handing work over",
11074
- "",
11075
- "Finishing is not a reason to publish anything. Say the work is ready, put the review in front of",
11076
- "them if they asked for one, and say how to read it. That is the whole handover. A reading order is",
11077
- "extra work you do on request, and it has its own section further down.",
11078
- "",
11079
- "## Put the review in front of them",
11080
- "",
11081
- "When someone asks you for a review, open it rather than describing how:",
11082
- "",
11083
- "```bash",
11084
- "adiff review pane --repo <repo> --branch <branch>",
11085
- "```",
11086
- "",
11087
- "It splits the pane they are already looking at, so their next move is to look right rather than to",
11088
- "type. The answer says what happened:",
11089
- "",
11090
- "```json",
11091
- "{\"ok\":true,\"opened\":true,\"pane\":\"tmux\",\"command\":\"adiff review open --repo /work/api --branch add-invitations\"}",
11092
- "```",
11093
- "",
11094
- "`opened:false` means nothing could be split, which is ordinary: a terminal without tmux, Zellij,",
11095
- "WezTerm or kitty has nowhere to put a pane. The answer carries `command` either way, so quote that",
11096
- "line and let them run it.",
11097
- "",
11098
- "Open a pane when a review was asked for. Finishing work is not a reason on its own, and taking over",
11099
- "someone's screen uninvited is worse than a line they have to copy.",
11100
- "",
11101
- "## Tell the reviewer how to read it",
11102
- "",
11103
- "Whether or not a pane opened, say what to do with it. Name the repository they should point at,",
11104
- "which is the repository the worktree belongs to:",
11105
- "",
11106
- "> Open it with `adiff review open --repo <repo> --branch <branch>`, which lands on this branch's",
11107
- "> diff. The sidebar lists the files; `j` and `k` move down the diff, `]` and `[` walk between",
11108
- "> files, `}` and `{` jump to the next and previous change, `G` goes to the end. Select lines with",
11109
- "> `v`, write a comment with `c`, and send it with `ctrl+s`. Press `?` for the rest.",
11110
- "",
11111
- "Fill the repository path and the branch in yourself, so nobody has to compose the command or find",
11112
- "the branch in a list. `--branch` takes the name `branch list` reports; without it the review opens",
11113
- "on the worktree list.",
11114
- "",
11115
- "Say what you want looked at hardest, and where you are unsure. A reviewer who knows which part you",
11116
- "doubt spends their attention there. Offer a reading order rather than writing one: if the change is",
11117
- "long enough that the order matters, say you can publish one and let them decide.",
11118
- "",
11119
- "## Publishing a reading order, when you are asked for one",
11120
- "",
11121
- "Only when the reviewer asks. A reading order is a real piece of work, it can be wrong, and one",
11122
- "nobody wanted spends their attention on your summary rather than on the code.",
11123
- "",
11124
- "The ask often arrives as a comment. Pressing `L` in the review sends you one of these:",
11125
- "",
11126
- "- \"Please write a reading order for this branch with `adiff layers set` …\" — there is none yet.",
11127
- "- \"The reading order on this branch describes an older commit …\" — read the diff again from",
11128
- " scratch. Do not patch the old layers; line numbers have moved.",
11129
- "- \"Please revise the reading order …\" — there is one and the reviewer wants it different. Ask what",
11130
- " is wrong with it if the comment does not say.",
11131
- "",
11132
- "Answer it like any other comment when you are done.",
11133
- "",
11134
- "When they do ask, write **layers**: an ordered set over the diff, each one a claim about a span of",
11135
- "code. The reviewer then walks the argument instead of the filesystem.",
11136
- "",
11137
- "```bash",
11138
- "adiff layers set --worktree . --json - <<'JSON'",
11139
- "{",
11140
- " \"summary\": \"Team invitations, end to end\",",
11141
- " \"layers\": [",
11142
- " {",
11143
- " \"title\": \"Add the invitation data model\",",
11144
- " \"note\": \"The record every later layer leans on\",",
11145
- " \"spans\": [{ \"path\": \"src/db/invites.ts\", \"start\": 1, \"end\": 48 }]",
11146
- " },",
11147
- " {",
11148
- " \"title\": \"Add the invitation API\",",
11149
- " \"spans\": [",
11150
- " { \"path\": \"src/api/invites.ts\", \"start\": 1, \"end\": 96 },",
11151
- " { \"path\": \"src/api/router.ts\", \"start\": 12, \"end\": 14 }",
11152
- " ]",
11153
- " },",
11154
- " {",
11155
- " \"title\": \"Build the invite & members UI\",",
11156
- " \"spans\": [{ \"path\": \"src/ui/Members.tsx\", \"start\": 1, \"end\": 210 }]",
11157
- " }",
11158
- " ]",
11159
- "}",
11160
- "JSON",
11161
- "```",
11162
- "",
11163
- "Rules that make a layers worth reading:",
11164
- "",
11165
- "- **Order is the point.** Layer 1 is what the reader must understand before layer 2 makes sense.",
11166
- " Data model, then the code that uses it, then the surface, then the mechanical bits last.",
11167
- "- **A title is a claim, not a file name.** \"Add the invitation API\", never \"changes to",
11168
- " src/api/invites.ts\".",
11169
- "- **Line numbers are the new side of the diff**, the same numbers `adiff comment take` reports.",
11170
- "- **Cover everything.** adiff computes coverage itself and answers with the changed lines no layer",
11171
- " claims; those show up for the reviewer under \"not in any layer\" whatever you do. A layer set that",
11172
- " quietly skips a third of the diff is worse than none, so put the leftovers in a final layer and",
11173
- " say they are mechanical. Claim the lines you actually read: a span reaching past them counts only",
11174
- " the changed lines inside it, so padding the range buys nothing.",
11175
- "",
11176
- "The answer to `layers set` is the honest report — check it before you claim to be done:",
11177
- "",
11178
- "```json",
11179
- "{\"ok\":true,\"layers\":{\"version\":1,\"stale\":false,\"covered\":7,\"partial\":1,\"total\":9,\"uncovered\":[{\"path\":\"src/api/router.ts\",\"start\":40,\"end\":52}],\"vanished\":[],\"layers\":[{\"title\":\"Add the invitation data model\",\"files\":[\"src/db/invites.ts\"],\"covered\":1,\"partial\":0,\"vanished\":[]}]}}",
11180
- "",
11181
- "`covered`, `partial` and `vanished` appear per layer as well as for the document, so you can tell",
11182
- "which of your own layers is the thin one. `vanished` on a layer names paths it claims that are not",
11183
- "in the diff — usually a typo or a file that moved.",
11184
- "",
11185
- "`layers set` refuses a document it cannot use and says which layer is wrong and why: a span that",
11186
- "ends before it starts, a span starting below line 1, a start or end that is not a whole number, a",
11187
- "block with no `kind`, a layer with no title. It no longer drops a bad span quietly, so a layer that",
11188
- "used to cover less than you thought now fails loudly instead.",
11189
- "```",
11190
- "",
11191
- "`total` counts hunks. `covered` counts the ones where every changed line sits inside a layer, and",
11192
- "`partial` the ones a layer explains only some of. `uncovered` names the runs of changed lines no",
11193
- "layer claims, so it reads as line numbers a reviewer would otherwise have to find alone: claim them",
11194
- "and set the layers again. Done means `uncovered` is empty. `vanished` names paths a layer points at",
11195
- "that this branch does not change, which usually means a typo in a path. Read it back at any time",
11196
- "with:",
11197
- "",
11198
- "```bash",
11199
- "adiff layers show --worktree . --fields covered,partial,total,uncovered",
11200
- "```",
11201
- "",
11202
- "`uncovered` does not always empty out by claiming lines you can see. A deleted line is counted at",
11203
- "the number it had in the old file, so a branch that cuts a file from 409 lines to 394 reports an",
11204
- "uncovered run at 395-409 — line numbers past the end of the file as it now stands. A span over the",
11205
- "new file cannot reach them; only a span whose `end` runs past the end of the file can. Write one, or",
11206
- "say the run is unreachable, rather than reading the leftover as a layer you forgot.",
11207
- "",
11208
- "That is also the case for spans generally: `start` 1 to past the last line covers a file whatever",
11209
- "happens to it, while a tight range goes stale on the next push that moves the lines under it.",
11210
- "",
11211
- "Setting layers again supersedes the previous set and bumps `version`; the set records the commit it",
11212
- "was written for, and adiff reports it as `stale` once the branch moves past that commit. Once a",
11213
- "reviewer has a reading order, keep it true: write it again after you address their comments.",
11214
- "",
11215
- "When you have published one, tell them the sidebar now holds it: `s` swaps between the layers and",
11216
- "the files, each layer shows the files it covers with the ones already reviewed ticked off, and `]`",
11217
- "and `[` walk those files in the order you put them in — from the last file of one layer into the",
11218
- "first of the next.",
11219
- "",
11220
- "## Helping draft a review of somebody else's pull request",
11221
- "",
11222
- "Sometimes the reviewer is not reading your work — they are reading a stranger's pull request and",
11223
- "want you to think it through with them before they say anything on it. There, a comment is not an",
11224
- "instruction to you. It is a draft of what the reviewer will say, in the reviewer's name.",
11225
- "",
11226
- "Comments on a pull request are **held**. Nothing reaches the forge until the reviewer sends them.",
11227
- "",
11228
- "```bash",
11229
- "adiff draft list --repo . --branch their-change",
11230
- "adiff draft add --repo . --branch their-change --file src/api.ts --start 40 --end 52 --body \"…\"",
11231
- "adiff draft edit --repo . --branch their-change --id d1 --body \"…\"",
11232
- "adiff draft drop --repo . --branch their-change --id d1",
11233
- "```",
11234
- "",
11235
- "`draft add` anchors the same way `comment send` does, so `--side old` is the version being replaced.",
11236
- "",
11237
- "Rules for drafting on somebody else's behalf:",
11238
- "",
11239
- "- **You never send.** There is no command that dispatches, on purpose. The reviewer signs the",
11240
- " review, so the reviewer sends it.",
11241
- "- **Write what the reviewer meant, not what you would say.** They told you the point; your job is",
11242
- " the wording. If you are not sure what the point is, ask rather than inventing one.",
11243
- "- **One draft per point.** A held comment that covers three things cannot be dropped in part.",
11244
- "- **Say what you drafted.** List the drafts back after you write them, so the reviewer can read",
11245
- " them over rather than discovering them at the moment of sending.",
11246
- "- **A draft is not a review of the reviewer.** Do not soften a point they meant sharply, or sharpen",
11247
- " one they meant gently.",
11248
- "",
11249
- "## Discovering the rest",
11250
- "",
11251
- "```bash",
11252
- "adiff describe",
11253
- "```",
11254
- "",
11255
- "Returns every command with its options, which are required, which part of the loop it belongs to,",
11256
- "and where its payload sits. `adiff <command> --help` says the same for one command in plain text.",
11257
- "Use either instead of guessing, and use `--fields` to keep answers small:",
11258
- "",
11259
- "```bash",
11260
- "adiff branch list --repo . --fields branch,files",
11261
- "```",
11262
- ""
11263
- ].join("\n");
11264
- }));
11265
- //#endregion
11266
- //#region src/cli/skill.ts
11267
- var readAt, writeAt, SKILL_AT, isLink, refreshAt, settledRoot, refreshSkill;
11268
- var init_skill = __esmMin((() => {
11269
- init_dist();
11270
- init_error();
11271
- init_shipped_skill();
11272
- readAt = fn("Cli.readAt")(function* (path) {
11273
- return yield* tryPromise({
11274
- try: () => readFile(path, "utf8"),
11275
- catch: () => new InitUnwritable({
11276
- path,
11277
- reason: "unreadable"
11278
- })
11279
- }).pipe(option$1);
11280
- });
11281
- writeAt = fn("Cli.writeAt")(function* (path, text) {
11282
- yield* tryPromise({
11283
- try: () => mkdir(dirname(path), { recursive: true }).then(() => writeFile(path, text, "utf8")),
11284
- catch: (cause) => new InitUnwritable({
11285
- path,
11286
- reason: String(cause)
11287
- })
11288
- });
11289
- });
11290
- SKILL_AT = join(".claude", "skills", "adiff", "SKILL.md");
11291
- isLink = (path) => {
11292
- try {
11293
- return lstatSync(path).isSymbolicLink();
11294
- } catch {
11295
- return false;
11296
- }
11297
- };
11298
- refreshAt = fn("Cli.refreshAt")(function* (root, wanted) {
11299
- const path = join(root, SKILL_AT);
11300
- if (!existsSync(path)) return [];
11301
- if (isLink(path)) return [{
11302
- path,
11303
- action: "linked"
11304
- }];
11305
- const current = yield* readAt(path);
11306
- if (getOrUndefined$1(current) === wanted) return [{
11307
- path,
11308
- action: "unchanged"
11309
- }];
11310
- yield* writeAt(path, wanted);
11311
- return [{
11312
- path,
11313
- action: "update"
11314
- }];
11315
- });
11316
- settledRoot = (root) => {
11317
- try {
11318
- return realpathSync(root);
11319
- } catch {
11320
- return root;
11321
- }
11322
- };
11323
- refreshSkill = fn("Cli.refreshSkill")(function* (roots) {
11324
- const seen = [...new Set(roots.map(settledRoot))];
11325
- const found = [];
11326
- for (const root of seen) found.push(...yield* refreshAt(root, SHIPPED_SKILL));
11327
- return { changes: found };
11328
- });
11329
- }));
11330
- //#endregion
11331
10931
  //#region src/cli/pane.ts
11332
10932
  var TIMEOUT_MS, set, splitters, named, selfInvocation, ran, split, openPane;
11333
10933
  var init_pane = __esmMin((() => {
@@ -11433,12 +11033,11 @@ var init_pane = __esmMin((() => {
11433
11033
  //#endregion
11434
11034
  //#region package.json
11435
11035
  init_drafts();
11436
- init_skill();
11437
11036
  init_pane();
11438
- var version$1 = "0.1.0-alpha.146";
11037
+ var version$1 = "0.1.0-alpha.147";
11439
11038
  //#endregion
11440
11039
  //#region src/cli/upgrade.ts
11441
- var PACKAGE, TAG, RELEASES, REGISTRY, ASK_MS, RUN_MS, CELLAR, COMPILED, INSTALLED, BUN_GLOBAL, routeOf, ROUTES, asRoute, checkoutOf, assetOf, commandFor, NOTES, RUNNABLE, NUMBERS, numbersIn, compare$1, partsOf, newer, tagIn, fetched, askLatest, here, findUpgrade, willUpgrade, ranChild, runUpgrade, statusOf$1, sayFound, sayDone, attempted, REFRESH_MS, NOT_ASKED, refreshSkills, updatedIn, sayRefreshed, upgradeReport;
11040
+ var PACKAGE, TAG, RELEASES, REGISTRY, ASK_MS, RUN_MS, CELLAR, COMPILED, INSTALLED, BUN_GLOBAL, routeOf, ROUTES, asRoute, checkoutOf, assetOf, commandFor, NOTES, RUNNABLE, NUMBERS, numbersIn, compare$1, partsOf, newer, tagIn, fetched, askLatest, here, findUpgrade, willUpgrade, ranChild, runUpgrade, statusOf$1, sayFound, sayDone, attempted, SAY_SKILL_TOO, upgradeReport;
11442
11041
  var init_upgrade$1 = __esmMin((() => {
11443
11042
  init_dist();
11444
11043
  PACKAGE = "@eliya-oss/agent-diff";
@@ -11595,41 +11194,7 @@ var init_upgrade$1 = __esmMin((() => {
11595
11194
  if (found.latest === void 0) return `Ran \`${found.command}\`. Run \`adiff --version\` to see which build you have now.`;
11596
11195
  return `Ran \`${found.command}\`, and adiff ${found.latest} is installed now.`;
11597
11196
  };
11598
- REFRESH_MS = 1e4;
11599
- NOT_ASKED = {
11600
- updated: [],
11601
- failed: false
11602
- };
11603
- refreshSkills = ranChild({
11604
- command: "adiff",
11605
- args: [
11606
- "skill",
11607
- "refresh",
11608
- "--json"
11609
- ],
11610
- timeout: REFRESH_MS,
11611
- stdio: [
11612
- "ignore",
11613
- "pipe",
11614
- "ignore"
11615
- ]
11616
- }, (code, said) => code === 0 ? {
11617
- updated: updatedIn(said),
11618
- failed: false
11619
- } : {
11620
- updated: [],
11621
- failed: true
11622
- }, NOT_ASKED).pipe(withSpan("Cli.refreshedSkill"));
11623
- updatedIn = (said) => {
11624
- return (runSync(try_(() => JSON.parse(said)).pipe(orElseSucceed(() => ({})))).changes ?? []).filter((change) => change.action === "update").flatMap((change) => change.path === void 0 ? [] : [change.path]);
11625
- };
11626
- sayRefreshed = (refreshed) => {
11627
- if (refreshed.failed) return "The skill installed beside this could not be rewritten, so it still describes the older adiff. Run `adiff skill refresh` to see why.";
11628
- const first = refreshed.updated[0];
11629
- if (first === void 0) return void 0;
11630
- const rest = refreshed.updated.length - 1;
11631
- return rest === 0 ? `The skill at ${first} is the newest one too.` : `The skill at ${first} and ${rest} more is the newest one too.`;
11632
- };
11197
+ SAY_SKILL_TOO = "Run `npx skills update adiff` to bring the skill up with it.";
11633
11198
  upgradeReport = (found, ran, check) => {
11634
11199
  const note = found.current === true ? statusOf$1(found) : willUpgrade(found, check) ? `${statusOf$1(found)} ${attempted(found, ran)}` : `${statusOf$1(found)} ${NOTES[found.route]} Run \`${found.command}\` to upgrade.`;
11635
11200
  return {
@@ -12720,16 +12285,6 @@ var init_catalog = __esmMin((() => {
12720
12285
  dataKey: "preference",
12721
12286
  example: "adiff config set --name hold --value on"
12722
12287
  },
12723
- {
12724
- name: "skill refresh",
12725
- about: "Rewrite the adiff skill wherever it is already installed, in this directory and in your home directory. Installs nothing that is not already there",
12726
- group: SET_UP,
12727
- addresses: "none",
12728
- safety: "write",
12729
- options: [],
12730
- dataKey: "changes",
12731
- example: "adiff skill refresh"
12732
- },
12733
12288
  {
12734
12289
  name: "upgrade",
12735
12290
  about: "Upgrade this install to the newest build, using whatever installed it. Answers a person in plain text, and a caller in JSON with --json",
@@ -20383,10 +19938,6 @@ const layersShow = fn("Main.layersShow")(function* (options) {
20383
19938
  const layers = yield* showLayers(yield* required(options, "worktree"));
20384
19939
  yield* answer(options, { layers });
20385
19940
  });
20386
- const skillRefresh = fn("Main.skillRefresh")(function* (options) {
20387
- const report = yield* refreshSkill([process.cwd(), homedir()]);
20388
- yield* answer(options, { changes: report.changes });
20389
- });
20390
19941
  const configList = fn("Main.configList")(function* (options) {
20391
19942
  yield* answer(options, { preferences: yield* readPreferences() });
20392
19943
  });
@@ -20408,18 +19959,13 @@ const reviewPane = fn("Main.reviewPane")(function* (options) {
20408
19959
  });
20409
19960
  });
20410
19961
  const say = (line) => sync(() => process.stdout.write(line));
20411
- const NOTHING_REFRESHED = {
20412
- updated: [],
20413
- failed: false
20414
- };
20415
19962
  const settledUpgrade = (found, check, ran) => sync(() => {
20416
19963
  if (check || found.current === true || ran) return;
20417
19964
  process.exitCode = 1;
20418
19965
  });
20419
- const saidUpgrade = fn("Main.saidUpgrade")(function* (found, ran, skills) {
19966
+ const saidUpgrade = fn("Main.saidUpgrade")(function* (found, ran) {
20420
19967
  yield* say(`\n${sayDone(found, ran)}\n`);
20421
- const also = sayRefreshed(skills);
20422
- if (also !== void 0) yield* say(`${also}\n`);
19968
+ yield* say(`${SAY_SKILL_TOO}\n`);
20423
19969
  });
20424
19970
  const routes = {
20425
19971
  "branch list": branchList,
@@ -20445,7 +19991,6 @@ const routes = {
20445
19991
  "review progress": reviewStatus,
20446
19992
  "layers set": layersSet,
20447
19993
  "layers show": layersShow,
20448
- "skill refresh": skillRefresh,
20449
19994
  upgrade: fn("Main.upgrade")(function* (options) {
20450
19995
  const check = options["check"] !== void 0;
20451
19996
  const quiet = options["json"] !== void 0;
@@ -20453,15 +19998,8 @@ const routes = {
20453
19998
  const upgrading = willUpgrade(found, check);
20454
19999
  if (!quiet) yield* say(`${sayFound(found, check)}\n${upgrading ? "\n" : ""}`);
20455
20000
  const ran = upgrading ? yield* runUpgrade(found, quiet) : false;
20456
- const skills = ran ? yield* refreshSkills : NOTHING_REFRESHED;
20457
- if (quiet) {
20458
- const also = skills.updated.length === 0 ? {} : { skills: skills.updated };
20459
- return yield* answer(options, {
20460
- upgrade: upgradeReport(found, ran, check),
20461
- ...also
20462
- });
20463
- }
20464
- if (upgrading) yield* saidUpgrade(found, ran, skills);
20001
+ if (quiet) return yield* answer(options, { upgrade: upgradeReport(found, ran, check) });
20002
+ if (upgrading) yield* saidUpgrade(found, ran);
20465
20003
  return yield* settledUpgrade(found, check, ran);
20466
20004
  }),
20467
20005
  describe: fn("Main.describe")(function* (options) {
package/package.json CHANGED
@@ -23,7 +23,7 @@
23
23
  "bin": {
24
24
  "adiff": "./bin/adiff.js"
25
25
  },
26
- "version": "0.1.0-alpha.146",
26
+ "version": "0.1.0-alpha.147",
27
27
  "description": "Review the work an agent left you without losing the thread: comments live on the lines, the agent answers them, and each point stays open until you settle it.",
28
28
  "license": "MIT",
29
29
  "repository": {
@@ -42,7 +42,6 @@
42
42
  "scripts": {
43
43
  "check": "pnpm run typecheck && pnpm run lint && pnpm run build && pnpm test",
44
44
  "build": "rolldown -c rolldown.config.ts",
45
- "embed-skill": "node --experimental-ffi --disable-warning=ExperimentalWarning scripts/embed-skill.ts",
46
45
  "typecheck": "tsc --noEmit",
47
46
  "lint": "oxlint && node scripts/check-rules.ts",
48
47
  "test": "NODE_OPTIONS=--experimental-ffi vitest run",