@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 +93 -74
- package/package.json +10 -15
- package/reference/sdlc/code.playbook/bin/playbook.js +438 -0
- package/reference/sdlc/code.playbook/code.fsm.ts +3 -2
- package/reference/sdlc/code.playbook/code.playbook.js +3 -2
- package/reference/sdlc/code.playbook/code.playbook.ts +3 -2
- package/reference/sdlc/code.playbook/code.registry.d.ts +18 -3
- package/reference/sdlc/code.playbook/code.registry.js +50 -32
- package/reference/sdlc/code.playbook/code.registry.ts +77 -37
- package/reference/sdlc/code.playbook/playbook-captain.d.ts +8 -5
- package/reference/sdlc/code.playbook/playbook-captain.js +141 -55
- package/reference/sdlc/code.playbook/playbook-captain.ts +203 -73
- package/reference/sdlc/code.playbook/playbook.config.template.yaml +58 -0
- package/reference/sdlc/code.playbook/bin/playbook-code.js +0 -453
- package/reference/sdlc/code.playbook/code.tmux-play.d.ts +0 -4
- package/reference/sdlc/code.playbook/code.tmux-play.js +0 -11
- package/reference/sdlc/code.playbook/code.tmux-play.ts +0 -29
- package/reference/sdlc/code.playbook/playbook-code.config.template.yaml +0 -72
- package/reference/sdlc/code.playbook/tmux-play.config.yaml +0 -50
- package/reference/sdlc/code.playbook/tmux-play.production.config.yaml +0 -33
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
|
|
58
|
+
playbook
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
For a one-shot run without a global install,
|
|
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
|
|
65
|
+
npx @sublang/playbook
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
On first run, `playbook
|
|
69
|
-
`${XDG_CONFIG_HOME:-$HOME/.config}/playbook/playbook
|
|
70
|
-
from the bundled
|
|
71
|
-
declared adapters before launching.
|
|
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
|
|
78
|
-
|
|
79
|
-
|
|
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
|
|
82
|
+
playbook --help
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
|
99
|
+
$EDITOR "${XDG_CONFIG_HOME:-$HOME/.config}/playbook/playbook.config.yaml"
|
|
97
100
|
```
|
|
98
101
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
`captain
|
|
103
|
-
`
|
|
104
|
-
`
|
|
105
|
-
|
|
106
|
-
the
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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
|
-
`
|
|
114
|
-
|
|
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
|
|
119
|
-
Reviewer on
|
|
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
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
|
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.
|
|
174
|
-
install -g @sublang/playbook`) resolves a compatible cligent 0.
|
|
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
|
|
188
|
-
|
|
189
|
-
|
|
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
|
|
208
|
+
pnpm playbook
|
|
193
209
|
```
|
|
194
210
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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
|
|
218
|
-
`@sublang/playbook/playbook-captain
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
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
|
|
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.
|
|
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/
|
|
54
|
-
"reference/sdlc/code.playbook/
|
|
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
|
|
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
|
|
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.
|
|
87
|
+
"@sublang/cligent": "^0.13.0",
|
|
93
88
|
"xstate": "^5.19.4",
|
|
94
89
|
"yaml": "^2.9.0"
|
|
95
90
|
},
|