@vibecompass/vibecompass 0.6.0 → 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
@@ -6,784 +6,188 @@
6
6
 
7
7
  # @vibecompass/vibecompass
8
8
 
9
- Local-first project-memory core for [VibeCompass](https://vibecompass.dev).
10
-
11
- This package owns the canonical local file contract for VibeCompass project
12
- memory: `project.yaml`, `architecture/`, `decisions/`, `sessions/`, and the
13
- derived `state/manifest.json` that lets tools read the local root efficiently.
14
-
15
- ## Current scope
16
-
17
- Shipped today:
18
-
19
- - `vibecompass init` for scaffolding a project-memory root
20
- - interactive guided init for placement, workflow bootstrap, and first-session setup
21
- - lightweight starter architecture/session memory plus example-only decision guidance
22
- - generated `context.md` plus opt-in workflow guide files
23
- - opt-in starter `CLAUDE.md` / `AGENTS.md` templates that are created only when missing, with VibeCompass-managed regions for future refreshes
24
- - `vibecompass start-session` / `vibecompass close-session` for lane-aware local builder workflow
25
- - `vibecompass list-sessions` / `vibecompass switch-session` for multiple active session lanes
26
- - `vibecompass end-session` as a discoverable alias for `close-session`
27
- - `vibecompass sync-agents` for generated `CLAUDE.md`, `AGENTS.md`, `.cursorrules`, and `.github/copilot-instructions.md` views
28
- - `vibecompass status` for a read-only project-memory health and drift report
29
- - `vibecompass refresh-workflow` for explicit dry-run/apply refresh of package-owned derived workflow files
30
- - `vibecompass docs-review --guided` — print a comprehensive review prompt for your chosen LLM to run
31
- - `vibecompass docs-review --submit-hosted` — submit the review request to the hosted app and poll for proposal/artifact output
32
- - `vibecompass docs-review --run-local --provider anthropic` — local provider adapter that saves review output locally
33
- - `vibecompass docs-review --apply-output` — apply accepted architecture-doc blocks into canonical `architecture/` docs
34
- - docs-review prompt v2 with staged evidence inventory, coverage planning, bounded doc generation, retrieval metadata, and soft oversized-doc warnings
35
- - strict docs-review output validation for architecture-doc fences, duplicate paths, and required frontmatter
36
- - `vibecompass docs-review --complete` — mark the review accepted after the docs land
37
- - hosted sync commands: `push`, `pull-preview`, `pull-export`, and `apply-export`
38
- - canonical file scanning and validation
39
- - `state/manifest.json` generation
40
- - JavaScript read-model helpers for project, feature, decision, and file context
41
-
42
- Not shipped yet:
43
-
44
- - one-command hosted docs-review that directly writes canonical local docs
45
- - additional local docs-review providers beyond Anthropic
46
- - automatic acceptance of review findings without a local apply step
47
-
48
- The package is useful today as the local project-memory CLI and JavaScript
49
- core. Use it to create a root, keep project memory current, run local sessions,
50
- and sync with hosted VibeCompass when you have a hosted project binding.
51
-
52
- ## Requirements
53
-
54
- - Node.js 20+
9
+ Local-first project memory for AI coding sessions.
10
+
11
+ VibeCompass creates a `.compass/` project-memory root with architecture docs,
12
+ decision logs, session notes, and agent instructions so Claude Code, Codex,
13
+ Cursor, and Copilot can pick up where the last session left off.
14
+
15
+ Full docs: https://vibecompass.dev/developers
55
16
 
56
17
  ## Install
57
18
 
58
- ### CLI
19
+ Run without installing:
59
20
 
60
21
  ```bash
61
22
  npx -y @vibecompass/vibecompass --help
62
23
  ```
63
24
 
64
- The npm package is scoped under the VibeCompass org, but the installed CLI
65
- command is intentionally unscoped: `vibecompass`.
66
-
67
- ### Library
25
+ Or install in a project:
68
26
 
69
27
  ```bash
70
28
  npm install @vibecompass/vibecompass
71
29
  ```
72
30
 
73
- ## Latest release
31
+ Requires Node.js 20+.
74
32
 
75
- `0.6.0` upgrades docs-review to `VibeCompass Docs Review Prompt v2`.
76
- The generated review prompt now guides the LLM through evidence inventory,
77
- coverage planning, bounded architecture-doc generation, and apply/verify.
78
- Accepted architecture docs over the 12000-byte soft budget are still applied,
79
- but surface an `oversized_architecture_doc` warning so users can compact them
80
- before future LLM sessions load that context.
33
+ ## Quick Start
81
34
 
82
- ## Quickstart
83
-
84
- Most users should start with the guided bootstrap:
35
+ Create project memory:
85
36
 
86
37
  ```bash
87
38
  npx -y @vibecompass/vibecompass init --guided
88
39
  ```
89
40
 
90
- Guided init asks about repo topology, recommends a placement pattern
91
- (`workspace-root`, `dedicated-memory-repo`, or `primary-repo`), writes
92
- lightweight starter project memory, scaffolds the workflow files you opt into,
93
- and can open the first builder session immediately.
94
-
95
- After init, the usual loop is:
41
+ Check what to do next:
96
42
 
97
43
  ```bash
98
44
  npx -y @vibecompass/vibecompass status --root .compass
99
- npx -y @vibecompass/vibecompass start-session --root .compass --id feature-lane --working-on "Build the next feature"
100
- npx -y @vibecompass/vibecompass docs-review --root .compass --guided
101
- npx -y @vibecompass/vibecompass close-session --root .compass --session feature-lane --title "Feature Lane" --completed "Shipped the slice" --next-step "Review and publish"
102
45
  ```
103
46
 
104
- Run `vibecompass status` when you are not sure what to do next. It is
105
- read-only and prints the safest follow-up commands for the current root.
106
-
107
- When the owner directory is a workspace root or primary repo, the canonical
108
- root defaults to `.compass/` inside that directory. For a dedicated memory repo,
109
- the canonical root defaults to the repo root itself.
110
-
111
- Skip the prompts and drive the setup explicitly:
112
-
113
- ```bash
114
- npx -y @vibecompass/vibecompass init \
115
- --placement primary-repo \
116
- --tooling-root . \
117
- --name "Acme Platform" \
118
- --mode local-only \
119
- --repo app=https://github.com/acme/app.git \
120
- --with-workflow \
121
- --with-claude \
122
- --with-agents \
123
- --close-session-git-publish \
124
- --close-session-git-remote origin \
125
- --start-session \
126
- --session-id mcp-dogfood \
127
- --session-working-on "Validate the local-first MCP workflow"
128
- ```
129
-
130
- That creates the canonical root plus lightweight starter memory:
131
-
132
- ```text
133
- PROJECT_MEMORY_ROOT/project.yaml
134
- PROJECT_MEMORY_ROOT/architecture/overview/project-shape.md
135
- PROJECT_MEMORY_ROOT/decisions/EXAMPLE.md # example-only, ignored by canonical parsing
136
- PROJECT_MEMORY_ROOT/sessions/YYYY-MM-DD-1-project-memory-initialized.md
137
- PROJECT_MEMORY_ROOT/state/manifest.json
138
- ```
139
-
140
- The starter architecture doc is intentionally marked as initial scaffold
141
- coverage. It is useful orientation, not a comprehensive review. Before risky
142
- implementation work, inspect the relevant code and replace or expand the
143
- starter docs with evidence-backed domain/feature/component docs.
144
-
145
- When workflow scaffolding is enabled, init also creates:
146
-
147
- ```text
148
- PROJECT_MEMORY_ROOT/context.md
149
- PROJECT_MEMORY_ROOT/architecture/README.md
150
- PROJECT_MEMORY_ROOT/decisions/README.md
151
- PROJECT_MEMORY_ROOT/sessions/README.md
152
- CLAUDE.md # at the tooling root, only if missing and --with-claude is used
153
- AGENTS.md # at the tooling root, only if missing and --with-agents is used
154
- ```
155
-
156
- `context.md` is a derived package-owned file. Re-running `init --force --with-workflow`
157
- regenerates it; do not treat it as a hand-edited source document.
158
- Starter `CLAUDE.md` / `AGENTS.md` files include VibeCompass managed markers
159
- when the package creates them, so later `sync-agents` and session lifecycle
160
- commands can refresh the generated region without warning. If those files
161
- already exist without markers, init leaves them untouched unless you explicitly
162
- adopt them.
163
-
164
- Check an initialized root without writing files:
165
-
166
- ```bash
167
- npx -y @vibecompass/vibecompass status --root .compass
168
- ```
169
-
170
- Use `status --json` when another tool needs the typed diagnostic model. The
171
- JSON output intentionally excludes raw hosted preview tokens and resolved
172
- credential values.
173
-
174
- Preview package-owned workflow refreshes without mutating files:
175
-
176
- ```bash
177
- npx -y @vibecompass/vibecompass refresh-workflow --root .compass --dry-run
178
- ```
179
-
180
- Apply the refresh explicitly when the plan looks right:
181
-
182
- ```bash
183
- npx -y @vibecompass/vibecompass refresh-workflow --root .compass --apply
184
- ```
185
-
186
- `refresh-workflow` updates generated workflow artifacts such as `context.md`,
187
- workflow guide READMEs, managed agent-file blocks, and the local
188
- `state/manifest.json`. Existing package-version stamps are sticky by default;
189
- pass `--update-package-stamp` when you intentionally want to move the
190
- canonical `project.yaml.metadata.package_version` stamp to the current CLI.
191
-
192
- ## After init: generate real architecture docs
193
-
194
- `init` writes a small starter map of your project. To turn it into real
195
- architecture docs, run a docs-review and let your AI tool write them:
196
-
197
- ```bash
198
- npx -y @vibecompass/vibecompass docs-review --guided
199
- ```
200
-
201
- You can run this right after `init`, or any time later — for example after
202
- scope expands, or before risky implementation work. `start-session` will
203
- remind you with a non-blocking warning if no completed review exists.
204
-
205
- What happens:
206
-
207
- 1. The CLI asks which LLM you'll use, then prints a versioned staged review prompt with fixed review criteria.
208
- 2. You paste that prompt into your AI tool (Claude Code, Codex, Cursor, etc.).
209
- 3. The AI inventories project memory and source evidence, proposes a coverage plan, then writes only accepted architecture docs under
210
- `architecture/<domain>/<feature>/<component>.md`.
211
- 4. Run `vibecompass docs-review --apply-output` after accepting fenced
212
- architecture-doc blocks, or `--complete` if accepted docs were written
213
- manually.
214
-
215
- The guided prompt is deterministic apart from project-specific fields
216
- (`project`, `mode`, `root`, provider, and model). It uses the same structure
217
- VibeCompass dogfoods: read project memory first, inspect source evidence,
218
- build a coverage plan, write retrieval-oriented component docs with review
219
- metadata, preserve the starter overview, and emit accepted docs as
220
- `vibecompass-architecture-doc` blocks. The prompt includes a soft 12000-byte
221
- budget per generated architecture doc so future LLM sessions can load targeted
222
- context without pulling oversized narrative files by default.
223
-
224
- Plain `--guided` never calls an AI itself. You stay in control of which
225
- provider runs the review and what gets saved. Use `--run-local --provider
226
- anthropic` when you want the package to execute the same review through your
227
- local Anthropic key.
228
-
229
- ### Other ways to run a review
230
-
231
- - `--submit-hosted` sends the review request to the hosted app and records a
232
- run ID. Hosted execution creates proposals and docs-review artifacts; for
233
- local-primary projects, canonical local files change only after
234
- pull-preview/export/apply and a confirming push.
235
- - `--run-local --provider anthropic` calls Anthropic directly with your
236
- `ANTHROPIC_API_KEY` and saves the raw output to
237
- `state/docs-review-output.md`.
238
- - `--apply-output` writes accepted fenced architecture-doc blocks from
239
- `state/docs-review-output.md` into canonical `architecture/` docs and
240
- completes the local review marker.
241
-
242
- For most users, stick with `--guided`.
243
-
244
- If you do not chain straight into a first session from `init`, open one later:
47
+ Start a builder session:
245
48
 
246
49
  ```bash
247
50
  npx -y @vibecompass/vibecompass start-session \
248
- --id mcp-dogfood \
249
- --working-on "Validate the MCP dogfood workflow against the docs repo"
250
- ```
251
-
252
- Close the active builder session:
253
-
254
- ```bash
255
- npx -y @vibecompass/vibecompass close-session \
256
- --session mcp-dogfood \
257
- --title "Workflow Parity Commands" \
258
- --completed "Added package-owned start-session and close-session commands" \
259
- --next-step "Run the package publish dry-run"
260
- ```
261
-
262
- `end-session` is accepted as an alias for the same lifecycle step and flags:
263
- `npx -y @vibecompass/vibecompass end-session ...`.
264
-
265
- The package CLI owns filesystem lifecycle only. The default scaffolded
266
- workflow also uses prompt commands inside your coding tool:
267
-
268
- ```text
269
- start session # builder role trigger
270
- join as reviewer # reviewer role trigger
271
- review handoff # reviewer reads selected-lane wip.md, handoff.md, and diffs
272
- address review # builder reads selected-lane feedback, responds inline, and continues
51
+ --root .compass \
52
+ --id feature-lane \
53
+ --working-on "Build the next feature"
273
54
  ```
274
55
 
275
- Those prompt commands are documented in the generated `context.md`,
276
- `CLAUDE.md`, and `AGENTS.md` templates. They are not additional
277
- `vibecompass` CLI subcommands.
278
- Reviewer handback is explicit in the package-managed workflow: the reviewer
279
- ends the pass by updating the selected lane's `wip.md` + `handoff.md`, and
280
- the builder closes the session with `vibecompass close-session --session
281
- <lane-id>` using the defaults stored in
282
- `project.yaml.metadata.workflow.close_session`.
283
-
284
- Active builder sessions are named lanes under
285
- `sessions/active/<lane-id>/`. Use one lane per active feature or workstream.
286
- `start-session` requires `--id <lane-id>` for every lane, including the first
287
- one in a project.
288
- Finalized sessions are append-only notes named
289
- `sessions/YYYY-MM-DD-N-title.md`, so multiple sessions on the same day
290
- increment `N`. Decisions remain append-only in `decisions/`; a session note
291
- can reference a decision, but the decision file is the durable source of truth.
292
-
293
- For higher-risk work, use planning mode as a prompt-level step inside the
294
- active session. Planning mode should read the same context, propose scope and
295
- tradeoffs, and record the agreed plan in the selected lane's `wip.md`; it
296
- should not create a separate lifecycle artifact or finalize decisions until
297
- you approve implementation.
298
-
299
- Generate agent-instruction files from project memory:
56
+ Generate evidence-backed architecture docs:
300
57
 
301
58
  ```bash
302
- npx -y @vibecompass/vibecompass sync-agents --root .compass
303
- ```
304
-
305
- `sync-agents` writes compact VibeCompass bootloader regions:
306
-
307
- ```md
308
- <!-- vibecompass:start - managed by VibeCompass, do not edit -->
309
- ... generated content ...
310
- <!-- vibecompass:end -->
59
+ npx -y @vibecompass/vibecompass docs-review --root .compass --guided
311
60
  ```
312
61
 
313
- Content outside those markers is preserved. Package-created starter files
314
- include managed markers from the beginning. Existing user files without markers
315
- are reported as warnings and left untouched unless you explicitly adopt them:
62
+ Close the session:
316
63
 
317
64
  ```bash
318
- npx -y @vibecompass/vibecompass sync-agents --root .compass --adopt-existing
65
+ npx -y @vibecompass/vibecompass close-session \
66
+ --root .compass \
67
+ --session feature-lane \
68
+ --title "Feature Lane" \
69
+ --completed "Shipped the slice" \
70
+ --next-step "Review and publish"
319
71
  ```
320
72
 
321
- The managed block intentionally stays short: project-memory root, read order,
322
- prompt-command routing, and hard safety rules. Detailed workflow lives in
323
- `context.md` and generated files under `workflows/`, so `CLAUDE.md`, `AGENTS.md`,
324
- `.cursorrules`, and Copilot instructions do not duplicate long protocol text.
325
- `CLAUDE.md` starters also keep the mutable `Current session` block above the
326
- managed region because session lifecycle commands update it. `AGENTS.md`
327
- starters are intentionally just the managed bootloader; add Codex/team notes
328
- before or after the marker block if needed, and `sync-agents` will preserve them.
329
-
330
- Adoption appends a managed VibeCompass block to the end of existing unmarked
331
- agent files, preserves everything outside the markers, and reports possible
332
- workflow-overlap lines before you rely on the result. Guided init may offer the
333
- same adoption step for existing files, but the prompt defaults to no.
334
-
335
- Connect hosted VibeCompass later when you want browser views, team sync, or hosted docs-review:
73
+ ## Common Commands
336
74
 
337
75
  ```bash
338
- npx -y @vibecompass/vibecompass connect-hosted \
339
- --sync-api-url https://vibecompass.dev \
340
- --sync-project-id vc_proj_example \
341
- --sync-credential-env-var VIBECOMPASS_SYNC_TOKEN
342
- ```
76
+ # Create or inspect project memory
77
+ vibecompass init --guided
78
+ vibecompass status --root .compass
343
79
 
344
- Then set the secret locally and push the first baseline:
80
+ # Session workflow
81
+ vibecompass start-session --root .compass --id auth-flow --working-on "Auth flow"
82
+ vibecompass list-sessions --root .compass
83
+ vibecompass switch-session auth-flow --root .compass
84
+ vibecompass close-session --root .compass --session auth-flow --title "Auth Flow" --completed "Built auth" --next-step "Review"
345
85
 
346
- ```bash
347
- export VIBECOMPASS_SYNC_TOKEN='your-sync-token'
348
- npx -y @vibecompass/vibecompass push
349
- ```
86
+ # Agent instruction files
87
+ vibecompass sync-agents --root .compass
350
88
 
351
- Create a `local-primary` root non-interactively when you also want the hosted sync binding written into `project.yaml` during init:
89
+ # Architecture docs review
90
+ vibecompass docs-review --root .compass --guided
91
+ vibecompass docs-review --root .compass --apply-output
352
92
 
353
- ```bash
354
- npx -y @vibecompass/vibecompass init \
355
- --placement primary-repo \
356
- --tooling-root . \
357
- --name "Acme Platform" \
358
- --mode local-primary \
359
- --repo app=https://github.com/acme/app.git \
360
- --sync-api-url https://vibecompass.dev \
361
- --sync-project-id vc_proj_example \
362
- --sync-credential-env-var VIBECOMPASS_SYNC_TOKEN
93
+ # Rerun docs review from an archived architecture-doc slate
94
+ vibecompass docs-review --root .compass --rebuild --path architecture
95
+ vibecompass docs-review --root .compass --rebuild --apply --stale-policy archive --path architecture
363
96
  ```
364
97
 
365
- That creates:
98
+ ## What It Creates
366
99
 
367
100
  ```text
368
101
  .compass/
369
102
  project.yaml
103
+ context.md
370
104
  architecture/
371
105
  decisions/
372
106
  sessions/
373
107
  state/
374
- manifest.json
375
108
  ```
376
109
 
377
- The sync fields in `project.yaml` are non-secret. The token value stays in
378
- your environment and is never written to canonical project memory.
379
-
380
- ## CLI
381
-
382
- ### `vibecompass init`
383
-
384
- ```text
385
- vibecompass init --name <project-name> --mode <local-only|local-primary|hosted-only> --repo <id=remote> [options]
386
- ```
387
-
388
- Options:
389
-
390
- - `--root <path>`: project-memory root; defaults to `.compass`
391
- - `--tooling-root <path>`: owner directory for workflow files and placement defaults
392
- - `--slug <slug>`: optional project slug
393
- - `--description <text>`: optional short project description
394
- - `--placement <workspace-root|dedicated-memory-repo|primary-repo>`: optional explicit placement pattern
395
- - `--guided`: ask placement and setup questions interactively
396
- - `--repo <id=remote>`: repeatable repo descriptor
397
- - `--repo-branch <id=branch>`: optional per-repo default branch
398
- - `--sync-api-url <url>`: hosted sync API URL for `local-primary` or `hosted-only`
399
- - `--sync-project-id <id>`: hosted sync project ID for `local-primary` or `hosted-only`
400
- - `--sync-credential-env-var <name>`: local env-var reference for `local-primary` or `hosted-only`
401
- - `--with-workflow`: generate `context.md` plus workflow guide files
402
- - `--with-claude`: create a starter `CLAUDE.md` if it does not already exist
403
- - `--with-agents`: create a starter `AGENTS.md` if it does not already exist
404
- - `--adopt-existing-agent-files`: append managed blocks to existing unmarked agent files
405
- - `--start-session`: open the first builder session after init
406
- - `--session-working-on <text>`: required with `--start-session` outside guided mode
407
- - `--session-id <lane-id>`: required with `--start-session`; names the first builder lane
408
- - `--close-session-git-publish`: store that the close-session workflow includes a Git publish step
409
- - `--close-session-git-remote <name>`: optional default Git remote name for that stored publish step
410
- - `--force`: overwrite an existing `project.yaml`
411
- - `--replace-active-lanes`: allow `--force` to replace a root that has active session lanes
412
-
413
- When `--start-session` is used, `init` automatically enables the minimum
414
- workflow bootstrap required for that session: `context.md` plus `CLAUDE.md`.
415
- Guided init can also record workflow defaults in
416
- `project.yaml.metadata.workflow`, including whether close-session should
417
- include a Git publish step and which remote name to use for that step.
418
-
419
- Guided init is inference-first for common repo layouts: it reads `package.json`,
420
- detects the current Git `origin` when you run it inside a repo, or scans a
421
- parent workspace for immediate child repos when the parent is not itself a Git
422
- checkout. It asks once before using detected repos, maps a friendly setup goal
423
- to the stored project mode, places single-child repo memory under that child
424
- repo, and uses workspace-root placement for multi-repo parent folders. Hosted
425
- credentials are deferred by default; run `vibecompass connect-hosted` when you
426
- are ready to connect the local root to `vibecompass.dev`.
427
-
428
- ### `vibecompass connect-hosted`
429
-
430
- ```text
431
- vibecompass connect-hosted [options]
432
- ```
433
-
434
- Options:
435
-
436
- - `--root <path>`: project-memory root; defaults to `.compass`
437
- - `--sync-api-url <url>`: hosted sync API URL
438
- - `--sync-project-id <id>`: hosted sync project ID
439
- - `--sync-credential-env-var <name>`: local env-var reference
440
-
441
- Without all three sync flags, `connect-hosted` prompts for the missing fields.
442
- It updates only the non-secret `project.yaml.sync` binding; you still set the
443
- actual token in your environment before running hosted commands.
444
- Running it again replaces the existing hosted binding in `project.yaml`, which
445
- is the intended rotation path after you create a new sync credential.
446
-
447
- ### `vibecompass status`
448
-
449
- ```text
450
- vibecompass status [options]
451
- ```
452
-
453
- Options:
454
-
455
- - `--root <path>`: project-memory root; defaults to `.compass`
456
- - `--tooling-root <path>`: directory where agent files are inspected; defaults to cwd
457
- - `--json`: print the typed status model as JSON
458
-
459
- `status` is strictly read-only. It reports project identity, active session
460
- lanes, package-version drift, local manifest compatibility, docs-review
461
- marker state, generated agent-file drift, warnings, and recommended next
462
- commands. It does not write canonical files, generated workflow files, agent
463
- instruction files, or `state/manifest.json`.
464
-
465
- ### `vibecompass refresh-workflow`
466
-
467
- ```text
468
- vibecompass refresh-workflow [--dry-run|--apply] [options]
469
- ```
470
-
471
- Options:
472
-
473
- - `--root <path>`: project-memory root; defaults to `.compass`
474
- - `--tooling-root <path>`: directory where agent files are refreshed; defaults to cwd
475
- - `--dry-run`: show planned refresh without changing files; this is the default
476
- - `--apply`: apply the planned workflow refresh
477
- - `--update-package-stamp`: update an existing `project.yaml` package-version stamp
478
- - `--allow-downgrade-templates`: allow applying templates with a CLI older than the root stamp
479
-
480
- `refresh-workflow` is the explicit upgrade path for package-owned derived
481
- artifacts. Dry-run mode is read-only. Apply mode can regenerate `context.md`,
482
- workflow guide READMEs that still match the package-generated shape, managed
483
- agent-file blocks, and `state/manifest.json`. It leaves user-authored workflow
484
- guide files untouched when they no longer match the generated guide shape.
485
-
486
- Package-version stamps are intentionally conservative: missing legacy stamps
487
- can be created by apply mode, existing older or invalid stamps are left
488
- untouched unless `--update-package-stamp` is passed, and roots stamped by a
489
- newer CLI require `--allow-downgrade-templates` before older templates are
490
- applied.
491
-
492
- ### `vibecompass start-session`
493
-
494
- ```text
495
- vibecompass start-session --id <lane-id> --working-on <text> [options]
496
- ```
497
-
498
- Options:
499
-
500
- - `--root <path>`: project-memory root; defaults to `.compass`
501
- - `--tooling-root <path>`: workspace root that contains `CLAUDE.md`; defaults to cwd
502
- - `--working-on <text>`: required active-session summary
503
- - `--id <lane-id>`: required lane ID
504
- - `--feature <slug>`: repeatable feature slug for the lane
505
- - `--repo <id>`: repeatable repo ID for the lane
506
- - `--claim <path>`: repeatable path claim for overlap warnings
507
- - `--date <YYYY-MM-DD>`: optional explicit session date
508
- - `--last-thing-completed <text>`: optional override for the `CLAUDE.md` current-session block
509
- - `--blockers <text>`: optional current blockers summary
510
- - `--next-session-should <text>`: optional current-session handoff summary
511
-
512
- This command updates the `Current session` block in `CLAUDE.md` and creates
513
- `sessions/active/<lane-id>/session.yaml`, `wip.md`, and `handoff.md` for the
514
- next session number. It also updates `sessions/active/index.yaml`.
515
-
516
- If no completed docs-review marker exists under `state/docs-review.json`,
517
- `start-session` prints a non-blocking warning that starter docs are not a
518
- comprehensive architecture review.
519
-
520
- ### `vibecompass list-sessions`
110
+ Generated agent files can also include managed VibeCompass blocks:
521
111
 
522
112
  ```text
523
- vibecompass list-sessions [options]
113
+ CLAUDE.md
114
+ AGENTS.md
115
+ .cursorrules
116
+ .github/copilot-instructions.md
524
117
  ```
525
118
 
526
- Lists active session lanes and marks the current lane.
527
-
528
- Options:
119
+ ## Prompt Commands
529
120
 
530
- - `--root <path>`: project-memory root; defaults to `.compass`
121
+ After setup, use these phrases inside your AI coding tool:
531
122
 
532
- ### `vibecompass switch-session`
123
+ - `start session`
124
+ - `join as reviewer`
125
+ - `planning mode`
126
+ - `review handoff`
127
+ - `address review`
128
+ - `close session` / `end session`
129
+ - `docs review`
533
130
 
534
- ```text
535
- vibecompass switch-session <lane-id> [options]
536
- ```
131
+ The npm package owns the file mechanics. Your AI session owns reading the
132
+ workflow files, updating handoffs, and applying reviewed changes.
537
133
 
538
- Changes the current lane in `sessions/active/index.yaml`.
134
+ ## Hosted Sync
539
135
 
540
- Options:
136
+ Use hosted sync when you want browser review, team workflows, or hosted
137
+ docs-review proposals:
541
138
 
542
- - `--root <path>`: project-memory root; defaults to `.compass`
543
- - `--session <lane-id>`: lane ID; positional ID is also accepted
544
-
545
- ### `vibecompass close-session`
546
-
547
- ```text
548
- vibecompass close-session --title <text> --completed <text> --next-step <text> [options]
549
- ```
550
-
551
- `vibecompass end-session` accepts the same options and runs the same close
552
- path. `close-session` remains the canonical command name in generated workflow
553
- metadata and docs.
554
-
555
- Options:
556
-
557
- - `--root <path>`: project-memory root; defaults to `.compass`
558
- - `--tooling-root <path>`: workspace root that contains `CLAUDE.md`; defaults to cwd
559
- - `--title <text>`: required finalized session-note title
560
- - `--worked-on <text>`: optional override for the "What we worked on" section
561
- - `--session <lane-id>`: active lane to close; required when multiple lanes are active
562
- - `--completed <text>`: repeatable completed item
563
- - `--decision <text>`: repeatable decision reference or summary
564
- - `--model <text>`: optional repeatable model contribution entry
565
- - `--blocker <text>`: repeatable blocker or open question
566
- - `--next-step <text>`: repeatable next-session instruction
567
- - `--last-thing-completed <text>`: optional override for the `CLAUDE.md` completed summary
568
- - `--next-session-should <text>`: optional override for the `CLAUDE.md` next-session summary
569
-
570
- This command finalizes the active scratchpad into
571
- `sessions/YYYY-MM-DD-N-display-title.md`, deletes the closed lane directory
572
- under `sessions/active/<lane-id>/`, updates `sessions/active/index.yaml`, and
573
- updates the `Current session` block in `CLAUDE.md`. If no `--model` flags are
574
- provided, the session note records `Not recorded.` under `Models used`.
575
- This is the final builder lifecycle step after the last `address review`
576
- pass, not a reviewer action. It also prints the workflow guidance derived
577
- from `project.yaml.metadata.workflow.close_session`, including any
578
- configured Git publish step.
579
-
580
- ### `vibecompass sync-agents`
139
+ ```bash
140
+ vibecompass connect-hosted \
141
+ --root .compass \
142
+ --sync-api-url https://vibecompass.dev \
143
+ --sync-project-id vc_proj_example \
144
+ --sync-credential-env-var VIBECOMPASS_SYNC_TOKEN
581
145
 
582
- ```text
583
- vibecompass sync-agents [options]
146
+ vibecompass push --root .compass
584
147
  ```
585
148
 
586
- Options:
149
+ ### Multiple environments
587
150
 
588
- - `--root <path>`: project-memory root; defaults to `.compass`
589
- - `--tooling-root <path>`: directory where agent files are written; defaults to cwd
590
- - `--format <name>`: optional format filter: `claude_md`, `agents_md`, `cursor_rules`, or `copilot_instructions`
591
- - `--adopt-existing`: append managed blocks to existing unmarked files
592
- - `--dry-run`: show planned writes without changing files
151
+ One project can have named sync targets (for example a local dev server and
152
+ production) so you never have to rebind:
593
153
 
594
- This command generates enabled agent-instruction files from canonical project
595
- memory. It creates missing files with managed markers, replaces existing
596
- managed regions, preserves content outside markers, and warns instead of
597
- overwriting existing unmarked files unless `--adopt-existing` is supplied.
598
-
599
- ### Hosted sync commands
154
+ ```bash
155
+ # add targets once — the first one becomes the default
156
+ vibecompass connect-hosted --root .compass --target dev \
157
+ --sync-api-url http://localhost:3000 --sync-project-id vc_proj_dev \
158
+ --sync-credential-env-var VIBECOMPASS_SYNC_TOKEN
159
+ vibecompass connect-hosted --root .compass --target prod \
160
+ --sync-api-url https://vibecompass.dev --sync-project-id vc_proj_prod \
161
+ --sync-credential-env-var VIBECOMPASS_SYNC_TOKEN_PROD
600
162
 
601
- ```text
602
- vibecompass push [options]
603
- vibecompass pull-preview [options]
604
- vibecompass pull-export [options]
605
- vibecompass apply-export [options]
163
+ # then pick per command, or switch the default
164
+ vibecompass push --root .compass --sync-target prod
165
+ vibecompass sync-target prod --root .compass
606
166
  ```
607
167
 
608
- Common option:
609
-
610
- - `--root <path>`: project-memory root; defaults to `.compass`
611
-
612
- Hosted sync commands require `project.yaml` mode `local-primary`, a
613
- non-secret `project.yaml.sync` binding, and the token named by
614
- `sync.credential_env_var` in your environment.
615
-
616
- `push` sends canonical local project memory to the hosted sync API.
168
+ Tip: if you already have a single (flat) binding, add it as your first named
169
+ target using the same URL and project id — its sync history carries over.
617
170
 
618
- `pull-preview` asks hosted sync for pending proposal state without changing
619
- canonical local files. It records preview metadata in local `state/`. Pass
620
- `--no-pending-proposals` when you only want remote state and conflict data.
621
-
622
- `pull-export` exports accepted hosted proposal operations into a local bundle
623
- under `state/pull-export.json` by default. Use `--proposal <id>` to select
624
- proposal IDs, `--preview-token <token>` to export from a specific preview, and
625
- `--output <path>` to choose a different output path under the root.
626
-
627
- `apply-export` applies a local export bundle to canonical project-memory files
628
- and records the resulting state. Use `--output <path>` when the export bundle
629
- is not at the default `state/pull-export.json`.
630
-
631
- ### `vibecompass docs-review`
632
-
633
- ```text
634
- vibecompass docs-review --guided [options]
635
- ```
636
-
637
- Options:
638
-
639
- - `--root <path>`: project-memory root; defaults to `.compass`
640
- - `--guided`: print a comprehensive review prompt for your chosen LLM to run (recommended)
641
- - `--submit-hosted`: submit the review request to the hosted app
642
- - `--poll-hosted`: poll a hosted docs-review run and update `state/docs-review.json`
643
- - `--run-local`: run the generated review request with a local provider
644
- - `--provider <name>`: local provider for `--run-local`; currently `anthropic`
645
- - `--run-local-anthropic`: compatibility alias for `--run-local --provider anthropic`
646
- - `--apply-output`: apply accepted architecture-doc blocks from review output
647
- - `--apply-decision-artifact`: append an accepted hosted decision artifact locally
648
- - `--artifact <id>`: artifact ID for `--apply-decision-artifact`
649
- - `--refresh-index`: also regenerate `decisions/INDEX.md` after applying a decision artifact
650
- - `--output <path>`: review output path for `--apply-output`; defaults to `state/docs-review-output.md`
651
- - `--complete`: mark accepted docs-review changes as completed in local state
652
- - `--llm <name>`: preferred LLM/provider to record for the review (e.g. `claude`, `codex`, `gemini`)
653
- - `--model <name>`: model name/version to record for the review
654
- - `--anthropic-env-var <name>`: env var for local Anthropic runtime; defaults to `ANTHROPIC_API_KEY`
655
- - `--max-tokens <number>`: local Anthropic output budget, 1024–32000; defaults to 16000
656
-
657
- Plain `--guided` does not call an AI itself; it prints a review prompt your
658
- chosen LLM runs. `--submit-hosted`, `--run-local`, and `--apply-output` are
659
- explicit alternative steps.
660
-
661
- Project-mode requirements:
662
-
663
- - `local-only` — `--guided` can use any external LLM; `--run-local` requires a supported local provider key
664
- - `local-primary` — hosted sync binding preferred for hosted submission; local provider key accepted for `--run-local`
665
- - `hosted-only` — hosted sync binding required
666
-
667
- `--run-local --provider anthropic` always uses local Anthropic regardless of
668
- hosted binding, so hosted precedence does not apply when that flag is set.
669
-
670
- `--submit-hosted` uses `sync.credential_env_var` and records the hosted run
671
- ID in `state/docs-review.json`. Use `--poll-hosted` to refresh the run marker.
672
- Hosted execution creates review proposals and artifacts; for `local-primary`
673
- roots, local files stay untouched until you pull-preview, export, apply
674
- locally, and push to confirm the accepted output.
675
- Missing or stale hosted baselines fail with package-facing next-step guidance
676
- instead of running model work against the wrong source of truth.
677
-
678
- `--run-local-anthropic` remains as a compatibility alias. New scripts should
679
- use `--run-local --provider anthropic`.
680
-
681
- `--apply-output` looks for accepted architecture docs in fenced blocks:
682
-
683
- ````md
684
- ```vibecompass-architecture-doc path=architecture/domain/feature/component.md
685
- ---
686
- domain: Platform
687
- feature: Example
688
- component: Backend
689
- status: In progress
690
- ---
691
-
692
- ## Description
693
- Accepted review content.
694
- ```
695
- ````
696
-
697
- The fence opening is strict: it must be exactly
698
- `vibecompass-architecture-doc path=<architecture/*.md>` with one `path`
699
- attribute and no extra attributes. Malformed architecture-doc fences report a
700
- targeted error instead of being treated as "no output found".
701
-
702
- Only `architecture/*.md` paths are writable through this apply step. Component
703
- docs require non-empty `domain`, `feature`, `component`, and `status`
704
- frontmatter. The project overview file,
705
- `architecture/overview/project-shape.md`, may use status-only frontmatter so it
706
- matches hosted docs-review proposal behavior. If one accepted output contains
707
- multiple blocks for the same architecture path, local apply fails rather than
708
- silently overwriting earlier accepted content.
709
-
710
- Accepted architecture docs over the soft 12000-byte size budget are applied
711
- with an `oversized_architecture_doc` warning instead of being rejected. Treat
712
- that warning as a prompt to compact the doc unless the extra detail is needed
713
- for future retrieval.
714
-
715
- `vibecompass docs-review --complete` updates the marker in
716
- `state/docs-review.json` to `status: "completed"` once the docs have
717
- landed, preserving the recorded `llm` / `model` so future sessions know
718
- what reviewed the architecture.
719
-
720
- ### Prompt commands
721
-
722
- These are the default prompt commands used by the scaffolded workflow files:
723
-
724
- - `start session`: builder role trigger
725
- - `join as reviewer`: reviewer role trigger
726
- - `review handoff`: reviewer reads the selected lane's latest `wip.md`, `handoff.md`, latest finalized note, and relevant diffs before appending findings
727
- - `address review`: builder reads the latest reviewer feedback in the selected lane's `wip.md` / `handoff.md`, responds inline, applies accepted changes, and refreshes the builder handoff
728
- - `close session`: builder runs the close-out checklist and ends with `vibecompass close-session --session <lane-id>`; `end session` is accepted as a synonym
729
-
730
- They are prompt commands for AI-tool behavior, not package CLI commands.
731
- Reviewer handback ends when the reviewer has updated the selected lane's
732
- `wip.md` and `handoff.md`; there is no extra reviewer-exit step. The builder
733
- remains in builder role, uses `address review` until findings are resolved or
734
- explicitly deferred, and then uses the `close session` prompt to run
735
- `vibecompass close-session --session <lane-id>` using the workflow defaults
736
- recorded in `project.yaml`.
171
+ See https://vibecompass.dev/developers for the full local-primary workflow.
737
172
 
738
173
  ## JavaScript API
739
174
 
740
175
  ```js
741
176
  import {
742
- PACKAGE_VERSION,
743
- STATE_VERSION,
744
177
  initializeProjectMemory,
745
- inspectProjectCompatibility,
746
- formatCompatibilityWarnings,
747
- preflightDocsReview,
748
- startProjectSession,
749
- listProjectSessions,
750
- switchProjectSession,
751
- closeProjectSession,
752
- syncAgentInstructionFiles,
753
- getSupportedAgentFormats,
754
178
  getProjectStatus,
755
- renderStatusText,
756
- toStatusJson,
757
- refreshWorkflow,
758
179
  scanProjectMemory,
759
- generateStateManifest,
760
- prepareStateManifest,
761
- writeStateManifest,
762
- pushProjectMemory,
763
- pullPreviewProjectMemory,
764
- pullExportProjectMemory,
765
- applyPullExport,
766
180
  loadProjectReadModel,
767
181
  getProjectContext,
768
- getFeatureContext,
769
- getDecisionLog,
770
- getFileContext,
771
182
  } from "@vibecompass/vibecompass";
772
183
  ```
773
184
 
774
- Typical flow:
775
-
776
- ```js
777
- const readModel = await loadProjectReadModel("/absolute/path/to/.compass");
778
- const project = getProjectContext(readModel);
779
- ```
780
-
781
- ## Relationship to `vibecompass-mcp`
185
+ Use the JavaScript API when building tools that need to inspect or manage a
186
+ local VibeCompass project-memory root.
782
187
 
783
- `vibecompass` owns the local canonical files and read model.
784
- `vibecompass-mcp` is the MCP transport adapter that exposes that memory to
785
- Claude Code, Codex, Cursor, and similar tools.
188
+ ## More Documentation
786
189
 
787
- Use `vibecompass-mcp` when you want AI tooling integration.
788
- Use `vibecompass` when you want to create, validate, and read the local
789
- project-memory root itself.
190
+ - Developer guide: https://vibecompass.dev/developers
191
+ - CLI reference: https://vibecompass.dev/developers/cli
192
+ - Session protocol: https://vibecompass.dev/developers/protocol
193
+ - Concepts: https://vibecompass.dev/developers/concepts