@sublang/playbook 0.8.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,86 +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 Reviewer 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[1m]`) rather than the adapter family
112
- (`claude`).
113
-
114
- `players.committer` is an optional alias naming which role `coder`
115
- or `reviewer` — runs the commit turn; the seeded overlay points it at
116
- the Coder. 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
117
125
  ([PBRT-8](specs/user/playbook-runtime.md#pbrt-8)).
118
126
 
119
- For example, the seeded overlay runs the Coder on Claude Opus 4.8 1m
120
- and the Reviewer on GPT-5.5, with the Committer aliased to the Coder:
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:
121
129
 
122
130
  ```yaml
123
- captain:
124
- adapter: claude
125
- model: claude-opus-4-8
126
- reasoningEffort: high
127
- permissions:
128
- mode: auto
129
-
130
- players:
131
- 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:
132
139
  adapter: claude
133
140
  model: claude-opus-4-8[1m]
134
141
  reasoningEffort: xhigh
135
142
  permissions:
136
- mode: auto
137
- reviewer: # role key must stay `reviewer` — see PBRT-4
143
+ mode: auto # protected auto mode for the Claude Coder
144
+ codex-gpt:
138
145
  adapter: codex
139
146
  model: gpt-5.5
140
147
  reasoningEffort: xhigh
@@ -142,17 +149,25 @@ players:
142
149
  mode: auto
143
150
  writablePaths:
144
151
  - .git # allow git metadata writes under Codex auto mode
145
- committer: coder # 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`
146
162
  ```
147
163
 
148
- Normal `playbook-code` runs use the seeded path above. If you need a
149
- separate config file for a one-off run, pass it explicitly; this bypasses
150
- the seed and readiness gate and forwards the arguments to `tmux-play`
151
- verbatim, as pinned in
152
- [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)):
153
168
 
154
169
  ```sh
155
- playbook-code --config ./playbook-code.config.yaml
170
+ playbook --config ./tmux-play.config.yaml
156
171
  ```
157
172
 
158
173
  ### Install (contributors / from source)
@@ -185,17 +200,19 @@ instead, copy
185
200
  into place; the override is gitignored so it never leaks into a
186
201
  production install.
187
202
 
188
- Drive a Boss turn against the source tree (uses the developer
189
- [`tmux-play.config.yaml`](reference/sdlc/code.playbook/tmux-play.config.yaml)
190
- 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:
191
206
 
192
207
  ```sh
193
- pnpm exec tmux-play --config reference/sdlc/code.playbook/tmux-play.config.yaml
208
+ pnpm playbook
194
209
  ```
195
210
 
196
- `pnpm exec` resolves `tmux-play` from the package's local
197
- `node_modules/.bin/`, so this works whether or not `@sublang/cligent` is
198
- 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.
199
216
 
200
217
  ### Running a Boss turn
201
218
 
@@ -215,11 +232,12 @@ and streams the CODE state machine with the four-glyph vocabulary `◆ ▸ ⮕
215
232
  [PBRT-3](specs/user/playbook-runtime.md#pbrt-3), while player prompts
216
233
  ride their own panes.
217
234
 
218
- Published configs should import the shell adapter from
219
- `@sublang/playbook/playbook-captain`. Existing explicit configs that
220
- still import `@sublang/playbook/code/tmux-play` keep resolving through
221
- a compatibility shim that delegates to the same shell with CODE
222
- 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.
223
241
 
224
242
  ### Embedding the runtime in your own host
225
243
 
@@ -308,7 +326,7 @@ package.
308
326
 
309
327
  ## Requirements
310
328
 
311
- - Node.js ≥ 20.6.0 (the `playbook-code` shim uses
329
+ - Node.js ≥ 20.6.0 (the `playbook` launcher uses
312
330
  `import.meta.resolve`, unflagged since this release)
313
331
  - pnpm 9 (for the reference package)
314
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.8.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",