@vibecompass/vibecompass 0.1.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/LICENSE +21 -0
- package/README.md +329 -0
- package/package.json +42 -0
- package/src/cli.js +572 -0
- package/src/frontmatter.js +28 -0
- package/src/generators/agent-files/agents-md.js +13 -0
- package/src/generators/agent-files/claude-md.js +13 -0
- package/src/generators/agent-files/copilot-instructions.js +13 -0
- package/src/generators/agent-files/cursor-rules.js +13 -0
- package/src/generators/agent-files/index.js +147 -0
- package/src/generators/agent-files/markers.js +49 -0
- package/src/generators/agent-files/template.js +75 -0
- package/src/hash.js +29 -0
- package/src/index.js +15 -0
- package/src/init.js +227 -0
- package/src/manifest.js +75 -0
- package/src/project-memory.js +678 -0
- package/src/project-yaml.js +107 -0
- package/src/read-model.js +557 -0
- package/src/scaffold.js +404 -0
- package/src/session.js +553 -0
- package/src/setup.js +719 -0
- package/src/simple-yaml.js +227 -0
- package/src/workflow.js +120 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jack
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
# @vibecompass/vibecompass
|
|
2
|
+
|
|
3
|
+
Local-first project-memory core for [VibeCompass](https://vibecompass.dev).
|
|
4
|
+
|
|
5
|
+
This package owns the canonical local file contract for VibeCompass project
|
|
6
|
+
memory: `project.yaml`, `architecture/`, `decisions/`, `sessions/`, and the
|
|
7
|
+
derived `state/manifest.json` that lets tools read the local root efficiently.
|
|
8
|
+
|
|
9
|
+
## Current scope
|
|
10
|
+
|
|
11
|
+
Shipped today:
|
|
12
|
+
|
|
13
|
+
- `vibecompass init` for scaffolding a project-memory root
|
|
14
|
+
- interactive guided init for placement, workflow bootstrap, and first-session setup
|
|
15
|
+
- generated `context.md` plus opt-in workflow guide files
|
|
16
|
+
- opt-in starter `CLAUDE.md` / `AGENTS.md` templates that are created once and never overwritten
|
|
17
|
+
- `vibecompass start-session` / `vibecompass close-session` for the local builder workflow
|
|
18
|
+
- `vibecompass sync-agents` for generated `CLAUDE.md`, `AGENTS.md`, `.cursorrules`, and `.github/copilot-instructions.md` views
|
|
19
|
+
- canonical file scanning and validation
|
|
20
|
+
- `state/manifest.json` generation
|
|
21
|
+
- JavaScript read-model helpers for project, feature, decision, and file context
|
|
22
|
+
|
|
23
|
+
Not shipped yet:
|
|
24
|
+
|
|
25
|
+
- hosted sync commands such as push, pull-preview, and pull-export
|
|
26
|
+
|
|
27
|
+
The package is publishable now as the file-contract and read-model core. The
|
|
28
|
+
broader local-primary sync workflow is still being built on top of it.
|
|
29
|
+
|
|
30
|
+
## Requirements
|
|
31
|
+
|
|
32
|
+
- Node.js 20+
|
|
33
|
+
|
|
34
|
+
## Install
|
|
35
|
+
|
|
36
|
+
### CLI
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx -y @vibecompass/vibecompass --help
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Library
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm install @vibecompass/vibecompass
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Quickstart
|
|
49
|
+
|
|
50
|
+
Run the guided bootstrap:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npx -y @vibecompass/vibecompass init --guided
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Guided init asks about repo topology, recommends a placement pattern
|
|
57
|
+
(`workspace-root`, `dedicated-memory-repo`, or `primary-repo`), scaffolds the
|
|
58
|
+
workflow files you opt into, and can open the first builder session
|
|
59
|
+
immediately.
|
|
60
|
+
|
|
61
|
+
When the owner directory is a workspace root or primary repo, the canonical
|
|
62
|
+
root defaults to `.compass/` inside that directory. For a dedicated memory repo,
|
|
63
|
+
the canonical root defaults to the repo root itself.
|
|
64
|
+
|
|
65
|
+
Skip the prompts and drive the setup explicitly:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npx -y @vibecompass/vibecompass init \
|
|
69
|
+
--placement primary-repo \
|
|
70
|
+
--tooling-root . \
|
|
71
|
+
--name "Acme Platform" \
|
|
72
|
+
--mode local-only \
|
|
73
|
+
--repo app=https://github.com/acme/app.git \
|
|
74
|
+
--with-workflow \
|
|
75
|
+
--with-claude \
|
|
76
|
+
--with-agents \
|
|
77
|
+
--close-session-git-publish \
|
|
78
|
+
--close-session-git-remote origin \
|
|
79
|
+
--start-session \
|
|
80
|
+
--session-working-on "Validate the local-first MCP workflow"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
That creates the canonical root plus, when workflow scaffolding is enabled:
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
PROJECT_MEMORY_ROOT/context.md
|
|
87
|
+
PROJECT_MEMORY_ROOT/architecture/README.md
|
|
88
|
+
PROJECT_MEMORY_ROOT/decisions/README.md
|
|
89
|
+
PROJECT_MEMORY_ROOT/sessions/README.md
|
|
90
|
+
CLAUDE.md # at the tooling root, only if missing and --with-claude is used
|
|
91
|
+
AGENTS.md # at the tooling root, only if missing and --with-agents is used
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
`context.md` is a derived package-owned file. Re-running `init --force --with-workflow`
|
|
95
|
+
regenerates it; do not treat it as a hand-edited source document.
|
|
96
|
+
|
|
97
|
+
If you do not chain straight into a first session from `init`, open one later:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
npx -y @vibecompass/vibecompass start-session \
|
|
101
|
+
--working-on "Validate the MCP dogfood workflow against the docs repo"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Close the active builder session:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npx -y @vibecompass/vibecompass close-session \
|
|
108
|
+
--title "Workflow Parity Commands" \
|
|
109
|
+
--completed "Added package-owned start-session and close-session commands" \
|
|
110
|
+
--next-step "Run the package publish dry-run"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The package CLI owns filesystem lifecycle only. The default scaffolded
|
|
114
|
+
workflow also uses prompt commands inside your coding tool:
|
|
115
|
+
|
|
116
|
+
```text
|
|
117
|
+
start session # builder role trigger
|
|
118
|
+
join as reviewer # reviewer role trigger
|
|
119
|
+
review handoff # reviewer reads the latest note, wip.md, handoff.md, and diffs
|
|
120
|
+
address review # builder reads reviewer feedback, responds inline, and continues
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Those prompt commands are documented in the generated `context.md`,
|
|
124
|
+
`CLAUDE.md`, and `AGENTS.md` templates. They are not additional
|
|
125
|
+
`vibecompass` CLI subcommands.
|
|
126
|
+
Reviewer handback is explicit in the package-managed workflow: the reviewer
|
|
127
|
+
ends the pass by updating `wip.md` + `handoff.md`, and the builder closes
|
|
128
|
+
the session with `vibecompass close-session` using the defaults stored in
|
|
129
|
+
`project.yaml.metadata.workflow.close_session`.
|
|
130
|
+
|
|
131
|
+
Generate agent-instruction files from project memory:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
npx -y @vibecompass/vibecompass sync-agents --root .compass
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
`sync-agents` writes only VibeCompass managed regions:
|
|
138
|
+
|
|
139
|
+
```md
|
|
140
|
+
<!-- vibecompass:start - managed by VibeCompass, do not edit -->
|
|
141
|
+
... generated content ...
|
|
142
|
+
<!-- vibecompass:end -->
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Content outside those markers is preserved. Existing files without markers are
|
|
146
|
+
reported as warnings and left untouched.
|
|
147
|
+
|
|
148
|
+
Create a `local-primary` root when you also want the hosted sync binding written into `project.yaml`:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
npx -y @vibecompass/vibecompass init \
|
|
152
|
+
--placement primary-repo \
|
|
153
|
+
--tooling-root . \
|
|
154
|
+
--name "Acme Platform" \
|
|
155
|
+
--mode local-primary \
|
|
156
|
+
--repo app=https://github.com/acme/app.git \
|
|
157
|
+
--sync-api-url https://vibecompass.dev \
|
|
158
|
+
--sync-project-id vc_proj_example \
|
|
159
|
+
--sync-credential-env-var VIBECOMPASS_SYNC_TOKEN
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
That creates:
|
|
163
|
+
|
|
164
|
+
```text
|
|
165
|
+
.compass/
|
|
166
|
+
project.yaml
|
|
167
|
+
architecture/
|
|
168
|
+
decisions/
|
|
169
|
+
sessions/
|
|
170
|
+
state/
|
|
171
|
+
manifest.json
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Next step after init:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
export VIBECOMPASS_SYNC_TOKEN='your-sync-token'
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
`vibecompass` does not yet perform hosted sync itself. The sync fields in
|
|
181
|
+
`project.yaml` are the non-secret binding for the upcoming push/pull flows.
|
|
182
|
+
|
|
183
|
+
## CLI
|
|
184
|
+
|
|
185
|
+
### `vibecompass init`
|
|
186
|
+
|
|
187
|
+
```text
|
|
188
|
+
vibecompass init --name <project-name> --mode <local-only|local-primary|hosted-only> --repo <id=remote> [options]
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Options:
|
|
192
|
+
|
|
193
|
+
- `--root <path>`: project-memory root; defaults to `.compass`
|
|
194
|
+
- `--tooling-root <path>`: owner directory for workflow files and placement defaults
|
|
195
|
+
- `--slug <slug>`: optional project slug
|
|
196
|
+
- `--description <text>`: optional short project description
|
|
197
|
+
- `--placement <workspace-root|dedicated-memory-repo|primary-repo>`: optional explicit placement pattern
|
|
198
|
+
- `--guided`: ask placement and setup questions interactively
|
|
199
|
+
- `--repo <id=remote>`: repeatable repo descriptor
|
|
200
|
+
- `--repo-branch <id=branch>`: optional per-repo default branch
|
|
201
|
+
- `--sync-api-url <url>`: hosted sync API URL for `local-primary`
|
|
202
|
+
- `--sync-project-id <id>`: hosted sync project ID for `local-primary`
|
|
203
|
+
- `--sync-credential-env-var <name>`: local env-var reference for `local-primary`
|
|
204
|
+
- `--with-workflow`: generate `context.md` plus workflow guide files
|
|
205
|
+
- `--with-claude`: create a starter `CLAUDE.md` if it does not already exist
|
|
206
|
+
- `--with-agents`: create a starter `AGENTS.md` if it does not already exist
|
|
207
|
+
- `--start-session`: open the first builder session after init
|
|
208
|
+
- `--session-working-on <text>`: required with `--start-session` outside guided mode
|
|
209
|
+
- `--close-session-git-publish`: store that the close-session workflow includes a Git publish step
|
|
210
|
+
- `--close-session-git-remote <name>`: optional default Git remote name for that stored publish step
|
|
211
|
+
- `--force`: overwrite an existing `project.yaml`
|
|
212
|
+
|
|
213
|
+
When `--start-session` is used, `init` automatically enables the minimum
|
|
214
|
+
workflow bootstrap required for that session: `context.md` plus `CLAUDE.md`.
|
|
215
|
+
Guided init can also record workflow defaults in
|
|
216
|
+
`project.yaml.metadata.workflow`, including whether close-session should
|
|
217
|
+
include a Git publish step and which remote name to use for that step.
|
|
218
|
+
|
|
219
|
+
### `vibecompass start-session`
|
|
220
|
+
|
|
221
|
+
```text
|
|
222
|
+
vibecompass start-session --working-on <text> [options]
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Options:
|
|
226
|
+
|
|
227
|
+
- `--root <path>`: project-memory root; defaults to `.compass`
|
|
228
|
+
- `--tooling-root <path>`: workspace root that contains `CLAUDE.md`; defaults to cwd
|
|
229
|
+
- `--working-on <text>`: required active-session summary
|
|
230
|
+
- `--date <YYYY-MM-DD>`: optional explicit session date
|
|
231
|
+
|
|
232
|
+
This command updates the `Current session` block in `CLAUDE.md` and creates
|
|
233
|
+
`sessions/wip.md` plus `sessions/handoff.md` for the next session number.
|
|
234
|
+
|
|
235
|
+
### `vibecompass close-session`
|
|
236
|
+
|
|
237
|
+
```text
|
|
238
|
+
vibecompass close-session --title <text> --completed <text> --next-step <text> [options]
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Options:
|
|
242
|
+
|
|
243
|
+
- `--root <path>`: project-memory root; defaults to `.compass`
|
|
244
|
+
- `--tooling-root <path>`: workspace root that contains `CLAUDE.md`; defaults to cwd
|
|
245
|
+
- `--title <text>`: required finalized session-note title
|
|
246
|
+
- `--worked-on <text>`: optional override for the "What we worked on" section
|
|
247
|
+
- `--completed <text>`: repeatable completed item
|
|
248
|
+
- `--decision <text>`: repeatable decision reference or summary
|
|
249
|
+
- `--model <text>`: optional repeatable model contribution entry
|
|
250
|
+
- `--blocker <text>`: repeatable blocker or open question
|
|
251
|
+
- `--next-step <text>`: repeatable next-session instruction
|
|
252
|
+
|
|
253
|
+
This command finalizes the active scratchpad into
|
|
254
|
+
`sessions/YYYY-MM-DD-N-display-title.md`, deletes `wip.md` / `handoff.md`, and
|
|
255
|
+
updates the `Current session` block in `CLAUDE.md`. If no `--model` flags are
|
|
256
|
+
provided, the session note records `Not recorded.` under `Models used`.
|
|
257
|
+
This is the final builder lifecycle step after the last `address review`
|
|
258
|
+
pass, not a reviewer action. It also prints the workflow guidance derived
|
|
259
|
+
from `project.yaml.metadata.workflow.close_session`, including any
|
|
260
|
+
configured Git publish step.
|
|
261
|
+
|
|
262
|
+
### `vibecompass sync-agents`
|
|
263
|
+
|
|
264
|
+
```text
|
|
265
|
+
vibecompass sync-agents [options]
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
Options:
|
|
269
|
+
|
|
270
|
+
- `--root <path>`: project-memory root; defaults to `.compass`
|
|
271
|
+
- `--tooling-root <path>`: directory where agent files are written; defaults to cwd
|
|
272
|
+
- `--format <name>`: optional format filter: `claude_md`, `agents_md`, `cursor_rules`, or `copilot_instructions`
|
|
273
|
+
- `--dry-run`: show planned writes without changing files
|
|
274
|
+
|
|
275
|
+
This command generates enabled agent-instruction files from canonical project
|
|
276
|
+
memory. It creates missing files with managed markers, replaces existing
|
|
277
|
+
managed regions, preserves content outside markers, and warns instead of
|
|
278
|
+
overwriting existing unmarked files.
|
|
279
|
+
|
|
280
|
+
### Prompt commands
|
|
281
|
+
|
|
282
|
+
These are the default prompt commands used by the scaffolded workflow files:
|
|
283
|
+
|
|
284
|
+
- `start session`: builder role trigger
|
|
285
|
+
- `join as reviewer`: reviewer role trigger
|
|
286
|
+
- `review handoff`: reviewer reads the latest finalized note, `wip.md`, `handoff.md`, and relevant diffs before appending findings
|
|
287
|
+
- `address review`: builder reads the latest reviewer feedback in `wip.md` / `handoff.md`, responds inline, applies accepted changes, and refreshes the builder handoff
|
|
288
|
+
|
|
289
|
+
They are prompt commands for AI-tool behavior, not package CLI commands.
|
|
290
|
+
Reviewer handback ends when the reviewer has updated `wip.md` and
|
|
291
|
+
`handoff.md`; there is no extra reviewer-exit step. The builder remains
|
|
292
|
+
in builder role, uses `address review` until findings are resolved or
|
|
293
|
+
explicitly deferred, and then runs `vibecompass close-session` using the
|
|
294
|
+
workflow defaults recorded in `project.yaml`.
|
|
295
|
+
|
|
296
|
+
## JavaScript API
|
|
297
|
+
|
|
298
|
+
```js
|
|
299
|
+
import {
|
|
300
|
+
initializeProjectMemory,
|
|
301
|
+
startProjectSession,
|
|
302
|
+
closeProjectSession,
|
|
303
|
+
syncAgentInstructionFiles,
|
|
304
|
+
scanProjectMemory,
|
|
305
|
+
writeStateManifest,
|
|
306
|
+
loadProjectReadModel,
|
|
307
|
+
getProjectContext,
|
|
308
|
+
getFeatureContext,
|
|
309
|
+
getDecisionLog,
|
|
310
|
+
getFileContext,
|
|
311
|
+
} from "vibecompass";
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
Typical flow:
|
|
315
|
+
|
|
316
|
+
```js
|
|
317
|
+
const readModel = await loadProjectReadModel("/absolute/path/to/.compass");
|
|
318
|
+
const project = getProjectContext(readModel);
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
## Relationship to `vibecompass-mcp`
|
|
322
|
+
|
|
323
|
+
`vibecompass` owns the local canonical files and read model.
|
|
324
|
+
`vibecompass-mcp` is the MCP transport adapter that exposes that memory to
|
|
325
|
+
Claude Code, Codex, Cursor, and similar tools.
|
|
326
|
+
|
|
327
|
+
Use `vibecompass-mcp` when you want AI tooling integration.
|
|
328
|
+
Use `vibecompass` when you want to create, validate, and read the local
|
|
329
|
+
project-memory root itself.
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vibecompass/vibecompass",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Local-first project-memory core for VibeCompass",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"vibecompass": "src/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "src/index.js",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./src/index.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"src/*.js",
|
|
15
|
+
"src/generators/**/*.js"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"test": "node --test src/tests/*.test.js",
|
|
19
|
+
"prepublishOnly": "npm test"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"vibecompass",
|
|
23
|
+
"project-memory",
|
|
24
|
+
"documentation",
|
|
25
|
+
"local-first"
|
|
26
|
+
],
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/jack-whimvy/vibecompass.git"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://github.com/jack-whimvy/vibecompass#readme",
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/jack-whimvy/vibecompass/issues"
|
|
34
|
+
},
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=20"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
}
|
|
42
|
+
}
|