@rness/cli 0.18.1 → 0.20.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,19 @@ 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 — each row with the
64
+ colour of its status on Agent Pulse (`color`, the board's name for it:
65
+ `yellow` for `In progress`; `red` without a status) and its item there
66
+ (`link`, the board filtered on its path; null without a pulse) — the
67
+ board (`pulse`), and what a Claude Code session shows of the workspace,
68
+ worded by the CLI — the session-start banner, the status line entry, the
69
+ scope's plans `In progress` and the notes of the safety net (see
70
+ "Hooks"). The plugin's mod reads it (see
71
+ "The mod").
72
+ - From Claude Code, `/rness:status [tab]` opens a pane beside the
73
+ conversation when the plugin's mod is loaded (see "The mod"), and shows
74
+ those tables otherwise (see "Agent targets"). Nothing started from inside
75
+ Claude Code gets the terminal, so
64
76
  the view cannot open from there (verified with Claude Code 2.1.284 on
65
77
  2026-09-29). Two ways to reach it, and the skill ends with both: in the
66
78
  same terminal, `Ctrl+Z` suspends Claude Code, run `npx @rness/cli status`
@@ -93,11 +105,12 @@ the files a given agent needs, for the agents the team declares in
93
105
  applies it once the repository has been trusted interactively. Verified
94
106
  with Claude Code 2.1.284 on 2026-09-29. Each clone also gets `.mcp.json`,
95
107
  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
108
+ carries four hooks, and so does `.claude/settings.json` at the workspace
97
109
  root, which `sync` writes on every machine; see "Hooks". Both places also
