create-claude-cabinet 0.47.0 → 0.49.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.
Files changed (106) hide show
  1. package/README.md +1 -0
  2. package/lib/CLAUDE.md +240 -0
  3. package/lib/cli.js +202 -349
  4. package/lib/copy.js +75 -1
  5. package/lib/engagement-server-setup.js +1 -17
  6. package/lib/engagement-setup.js +1 -1
  7. package/lib/installer-gate.js +135 -0
  8. package/lib/metadata.js +20 -0
  9. package/lib/modules.js +292 -0
  10. package/lib/mux-setup.js +1 -17
  11. package/lib/project-context.js +16 -96
  12. package/lib/settings-merge.js +148 -9
  13. package/lib/site-audit-setup.js +23 -7
  14. package/lib/verify-setup.js +20 -9
  15. package/lib/watchtower-setup.js +1 -5
  16. package/package.json +1 -1
  17. package/templates/CLAUDE.md +1159 -0
  18. package/templates/briefing/_briefing-template.md +6 -11
  19. package/templates/cabinet/eval-protocol.md +27 -10
  20. package/templates/cabinet/watchtower-contracts.md +124 -0
  21. package/templates/cabinet/worktree-invocation-contract.md +59 -0
  22. package/templates/engagement/__tests__/checklist-visibility.test.mjs +76 -0
  23. package/templates/engagement/engagement-checklist.mjs +26 -2
  24. package/templates/engagement/engagement-schema.md +8 -6
  25. package/templates/engagement/pib-db-patches/pib-db-lib.mjs +102 -18
  26. package/templates/engagement/pib-db-patches/pib-db-schema.sql +1 -1
  27. package/templates/engagement/pib-db-patches/pib-db.mjs +4 -1
  28. package/templates/engagement/sql-constants.mjs +9 -1
  29. package/templates/engagement-server/__tests__/cross-tenant-auth.test.mjs +87 -0
  30. package/templates/engagement-server/server.mjs +65 -40
  31. package/templates/hooks/action-completion-gate.sh +10 -0
  32. package/templates/hooks/action-quality-gate.sh +10 -0
  33. package/templates/hooks/skill-telemetry.sh +10 -5
  34. package/templates/hooks/skill-tool-telemetry.sh +11 -5
  35. package/templates/mcp/pib-db.json +1 -1
  36. package/templates/mux/__tests__/mux-fail-loud.fixture.sh +4 -5
  37. package/templates/mux/__tests__/worktree-lifecycle.fixture.sh +214 -0
  38. package/templates/mux/__tests__/worktree-lifecycle.test.mjs +44 -0
  39. package/templates/mux/__tests__/worktree-status-clean.fixture.sh +245 -0
  40. package/templates/mux/__tests__/worktree-status-clean.test.mjs +89 -0
  41. package/templates/mux/bin/mux +44 -28
  42. package/templates/mux/config/worktree-cleanup.sh +57 -12
  43. package/templates/mux/config/worktree-dirty-check.sh +72 -2
  44. package/templates/mux/config/worktree-session-health.sh +401 -17
  45. package/templates/rules/enforcement-pipeline.md +0 -12
  46. package/templates/scripts/__tests__/api-usage-idle-gate.test.mjs +81 -0
  47. package/templates/scripts/__tests__/assessment-recalibration.test.mjs +387 -0
  48. package/templates/scripts/__tests__/batch-disposition.test.mjs +19 -0
  49. package/templates/scripts/__tests__/branch-diverged-reconcile.test.mjs +374 -0
  50. package/templates/scripts/__tests__/bsql-loader-verify.test.mjs +47 -0
  51. package/templates/scripts/__tests__/completion-review-reconcile.test.mjs +173 -0
  52. package/templates/scripts/__tests__/cross-ring-reader.test.mjs +12 -4
  53. package/templates/scripts/__tests__/detector-registry.test.mjs +152 -0
  54. package/templates/scripts/__tests__/draft-surfacing.test.mjs +433 -0
  55. package/templates/scripts/__tests__/generated-state-classification.test.mjs +228 -0
  56. package/templates/scripts/__tests__/inbox-assessment.test.mjs +341 -0
  57. package/templates/scripts/__tests__/memory-reachability.test.mjs +150 -0
  58. package/templates/scripts/__tests__/mirror-parity.test.mjs +54 -0
  59. package/templates/scripts/__tests__/resolve-project-slug.test.mjs +186 -0
  60. package/templates/scripts/__tests__/ring1-pib-error-surfacing.test.mjs +69 -0
  61. package/templates/scripts/__tests__/ring1-stale-open-counts.test.mjs +143 -0
  62. package/templates/scripts/__tests__/ring3-attribution.test.mjs +267 -0
  63. package/templates/scripts/__tests__/ring3-completion-filter.test.mjs +176 -0
  64. package/templates/scripts/__tests__/ring3-coverage-debt.test.mjs +377 -0
  65. package/templates/scripts/__tests__/ring3-last-session-pointer.test.mjs +80 -0
  66. package/templates/scripts/__tests__/ring3-thread-capture.test.mjs +213 -0
  67. package/templates/scripts/__tests__/watchtower-status-ring4.test.mjs +89 -0
  68. package/templates/scripts/audit-coherence-check.mjs +127 -0
  69. package/templates/scripts/audit-synth.mjs +117 -0
  70. package/templates/scripts/load-triage-history.js +23 -2
  71. package/templates/scripts/merge-findings.js +13 -3
  72. package/templates/scripts/patterns-scope-check.mjs +122 -0
  73. package/templates/scripts/pib-db-lib.mjs +116 -18
  74. package/templates/scripts/pib-db-mcp-server.mjs +2 -1
  75. package/templates/scripts/pib-db.mjs +2 -1
  76. package/templates/scripts/review-server.mjs +7 -12
  77. package/templates/scripts/triage-server.mjs +7 -8
  78. package/templates/scripts/watchtower-cross-ring-reader.mjs +38 -7
  79. package/templates/scripts/watchtower-inbox-assessment.mjs +857 -0
  80. package/templates/scripts/watchtower-lib.mjs +550 -9
  81. package/templates/scripts/watchtower-queue.mjs +197 -2
  82. package/templates/scripts/watchtower-ring1.mjs +567 -106
  83. package/templates/scripts/watchtower-ring2.mjs +213 -15
  84. package/templates/scripts/watchtower-ring3-close.mjs +679 -90
  85. package/templates/scripts/watchtower-status.sh +17 -0
  86. package/templates/scripts/work-tracker-server.mjs +26 -22
  87. package/templates/skills/audit/SKILL.md +24 -8
  88. package/templates/skills/audit/phases/structural-checks.md +22 -0
  89. package/templates/skills/briefing/SKILL.md +8 -0
  90. package/templates/skills/cabinet-accessibility/SKILL.md +1 -1
  91. package/templates/skills/cabinet-anthropic-insider/SKILL.md +29 -8
  92. package/templates/skills/cabinet-process-therapist/SKILL.md +45 -3
  93. package/templates/skills/cc-publish/SKILL.md +41 -7
  94. package/templates/skills/debrief/phases/audit-pattern-capture.md +13 -0
  95. package/templates/skills/inbox/SKILL.md +124 -6
  96. package/templates/skills/orient/SKILL.md +4 -0
  97. package/templates/skills/pulse/SKILL.md +10 -8
  98. package/templates/skills/session-handoff/SKILL.md +6 -8
  99. package/templates/skills/spring-clean/SKILL.md +1 -1
  100. package/templates/skills/spring-clean/phases/execute-decisions.md +1 -1
  101. package/templates/skills/validate/phases/validators.md +86 -0
  102. package/templates/skills/watchtower/SKILL.md +18 -26
  103. package/templates/watchtower/config.json.template +2 -1
  104. package/templates/workflows/deliberative-audit.js +258 -87
  105. package/templates/workflows/execute-group-complete.js +16 -2
  106. package/templates/workflows/execute-group-implement.js +16 -2
