create-claude-cabinet 0.26.0 โ 0.27.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/lib/cli.js +64 -29
- package/lib/metadata.js +22 -1
- package/lib/migrate-from-omega.js +681 -0
- package/lib/migrate-memory-cmd.js +653 -0
- package/lib/migration-snapshot.js +241 -0
- package/lib/project-context.js +103 -0
- package/lib/settings-merge.js +82 -51
- package/lib/verify-setup.js +4 -3
- package/package.json +4 -1
- package/templates/README.md +4 -3
- package/templates/cabinet/cross-project-rules-README.md +131 -0
- package/templates/cabinet/subagent-memory.md +90 -0
- package/templates/hooks/memory-index-guard.sh +70 -0
- package/templates/rules/memory-capture.md +64 -54
- package/templates/skills/cabinet-anthropic-insider/SKILL.md +7 -6
- package/templates/skills/cabinet-anti-confirmation/SKILL.md +1 -0
- package/templates/skills/cabinet-cc-health/SKILL.md +42 -39
- package/templates/skills/cabinet-goal-alignment/SKILL.md +1 -0
- package/templates/skills/cabinet-historian/SKILL.md +64 -121
- package/templates/skills/cabinet-record-keeper/SKILL.md +1 -0
- package/templates/skills/cabinet-technical-debt/SKILL.md +1 -0
- package/templates/skills/cabinet-vision/SKILL.md +1 -0
- package/templates/skills/cc-remember/SKILL.md +101 -0
- package/templates/skills/cc-upgrade/SKILL.md +34 -20
- package/templates/skills/cc-upgrade/phases/omega-migration-detect.md +134 -0
- package/templates/skills/debrief/SKILL.md +28 -27
- package/templates/skills/debrief/phases/record-lessons.md +56 -52
- package/templates/skills/memory/SKILL.md +85 -151
- package/templates/skills/onboard/phases/detect-state.md +1 -1
- package/templates/skills/onboard/phases/interview.md +33 -0
- package/templates/skills/orient/SKILL.md +20 -38
- package/templates/skills/orient/phases/auto-maintenance.md +14 -54
- package/templates/skills/orient/phases/context.md +20 -20
- package/templates/skills/validate/phases/validators.md +11 -0
- package/templates/skills/verify/phases/discover.md +5 -3
- package/lib/omega-setup.js +0 -266
- package/templates/hooks/domain-memories.sh +0 -65
- package/templates/hooks/omega-memory-guard.sh +0 -77
- package/templates/scripts/cabinet-memory-adapter.py +0 -367
- package/templates/scripts/migrate-memory-to-omega.py +0 -124
package/lib/cli.js
CHANGED
|
@@ -4,10 +4,9 @@ const fs = require('fs');
|
|
|
4
4
|
const os = require('os');
|
|
5
5
|
const crypto = require('crypto');
|
|
6
6
|
const { copyTemplates } = require('./copy');
|
|
7
|
-
const { mergeSettings } = require('./settings-merge');
|
|
7
|
+
const { mergeSettings, healUserSettings } = require('./settings-merge');
|
|
8
8
|
const { create: createMetadata, read: readMetadata } = require('./metadata');
|
|
9
9
|
const { setupDb } = require('./db-setup');
|
|
10
|
-
const { setupOmega } = require('./omega-setup');
|
|
11
10
|
const { setupVerifyRuntime } = require('./verify-setup');
|
|
12
11
|
const { reset } = require('./reset');
|
|
13
12
|
|
|
@@ -443,15 +442,6 @@ const MODULES = {
|
|
|
443
442
|
lean: false,
|
|
444
443
|
templates: ['skills/validate', 'scripts/skill-validator.sh'],
|
|
445
444
|
},
|
|
446
|
-
'memory': {
|
|
447
|
-
name: 'Semantic Memory (omega)',
|
|
448
|
-
description: 'Rich session memory via omega-memory. Captures decisions, reasoning chains, and lessons between sessions. Requires Python 3.11+.',
|
|
449
|
-
mandatory: false,
|
|
450
|
-
default: true,
|
|
451
|
-
lean: false,
|
|
452
|
-
needsOmega: true,
|
|
453
|
-
templates: ['skills/memory', 'scripts/cabinet-memory-adapter.py', 'scripts/migrate-memory-to-omega.py', 'rules/memory-capture.md', 'hooks/omega-memory-guard.sh'],
|
|
454
|
-
},
|
|
455
445
|
'verify': {
|
|
456
446
|
name: 'Verification Harness (Cucumber + Playwright)',
|
|
457
447
|
description: 'Walkthrough verification with human-in-the-loop verdict pauses. Replaces flat AC lists with re-runnable user-journey scenarios. Includes /verify skeleton skill + cabinet-verify npm runtime + opt-in integration phases for /plan, /execute, /debrief.',
|
|
@@ -529,6 +519,8 @@ function parseArgs(argv) {
|
|
|
529
519
|
else if (arg === '--help' || arg === '-h') flags.help = true;
|
|
530
520
|
else if (arg === '--reset') flags.reset = true;
|
|
531
521
|
else if (arg === '--force') flags.force = true;
|
|
522
|
+
else if (arg === '--migrate-memory') flags.migrateMemory = true;
|
|
523
|
+
else if (arg === '--unmigrate-memory') flags.unmigrateMemory = true;
|
|
532
524
|
else if (arg === '--modules' && i + 1 < args.length) {
|
|
533
525
|
flags.modules = args[++i].split(',').map(s => s.trim()).filter(Boolean);
|
|
534
526
|
}
|
|
@@ -546,11 +538,17 @@ function printHelp() {
|
|
|
546
538
|
--yes, -y Accept all defaults, no prompts
|
|
547
539
|
--lean Install core modules only (no work-tracking, compliance, validate)
|
|
548
540
|
--no-db Skip work tracking database setup
|
|
549
|
-
--modules <keys> Comma-separated module keys to install (e.g., 'verify
|
|
541
|
+
--modules <keys> Comma-separated module keys to install (e.g., 'verify').
|
|
550
542
|
Mandatory modules are always included.
|
|
551
543
|
--dry-run Show what would be copied without writing
|
|
552
544
|
--reset Remove Claude Cabinet files (uses manifest for safety)
|
|
553
|
-
--force With --reset: remove even customized files
|
|
545
|
+
--force With --reset: remove even customized files;
|
|
546
|
+
with --migrate-memory: override already-migrated guard
|
|
547
|
+
--migrate-memory One-time migration off omega-memory (v0.27.0+).
|
|
548
|
+
Exports omega memories to built-in memory layout, then
|
|
549
|
+
disables omega hooks/MCP. Idempotent โ safe to re-run.
|
|
550
|
+
Pair with --dry-run to preview.
|
|
551
|
+
--unmigrate-memory Roll back --migrate-memory using its backup dir.
|
|
554
552
|
--help, -h Show this help
|
|
555
553
|
|
|
556
554
|
Examples:
|
|
@@ -579,6 +577,48 @@ async function run() {
|
|
|
579
577
|
return;
|
|
580
578
|
}
|
|
581
579
|
|
|
580
|
+
if (flags.migrateMemory) {
|
|
581
|
+
const { migrateMemoryCmd } = require('./migrate-memory-cmd');
|
|
582
|
+
const projectDir = path.resolve(flags.targetDir);
|
|
583
|
+
console.log('');
|
|
584
|
+
console.log(` ๐ Omega โ built-in memory migration${flags.dryRun ? ' [dry-run]' : ''}`);
|
|
585
|
+
console.log('');
|
|
586
|
+
const result = await migrateMemoryCmd({
|
|
587
|
+
cwd: projectDir,
|
|
588
|
+
dryRun: flags.dryRun,
|
|
589
|
+
force: flags.force,
|
|
590
|
+
});
|
|
591
|
+
console.log('');
|
|
592
|
+
if (result.skipped) {
|
|
593
|
+
console.log(` ${result.message || result.reason}`);
|
|
594
|
+
} else if (flags.dryRun) {
|
|
595
|
+
console.log(` Dry run complete. ${result.steps.length} step(s) would execute.`);
|
|
596
|
+
} else {
|
|
597
|
+
console.log(` โ Migration complete.`);
|
|
598
|
+
console.log(` Backup: ${result.backupDir}`);
|
|
599
|
+
console.log(` State: ${result.state.state} (recorded in .ccrc.json.migrated_from_omega)`);
|
|
600
|
+
console.log(` Rollback: npx create-claude-cabinet --unmigrate-memory`);
|
|
601
|
+
}
|
|
602
|
+
console.log('');
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
if (flags.unmigrateMemory) {
|
|
607
|
+
const { unmigrateMemoryCmd } = require('./migrate-memory-cmd');
|
|
608
|
+
const projectDir = path.resolve(flags.targetDir);
|
|
609
|
+
console.log('');
|
|
610
|
+
console.log(` โฉ๏ธ Rolling back omega โ built-in migration${flags.dryRun ? ' [dry-run]' : ''}`);
|
|
611
|
+
console.log('');
|
|
612
|
+
const result = await unmigrateMemoryCmd({ cwd: projectDir, dryRun: flags.dryRun });
|
|
613
|
+
if (!result.ok) {
|
|
614
|
+
console.error(` โ ${result.message}`);
|
|
615
|
+
process.exit(1);
|
|
616
|
+
}
|
|
617
|
+
console.log(` ${result.message}`);
|
|
618
|
+
console.log('');
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
|
|
582
622
|
console.log('');
|
|
583
623
|
console.log(' ๐๏ธ Claude Cabinet v' + VERSION);
|
|
584
624
|
console.log(' A cabinet of experts for your Claude Code project');
|
|
@@ -978,11 +1018,20 @@ async function run() {
|
|
|
978
1018
|
|
|
979
1019
|
// --- Merge hooks into settings.json ---
|
|
980
1020
|
if (selectedModules.includes('hooks') && !flags.dryRun) {
|
|
981
|
-
const
|
|
982
|
-
const settingsPath = mergeSettings(projectDir, { includeDb, includeMemory });
|
|
1021
|
+
const settingsPath = mergeSettings(projectDir, { includeDb });
|
|
983
1022
|
console.log(` โ๏ธ Merged hooks into ${path.relative(projectDir, settingsPath)}`);
|
|
984
1023
|
}
|
|
985
1024
|
|
|
1025
|
+
// --- Heal user-level ~/.claude/settings.json ---
|
|
1026
|
+
// Strip CC hook entries with project-relative paths that fire (and fail) in
|
|
1027
|
+
// every project including non-CC ones. Idempotent; no-op for clean configs.
|
|
1028
|
+
if (!flags.dryRun) {
|
|
1029
|
+
const removed = healUserSettings();
|
|
1030
|
+
if (removed > 0) {
|
|
1031
|
+
console.log(` ๐งน Removed ${removed} stale CC hook entr${removed === 1 ? 'y' : 'ies'} from ~/.claude/settings.json`);
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
|
|
986
1035
|
// --- Merge pib-db MCP server into .mcp.json ---
|
|
987
1036
|
if (selectedModules.includes('work-tracking') && !flags.dryRun) {
|
|
988
1037
|
try {
|
|
@@ -1015,20 +1064,6 @@ async function run() {
|
|
|
1015
1064
|
}
|
|
1016
1065
|
}
|
|
1017
1066
|
|
|
1018
|
-
// --- Set up omega memory ---
|
|
1019
|
-
const needsOmega = selectedModules.some(m => MODULES[m].needsOmega);
|
|
1020
|
-
if (needsOmega && !flags.dryRun) {
|
|
1021
|
-
try {
|
|
1022
|
-
console.log('');
|
|
1023
|
-
const omegaResults = setupOmega();
|
|
1024
|
-
for (const r of omegaResults) console.log(` ๐ง ${r}`);
|
|
1025
|
-
} catch (err) {
|
|
1026
|
-
console.log(` โ Omega memory setup skipped: ${err.message}`);
|
|
1027
|
-
console.log(' Memory module will be inactive until Python 3.11+ is available.');
|
|
1028
|
-
console.log(' Re-run the installer after installing Python to enable it.');
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
1067
|
// --- Run module postInstall hooks ---
|
|
1033
1068
|
// Modules with a `postInstall` field dispatch to a matching setup
|
|
1034
1069
|
// function after templates are copied. Currently only 'verify-setup'
|
package/lib/metadata.js
CHANGED
|
@@ -22,8 +22,29 @@ function write(projectDir, data) {
|
|
|
22
22
|
fs.writeFileSync(file, JSON.stringify(data, null, 2) + '\n');
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Shallow-merge `partial` into the existing .ccrc.json and write back.
|
|
27
|
+
* Preserves any unknown top-level keys (e.g., `migrated_from_omega`)
|
|
28
|
+
* that this codepath doesn't know about โ critical for cross-codepath
|
|
29
|
+
* fields written by other tools like --migrate-memory.
|
|
30
|
+
*
|
|
31
|
+
* Returns the merged result.
|
|
32
|
+
*/
|
|
33
|
+
function merge(projectDir, partial) {
|
|
34
|
+
const existing = read(projectDir) || {};
|
|
35
|
+
const data = { ...existing, ...partial };
|
|
36
|
+
write(projectDir, data);
|
|
37
|
+
return data;
|
|
38
|
+
}
|
|
39
|
+
|
|
25
40
|
function create(projectDir, { modules, skipped, version, manifest = {} }) {
|
|
41
|
+
// Read existing first so unknown top-level keys (e.g.
|
|
42
|
+
// `migrated_from_omega` set by --migrate-memory) survive the
|
|
43
|
+
// install/upgrade rewrite. Only the install-specific fields below
|
|
44
|
+
// are reset on each create() call.
|
|
45
|
+
const existing = read(projectDir) || {};
|
|
26
46
|
const data = {
|
|
47
|
+
...existing,
|
|
27
48
|
version,
|
|
28
49
|
installedAt: new Date().toISOString(),
|
|
29
50
|
upstreamPackage: 'create-claude-cabinet',
|
|
@@ -43,4 +64,4 @@ function create(projectDir, { modules, skipped, version, manifest = {} }) {
|
|
|
43
64
|
return data;
|
|
44
65
|
}
|
|
45
66
|
|
|
46
|
-
module.exports = { read, write, create, metadataPath, METADATA_FILE };
|
|
67
|
+
module.exports = { read, write, merge, create, metadataPath, METADATA_FILE };
|