@rness/cli 0.18.0 → 0.19.0

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 CHANGED
@@ -28,7 +28,7 @@ Inside a workspace, every `rness` delegates to the copy pinned in
28
28
  rness login [--setup-git|--no-setup-git]
29
29
  rness logout
30
30
  rness context [--scope <name>] [--json]
31
- rness status [<tab>]
31
+ rness status [<tab>] [--json]
32
32
  rness pulse create [<collection>] [-y]
33
33
  rness pulse sync
34
34
  rness validate
@@ -48,6 +48,7 @@ writes nothing and exits 1 when a block is out of date — use it in CI.
48
48
 
49
49
  rness status # every decision, specification and plan, a tab per directory
50
50
  rness status specs # open on one tab (off a terminal: print only that one)
51
+ rness status --json # one JSON object: what the Claude Code plugin draws
51
52
 
52
53
  A tab for `ADR`, `Specs` and `Plans`, always, then one for each other
53
54
  directory of `.rness/` whose Markdown files carry a `status` in their front
@@ -59,8 +60,15 @@ when dropped, red `?` when missing.
59
60
  `PgUp`/`PgDn`, `Home`/`End` scroll, `q` or `Esc` closes and gives the
60
61
  screen back. Read-only.
61
62
  - Off a terminal — a pipe, CI, an agent's tool — Markdown: a table per tab.
62
- - From Claude Code, `/rness:status [tab]` shows those tables (see "Agent
63
- targets"). Nothing started from inside Claude Code gets the terminal, so
63
+ - `--json`, terminal or not: the tabs and their rows, with what a Claude
64
+ Code session shows of the workspace, worded by the CLI — the session-start
65
+ banner, the status line entry, the scope's plans `In progress` and the
66
+ notes of the safety net (see "Hooks"). The plugin's mod reads it (see
67
+ "The mod").
68
+ - From Claude Code, `/rness:status [tab]` opens a pane beside the
69
+ conversation when the plugin's mod is loaded (see "The mod"), and shows
70
+ those tables otherwise (see "Agent targets"). Nothing started from inside
71
+ Claude Code gets the terminal, so
64
72
  the view cannot open from there (verified with Claude Code 2.1.284 on
65
73
  2026-09-29). Two ways to reach it, and the skill ends with both: in the
66
74
  same terminal, `Ctrl+Z` suspends Claude Code, run `npx @rness/cli status`
@@ -93,11 +101,12 @@ the files a given agent needs, for the agents the team declares in
93
101
  applies it once the repository has been trusted interactively. Verified
94
102
  with Claude Code 2.1.284 on 2026-09-29. Each clone also gets `.mcp.json`,
95
103
  which registers the MCP server; see "MCP server". The same settings file
96
- carries three hooks, and so does `.claude/settings.json` at the workspace
104
+ carries four hooks, and so does `.claude/settings.json` at the workspace
97
105
  root, which `sync` writes on every machine; see "Hooks". Both places also
98
- get a Claude Code plugin, `.claude/skills/rness/`, with five commands:
106
+ get a Claude Code plugin, `.claude/skills/rness/`, with four commands:
99
107
  `/rness:status [tab]`, the tables of `rness status`, and the lifecycle
100
- skills below. rness owns those files whole — an edit by hand is reported
108
+ skills below; and a mod, its hooks module (see "The mod"). rness owns
109
+ those files whole — an edit by hand is reported
101
110
  by `sync --check` and written back by `sync`. The plugin's manifest,
102
111
  `.claude-plugin/plugin.json`, also carries the agent-plugins.org
103
112
  `$schema`, the author, homepage, repository, licence and keywords, so a
@@ -133,7 +142,8 @@ the files a given agent needs, for the agents the team declares in
133
142
  by `rness doc new <collection>` — the second pre-approved line of each
134
143
  skill, so that every runtime and a bare terminal get the same number;
135
144
  `rness validate` refuses two documents with one number, the case a merge
136
- of two branches can still produce. Each skill records its session: it adds
145
+ of two branches can still produce, and a document named without one
146
+ (`NNNN-<slug>.md`, never a date). Each skill records its session: it adds
137
147
  `{ id: <session id>, agent: <model> }` to `sessions:` in the front matter
138
148
  of what it writes or closes. The agent is the model it runs as, as Claude
139
149
  Code names it (`Claude Opus 5.5`): no variable gives it to a skill. An
@@ -151,10 +161,60 @@ the files a given agent needs, for the agents the team declares in
151
161
  - Other agents (Codex, Cursor, GitHub Copilot) read the `AGENTS.md` block;
152
162
  `sync` refuses an agent it has no target for.
153
163
 
