@rness/cli 0.6.2 → 0.8.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
@@ -20,10 +20,10 @@ Inside a workspace, every `rness` delegates to the copy pinned in
20
20
 
21
21
  ## Commands
22
22
 
23
- rness create [<org>] [--repos a,b] [--pm npm|pnpm|yarn|bun] [--ssh|--https] [--skip-install] -y
24
- rness create <name> --blank [--pm npm|pnpm|yarn|bun] [--skip-install] -y
23
+ rness create [<org>] [--repos a,b] [--agent claude] [--pm npm|pnpm|yarn|bun] [--ssh|--https] [--skip-install] -y
24
+ rness create <name> --blank [--agent claude] [--pm npm|pnpm|yarn|bun] [--skip-install] -y
25
25
  rness add <repo> [--scopes apps/web,packages/ui] [--ssh|--https] -y
26
- rness sync [--all] [--scope <name>] [--check] [--pull] -y
26
+ rness sync [--all] [--scope <name>] [--check] [--pull] [--agent <name>] -y
27
27
  rness upgrade [<version>] -y
28
28
  rness login [--setup-git|--no-setup-git]
29
29
  rness logout
@@ -40,6 +40,35 @@ writes nothing and exits 1 when a block is out of date — use it in CI.
40
40
  `.rness/` goes to the network. Bring repositories in with
41
41
  `rness add <owner>/<repo>` or a git URL — a bare name needs an `"org"`.
42
42
 
43
+ ### Agent targets
44
+
45
+ The `AGENTS.md` block is what every agent reads. On top of it, rness writes
46
+ the files a given agent needs, for the agents the team declares in
47
+ `rness.json`:
48
+
49
+ rness sync --agent claude # declare claude, then write its files
50
+ rness sync # in a terminal, with nothing declared, asks once
51
+
52
+ ```json
53
+ { "contract": 1, "org": "acme", "agents": ["claude"], "repos": { … }, "scopes": { … } }
54
+ ```
55
+
56
+ - `agents` is the team's: the files it produces are committed in each
57
+ repository. `[]` means none; without the key, `sync` asks in a terminal and
58
+ never in scripts (`-y`, `--check`). A new workspace asks with `create`'s
59
+ other questions, or takes `--agent`.
60
+ - **Claude Code** (`claude`): each clone gets `.claude/settings.json` with
61
+ `../../.rness` in `permissions.additionalDirectories`, so a session in the
62
+ repository reads the context repository without a prompt. Claude Code
63
+ applies it once the repository has been trusted interactively. Verified
64
+ with Claude Code 2.1.284 on 2026-09-29.
65
+ - rness owns values, not files: what is missing is added, nothing else is
66
+ touched, and a file it cannot parse is reported, never rewritten.
67
+ `sync --check` and `validate` report a missing value. Removing an agent
68
+ from `agents` leaves its values in place; `sync` says where.
69
+ - Other agents (Codex, Cursor, GitHub Copilot) read the `AGENTS.md` block;
70
+ `sync` refuses an agent it has no target for.
71
+
43
72
  ### Log in
44
73
 
45
74
  rness login # shows a code and https://github.com/login/device
@@ -109,7 +138,8 @@ dependency does this: `util.styleText`, and a banner kept as a constant.
109
138
  ### Upgrade
110
139
 
111
140
  rness upgrade # the latest release; `rness upgrade 0.5.0` for another
112
- npx @rness/cli@latest upgrade # from a workspace pinned below 0.5.0
141
+ npx @rness/cli@latest upgrade # your global rness is older than the pin, or the pin is below 0.5.0
142
+ pnpm rness upgrade # inside .rness: the pinned copy merges its own scaffold
113
143
 
114
144
  The version is written in one place, `.rness/package.json`. `upgrade` pins it
115
145
  there (exact, the rest of the file untouched), installs with the workspace's
@@ -127,18 +157,44 @@ or later, which checks for itself whatever launched it. With an older global
127
157
  and a workspace below 0.5.3, a pin that moved is neither installed nor
128
158
  announced: `npm i -g @rness/cli@latest` once.
129
159
 
