@vibecompass/vibecompass 0.3.3 → 0.4.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
@@ -1,3 +1,9 @@
1
+ <p align="center">
2
+ <a href="https://vibecompass.dev">
3
+ <img src="https://raw.githubusercontent.com/jack-whimvy/vibecompass/main/brand/logo-a4.png" alt="VibeCompass" height="96" />
4
+ </a>
5
+ </p>
6
+
1
7
  # @vibecompass/vibecompass
2
8
 
3
9
  Local-first project-memory core for [VibeCompass](https://vibecompass.dev).
@@ -19,24 +25,27 @@ Shipped today:
19
25
  - `vibecompass list-sessions` / `vibecompass switch-session` for multiple active session lanes
20
26
  - `vibecompass end-session` as a discoverable alias for `close-session`
21
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
22
30
  - `vibecompass docs-review --guided` — print a comprehensive review prompt for your chosen LLM to run
23
31
  - `vibecompass docs-review --submit-hosted` — submit the review request to the hosted app and poll for proposal/artifact output
24
32
  - `vibecompass docs-review --run-local --provider anthropic` — local provider adapter that saves review output locally
25
33
  - `vibecompass docs-review --apply-output` — apply accepted architecture-doc blocks into canonical `architecture/` docs
26
34
  - `vibecompass docs-review --complete` — mark the review accepted after the docs land
35
+ - hosted sync commands: `push`, `pull-preview`, `pull-export`, and `apply-export`
27
36
  - canonical file scanning and validation
28
37
  - `state/manifest.json` generation
29
38
  - JavaScript read-model helpers for project, feature, decision, and file context
30
39
 
31
40
  Not shipped yet:
32
41
 
33
- - hosted sync commands (push, pull-preview, pull-export)
34
- - hosted docs-review execution that runs the review and writes canonical docs
42
+ - one-command hosted docs-review that directly writes canonical local docs
35
43
  - additional local docs-review providers beyond Anthropic
36
44
  - automatic acceptance of review findings without a local apply step
37
45
 
38
- The package is publishable now as the file-contract and read-model core. The
39
- broader local-primary sync workflow is still being built on top of it.
46
+ The package is useful today as the local project-memory CLI and JavaScript
47
+ core. Use it to create a root, keep project memory current, run local sessions,
48
+ and sync with hosted VibeCompass when you have a hosted project binding.
40
49
 
41
50
  ## Requirements
42
51
 
@@ -61,7 +70,7 @@ npm install @vibecompass/vibecompass
61
70
 
62
71
  ## Quickstart
63
72
 
64
- Run the guided bootstrap:
73
+ Most users should start with the guided bootstrap:
65
74
 
66
75
  ```bash
67
76
  npx -y @vibecompass/vibecompass init --guided
@@ -72,6 +81,18 @@ Guided init asks about repo topology, recommends a placement pattern
72
81
  lightweight starter project memory, scaffolds the workflow files you opt into,
73
82
  and can open the first builder session immediately.
74
83
 
84
+ After init, the usual loop is:
85
+
86
+ ```bash
87
+ npx -y @vibecompass/vibecompass status --root .compass
88
+ npx -y @vibecompass/vibecompass start-session --root .compass --id feature-lane --working-on "Build the next feature"
89
+ npx -y @vibecompass/vibecompass docs-review --root .compass --guided
90
+ npx -y @vibecompass/vibecompass close-session --root .compass --session feature-lane --title "Feature Lane" --completed "Shipped the slice" --next-step "Review and publish"
91
+ ```
92
+
93
+ Run `vibecompass status` when you are not sure what to do next. It is
94
+ read-only and prints the safest follow-up commands for the current root.
95
+
75
96
  When the owner directory is a workspace root or primary repo, the canonical
76
97
  root defaults to `.compass/` inside that directory. For a dedicated memory repo,
77
98
  the canonical root defaults to the repo root itself.
@@ -124,6 +145,34 @@ AGENTS.md # at the tooling root, only if missing and --with-agents is
124
145
  `context.md` is a derived package-owned file. Re-running `init --force --with-workflow`
125
146
  regenerates it; do not treat it as a hand-edited source document.
126
147
 
148
+ Check an initialized root without writing files:
149
+
150
+ ```bash
151
+ npx -y @vibecompass/vibecompass status --root .compass
152
+ ```
153
+
154
+ Use `status --json` when another tool needs the typed diagnostic model. The
155
+ JSON output intentionally excludes raw hosted preview tokens and resolved
156
+ credential values.
157
+
158
+ Preview package-owned workflow refreshes without mutating files:
159
+
160
+ ```bash
161
+ npx -y @vibecompass/vibecompass refresh-workflow --root .compass --dry-run
162
+ ```
163
+
164
+ Apply the refresh explicitly when the plan looks right:
165
+
166
+ ```bash
167
+ npx -y @vibecompass/vibecompass refresh-workflow --root .compass --apply
168
+ ```
169
+
170
+ `refresh-workflow` updates generated workflow artifacts such as `context.md`,
171
+ workflow guide READMEs, managed agent-file blocks, and the local
172
+ `state/manifest.json`. Existing package-version stamps are sticky by default;
173
+ pass `--update-package-stamp` when you intentionally want to move the
174
+ canonical `project.yaml.metadata.package_version` stamp to the current CLI.
175
+
127
176
  ## After init: generate real architecture docs
128
177
 
129
178
  `init` writes a small starter map of your project. To turn it into real
@@ -243,7 +292,16 @@ npx -y @vibecompass/vibecompass sync-agents --root .compass
243
292
  ```
244
293
 
245
294
  Content outside those markers is preserved. Existing files without markers are
246
- reported as warnings and left untouched.
295
+ reported as warnings and left untouched unless you explicitly adopt them:
296
+
297
+ ```bash
298
+ npx -y @vibecompass/vibecompass sync-agents --root .compass --adopt-existing
299
+ ```
300
+
301
+ Adoption appends a managed VibeCompass block to the end of existing unmarked
302
+ agent files, preserves everything outside the markers, and reports possible
303
+ workflow-overlap lines before you rely on the result. Guided init may offer the
304
+ same adoption step for existing files, but the prompt defaults to no.
247
305
 
248
306
  Connect hosted VibeCompass later when you want browser views, team sync, or hosted docs-review:
249
307
 
@@ -314,12 +372,14 @@ Options:
314
372
  - `--with-workflow`: generate `context.md` plus workflow guide files
315
373
  - `--with-claude`: create a starter `CLAUDE.md` if it does not already exist
316
374
  - `--with-agents`: create a starter `AGENTS.md` if it does not already exist
375
+ - `--adopt-existing-agent-files`: append managed blocks to existing unmarked agent files
317
376
  - `--start-session`: open the first builder session after init
318
377
  - `--session-working-on <text>`: required with `--start-session` outside guided mode
319
378
  - `--session-id <lane-id>`: required with `--start-session`; names the first builder lane
320
379
  - `--close-session-git-publish`: store that the close-session workflow includes a Git publish step
321
380
  - `--close-session-git-remote <name>`: optional default Git remote name for that stored publish step
322
381
  - `--force`: overwrite an existing `project.yaml`
382
+ - `--replace-active-lanes`: allow `--force` to replace a root that has active session lanes
323
383
 
324
384
  When `--start-session` is used, `init` automatically enables the minimum
325
385
  workflow bootstrap required for that session: `context.md` plus `CLAUDE.md`.
@@ -355,6 +415,51 @@ actual token in your environment before running hosted commands.
355
415
  Running it again replaces the existing hosted binding in `project.yaml`, which
356
416
  is the intended rotation path after you create a new sync credential.
357
417
 
418
+ ### `vibecompass status`
419
+
420
+ ```text
421
+ vibecompass status [options]
422
+ ```
423
+
424
+ Options:
425
+
426
+ - `--root <path>`: project-memory root; defaults to `.compass`
427
+ - `--tooling-root <path>`: directory where agent files are inspected; defaults to cwd
428
+ - `--json`: print the typed status model as JSON
429
+
430
+ `status` is strictly read-only. It reports project identity, active session
431
+ lanes, package-version drift, local manifest compatibility, docs-review
432
+ marker state, generated agent-file drift, warnings, and recommended next
433
+ commands. It does not write canonical files, generated workflow files, agent
434
+ instruction files, or `state/manifest.json`.
435
+
436
+ ### `vibecompass refresh-workflow`
437
+
438
+ ```text
439
+ vibecompass refresh-workflow [--dry-run|--apply] [options]
440
+ ```
441
+
442
+ Options:
443
+
444
+ - `--root <path>`: project-memory root; defaults to `.compass`
445
+ - `--tooling-root <path>`: directory where agent files are refreshed; defaults to cwd
446
+ - `--dry-run`: show planned refresh without changing files; this is the default
447
+ - `--apply`: apply the planned workflow refresh
448
+ - `--update-package-stamp`: update an existing `project.yaml` package-version stamp
449
+ - `--allow-downgrade-templates`: allow applying templates with a CLI older than the root stamp
450
+
451
+ `refresh-workflow` is the explicit upgrade path for package-owned derived
452
+ artifacts. Dry-run mode is read-only. Apply mode can regenerate `context.md`,
453
+ workflow guide READMEs that still match the package-generated shape, managed
454
+ agent-file blocks, and `state/manifest.json`. It leaves user-authored workflow
455
+ guide files untouched when they no longer match the generated guide shape.
456
+
457
+ Package-version stamps are intentionally conservative: missing legacy stamps
458
+ can be created by apply mode, existing older or invalid stamps are left
459
+ untouched unless `--update-package-stamp` is passed, and roots stamped by a
460
+ newer CLI require `--allow-downgrade-templates` before older templates are
461
+ applied.
462
+
358
463
  ### `vibecompass start-session`
359
464
 
360
465
  ```text
@@ -371,6 +476,9 @@ Options:
371
476
  - `--repo <id>`: repeatable repo ID for the lane
372
477
  - `--claim <path>`: repeatable path claim for overlap warnings
373
478
  - `--date <YYYY-MM-DD>`: optional explicit session date
479
+ - `--last-thing-completed <text>`: optional override for the `CLAUDE.md` current-session block
480
+ - `--blockers <text>`: optional current blockers summary
481
+ - `--next-session-should <text>`: optional current-session handoff summary
374
482
 
375
483
  This command updates the `Current session` block in `CLAUDE.md` and creates
376
484
  `sessions/active/<lane-id>/session.yaml`, `wip.md`, and `handoff.md` for the
@@ -388,6 +496,10 @@ vibecompass list-sessions [options]
388
496
 
389
497
  Lists active session lanes and marks the current lane.
390
498
 
499
+ Options:
500
+
501
+ - `--root <path>`: project-memory root; defaults to `.compass`
502
+
391
503
  ### `vibecompass switch-session`
392
504
 
393
505
  ```text
@@ -396,6 +508,11 @@ vibecompass switch-session <lane-id> [options]
396
508
 
397
509
  Changes the current lane in `sessions/active/index.yaml`.
398
510
 
511
+ Options:
512
+
513
+ - `--root <path>`: project-memory root; defaults to `.compass`
514
+ - `--session <lane-id>`: lane ID; positional ID is also accepted
515
+
399
516
  ### `vibecompass close-session`
400
517
 
401
518
  ```text
@@ -418,6 +535,8 @@ Options:
418
535
  - `--model <text>`: optional repeatable model contribution entry
419
536
  - `--blocker <text>`: repeatable blocker or open question
420
537
  - `--next-step <text>`: repeatable next-session instruction
538
+ - `--last-thing-completed <text>`: optional override for the `CLAUDE.md` completed summary
539
+ - `--next-session-should <text>`: optional override for the `CLAUDE.md` next-session summary
421
540
 
422
541
  This command finalizes the active scratchpad into
423
542
  `sessions/YYYY-MM-DD-N-display-title.md`, deletes the closed lane directory
@@ -440,12 +559,45 @@ Options:
440
559
  - `--root <path>`: project-memory root; defaults to `.compass`
441
560
  - `--tooling-root <path>`: directory where agent files are written; defaults to cwd
442
561
  - `--format <name>`: optional format filter: `claude_md`, `agents_md`, `cursor_rules`, or `copilot_instructions`
562
+ - `--adopt-existing`: append managed blocks to existing unmarked files
443
563
  - `--dry-run`: show planned writes without changing files
444
564
 
445
565
  This command generates enabled agent-instruction files from canonical project
446
566
  memory. It creates missing files with managed markers, replaces existing
447
567
  managed regions, preserves content outside markers, and warns instead of
448
- overwriting existing unmarked files.
568
+ overwriting existing unmarked files unless `--adopt-existing` is supplied.
569
+
570
+ ### Hosted sync commands
571
+
572
+ ```text
573
+ vibecompass push [options]
574
+ vibecompass pull-preview [options]
575
+ vibecompass pull-export [options]
576
+ vibecompass apply-export [options]
577
+ ```
578
+
579
+ Common option:
580
+
581
+ - `--root <path>`: project-memory root; defaults to `.compass`
582
+
583
+ Hosted sync commands require `project.yaml` mode `local-primary`, a
584
+ non-secret `project.yaml.sync` binding, and the token named by
585
+ `sync.credential_env_var` in your environment.
586
+
587
+ `push` sends canonical local project memory to the hosted sync API.
588
+
589
+ `pull-preview` asks hosted sync for pending proposal state without changing
590
+ canonical local files. It records preview metadata in local `state/`. Pass
591
+ `--no-pending-proposals` when you only want remote state and conflict data.
592
+
593
+ `pull-export` exports accepted hosted proposal operations into a local bundle
594
+ under `state/pull-export.json` by default. Use `--proposal <id>` to select
595
+ proposal IDs, `--preview-token <token>` to export from a specific preview, and
596
+ `--output <path>` to choose a different output path under the root.
597
+
598
+ `apply-export` applies a local export bundle to canonical project-memory files
599
+ and records the resulting state. Use `--output <path>` when the export bundle
600
+ is not at the default `state/pull-export.json`.
449
601
 
450
602
  ### `vibecompass docs-review`
451
603
 
@@ -458,10 +610,14 @@ Options:
458
610
  - `--root <path>`: project-memory root; defaults to `.compass`
459
611
  - `--guided`: print a comprehensive review prompt for your chosen LLM to run (recommended)
460
612
  - `--submit-hosted`: submit the review request to the hosted app
613
+ - `--poll-hosted`: poll a hosted docs-review run and update `state/docs-review.json`
461
614
  - `--run-local`: run the generated review request with a local provider
462
615
  - `--provider <name>`: local provider for `--run-local`; currently `anthropic`
463
616
  - `--run-local-anthropic`: compatibility alias for `--run-local --provider anthropic`
464
617
  - `--apply-output`: apply accepted architecture-doc blocks from review output
618
+ - `--apply-decision-artifact`: append an accepted hosted decision artifact locally
619
+ - `--artifact <id>`: artifact ID for `--apply-decision-artifact`
620
+ - `--refresh-index`: also regenerate `decisions/INDEX.md` after applying a decision artifact
465
621
  - `--output <path>`: review output path for `--apply-output`; defaults to `state/docs-review-output.md`
466
622
  - `--complete`: mark accepted docs-review changes as completed in local state
467
623
  - `--llm <name>`: preferred LLM/provider to record for the review (e.g. `claude`, `codex`, `gemini`)
@@ -483,9 +639,10 @@ Project-mode requirements:
483
639
  hosted binding, so hosted precedence does not apply when that flag is set.
484
640
 
485
641
  `--submit-hosted` uses `sync.credential_env_var` and records the hosted run
486
- ID in `state/docs-review.json`. Hosted execution creates review proposals and
487
- artifacts; for `local-primary` roots, local files stay untouched until you
488
- pull-preview, export, apply locally, and push to confirm the accepted output.
642
+ ID in `state/docs-review.json`. Use `--poll-hosted` to refresh the run marker.
643
+ Hosted execution creates review proposals and artifacts; for `local-primary`
644
+ roots, local files stay untouched until you pull-preview, export, apply
645
+ locally, and push to confirm the accepted output.
489
646
  Missing or stale hosted baselines fail with package-facing next-step guidance
490
647
  instead of running model work against the wrong source of truth.
491
648
 
@@ -537,19 +694,36 @@ recorded in `project.yaml`.
537
694
 
538
695
  ```js
539
696
  import {
697
+ PACKAGE_VERSION,
698
+ STATE_VERSION,
540
699
  initializeProjectMemory,
700
+ inspectProjectCompatibility,
701
+ formatCompatibilityWarnings,
541
702
  preflightDocsReview,
542
703
  startProjectSession,
704
+ listProjectSessions,
705
+ switchProjectSession,
543
706
  closeProjectSession,
544
707
  syncAgentInstructionFiles,
708
+ getSupportedAgentFormats,
709
+ getProjectStatus,
710
+ renderStatusText,
711
+ toStatusJson,
712
+ refreshWorkflow,
545
713
  scanProjectMemory,
714
+ generateStateManifest,
715
+ prepareStateManifest,
546
716
  writeStateManifest,
717
+ pushProjectMemory,
718
+ pullPreviewProjectMemory,
719
+ pullExportProjectMemory,
720
+ applyPullExport,
547
721
  loadProjectReadModel,
548
722
  getProjectContext,
549
723
  getFeatureContext,
550
724
  getDecisionLog,
551
725
  getFileContext,
552
- } from "vibecompass";
726
+ } from "@vibecompass/vibecompass";
553
727
  ```
554
728
 
555
729
  Typical flow:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibecompass/vibecompass",
3
- "version": "0.3.3",
3
+ "version": "0.4.0",
4
4
  "description": "Local-first project-memory core for VibeCompass",
5
5
  "type": "module",
6
6
  "bin": {