164
+ ### The mod
165
+
166
+ Since 0.19.0 the plugin carries a hooks module — what Claude Code calls a
167
+ mod — in `hooks/hooks.json`, `hooks/register.tsx` and `types/index.d.ts`.
168
+ It draws the workspace in the session, from `rness status --json` run by
169
+ the pinned copy, and computes nothing itself:
170
+
171
+ - **A band above the prompt**, whenever a note needs action (a pin the
172
+ installed copy does not match, problems `validate` would report): those
173
+ notes. The banner is not repeated there; the session-start line says it
174
+ once, in the transcript.
175
+ - **The status line**: `<scope> · <n> in progress`, with `⚠ <n>` when
176
+ there are notes. Claude Code draws it after the plugin's name:
177
+ `⚠ rness: web · 1 in progress` (2.1.289).
178
+ - **`/rness:status [tab]` as a pane** beside the conversation, a tab per
179
+ collection, a row per document; no model turn. The pane takes the
180
+ keyboard as it opens: a tab's digit (written before its name), or Tab
181
+ then Enter, shows that tab; ↑/↓, `PgUp`/`PgDn`, `Home`/`End` scroll, as
182
+ in the full-screen `rness status`; Esc and `q` close it, and so does Esc
183
+ at an empty prompt once the prompt has the keys back. A pane has no
184
+ ←/→ in Claude Code 2.1.289. In `claude -p`, or where no pane can be
185
+ placed, the skill's tables answer instead.
186
+
187
+ It reads the snapshot again at session start, after an `Edit` or `Write`
188
+ of a file under `.rness/`, and at the end of each turn, off the turn's
189
+ path. The module runs the pinned copy at the one path `sync` writes into it
190
+ for its place (`.rness` at the root, `../../.rness` in a clone), as the
191
+ settings hooks do: never a copy a clone's own tree could hold. It loads
192
+ where the plugin loads — a trusted folder, `claude -p` included — on a
193
+ Claude Code that has mods: run by 2.1.280 and later, ignored without an
194
+ error by 2.1.240 and 2.1.199, where the skills work as before (verified on
195
+ 2026-10-04). An older Claude Code is told so once per version and machine,
196
+ in the session-start line: `rness: Claude Code 2.1.240 shows no rness band,
197
+ status line or pane; 2.1.280 or later does — claude update`. The version
198
+ comes from `AI_AGENT`, which Claude Code sets (2.1.240 does); one that does
199
+ not set it, or not in that form, is told nothing. The versions told are kept
200
+ in `claude-code.json` beside the login (`~/.config/rness/` by default). Not in
201
+ `claude -p` or another SDK session, where nobody would read it; not after a
202
+ compaction. Versions between 2.1.240 and 2.1.280 were not tried: one of
203
+ them that loads mods is told to update for nothing. Mods are early access
204
+ in Claude Code: a release that changes their API may stop the band or the
205
+ pane until the next rness release; the skills and the settings hooks do not
206
+ depend on it.
207
+
208
+ To work on it, from `org/rness`: `pnpm check:mod` runs
209
+ `claude plugin validate` and `claude plugin test` on `packages/cli/mod`
210
+ (Claude Code needed, so not in CI); `tsc -p packages/cli/mod` type-checks it
211
+ once a `claude --plugin-dir packages/cli/mod` session has laid Claude
212
+ Code's types there.
213
+
154
214
  ### Hooks
155
215
 
156
216
  With `claude` in `agents`, each clone's `.claude/settings.json` and the
157
- workspace root's carry three Claude Code hooks, all run by the pinned copy:
217
+ workspace root's carry four Claude Code hooks, all run by the pinned copy:
158
218
 
159
219
  - **At session start** (`SessionStart`, every source): a line for the
160
220
  developer — `rness 0.10.0 · acme · scope web — 3 standards, 2 decisions`
@@ -162,7 +222,18 @@ workspace root's carry three Claude Code hooks, all run by the pinned copy:
162
222
  them. When the context may be wrong, both say why: no `.rness` next to the
163
223
  repository or nothing installed there, a `rness.json` rness refuses, a pin
164
224
  the installed copy does not match, the problems `rness validate` reports.
165
- After a compaction, the context only.
225
+ A Claude Code too old for the plugin's mod gets one more line, once (see
226
+ "The mod"). After a compaction, the context only.
227
+ - **Before an edit** (`PreToolUse` on `Edit|Write`): refused, with the
228
+ reason for the model, when it would change what `sync` generates — a
229
+ line of the block of an `AGENTS.md` or `CLAUDE.md` (the reason names the
230
+ standard that line comes from, to edit instead), or a file of
231
+ `.claude/skills/rness/` — or add a problem to a document of `.rness/` or
232
+ to `rness.json`. Only the problems the edit adds: a document already
233
+ broken stays editable. The `old_string` is found as Claude Code's `Edit`
234
+ finds it, straight quotes matching curly ones. Writes through Bash are
235
+ not seen: the guard is best effort. About 0.07 s per edit, 0.11 s for a
236
+ document of `.rness/` (measured 2026-10-04).
166
237
  - **After an edit** (`PostToolUse` on `Edit|Write`): when the file is under