package/README.md CHANGED
@@ -227,6 +227,7 @@ customization. You can pass multiple modules: `--modules verify,audit`.
227
227
  | **engagement-server** | Central multi-engagement API server (Railway/Fly deploy) |
228
228
  | **watchtower** | Continuous background state management replacing orient/debrief |
229
229
  | **mux** | Multi-project terminal manager — desks, auto-worktrees with shared identity, trail logging, DX captures, portal color-switching, durable tmux bindings, clipboard copy with hard-wrap removal, screenshot-to-clipboard launchd watcher |
230
+ | **bash-compress** | PostToolUse hook that compresses noisy Bash stdout (git status walls, npm/yarn install output) to reclaim context in long sessions; stderr and error lines pass through verbatim, fail-open |
230
231
 
231
232
  ## CLI Options
232
233
 
package/lib/CLAUDE.md ADDED
@@ -0,0 +1,240 @@
1
+ # `lib/` — Installer Internals (detailed reference)
2
+
3
+ This is the on-demand detail tier for `lib/`. Root `CLAUDE.md` § Key Files
4
+ carries the one-line current contract for each file; this file carries the
5
+ full per-file contract **and** the layered `act:`-by-`act:` evolution history.
6
+ Read this when working in `lib/`; skim root `CLAUDE.md` otherwise.
7
+
8
+ `lib/` is the installer core plus one setup engine per heavier subsystem.
9
+ No build step; CommonJS.
10
+
11
+ ## Installer core
12
+
13
+ - `lib/cli.js` — main orchestration and all CLI logic. The `MODULES`
14
+ registry MOVED to `lib/modules.js` (act:e82baead, architecture-0005);
15
+ `cli.js` re-exports it for back-compat (`require('../lib/cli').MODULES`
16
+ still works). `cli.js` keeps orchestration, arg parsing, the postInstall
17
+ pipeline, and generators.
18
+ The `--reindex` flag (act:98d41fa2) regenerates
19
+ `.claude/skills/_index.json` in place and exits (no install body, no
20
+ global side effects; no-op without `.claude/skills/`) — so a consumer
21
+ editing its `directives-project.yaml` overlay (a new session-close
22
+ mandate or routine, both read from `_index.json`) can pick it up
23
+ without a full reinstall. `generateSkillIndex` is exported.
24
+ The `--freeze`/`--unfreeze`/`--list-frozen` flags (act:c1013967) edit
25
+ `.ccrc.json` `frozenModules` and exit; the install body then expands
26
+ the declared list by its `requires` closure (`expandFrozenClosure` —
27
+ freezing engagement also pins work-tracking), intersects with what's
28
+ actually installed (`effectiveFrozen` — never the raw declared list),
29
+ and HOLDS those modules' CC-owned files at the current version (loud
30
+ per-module frozen report; an auto pib.db backup runs first when a
31
+ frozen install still has a pending schema migration). The
32
+ upstream-cleanup classifier is extracted to a pure `computeRemovals`;
33
+ it, `expandFrozenClosure`, and the hoisted top-level `manifestPath`
34
+ are exported + unit-tested. `generateAgentWrappers()` (see root
35
+ § Generated artifacts) also lives here.
36
+ Also home of `seedAdvisoriesGitignore()` (act:c008862c,
37
+ grp:wt-noise-immunity), run in the install body: on FRESH installs
38
+ only (no prior `.ccrc.json`) it seeds a `.gitignore` entry for
39
+ `.claude/cabinet/advisories-state.json` (machine-written runtime
40
+ state — tracked, it churns every commit and reads as authored work in
41
+ mux worktrees) unless some rule already ignores it (`git
42
+ check-ignore`); existing installs are left untouched — untracking a
43
+ live consumer repo is operator-gated — but a TRACKED copy is reported
44
+ loudly so the consumer walk surfaces it. No-git and dry-run aware,
45
+ injectable exec, exported for tests.
46
+ - `lib/modules.js` — the `MODULES` manifest: every module → the template
47
+ paths it copies into `.claude/` (architecture-0005; extracted from
48
+ `cli.js` in act:e82baead). `cli.js` requires + re-exports it for
49
+ back-compat. This is the SINGLE source for "which files does module X
50
+ ship" — the module template arrays that older docs said "live in
51
+ `lib/cli.js`" now live here. Exports `{ MODULES }`. Unit-tested that
52
+ each module ships its declared scripts (e.g. the audit module ships
53
+ `patterns-scope-check.mjs`).
54
+ - `lib/installer-gate.js` — shared version/hash gating for the setup
55
+ engines (Wave 1, act:a6377c82). Exports `sha256`, `compareVersions`,
56
+ `hashSourceDir`, `tarballIsStale`. Before it, `sha256()` was
57
+ copy-pasted three times and `compareVersions()` twice, and the
58
+ equal-version "don't hard-skip, fall through to a per-file hash-compare"
59
+ rule was re-implemented per installer. Per-file-manifest installers
60
+ (mux, watchtower, engagement-server) use `sha256` + `compareVersions`;
61
+ versioned-tarball installers (verify, site-audit) use `tarballIsStale`
62
+ + `hashSourceDir` for the equal-version source-hash re-pack. All five
63
+ setup engines delegate here.
64
+ - `lib/copy.js` — template copying with conflict detection; exports
65
+ `recordSkip()`, the single skip-ownership helper used by every skip
66
+ site in both `lib/cli.js` and `lib/copy.js` (skipped project-created
67
+ files are omitted from the `.ccrc.json` manifest — omission means
68
+ "not ours", so a reinstall can't claim them). Also exports
69
+ `isProjectOwnedSeed()` (act:2001bf54): the basename rule for files
70
+ shipped as STARTER content but PROJECT-OWNED by declaration the moment
71
+ they land — today `directives-project.yaml`. The installer seeds them
72
+ if absent, NEVER overwrites them, and ALWAYS omits them from the
73
+ manifest (a recorded seed false-blocks the very first edit via
74
+ cc-upstream-guard and a `--yes` reinstall would clobber it). The
75
+ cli.js upstream-cleanup loop exempts these too — dropping the key
76
+ means "project-owned", NOT "removed upstream", so the freeing
77
+ reinstall can't delete the consumer's overlay. Also exports
78
+ `classifyFileOwnership()` (Wave 1, act:a6377c82): the single-file
79
+ ownership cascade used by cli.js's single-file branch — it closes the
80
+ missing `isProjectOwnedSeed` guard on that path, so a project-owned
81
+ seed reached via the single-file route is classified the same as via
82
+ the directory walk. Also exports `freezeRetain()` (act:c1013967): the
83
+ canonical FREEZE rule — a THIRD ownership state between CC-owned and
84
+ project-owned. When a module is frozen (`.ccrc.json` `frozenModules`,
85
+ threaded as `copyTemplates({frozen})`), a differing CC-managed file is
86
+ HELD instead of overwritten: an ALREADY-CC-owned file (in the prior
87
+ manifest) is RETAINED in the new manifest at its ON-DISK hash (keeps
88
+ cc-drift-check/reset green and the cleanup loop from deleting it, while
89
+ cc-upstream-guard keeps it edit-blocked), recorded in `results.frozen[]`;
90
+ a project-owned file FALLS THROUGH to skip-and-omit (retaining it would
91
+ adopt + clobber it on unfreeze). A held-back NEW file in a frozen module
92
+ is reported but gets no manifest entry (no on-disk content to hash).
93
+ Single source of truth for the rule across both copy paths (the
94
+ directory walk and cli.js's single-file branch). 23 tests in `test/freeze/`.
95
+ - `lib/metadata.js` — `.ccrc.json` read/write/merge/create. `create()`
96
+ accepts + persists `dbSchemaVersion` (top-level field, set only when a
97
+ real version is confirmed — undefined rides the prior value through via
98
+ `...existing`); `lib/cli.js` threads `setupDb`'s returned `schemaVersion`
99
+ into it. Also exposes `readFrozenModules`/`setFrozenModules`
100
+ (act:c1013967): the `.ccrc.json` `frozenModules` accessors for the
101
+ freeze-module mechanism (a non-array reads as empty — shape-drift
102
+ defensive; `create()` preserves the field via `...existing`).
103
+ Also exposes `readMcpOptOut` (act:b770c323): the `.ccrc.json`
104
+ `mcpOptOut` accessor — the CC-shipped MCP server keys this consumer
105
+ declines (flow's `no-pib-db.md` is the live specimen; its validator
106
+ requires the pib-db registration absent while the engagement→
107
+ work-tracking closure keeps shipping the files). Same defensive shape
108
+ as `readFrozenModules`; the key survives reinstalls via `create()`'s
109
+ `...existing` spread, so a consumer sets it once by hand. Honored by
110
+ `mergeMcpServers` in `lib/cli.js` (opted-out keys are never added and
111
+ are REMOVED if present — self-heal toward declared intent; removal is
112
+ scoped to keys CC ships, so hand-added servers are never touched;
113
+ nothing-to-contribute installs don't rewrite `.mcp.json`). Tests in
114
+ `test/mcp-opt-out/`.
115
+ `normalize()` guards shape drift (non-object top level reads as
116
+ 'no metadata').
117
+ - `lib/settings-merge.js` — merges CC hooks into `.claude/settings.json`.
118
+ CC-owned hook commands ship with a `$CLAUDE_PROJECT_DIR/` prefix so they
119
+ resolve from any cwd (a bare-relative `.claude/hooks/X.sh` breaks when a
120
+ hook fires from a non-root directory; commit 81693f8). A reinstall
121
+ migration REPLACES (not duplicates) any superseded bare-relative form
122
+ with the prefixed one — `bareForm()` derives the legacy spelling,
123
+ `dropHookCommands()` removes it, then the prefixed form is added;
124
+ exact-match on CC-owned command strings only, so consumer-custom hooks
125
+ are never touched. `mergeSettings` ALSO migrates the stale pib action
126
+ gate matchers to their `mcp__pib-db__*` MCP tool-name form (act:ff693d4c —
127
+ the old bare matchers never matched the real MCP tool names, so the
128
+ gates were dead since shipping); the fired-at-least-once telemetry record
129
+ in `.claude/state/hooks-fired.jsonl` is written by the gate SCRIPTS
130
+ themselves (`action-quality-gate.sh`, `action-completion-gate.sh`), NOT by
131
+ settings-merge. Also heals `~/.claude/settings.json` by
132
+ stripping CC hook entries with project-relative paths (runs
133
+ unconditionally on every install). Exports `mergeBashCompressHooks()`
134
+ for the opt-in bash-compress module; `mergeSkillOverrides()` — the
135
+ installer sets the 34 cabinet-* skills to `skillOverrides: name-only`
136
+ so their long descriptions don't overflow the skill-listing budget
137
+ (act:bee0fa16); and `mergeCcDevHooks()` + `CC_DEV_HOOKS` — the
138
+ repo-local `node --check` PostToolUse dev hook
139
+ (`$CLAUDE_PROJECT_DIR/scripts/node-check-hook.sh`), gated on
140
+ package.json name === `create-claude-cabinet` so it installs only in
141
+ the source repo, never in consumers (act:ff693d4c). 10 tests in
142
+ `test/settings-merge/settings-merge.test.js`.
143
+ - `lib/reset.js` — manifest-safe uninstall/removal. Exports `reset()`:
144
+ removes CC-managed files per the `.ccrc.json` manifest and strips
145
+ CC-managed hook entries from `.claude/settings.json` (matched against
146
+ `CC_HOOK_PATTERNS` / `DEFAULT_HOOKS`), never touching project-owned files.
147
+
148
+ ## Work-tracking / DB
149
+
150
+ - `lib/db-setup.js` — pib-db init step (runs after the copy loop). Exports
151
+ the pure helpers `isAbiMismatch`, `readBundledSchemaVersion`,
152
+ `shouldSkipInit` plus `setupDb(projectDir, opts)` (injectable
153
+ `opts.exec`/`opts.log` for tests). `setupDb` returns `{results,
154
+ schemaVersion}` (a bare array before act:f5dab71f). LAZY-INIT: skips DB
155
+ init when the recorded `.ccrc.json` `dbSchemaVersion` already equals the
156
+ bundled `SCHEMA_VERSION` (read as TEXT from `pib-db-lib.mjs`, never
157
+ imported — so a no-migration reinstall never loads the native module).
158
+ SELF-HEALS a better-sqlite3 ABI mismatch (`npm rebuild` + retry once,
159
+ else one actionable line — never a throw or silent skip; act:e7c69b5c).
160
+ `schemaVersion` is null when init couldn't confirm a version, so the
161
+ caller never records a false 'schema current' claim. 10 tests in
162
+ `test/db-setup/db-setup.test.js`.
163
+ - `lib/engagement-setup.js` — extends the pib-db files with the engagement
164
+ schema when the engagement module is installed. Dispatched from cli.js's
165
+ postInstall pipeline. Two duties: (1) a marker-aware FILE OVERLAY —
166
+ copies the engagement-inclusive pib-db files over the base versions,
167
+ deciding by whether the installed file already contains engagement code
168
+ (not just its `SCHEMA_VERSION` number), so an equal-version reinstall
169
+ still upgrades a base→engagement file; (2) a postInstall schema-ensure.
170
+ Exports `setupEngagement()`.
171
+
172
+ ## Project identity
173
+
174
+ - `lib/project-context.js` — a THIN RE-EXPORT of
175
+ `templates/scripts/project-context.cjs` (Wave 1, act:a6377c82). The
176
+ logic lives in the template copy (co-located with the memory scripts,
177
+ which `require` it as a sibling; consumers have no `lib/`); this file
178
+ re-exports it so CC-source-repo callers (`lib/` code and the
179
+ memory/orient SKILL.md best-effort `require('./lib/project-context')`)
180
+ resolve the exact same implementation. Collapsed the byte-identical
181
+ twins that had already drifted once ("one concept, one place").
182
+
183
+ ## Setup engines (per opt-in module)
184
+
185
+ - `lib/verify-setup.js` — cabinet-verify runtime installer (creates
186
+ `~/.claude-cabinet/verify/<version>/dist/cabinet-verify-<version>.tgz`
187
+ via `npm pack`; writes `~/.claude-cabinet/verify/current/VERSION`
188
+ pointer; equal-version source-hash re-pack via `installer-gate.js`).
189
+ - `lib/site-audit-setup.js` — site-audit runtime installer (mirrors
190
+ verify-setup; packs `templates/site-audit-runtime/` to
191
+ `~/.claude-cabinet/site-audit/<version>/`; equal-version source-hash
192
+ re-pack via `installer-gate.js`).
193
+ - `lib/engagement-server-setup.js` — engagement-server runtime installer
194
+ (copies server files to `~/.claude-cabinet/engagement-server/`;
195
+ follows mux-setup.js pattern with global manifest SHA256 tracking,
196
+ incl. the equal-version hash-compare fall-through of act:df1a1dc3 —
197
+ equal versions copy only changed files, `'unchanged'` when none do).
198
+ - `lib/mux-setup.js` — mux runtime installer (copies bin/mux, config
199
+ scripts, and popup to user-level paths; creates data dirs;
200
+ `setupDarwinIntegration()` appends source-file to `~/.tmux.conf`,
201
+ reloads live tmux, and writes/bootstraps the
202
+ `com.mux.screenshot-to-clipboard` launchd plist; migrates legacy
203
+ `com.orenmagid.*` agent). Version gate (act:df1a1dc3): equal
204
+ CC-vs-installed version does NOT early-return — it falls through to
205
+ the SHA256 manifest hash-compare and copies only changed files
206
+ (new `'unchanged'` status when nothing differs), so a
207
+ dogfood-from-source template edit without a version bump still
208
+ propagates on reinstall.
209
+ - `lib/watchtower-setup.js` — global watchtower runtime refresher
210
+ (`refreshWatchtowerRuntime`, act:2da80102). REFRESH-ONLY: content-hash
211
+ refreshes the EXISTING `~/.claude-cabinet/watchtower/` runtime
212
+ (scripts/ = all globbed `watchtower-*.mjs` + the shell runners,
213
+ hooks/ = the session hooks, cabinet/ = the two docs) on every
214
+ reinstall by comparing each template against the runtime file's ACTUAL
215
+ on-disk bytes — act:4e05ff53 SEVERED the old manifest-driven skip, so
216
+ the shared `global-manifest.json` SHA256 record is now bookkeeping only,
217
+ not the skip signal; a stale or hand-edited runtime file therefore
218
+ reconverges on the next reinstall (self-heal). Dests keyed by absolute
219
+ path so no collision with mux's entries. No-ops with status `'absent'`
220
+ and zero writes when no runtime exists yet — fresh setup (launchd/cron,
221
+ config.json, migrate-keys, coherence assertion) stays the
222
+ `/watchtower install` SKILL.md step's job. Wired in lib/cli.js after the
223
+ postInstall loop, gated on `selectedModules.includes('watchtower')`. 5
224
+ hermetic tests in `test/watchtower-runtime-refresh/`.
225
+
226
+ ## Memory migration (one-time, off omega)
227
+
228
+ - `lib/migrate-from-omega.js` — one-time omega → built-in memory migration
229
+ engine (`--migrate-memory`): exports omega memories to Claude Code's
230
+ built-in memory layout (fresh-write or additive `omega-migrated/` merge
231
+ when native memory already exists), backs up first, then tears down
232
+ omega hooks/MCP. Never overwrites native files.
233
+ - `lib/migrate-memory-cmd.js` — CLI command wrapper for the migration
234
+ (`--migrate-memory`, `--dry-run`, `--unmigrate-memory` rollback).
235
+ - `lib/migration-snapshot.js` — captures pre-migration omega state to a
236
+ JSON snapshot so `--migrate-memory` can do DETERMINISTIC removal of
237
+ hooks / MCP entries / the OMEGA block (match against captured contents,
238
+ not pattern-guess against live state). Searches all three MCP config
239
+ locations and matches omega by command path (contains `omega-venv`)
240
+ rather than key name.