@sublang/playbook 0.7.0 → 0.9.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
@@ -55,79 +55,93 @@ npm install -g @sublang/playbook
55
55
  Then launch the reference playbook in a `tmux-play` session:
56
56
 
57
57
  ```sh
58
- playbook-code
58
+ playbook
59
59
  ```
60
60
 
61
- For a one-shot run without a global install, use the same command
62
- through npx:
61
+ For a one-shot run without a global install, invoke the scoped
62
+ package through npx (it runs the package's `playbook` bin):
63
63
 
64
64
  ```sh
65
- npx playbook-code
65
+ npx @sublang/playbook
66
66
  ```
67
67
 
68
- On first run, `playbook-code` creates a commented user config at
69
- `${XDG_CONFIG_HOME:-$HOME/.config}/playbook/playbook-code.config.yaml`
70
- from the bundled template, prints that path to stderr, then checks the
71
- declared adapters before launching. Later runs reuse that file and do
72
- not overwrite it.
68
+ On first run, `playbook` creates a commented user config at
69
+ `${XDG_CONFIG_HOME:-$HOME/.config}/playbook/playbook.config.yaml`
70
+ from the bundled starter, prints that path to stderr, then composes a
71
+ `tmux-play` config and checks the declared adapters before launching.
72
+ Later runs reuse that file and do not overwrite it.
73
73
 
74
74
  Known adapter readiness is intentionally light: `claude` is ready when
75
75
  local Claude Code auth exists or `ANTHROPIC_API_KEY` is set; `codex` is
76
76
  ready when local Codex CLI auth exists or `OPENAI_API_KEY` is set. If a
77
- known adapter is not ready, `playbook-code` prints its own help text
78
- with the config path, auth pointers, and agent-swap recipe, then exits
79
- without launching. You can view the same recovery text at any time:
77
+ known adapter is not ready, `playbook` prints its own help text with the
78
+ config path, auth pointers, and agent-swap recipe, then exits without
79
+ launching. You can view the same recovery text at any time:
80
80
 
81
81
  ```sh
82
- playbook-code --help
82
+ playbook --help
83
83
  ```
84
84
 
85
- The seed template runs each agent in cligent's protected auto mode
86
- (`permissions.mode: auto`), suppressing routine approval prompts. Its
87
- Codex Coder also grants `permissions.writablePaths: [.git]` so git
88
- metadata writes stay available under auto mode without switching to
89
- bypass permissions.
85
+ `playbook --list` prints the configured playbooks with their slash
86
+ commands and intents. Every seeded agent the Captain and both roles —
87
+ runs in cligent's protected auto mode (`permissions.mode: auto`), so
88
+ routine in-session approval prompts are suppressed without switching to
89
+ bypass permissions. The seeded Codex Reviewer additionally grants
90
+ `permissions.writablePaths: [.git]` so git metadata writes stay
91
+ available under the Codex sandbox; the Claude agents need no such grant
92
+ under their auto mode.
90
93
 
91
94
  ### Configure agents
92
95
 
93
96
  Edit the seeded user config when you want different coding agents:
94
97
 
95
98
  ```sh
96
- $EDITOR "${XDG_CONFIG_HOME:-$HOME/.config}/playbook/playbook-code.config.yaml"
99
+ $EDITOR "${XDG_CONFIG_HOME:-$HOME/.config}/playbook/playbook.config.yaml"
97
100
  ```
98
101
 
99
- Both CODE players can use `claude` or `codex`; other adapter ids are
100
- passed through to `tmux-play` with a warning because `playbook-code`
101
- does not know how to preflight their auth. The safe tuning points are
102
- `captain.adapter`, `captain.model`, and each role's `adapter` and
103
- `model` under `players.coder` / `players.reviewer`. The composer owns
104
- `captain.from` and points it at the Playbook Captain shell adapter, and
105
- it owns the `coder` / `reviewer` role keys, so leave those keys as-is;
106
- the runtime binds to those host-configuration invariants per
107
- [PBRT-4](specs/user/playbook-runtime.md#pbrt-4) and derives the
108
- `<coder-llm>` / `<reviewer-llm>` substitution strings from each role's
109
- `model` when pinned and `adapter` otherwise — so the Committer's
102
+ The config is top-level (no `config:` wrapper): a `profiles` map of
103
+ reusable agent settings, a `captain` Judge agent, optional `layout` /
104
+ `notifications` / `theme`, and a `playbooks` map of enabled playbooks. Each
105
+ `captain` or `players.<role>` value is a profile id or an adapter
106
+ shorthand (`claude`, `codex`); other adapter ids are passed through to
107
+ `tmux-play` with a warning because `playbook` cannot preflight their
108
+ auth. Name profiles by their underlying agent/model (e.g. `claude-opus`,
109
+ `codex-gpt`) so the profile ids read distinctly from the `coder` /
110
+ `reviewer` player roles that reference them. Within a `playbooks.<id>` block, `from` (the registry module),
111
+ `command` (an optional slash-command override), and `players` are
112
+ launcher-owned; every other key (e.g. CODE's `committer`) is that
113
+ playbook's option slice. The launcher injects `captain.from` and the
114
+ namespaced `<id>-<role>` host players, so you do not write those by
115
+ hand.
116
+
117
+ CODE's per-run `<coder-llm>` / `<reviewer-llm>` prompt strings come from
118
+ each role's pinned `model`, else its `adapter`
119
+ ([PBRT-4](specs/user/playbook-runtime.md#pbrt-4)) — so the Committer's
110
120
  commit-message trailers can name the concrete model
111
- (e.g. `claude-opus-4-8`) rather than the adapter family (`claude`).
112
-
113
- `players.committer` is an optional alias naming which role `coder`
114
- or `reviewer` runs the commit turn; the seeded overlay points it at
115
- the Reviewer. Absent the alias the Committer falls back to the Coder
121
+ (e.g. `claude-opus-4-8[1m]`) rather than the adapter family (`claude`).
122
+ `committer` is an optional CODE alias naming which role — `coder` or
123
+ `reviewer` runs the commit turn; the seeded config points it at the
124
+ Coder, and absent the alias the Committer falls back to the Coder
116
125
  ([PBRT-8](specs/user/playbook-runtime.md#pbrt-8)).
117
126
 
118
- For example, the seeded overlay runs the Coder on Codex and the
119
- Reviewer on Claude, with the Committer aliased to the Reviewer:
127
+ For example, the seeded config runs the Coder on Claude Opus 4.8 1m and
128
+ the Reviewer on GPT-5.5, with the Committer aliased to the Coder:
120
129
 
121
130
  ```yaml
122
- captain:
123
- adapter: claude
124
- model: claude-sonnet-4-6
125
- reasoningEffort: high
126
- permissions:
127
- mode: auto
128
-
129
- players:
130
- coder: # role key must stay `coder` — see PBRT-4
131
+ profiles:
132
+ claude-opus:
133
+ adapter: claude
134
+ model: claude-opus-4-8
135
+ reasoningEffort: high
136
+ permissions:
137
+ mode: auto # protected auto mode for the Claude Captain
138
+ claude-opus-1m:
139
+ adapter: claude
140
+ model: claude-opus-4-8[1m]
141
+ reasoningEffort: xhigh
142
+ permissions:
143
+ mode: auto # protected auto mode for the Claude Coder
144
+ codex-gpt:
131
145
  adapter: codex
132
146
  model: gpt-5.5
133
147
  reasoningEffort: xhigh
@@ -135,23 +149,25 @@ players:
135
149
  mode: auto
136
150
  writablePaths:
137
151
  - .git # allow git metadata writes under Codex auto mode
138
- reviewer: # role key must stay `reviewer` — see PBRT-4
139
- adapter: claude
140
- model: claude-opus-4-8
141
- reasoningEffort: xhigh
142
- permissions:
143
- mode: auto
144
- committer: reviewer # which role commits — `coder` or `reviewer`
152
+
153
+ captain: claude-opus
154
+
155
+ playbooks:
156
+ code:
157
+ from: "@sublang/playbook/code/registry"
158
+ players:
159
+ coder: claude-opus-1m
160
+ reviewer: codex-gpt
161
+ committer: coder # which role commits — `coder` or `reviewer`
145
162
  ```
146
163
 
147
- Normal `playbook-code` runs use the seeded path above. If you need a
148
- separate config file for a one-off run, pass it explicitly; this bypasses
149
- the seed and readiness gate and forwards the arguments to `tmux-play`
150
- verbatim, as pinned in
151
- [PBCODE-1](specs/user/playbook-code.md#pbcode-1):
164
+ If you need a separate config file for a one-off run, pass a raw
165
+ `tmux-play` config explicitly; this bypasses the seed, composition, and
166
+ readiness gate and forwards the arguments to `tmux-play` verbatim
167
+ ([PBCLI-1](specs/user/playbook-cli.md#pbcli-1)):
152
168
 
153
169
  ```sh
154
- playbook-code --config ./playbook-code.config.yaml
170
+ playbook --config ./tmux-play.config.yaml
155
171
  ```
156
172
 
157
173
  ### Install (contributors / from source)
@@ -170,8 +186,8 @@ pnpm test
170
186
  in the checked-in `pnpm-lock.yaml` — the same version CI installs
171
187
  via `--frozen-lockfile`, so contributor checkouts and CI agree.
172
188
  The published `package.json` declares `@sublang/cligent` as
173
- `^0.12.0`, so an end-user install with no lockfile (e.g., `npm
174
- install -g @sublang/playbook`) resolves a compatible cligent 0.12.x
189
+ `^0.13.0`, so an end-user install with no lockfile (e.g., `npm
190
+ install -g @sublang/playbook`) resolves a compatible cligent 0.13.x
175
191
  release (see [RELEASE-14](specs/dev/release.md#release-14)). To
176
192
  refresh the contributor pin within that range, run
177
193
  `pnpm update @sublang/cligent` and commit the resulting
@@ -184,17 +200,19 @@ instead, copy
184
200
  into place; the override is gitignored so it never leaks into a
185
201
  production install.
186
202
 
187
- Drive a Boss turn against the source tree (uses the developer
188
- [`tmux-play.config.yaml`](reference/sdlc/code.playbook/tmux-play.config.yaml)
189
- that imports the compiled Playbook Captain shell via relative path):
203
+ Drive a Boss turn against the source tree with the launcher, which
204
+ resolves `tmux-play`, the Playbook Captain shell, and the CODE registry
205
+ from the local package:
190
206
 
191
207
  ```sh
192
- pnpm exec tmux-play --config reference/sdlc/code.playbook/tmux-play.config.yaml
208
+ pnpm playbook
193
209
  ```
194
210
 
195
- `pnpm exec` resolves `tmux-play` from the package's local
196
- `node_modules/.bin/`, so this works whether or not `@sublang/cligent` is
197
- installed globally.
211
+ On first run this seeds the generic config at
212
+ `${XDG_CONFIG_HOME:-$HOME/.config}/playbook/playbook.config.yaml`
213
+ (see [Configure agents](#configure-agents)) and launches the composed
214
+ session, so this works whether or not `@sublang/cligent` is installed
215
+ globally.
198
216
 
199
217
  ### Running a Boss turn
200
218
 
@@ -214,11 +232,12 @@ and streams the CODE state machine with the four-glyph vocabulary `◆ ▸ ⮕
214
232
  [PBRT-3](specs/user/playbook-runtime.md#pbrt-3), while player prompts
215
233
  ride their own panes.
216
234
 
217
- Published configs should import the shell adapter from
218
- `@sublang/playbook/playbook-captain`. Existing explicit configs that
219
- still import `@sublang/playbook/code/tmux-play` keep resolving through
220
- a compatibility shim that delegates to the same shell with CODE
221
- registered.
235
+ Published configs import the shell adapter from
236
+ `@sublang/playbook/playbook-captain` and enable CODE through a
237
+ `captain.options.playbooks.code` block whose `from` is
238
+ `@sublang/playbook/code/registry`. The generic `playbook` launcher
239
+ composes this for you from the top-level `profiles` / `playbooks`
240
+ config above.
222
241
 
223
242
  ### Embedding the runtime in your own host
224
243
 
@@ -307,7 +326,7 @@ package.
307
326
 
308
327
  ## Requirements
309
328
 
310
- - Node.js ≥ 20.6.0 (the `playbook-code` shim uses
329
+ - Node.js ≥ 20.6.0 (the `playbook` launcher uses
311
330
  `import.meta.resolve`, unflagged since this release)
312
331
  - pnpm 9 (for the reference package)
313
332
  - A configured `tmux-play` host (for live Boss turns) — requires
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sublang/playbook",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "type": "module",
5
5
  "description": "Reference CODE playbook — XState v5 FSM, host-agnostic runtime, and Playbook Captain shell for a coder/reviewer/committer loop driven by GEARS spec items.",
6
6
  "license": "Apache-2.0",
@@ -46,17 +46,12 @@
46
46
  "reference/sdlc/code.playbook/playbook-captain.ts",
47
47
  "reference/sdlc/code.playbook/playbook-captain.js",
48
48
  "reference/sdlc/code.playbook/playbook-captain.d.ts",
49
- "reference/sdlc/code.playbook/code.tmux-play.ts",
50
- "reference/sdlc/code.playbook/code.tmux-play.js",
51
- "reference/sdlc/code.playbook/code.tmux-play.d.ts",
52
49
  "reference/sdlc/code.playbook/code.gears.md",
53
- "reference/sdlc/code.playbook/tmux-play.config.yaml",
54
- "reference/sdlc/code.playbook/tmux-play.production.config.yaml",
55
- "reference/sdlc/code.playbook/playbook-code.config.template.yaml",
56
- "reference/sdlc/code.playbook/bin/playbook-code.js"
50
+ "reference/sdlc/code.playbook/playbook.config.template.yaml",
51
+ "reference/sdlc/code.playbook/bin/playbook.js"
57
52
  ],
58
53
  "bin": {
59
- "playbook-code": "reference/sdlc/code.playbook/bin/playbook-code.js"
54
+ "playbook": "reference/sdlc/code.playbook/bin/playbook.js"
60
55
  },
61
56
  "exports": {
62
57
  "./runtime": {
@@ -67,20 +62,20 @@
67
62
  "types": "./reference/sdlc/code.playbook/code.playbook.d.ts",
68
63
  "default": "./reference/sdlc/code.playbook/code.playbook.js"
69
64
  },
65
+ "./code/registry": {
66
+ "types": "./reference/sdlc/code.playbook/code.registry.d.ts",
67
+ "default": "./reference/sdlc/code.playbook/code.registry.js"
68
+ },
70
69
  "./playbook-captain": {
71
70
  "types": "./reference/sdlc/code.playbook/playbook-captain.d.ts",
72
71
  "default": "./reference/sdlc/code.playbook/playbook-captain.js"
73
72
  },
74
- "./code/tmux-play": {
75
- "types": "./reference/sdlc/code.playbook/code.tmux-play.d.ts",
76
- "default": "./reference/sdlc/code.playbook/code.tmux-play.js"
77
- },
78
73
  "./slc/*": "./slc/*"
79
74
  },
80
75
  "scripts": {
81
76
  "build": "tsc",
82
77
  "test": "vitest run",
83
- "playbook-code": "node reference/sdlc/code.playbook/bin/playbook-code.js"
78
+ "playbook": "node reference/sdlc/code.playbook/bin/playbook.js"
84
79
  },
85
80
  "publishConfig": {
86
81
  "access": "public",
@@ -89,7 +84,7 @@
89
84
  "dependencies": {
90
85
  "@anthropic-ai/claude-agent-sdk": "^0.3.143",
91
86
  "@openai/codex-sdk": "^0.139.0",
92
- "@sublang/cligent": "^0.12.0",
87
+ "@sublang/cligent": "^0.13.0",
93
88
  "xstate": "^5.19.4",
94
89
  "yaml": "^2.9.0"
95
90
  },