codebyplan 1.13.22 → 1.13.24
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 +0 -109
- package/dist/cli.js +476 -690
- package/package.json +1 -1
- package/templates/hooks/README.md +3 -53
- package/templates/hooks/cbp-statusline.mjs +106 -11
- package/templates/hooks/cbp-statusline.py +79 -13
- package/templates/hooks/cbp-statusline.sh +97 -17
- package/templates/hooks/cbp-test-hooks.sh +0 -71
- package/templates/hooks/hooks.json +0 -20
- package/templates/settings.project.base.json +0 -7
- package/templates/skills/cbp-round-execute/SKILL.md +0 -18
- package/templates/skills/cbp-session-start/SKILL.md +2 -0
- package/templates/skills/cbp-task-complete/SKILL.md +0 -14
- package/templates/skills/cbp-task-start/SKILL.md +0 -8
- package/templates/hooks/cbp-cmux-branch-watch.sh +0 -39
- package/templates/hooks/cbp-cmux-workspace-sync.sh +0 -19
- package/templates/skills/cbp-setup-cmux/SKILL.md +0 -170
package/README.md
CHANGED
|
@@ -87,115 +87,6 @@ Show help message.
|
|
|
87
87
|
|
|
88
88
|
Print the CLI version.
|
|
89
89
|
|
|
90
|
-
## cmux integration
|
|
91
|
-
|
|
92
|
-
When you run Claude Code inside a [cmux](https://github.com/nicholasgasior/cmux) workspace, the `codebyplan` plugin automatically keeps the workspace metadata in sync with your git context:
|
|
93
|
-
|
|
94
|
-
- **On session start** — the workspace title is set to the current git branch, the workspace description is set to the repo folder basename, and the workspace color is applied from `.codebyplan/cmux.json` (configured via `/cbp-setup-cmux`). If no color is set, a one-line nudge is printed to session output.
|
|
95
|
-
- **On `git checkout` / `git switch`** — the same sync runs automatically after the Bash tool call completes (the match is broad and a redundant sync on a file-restore checkout is harmless, since `codebyplan cmux-sync` is idempotent).
|
|
96
|
-
|
|
97
|
-
This means your cmux workspace always reflects which branch and repo you're working in, without any manual intervention.
|
|
98
|
-
|
|
99
|
-
### How it works
|
|
100
|
-
|
|
101
|
-
Two hooks handle the sync:
|
|
102
|
-
|
|
103
|
-
| Hook | Event | Trigger |
|
|
104
|
-
| ---------------------------- | ------------------ | ------------------------------------------ |
|
|
105
|
-
| `cbp-cmux-workspace-sync.sh` | `SessionStart` | Every new Claude Code session |
|
|
106
|
-
| `cbp-cmux-branch-watch.sh` | `PostToolUse Bash` | Any `git checkout` or `git switch` command |
|
|
107
|
-
|
|
108
|
-
Both hooks delegate all logic to `codebyplan cmux-sync` — no cmux or git logic lives in the shell scripts.
|
|
109
|
-
|
|
110
|
-
### Binary resolution order
|
|
111
|
-
|
|
112
|
-
The `cmux` binary is resolved in this order (by `codebyplan cmux-sync` and `codebyplan cmux-status`, both delegating to `resolveCmuxBin()` in `lib/cmux.ts`):
|
|
113
|
-
|
|
114
|
-
1. `$CMUX_BUNDLED_CLI_PATH` — path cmux injects into its Claude hook environment
|
|
115
|
-
2. `$CMUX_CLAUDE_HOOK_CMUX_BIN` — alternative env var the hook environment may set
|
|
116
|
-
3. `cmux` on `$PATH` — fallback to the system-installed binary
|
|
117
|
-
|
|
118
|
-
### No-op outside cmux
|
|
119
|
-
|
|
120
|
-
Both hooks check for `$CMUX_WORKSPACE_ID` before doing anything. If you are not running inside a cmux workspace, the hooks exit immediately with no output and no side effects. Repos that do not use cmux are completely unaffected.
|
|
121
|
-
|
|
122
|
-
### Status surface
|
|
123
|
-
|
|
124
|
-
`codebyplan cmux-status` pushes CodeByPlan development state into the cmux workspace sidebar. The lifecycle skills (`cbp-task-start`, `cbp-task-complete`, `cbp-round-execute`) call it automatically — no manual invocation is needed.
|
|
125
|
-
|
|
126
|
-
**Flags:**
|
|
127
|
-
|
|
128
|
-
| Flag | Description |
|
|
129
|
-
| --------------------- | --------------------------------------------------------------- |
|
|
130
|
-
| `--checkpoint <text>` | Set the `cbp-checkpoint` status key |
|
|
131
|
-
| `--task <text>` | Set the `cbp-task` status key |
|
|
132
|
-
| `--qa <text>` | Set the `cbp-qa` status key |
|
|
133
|
-
| `--progress <val>` | Set the sidebar progress bar (0.0–1.0 float, or `N/D` fraction) |
|
|
134
|
-
| `--clear` | Clear all four keys from the sidebar |
|
|
135
|
-
|
|
136
|
-
**Examples:**
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
# Pushed by cbp-task-start when you start a task:
|
|
140
|
-
npx codebyplan cmux-status --checkpoint "CHK-176: cmux status" --task "TASK-2: implement cmux-status"
|
|
141
|
-
|
|
142
|
-
# Pushed by cbp-task-complete when a task finishes:
|
|
143
|
-
npx codebyplan cmux-status --task "TASK-2: implement cmux-status done" --progress 2/5
|
|
144
|
-
|
|
145
|
-
# Pushed by cbp-round-execute after each round:
|
|
146
|
-
npx codebyplan cmux-status --qa "R1 completed"
|
|
147
|
-
|
|
148
|
-
# Clear all status keys:
|
|
149
|
-
npx codebyplan cmux-status --clear
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
**`auto_status` toggle.** The command is gated by the `auto_status` field in `.codebyplan/cmux.json` (configured via `/cbp-setup-cmux`). When `auto_status` is `false`, every call is a no-op. The default is `true` — status pushing is enabled as long as the file exists or is absent (absent defaults to enabled).
|
|
153
|
-
|
|
154
|
-
**No-op outside cmux.** Like `codebyplan cmux-sync`, this command checks for `$CMUX_WORKSPACE_ID` before doing anything. Outside a cmux workspace it exits immediately with no output, so it is safe to call unconditionally from scripts and hooks.
|
|
155
|
-
|
|
156
|
-
### Auto dev server (`codebyplan cmux-serve`)
|
|
157
|
-
|
|
158
|
-
`codebyplan cmux-serve` auto-starts the dev server for any app whose source files are touched by the current round, and opens a cmux browser pane pointing at the allocated port. `cbp-round-execute` calls it automatically at round-execution start — no manual invocation is needed.
|
|
159
|
-
|
|
160
|
-
**How it works:**
|
|
161
|
-
|
|
162
|
-
The command receives the round's changed file list via `--files <comma-separated paths>`. It reads `.codebyplan/server.json` `port_allocations[]` and resolves which apps' source directories intersect the file list. For each matching app it:
|
|
163
|
-
|
|
164
|
-
1. Probes the allocated port (500ms `node:net` connection attempt — no `curl`, no `timeout`).
|
|
165
|
-
2. If the port is **not** listening: creates a `cmux new-split down` terminal pane and sends the dev command via `cmux send`.
|
|
166
|
-
3. Opens a browser pane via `cmux new-pane --type browser --url http://localhost:<port>`.
|
|
167
|
-
|
|
168
|
-
If the port is already listening (another worktree, or a previously started server) it skips straight to step 3 — only the browser pane is opened. This mitigates the multi-worktree port collision by never starting a second server on an already-occupied port.
|
|
169
|
-
|
|
170
|
-
**App-source-dir heuristic mapping** (from `port_allocations[].label` when `command` / `working_dir` are null):
|
|
171
|
-
|
|
172
|
-
| Label | App dir |
|
|
173
|
-
| ------------------------------ | -------------------------- |
|
|
174
|
-
| `Web Dev` | `apps/web` |
|
|
175
|
-
| `Web Dev (codebyplan-desktop)` | `apps/desktop` |
|
|
176
|
-
| `Backend Dev` | `apps/backend` |
|
|
177
|
-
| `MCP Dev` | `apps/mcp` |
|
|
178
|
-
| `Docs Ingest` | `apps/docs-ingest` |
|
|
179
|
-
| `E2E Tests` | skipped (not a dev server) |
|
|
180
|
-
|
|
181
|
-
When `allocation.command` and `allocation.working_dir` are both set (Tier 1), those values are used directly — the label heuristic is skipped. When no mapping exists for a label, one log line is emitted and the allocation is skipped; the rest continue.
|
|
182
|
-
|
|
183
|
-
**`auto_dev_server` toggle.** Gated by the `auto_dev_server` field in `.codebyplan/cmux.json` (configured via `/cbp-setup-cmux`). When `auto_dev_server` is `false`, every call is a no-op. The default is `true` — the feature is enabled as long as the file is absent or the key is not explicitly set to `false`.
|
|
184
|
-
|
|
185
|
-
**No-op outside cmux.** Like `codebyplan cmux-status`, this command checks for `$CMUX_WORKSPACE_ID` before doing anything. Outside a cmux workspace it exits immediately with no output and no side effects.
|
|
186
|
-
|
|
187
|
-
**Examples:**
|
|
188
|
-
|
|
189
|
-
```bash
|
|
190
|
-
# Called automatically by cbp-round-execute with the round's files:
|
|
191
|
-
npx codebyplan cmux-serve --files "apps/web/src/app/page.tsx,apps/web/src/components/Button.tsx"
|
|
192
|
-
|
|
193
|
-
# Target a specific app dir instead of a file list:
|
|
194
|
-
npx codebyplan cmux-serve --app apps/backend
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
---
|
|
198
|
-
|
|
199
90
|
## MCP Server
|
|
200
91
|
|
|
201
92
|
Claude Code connects to CodeByPlan via a remote MCP server. The `setup` command configures this automatically:
|