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