167
238
  `.rness/`, its front-matter problems — or those of `rness.json` — go back
168
239
  to the model, which fixes them in the same turn. Any other edit costs one
@@ -180,7 +251,7 @@ hand counts as missing, and the next `sync` adds a second one. The team's
180
251
  own hooks stay where they are.
181
252
 
182
253
  Claude Code runs hooks from a committed settings file without asking each
183
- developer, including in `claude -p`. These three read `.rness/`, write
254
+ developer, including in `claude -p`. These four read `.rness/`, write
184
255
  nothing in the workspace and run no install. Only with a pulse declared do
185
256
  they reach the network, through a detached `rness` process that uses your
186
257
  login; when that process fails, it writes why to `pulse.json` in rness's
@@ -603,6 +674,45 @@ per repository, the files to commit there.
603
674
  Exit codes: 0 success, 1 failure, 2 usage — or a refusal without a TTY.
604
675
  `RNESS_DEBUG=1` adds stack traces; `RNESS_NO_DELEGATE=1` skips the delegation.
605
676
 
677
+ ## 0.19.0 — the plugin's mod; edits of generated files refused before they land
678
+
679
+ - The Claude Code plugin gains a mod (see "The mod"): the notes to act on
680
+ above the prompt, a status line entry, and `/rness:status` as a pane
681
+ beside the conversation, with no model turn, driven by the keyboard. `sync` writes three more files into `.claude/skills/rness/`,
682
+ at the root and in each clone; an upgrade lists the clone's for commit.
683
+ Claude Code without mods ignores them; older than 2.1.280, it is told once
684
+ per version, in the session-start line, to run `claude update` (when it
685
+ sets `AI_AGENT`, as 2.1.240 does).
686
+ - A fourth hook, `PreToolUse` on `Edit|Write`: an edit of the block of an
687
+ `AGENTS.md` or `CLAUDE.md`, or of the plugin's files, is refused before
688
+ it is written, naming the file to edit instead; so is an edit that would
689
+ add a problem to a document of `.rness/` or to `rness.json`. Until the
690
+ upgrade has run on a machine, a session there runs the old pinned copy,
691
+ which says `unknown hook event "pre-tool-use"` and lets the edit through.
692
+ - `rness status --json` prints the tabs and what the mod draws.
693
+
694
+ ## 0.18.1 — a document without a number is caught; small fixes
695
+
696
+ - `rness validate` and the edit hook name a document of `adr/`, `specs/` or
697
+ `plans/` whose file name has no number, with the next one:
698
+ `plans/2026-10-02-x.md: not numbered; name it 0002-<slug>.md, the next
699
+ number of plans`. A plan another agent's skill wrote with a dated name
700
+ is the usual case; rename it, or let the agent do it when the hook
701
+ tells it. A workspace with such a file fails `validate` (and its CI)
702
+ after the upgrade until it is renamed. The scaffold's `CONVENTIONS.md`
703
+ states the rule, and `upgrade` merges it in.
704
+ - A dated file name is no longer read as a number: `rness doc new` after
705
+ `2026-10-02-x.md` gave `2027`, and two dated plans of one year were
706
+ reported as one number twice.
707
+ - `rness doc new` racing another one at the same number says `<file>
708
+ exists; nothing written` (exit 1) instead of a raw `EEXIST`.
709
+ - `1 repository`, not `1 repositories`, in `create` and `sync`.
710
+ - When the SSH test passes only by asking for the key's passphrase,
711
+ `create`, `add` and `sync` say once how to load it into an agent
712
+ (`ssh-add`), since every clone would ask again.
713
+ - Ctrl+C while `create` waits for an organization's approval is a cancel
714
+ in the plain look too: `cancelled`, nothing written, exit 0 (it was 130).
715
+
606
716
  ## 0.18.0 — the wizard asks where first and waits for the approval; the skills on one grammar; Node 22.17
607
717
 
608
718
  - The published CLI runs on **Node 22.17 or later** (ADR 0010); the guard
package/dist/bin/rness.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  findDelegate,
7
7
  reportError,
8
8
  run
9
- } from "../chunk-VGBS7HDY.js";
9
+ } from "../chunk-U5SBNWVD.js";
10
10
 
11
11
  // src/bin/rness.ts
12
12
  import { pathToFileURL } from "url";