@vibecompass/vibecompass 0.2.1 → 0.3.1
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 +202 -19
- package/package.json +1 -1
- package/src/cli.js +548 -3
- package/src/docs-review.js +1220 -0
- package/src/generators/agent-files/template.js +2 -2
- package/src/index.js +7 -0
- package/src/init.js +67 -25
- package/src/manifest.js +52 -2
- package/src/project-memory.js +22 -3
- package/src/read-model.js +1 -1
- package/src/scaffold.js +218 -12
- package/src/session.js +180 -6
- package/src/setup.js +149 -34
- package/src/sync.js +395 -0
package/README.md
CHANGED
|
@@ -12,19 +12,28 @@ Shipped today:
|
|
|
12
12
|
|
|
13
13
|
- `vibecompass init` for scaffolding a project-memory root
|
|
14
14
|
- interactive guided init for placement, workflow bootstrap, and first-session setup
|
|
15
|
+
- lightweight starter architecture/session memory plus example-only decision guidance
|
|
15
16
|
- generated `context.md` plus opt-in workflow guide files
|
|
16
17
|
- opt-in starter `CLAUDE.md` / `AGENTS.md` templates that are created once and never overwritten
|
|
17
18
|
- `vibecompass start-session` / `vibecompass close-session` for lane-aware local builder workflow
|
|
18
19
|
- `vibecompass list-sessions` / `vibecompass switch-session` for multiple active session lanes
|
|
19
20
|
- `vibecompass end-session` as a discoverable alias for `close-session`
|
|
20
21
|
- `vibecompass sync-agents` for generated `CLAUDE.md`, `AGENTS.md`, `.cursorrules`, and `.github/copilot-instructions.md` views
|
|
22
|
+
- `vibecompass docs-review --guided` — print a comprehensive review prompt for your chosen LLM to run
|
|
23
|
+
- `vibecompass docs-review --submit-hosted` — submit the review request to the hosted app and poll for proposal/artifact output
|
|
24
|
+
- `vibecompass docs-review --run-local --provider anthropic` — local provider adapter that saves review output locally
|
|
25
|
+
- `vibecompass docs-review --apply-output` — apply accepted architecture-doc blocks into canonical `architecture/` docs
|
|
26
|
+
- `vibecompass docs-review --complete` — mark the review accepted after the docs land
|
|
21
27
|
- canonical file scanning and validation
|
|
22
28
|
- `state/manifest.json` generation
|
|
23
29
|
- JavaScript read-model helpers for project, feature, decision, and file context
|
|
24
30
|
|
|
25
31
|
Not shipped yet:
|
|
26
32
|
|
|
27
|
-
- hosted sync commands
|
|
33
|
+
- hosted sync commands (push, pull-preview, pull-export)
|
|
34
|
+
- hosted docs-review execution that runs the review and writes canonical docs
|
|
35
|
+
- additional local docs-review providers beyond Anthropic
|
|
36
|
+
- automatic acceptance of review findings without a local apply step
|
|
28
37
|
|
|
29
38
|
The package is publishable now as the file-contract and read-model core. The
|
|
30
39
|
broader local-primary sync workflow is still being built on top of it.
|
|
@@ -59,9 +68,9 @@ npx -y @vibecompass/vibecompass init --guided
|
|
|
59
68
|
```
|
|
60
69
|
|
|
61
70
|
Guided init asks about repo topology, recommends a placement pattern
|
|
62
|
-
(`workspace-root`, `dedicated-memory-repo`, or `primary-repo`),
|
|
63
|
-
|
|
64
|
-
immediately.
|
|
71
|
+
(`workspace-root`, `dedicated-memory-repo`, or `primary-repo`), writes
|
|
72
|
+
lightweight starter project memory, scaffolds the workflow files you opt into,
|
|
73
|
+
and can open the first builder session immediately.
|
|
65
74
|
|
|
66
75
|
When the owner directory is a workspace root or primary repo, the canonical
|
|
67
76
|
root defaults to `.compass/` inside that directory. For a dedicated memory repo,
|
|
@@ -86,7 +95,22 @@ npx -y @vibecompass/vibecompass init \
|
|
|
86
95
|
--session-working-on "Validate the local-first MCP workflow"
|
|
87
96
|
```
|
|
88
97
|
|
|
89
|
-
That creates the canonical root plus
|
|
98
|
+
That creates the canonical root plus lightweight starter memory:
|
|
99
|
+
|
|
100
|
+
```text
|
|
101
|
+
PROJECT_MEMORY_ROOT/project.yaml
|
|
102
|
+
PROJECT_MEMORY_ROOT/architecture/overview/project-shape.md
|
|
103
|
+
PROJECT_MEMORY_ROOT/decisions/EXAMPLE.md # example-only, ignored by canonical parsing
|
|
104
|
+
PROJECT_MEMORY_ROOT/sessions/YYYY-MM-DD-1-project-memory-initialized.md
|
|
105
|
+
PROJECT_MEMORY_ROOT/state/manifest.json
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
The starter architecture doc is intentionally marked as initial scaffold
|
|
109
|
+
coverage. It is useful orientation, not a comprehensive review. Before risky
|
|
110
|
+
implementation work, inspect the relevant code and replace or expand the
|
|
111
|
+
starter docs with evidence-backed domain/feature/component docs.
|
|
112
|
+
|
|
113
|
+
When workflow scaffolding is enabled, init also creates:
|
|
90
114
|
|
|
91
115
|
```text
|
|
92
116
|
PROJECT_MEMORY_ROOT/context.md
|
|
@@ -100,6 +124,55 @@ AGENTS.md # at the tooling root, only if missing and --with-agents is
|
|
|
100
124
|
`context.md` is a derived package-owned file. Re-running `init --force --with-workflow`
|
|
101
125
|
regenerates it; do not treat it as a hand-edited source document.
|
|
102
126
|
|
|
127
|
+
## After init: generate real architecture docs
|
|
128
|
+
|
|
129
|
+
`init` writes a small starter map of your project. To turn it into real
|
|
130
|
+
architecture docs, run a docs-review and let your AI tool write them:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
npx -y @vibecompass/vibecompass docs-review --guided
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
You can run this right after `init`, or any time later — for example after
|
|
137
|
+
scope expands, or before risky implementation work. `start-session` will
|
|
138
|
+
remind you with a non-blocking warning if no completed review exists.
|
|
139
|
+
|
|
140
|
+
What happens:
|
|
141
|
+
|
|
142
|
+
1. The CLI asks which LLM you'll use, then prints a versioned prompt template with fixed review criteria.
|
|
143
|
+
2. You paste that prompt into your AI tool (Claude Code, Codex, Cursor, etc.).
|
|
144
|
+
3. The AI reads your repo and writes architecture docs under
|
|
145
|
+
`architecture/<domain>/<feature>/<component>.md`.
|
|
146
|
+
4. Run `vibecompass docs-review --apply-output` after accepting fenced
|
|
147
|
+
architecture-doc blocks, or `--complete` if accepted docs were written
|
|
148
|
+
manually.
|
|
149
|
+
|
|
150
|
+
The guided prompt is deterministic apart from project-specific fields
|
|
151
|
+
(`project`, `mode`, `root`, provider, and model). It uses the same structure
|
|
152
|
+
VibeCompass dogfoods: read project memory first, inspect source evidence,
|
|
153
|
+
write component docs with review metadata, preserve the starter overview, and
|
|
154
|
+
emit accepted docs as `vibecompass-architecture-doc` blocks.
|
|
155
|
+
|
|
156
|
+
Plain `--guided` never calls an AI itself. You stay in control of which
|
|
157
|
+
provider runs the review and what gets saved. Use `--run-local --provider
|
|
158
|
+
anthropic` when you want the package to execute the same review through your
|
|
159
|
+
local Anthropic key.
|
|
160
|
+
|
|
161
|
+
### Other ways to run a review
|
|
162
|
+
|
|
163
|
+
- `--submit-hosted` sends the review request to the hosted app and records a
|
|
164
|
+
run ID. Hosted execution creates proposals and docs-review artifacts; for
|
|
165
|
+
local-primary projects, canonical local files change only after
|
|
166
|
+
pull-preview/export/apply and a confirming push.
|
|
167
|
+
- `--run-local --provider anthropic` calls Anthropic directly with your
|
|
168
|
+
`ANTHROPIC_API_KEY` and saves the raw output to
|
|
169
|
+
`state/docs-review-output.md`.
|
|
170
|
+
- `--apply-output` writes accepted fenced architecture-doc blocks from
|
|
171
|
+
`state/docs-review-output.md` into canonical `architecture/` docs and
|
|
172
|
+
completes the local review marker.
|
|
173
|
+
|
|
174
|
+
For most users, stick with `--guided`.
|
|
175
|
+
|
|
103
176
|
If you do not chain straight into a first session from `init`, open one later:
|
|
104
177
|
|
|
105
178
|
```bash
|
|
@@ -172,7 +245,23 @@ npx -y @vibecompass/vibecompass sync-agents --root .compass
|
|
|
172
245
|
Content outside those markers is preserved. Existing files without markers are
|
|
173
246
|
reported as warnings and left untouched.
|
|
174
247
|
|
|
175
|
-
|
|
248
|
+
Connect hosted VibeCompass later when you want browser views, team sync, or hosted docs-review:
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
npx -y @vibecompass/vibecompass connect-hosted \
|
|
252
|
+
--sync-api-url https://vibecompass.dev \
|
|
253
|
+
--sync-project-id vc_proj_example \
|
|
254
|
+
--sync-credential-env-var VIBECOMPASS_SYNC_TOKEN
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
Then set the secret locally and push the first baseline:
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
export VIBECOMPASS_SYNC_TOKEN='your-sync-token'
|
|
261
|
+
npx -y @vibecompass/vibecompass push
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Create a `local-primary` root non-interactively when you also want the hosted sync binding written into `project.yaml` during init:
|
|
176
265
|
|
|
177
266
|
```bash
|
|
178
267
|
npx -y @vibecompass/vibecompass init \
|
|
@@ -198,14 +287,8 @@ That creates:
|
|
|
198
287
|
manifest.json
|
|
199
288
|
```
|
|
200
289
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
```bash
|
|
204
|
-
export VIBECOMPASS_SYNC_TOKEN='your-sync-token'
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
`vibecompass` does not yet perform hosted sync itself. The sync fields in
|
|
208
|
-
`project.yaml` are the non-secret binding for the upcoming push/pull flows.
|
|
290
|
+
The sync fields in `project.yaml` are non-secret. The token value stays in
|
|
291
|
+
your environment and is never written to canonical project memory.
|
|
209
292
|
|
|
210
293
|
## CLI
|
|
211
294
|
|
|
@@ -225,9 +308,9 @@ Options:
|
|
|
225
308
|
- `--guided`: ask placement and setup questions interactively
|
|
226
309
|
- `--repo <id=remote>`: repeatable repo descriptor
|
|
227
310
|
- `--repo-branch <id=branch>`: optional per-repo default branch
|
|
228
|
-
- `--sync-api-url <url>`: hosted sync API URL for `local-primary`
|
|
229
|
-
- `--sync-project-id <id>`: hosted sync project ID for `local-primary`
|
|
230
|
-
- `--sync-credential-env-var <name>`: local env-var reference for `local-primary`
|
|
311
|
+
- `--sync-api-url <url>`: hosted sync API URL for `local-primary` or `hosted-only`
|
|
312
|
+
- `--sync-project-id <id>`: hosted sync project ID for `local-primary` or `hosted-only`
|
|
313
|
+
- `--sync-credential-env-var <name>`: local env-var reference for `local-primary` or `hosted-only`
|
|
231
314
|
- `--with-workflow`: generate `context.md` plus workflow guide files
|
|
232
315
|
- `--with-claude`: create a starter `CLAUDE.md` if it does not already exist
|
|
233
316
|
- `--with-agents`: create a starter `AGENTS.md` if it does not already exist
|
|
@@ -244,6 +327,31 @@ Guided init can also record workflow defaults in
|
|
|
244
327
|
`project.yaml.metadata.workflow`, including whether close-session should
|
|
245
328
|
include a Git publish step and which remote name to use for that step.
|
|
246
329
|
|
|
330
|
+
Guided init is inference-first for the common single-repo case: it reads
|
|
331
|
+
`package.json`, detects the current Git `origin`, asks you to confirm the
|
|
332
|
+
detected repo, and maps a friendly setup goal to the stored project mode.
|
|
333
|
+
Hosted credentials are deferred by default; run `vibecompass connect-hosted`
|
|
334
|
+
when you are ready to connect the local root to `vibecompass.dev`.
|
|
335
|
+
|
|
336
|
+
### `vibecompass connect-hosted`
|
|
337
|
+
|
|
338
|
+
```text
|
|
339
|
+
vibecompass connect-hosted [options]
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
Options:
|
|
343
|
+
|
|
344
|
+
- `--root <path>`: project-memory root; defaults to `.compass`
|
|
345
|
+
- `--sync-api-url <url>`: hosted sync API URL
|
|
346
|
+
- `--sync-project-id <id>`: hosted sync project ID
|
|
347
|
+
- `--sync-credential-env-var <name>`: local env-var reference
|
|
348
|
+
|
|
349
|
+
Without all three sync flags, `connect-hosted` prompts for the missing fields.
|
|
350
|
+
It updates only the non-secret `project.yaml.sync` binding; you still set the
|
|
351
|
+
actual token in your environment before running hosted commands.
|
|
352
|
+
Running it again replaces the existing hosted binding in `project.yaml`, which
|
|
353
|
+
is the intended rotation path after you create a new sync credential.
|
|
354
|
+
|
|
247
355
|
### `vibecompass start-session`
|
|
248
356
|
|
|
249
357
|
```text
|
|
@@ -265,6 +373,10 @@ This command updates the `Current session` block in `CLAUDE.md` and creates
|
|
|
265
373
|
`sessions/active/<lane-id>/session.yaml`, `wip.md`, and `handoff.md` for the
|
|
266
374
|
next session number. It also updates `sessions/active/index.yaml`.
|
|
267
375
|
|
|
376
|
+
If no completed docs-review marker exists under `state/docs-review.json`,
|
|
377
|
+
`start-session` prints a non-blocking warning that starter docs are not a
|
|
378
|
+
comprehensive architecture review.
|
|
379
|
+
|
|
268
380
|
### `vibecompass list-sessions`
|
|
269
381
|
|
|
270
382
|
```text
|
|
@@ -332,6 +444,74 @@ memory. It creates missing files with managed markers, replaces existing
|
|
|
332
444
|
managed regions, preserves content outside markers, and warns instead of
|
|
333
445
|
overwriting existing unmarked files.
|
|
334
446
|
|
|
447
|
+
### `vibecompass docs-review`
|
|
448
|
+
|
|
449
|
+
```text
|
|
450
|
+
vibecompass docs-review --guided [options]
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
Options:
|
|
454
|
+
|
|
455
|
+
- `--root <path>`: project-memory root; defaults to `.compass`
|
|
456
|
+
- `--guided`: print a comprehensive review prompt for your chosen LLM to run (recommended)
|
|
457
|
+
- `--submit-hosted`: submit the review request to the hosted app
|
|
458
|
+
- `--run-local`: run the generated review request with a local provider
|
|
459
|
+
- `--provider <name>`: local provider for `--run-local`; currently `anthropic`
|
|
460
|
+
- `--run-local-anthropic`: compatibility alias for `--run-local --provider anthropic`
|
|
461
|
+
- `--apply-output`: apply accepted architecture-doc blocks from review output
|
|
462
|
+
- `--output <path>`: review output path for `--apply-output`; defaults to `state/docs-review-output.md`
|
|
463
|
+
- `--complete`: mark accepted docs-review changes as completed in local state
|
|
464
|
+
- `--llm <name>`: preferred LLM/provider to record for the review (e.g. `claude`, `codex`, `gemini`)
|
|
465
|
+
- `--model <name>`: model name/version to record for the review
|
|
466
|
+
- `--anthropic-env-var <name>`: env var for local Anthropic runtime; defaults to `ANTHROPIC_API_KEY`
|
|
467
|
+
- `--max-tokens <number>`: local Anthropic output budget, 1024–32000; defaults to 16000
|
|
468
|
+
|
|
469
|
+
Plain `--guided` does not call an AI itself; it prints a review prompt your
|
|
470
|
+
chosen LLM runs. `--submit-hosted`, `--run-local`, and `--apply-output` are
|
|
471
|
+
explicit alternative steps.
|
|
472
|
+
|
|
473
|
+
Project-mode requirements:
|
|
474
|
+
|
|
475
|
+
- `local-only` — `--guided` can use any external LLM; `--run-local` requires a supported local provider key
|
|
476
|
+
- `local-primary` — hosted sync binding preferred for hosted submission; local provider key accepted for `--run-local`
|
|
477
|
+
- `hosted-only` — hosted sync binding required
|
|
478
|
+
|
|
479
|
+
`--run-local --provider anthropic` always uses local Anthropic regardless of
|
|
480
|
+
hosted binding, so hosted precedence does not apply when that flag is set.
|
|
481
|
+
|
|
482
|
+
`--submit-hosted` uses `sync.credential_env_var` and records the hosted run
|
|
483
|
+
ID in `state/docs-review.json`. Hosted execution creates review proposals and
|
|
484
|
+
artifacts; for `local-primary` roots, local files stay untouched until you
|
|
485
|
+
pull-preview, export, apply locally, and push to confirm the accepted output.
|
|
486
|
+
Missing or stale hosted baselines fail with package-facing next-step guidance
|
|
487
|
+
instead of running model work against the wrong source of truth.
|
|
488
|
+
|
|
489
|
+
`--run-local-anthropic` remains as a compatibility alias. New scripts should
|
|
490
|
+
use `--run-local --provider anthropic`.
|
|
491
|
+
|
|
492
|
+
`--apply-output` looks for accepted architecture docs in fenced blocks:
|
|
493
|
+
|
|
494
|
+
````md
|
|
495
|
+
```vibecompass-architecture-doc path=architecture/domain/feature/component.md
|
|
496
|
+
---
|
|
497
|
+
domain: Platform
|
|
498
|
+
feature: Example
|
|
499
|
+
component: Backend
|
|
500
|
+
status: In progress
|
|
501
|
+
---
|
|
502
|
+
|
|
503
|
+
## Description
|
|
504
|
+
Accepted review content.
|
|
505
|
+
```
|
|
506
|
+
````
|
|
507
|
+
|
|
508
|
+
Only `architecture/*.md` paths are writable through this apply step.
|
|
509
|
+
|
|
510
|
+
`vibecompass docs-review --complete` updates the marker in
|
|
511
|
+
`state/docs-review.json` to `status: "completed"` once the docs have
|
|
512
|
+
landed, preserving the recorded `llm` / `model` so future sessions know
|
|
513
|
+
what reviewed the architecture.
|
|
514
|
+
|
|
335
515
|
### Prompt commands
|
|
336
516
|
|
|
337
517
|
These are the default prompt commands used by the scaffolded workflow files:
|
|
@@ -340,19 +520,22 @@ These are the default prompt commands used by the scaffolded workflow files:
|
|
|
340
520
|
- `join as reviewer`: reviewer role trigger
|
|
341
521
|
- `review handoff`: reviewer reads the selected lane's latest `wip.md`, `handoff.md`, latest finalized note, and relevant diffs before appending findings
|
|
342
522
|
- `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
|
|
523
|
+
- `close session`: builder runs the close-out checklist and ends with `vibecompass close-session --session <lane-id>`; `end session` is accepted as a synonym
|
|
343
524
|
|
|
344
525
|
They are prompt commands for AI-tool behavior, not package CLI commands.
|
|
345
526
|
Reviewer handback ends when the reviewer has updated the selected lane's
|
|
346
527
|
`wip.md` and `handoff.md`; there is no extra reviewer-exit step. The builder
|
|
347
528
|
remains in builder role, uses `address review` until findings are resolved or
|
|
348
|
-
explicitly deferred, and then
|
|
349
|
-
<lane-id>` using the workflow defaults
|
|
529
|
+
explicitly deferred, and then uses the `close session` prompt to run
|
|
530
|
+
`vibecompass close-session --session <lane-id>` using the workflow defaults
|
|
531
|
+
recorded in `project.yaml`.
|
|
350
532
|
|
|
351
533
|
## JavaScript API
|
|
352
534
|
|
|
353
535
|
```js
|
|
354
536
|
import {
|
|
355
537
|
initializeProjectMemory,
|
|
538
|
+
preflightDocsReview,
|
|
356
539
|
startProjectSession,
|
|
357
540
|
closeProjectSession,
|
|
358
541
|
syncAgentInstructionFiles,
|