98
- get a Claude Code plugin, `.claude/skills/rness/`, with five commands:
110
+ get a Claude Code plugin, `.claude/skills/rness/`, with four commands:
99
111
  `/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
112
+ skills below; and a mod, its hooks module (see "The mod"). rness owns
113
+ those files whole — an edit by hand is reported
101
114
  by `sync --check` and written back by `sync`. The plugin's manifest,
102
115
  `.claude-plugin/plugin.json`, also carries the agent-plugins.org
103
116
  `$schema`, the author, homepage, repository, licence and keywords, so a
@@ -152,10 +165,73 @@ the files a given agent needs, for the agents the team declares in
152
165
  - Other agents (Codex, Cursor, GitHub Copilot) read the `AGENTS.md` block;
153
166
  `sync` refuses an agent it has no target for.
154
167
 
168
+ ### The mod
169
+
170
+ Since 0.19.0 the plugin carries a hooks module — what Claude Code calls a
171
+ mod — in `hooks/hooks.json`, `hooks/register.tsx` and `types/index.d.ts`.
172
+ It draws the workspace in the session, from `rness status --json` run by
173
+ the pinned copy, and computes nothing itself:
174
+
175
+ - **A band above the prompt**, whenever a note needs action (a pin the
176
+ installed copy does not match, problems `validate` would report): those
177
+ notes. The banner is not repeated there; the session-start line says it
178
+ once, in the transcript.
179
+ - **The status line**: `<scope> · <n> in progress`, with `⚠ <n>` when
180
+ there are notes. Claude Code draws it after the plugin's name:
181
+ `⚠ rness: web · 1 in progress` (2.1.289).
182
+ - **`/rness:status [tab]` as a pane** beside the conversation, a tab per
183
+ collection, a row per document, its status in the colour Agent Pulse
184
+ gives it (yellow in progress, green done, red blocked, gray draft or
185
+ abandoned, blue proposed, purple approved — the board's purple is the
186
+ terminal's magenta); no model turn. The pane takes the keyboard as it
187
+ opens, on the newest row, with the keys of the full-screen view:
188
+ **↑/↓ select a row**, `PgUp`/`PgDn` a page away, `Home`/`End`
189
+ the ends, the window following the selection; **Tab and Shift+Tab
190
+ change the tab**, wrapping, and so does a tab's digit (written before
191
+ its name); **Enter, or a click, on a row shows the document**; Esc and
192
+ `q` close the pane, and so does Esc at an empty prompt once the prompt
193
+ has the keys back. The selected row is drawn between `‹` and `›`, which
194
+ a click presses too. A pane has no ←/→ in Claude Code 2.1.289. The
195
+ document is read from `.rness/` without its front matter, as the
196
+ board's card shows it; `q` brings the list back, Esc still closes. An
197
+ edit of the document shows at the next refresh. **Agent
198
+ Pulse is a link** when the workspace declares a pulse: the board from the
199
+ list, the document's item (the board filtered on its path) from the
200
+ document. The terminal opens it as it opens any hyperlink (cmd+click on
201
+ macOS, as a rule), a desktop surface on a click. In `claude -p`, or where
202
+ no pane can be placed, the skill's tables answer instead.
203
+
204
+ It reads the snapshot again at session start, after an `Edit` or `Write`
205
+ of a file under `.rness/`, and at the end of each turn, off the turn's
206
+ path. The module runs the pinned copy at the one path `sync` writes into it
207
+ for its place (`.rness` at the root, `../../.rness` in a clone), as the
208
+ settings hooks do: never a copy a clone's own tree could hold. It loads
209
+ where the plugin loads — a trusted folder, `claude -p` included — on a
210
+ Claude Code that has mods: run by 2.1.280 and later, ignored without an
211
+ error by 2.1.240 and 2.1.199, where the skills work as before (verified on
212
+ 2026-10-04). An older Claude Code is told so once per version and machine,
213
+ in the session-start line: `rness: Claude Code 2.1.240 shows no rness band,
214
+ status line or pane; 2.1.280 or later does — claude update`. The version
215
+ comes from `AI_AGENT`, which Claude Code sets (2.1.240 does); one that does
216
+ not set it, or not in that form, is told nothing. The versions told are kept
217
+ in `claude-code.json` beside the login (`~/.config/rness/` by default). Not in
218
+ `claude -p` or another SDK session, where nobody would read it; not after a
219
+ compaction. Versions between 2.1.240 and 2.1.280 were not tried: one of
220
+ them that loads mods is told to update for nothing. Mods are early access
221
+ in Claude Code: a release that changes their API may stop the band or the
222
+ pane until the next rness release; the skills and the settings hooks do not
223
+ depend on it.
224
+
225
+ To work on it, from `org/rness`: `pnpm check:mod` runs
226
+ `claude plugin validate` and `claude plugin test` on `packages/cli/mod`
227
+ (Claude Code needed, so not in CI); `tsc -p packages/cli/mod` type-checks it
228
+ once a `claude --plugin-dir packages/cli/mod` session has laid Claude
229
+ Code's types there.
230
+
155
231
  ### Hooks
156
232
 
157
233
  With `claude` in `agents`, each clone's `.claude/settings.json` and the
158
- workspace root's carry three Claude Code hooks, all run by the pinned copy:
234
+ workspace root's carry four Claude Code hooks, all run by the pinned copy:
159
235
 
160
236
  - **At session start** (`SessionStart`, every source): a line for the
161
237
  developer — `rness 0.10.0 · acme · scope web — 3 standards, 2 decisions`
@@ -163,7 +239,18 @@ workspace root's carry three Claude Code hooks, all run by the pinned copy:
163
239
  them. When the context may be wrong, both say why: no `.rness` next to the
164
240
  repository or nothing installed there, a `rness.json` rness refuses, a pin
165
241
  the installed copy does not match, the problems `rness validate` reports.
166
- After a compaction, the context only.
242
+ A Claude Code too old for the plugin's mod gets one more line, once (see
243
+ "The mod"). After a compaction, the context only.
244
+ - **Before an edit** (`PreToolUse` on `Edit|Write`): refused, with the
245
+ reason for the model, when it would change what `sync` generates — a
246
+ line of the block of an `AGENTS.md` or `CLAUDE.md` (the reason names the
247
+ standard that line comes from, to edit instead), or a file of
248
+ `.claude/skills/rness/` — or add a problem to a document of `.rness/` or
249
+ to `rness.json`. Only the problems the edit adds: a document already
250
+ broken stays editable. The `old_string` is found as Claude Code's `Edit`
251
+ finds it, straight quotes matching curly ones. Writes through Bash are
252
+ not seen: the guard is best effort. About 0.07 s per edit, 0.11 s for a
253
+ document of `.rness/` (measured 2026-10-04).
167
254
  - **After an edit** (`PostToolUse` on `Edit|Write`): when the file is under
168
255
  `.rness/`, its front-matter problems — or those of `rness.json` — go back
169
256
  to the model, which fixes them in the same turn. Any other edit costs one
@@ -181,7 +268,7 @@ hand counts as missing, and the next `sync` adds a second one. The team's
181
268
  own hooks stay where they are.
182
269
 
183
270
  Claude Code runs hooks from a committed settings file without asking each
184
- developer, including in `claude -p`. These three read `.rness/`, write
271
+ developer, including in `claude -p`. These four read `.rness/`, write
185
272
  nothing in the workspace and run no install. Only with a pulse declared do
186
273
  they reach the network, through a detached `rness` process that uses your
187
274
  login; when that process fails, it writes why to `pulse.json` in rness's
@@ -604,6 +691,32 @@ per repository, the files to commit there.
604
691
  Exit codes: 0 success, 1 failure, 2 usage — or a refusal without a TTY.
605
692
  `RNESS_DEBUG=1` adds stack traces; `RNESS_NO_DELEGATE=1` skips the delegation.
606
693
 
694
+ ## 0.20.0 — the status pane opens a document; ↑/↓ select, Tab changes the tab; Agent Pulse's colours and links
695
+
696
+ - `/rness:status` in Claude Code: each row's status in Agent Pulse's colour;
697
+ ↑/↓ select a row, Tab and Shift+Tab change the tab; Enter, or a click, on
698
+ a row shows the document in the pane and `q` brings the list back; Agent
699
+ Pulse is a link — the board from the list, the document's item from the
700
+ document. `rness status --json` prints each row's `color` and `link`, and
701
+ the board as `pulse`.
702
+
703
+ ## 0.19.0 — the plugin's mod; edits of generated files refused before they land
704
+
705
+ - The Claude Code plugin gains a mod (see "The mod"): the notes to act on
706
+ above the prompt, a status line entry, and `/rness:status` as a pane
707
+ beside the conversation, with no model turn, driven by the keyboard. `sync` writes three more files into `.claude/skills/rness/`,
708
+ at the root and in each clone; an upgrade lists the clone's for commit.
709
+ Claude Code without mods ignores them; older than 2.1.280, it is told once
710
+ per version, in the session-start line, to run `claude update` (when it
711
+ sets `AI_AGENT`, as 2.1.240 does).
712
+ - A fourth hook, `PreToolUse` on `Edit|Write`: an edit of the block of an
713
+ `AGENTS.md` or `CLAUDE.md`, or of the plugin's files, is refused before
714
+ it is written, naming the file to edit instead; so is an edit that would
715
+ add a problem to a document of `.rness/` or to `rness.json`. Until the
716
+ upgrade has run on a machine, a session there runs the old pinned copy,
717
+ which says `unknown hook event "pre-tool-use"` and lets the edit through.
718
+ - `rness status --json` prints the tabs and what the mod draws.
719
+
607
720
  ## 0.18.1 — a document without a number is caught; small fixes
608
721
 
609
722
  - `rness validate` and the edit hook name a document of `adr/`, `specs/` or
package/dist/bin/rness.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  findDelegate,
7
7
  reportError,
8
8
  run
9
- } from "../chunk-JHU2G7K7.js";
9
+ } from "../chunk-WIZHU4WT.js";
10
10
 
11
11
  // src/bin/rness.ts
12
12
  import { pathToFileURL } from "url";