130
- Usually nobody runs `upgrade` at all. A workspace ships
131
- `.github/dependabot.yml`, so each release opens a pull request on the
132
- organization's `.rness`: the pin and the lockfile in the diff, `validate`
133
- running on the new version, review, merge. `upgrade` writes that file into
134
- workspaces created before 0.5.1. The pull request arrives 3 to 10 days after
135
- a release: the check is weekly, and Dependabot holds any new version back for
136
- 3 days by default, a guard against a compromised release. The file's header
137
- says how to lift that delay for `@rness/cli`.
160
+ A workspace ships `.github/dependabot.yml`, so each release opens a pull
161
+ request on the organization's `.rness`: the pin and the lockfile in the diff,
162
+ `validate` running on the new version, review, merge. The pull request
163
+ arrives 3 to 10 days after a release: the check is weekly, and Dependabot
164
+ holds any new version back for 3 days by default, a guard against a
165
+ compromised release. The file's header says how to lift that delay for
166
+ `@rness/cli`.
167
+
168
+ `upgrade` also merges the scaffold of the target version into `.rness`, with
169
+ git: the CI workflow, the hooks, the starter documents. After a Dependabot
170
+ pull request, run it once more to merge the scaffold of the version the pin
171
+ now names; `rness validate` warns while it is behind.
172
+
173
+ rness upgrade
174
+ merging the @rness/cli 0.8.0 scaffold
175
+ added .github/workflows/validate.yml
176
+ updated .githooks/pre-commit
177
+ merged AGENTS.md
178
+
179
+ - The base is the last scaffold commit of `.rness`: the commit `create` made,
180
+ or the previous `chore: rness scaffold <version>`. A file the team never
181
+ touched takes the new version; an edited one keeps its edits where the
182
+ scaffold did not change; overlapping lines conflict, and `upgrade` stops
183
+ before installing — resolve with git (`git checkout --ours <file>` keeps
184
+ yours, `--theirs` takes the scaffold's), commit, run `upgrade` again.
185
+ - `.rness` must be a clean git repository. The merge is staged, not
186
+ committed: the next steps end in one commit.
187
+ - A workspace with no scaffold commit (made by hand, or older than
188
+ `create`) is adopted: identical files merge silently, a differing one
189
+ conflicts once.
190
+ - Merge an upgrade pull request with a merge commit, not a squash: a squash
191
+ drops the scaffold commit, and the next upgrade falls back to an older base.
138
192
 
139
193
  `upgrade` is never delegated to the pinned copy, which is what it replaces
140
- — so a workspace pinned below 0.5.0, whose copy has no such command, starts
141
- with the `npx` form.
194
+ — so it runs the copy you typed. A global `rness` older than the pin answers
195
+ "already at" and merges no scaffold: use the `npx` form, or the pinned copy
196
+ from inside `.rness`. A workspace pinned below 0.5.0, whose copy has no such
197
+ command, starts with the `npx` form.
142
198
 
143
199
  An upgrade touches `.rness` only: a generated block is current when its hash
144
200
  is, whatever wrote it, so no `AGENTS.md` of the organization changes unless
@@ -147,6 +203,33 @@ its content does.
147
203
  Exit codes: 0 success, 1 failure, 2 usage — or a refusal without a TTY.
148
204
  `RNESS_DEBUG=1` adds stack traces; `RNESS_NO_DELEGATE=1` skips the delegation.
149
205
 
206
+ ## 0.8.0 — upgrade merges the scaffold
207
+
208
+ - `rness upgrade` merges the target version's scaffold into `.rness` with
209
+ git, three-way, from the last scaffold commit: files the team never
210
+ touched are updated, edits are kept, overlaps conflict and stop the
211
+ upgrade before the install. See "Upgrade". After a Dependabot pull request,
212
+ run `rness upgrade` once to merge the scaffold; nothing is installed.
213
+ - `rness validate` warns while the merged scaffold is behind the pin.
214
+ - The commit `create` makes carries `Rness-Scaffold: <version>`.
215
+ - Breaking: `upgrade` refuses a `.rness` that is not a clean git repository.
216
+ The two migrations it carried (an old `validate.yml` line, a missing
217
+ `dependabot.yml`) are what the merge does now.
218
+ - Blocks are unchanged: no `rness sync` is needed after upgrading.
219
+
220
+ ## 0.7.0 — agent targets: Claude Code
221
+
222
+ - `rness.json` may declare the team's agents: `"agents": ["claude"]`. It is
223
+ an optional key of contract 1; no block changes. A CLI older than 0.7.0
224
+ refuses the key: move the pin before declaring an agent.
225
+ - `rness sync --agent claude` declares it and writes each clone's
226
+ `.claude/settings.json` (`../../.rness` in
227
+ `permissions.additionalDirectories`). In a terminal with nothing declared,
228
+ `sync` asks once which agents the team uses; `create` asks for a new
229
+ workspace, or takes `--agent`.
230
+ - `sync --check` and `validate` cover the agent files, and `sync --pull`
231
+ does not count them as local changes. See "Agent targets".
232
+
150
233
  ## 0.6.2 — no dialog for the root CLAUDE.md
151
234
 
152
235
  - Opening Claude Code in a repository of the workspace no longer asks "Allow
package/dist/bin/rness.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  findDelegate,
7
7
  reportError,
8
8
  run
9
- } from "../chunk-7TOHFPW6.js";
9
+ } from "../chunk-VQMX52HT.js";
10
10
 
11
11
  // src/bin/rness.ts
12
12
  import { pathToFileURL } from "url";