claudeos-core 1.7.0 → 2.0.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/CHANGELOG.md +138 -0
- package/CONTRIBUTING.md +92 -59
- package/README.de.md +465 -240
- package/README.es.md +446 -223
- package/README.fr.md +461 -238
- package/README.hi.md +485 -261
- package/README.ja.md +440 -235
- package/README.ko.md +244 -56
- package/README.md +215 -47
- package/README.ru.md +462 -238
- package/README.vi.md +454 -230
- package/README.zh-CN.md +476 -252
- package/bin/cli.js +144 -140
- package/bin/commands/init.js +550 -46
- package/bin/commands/memory.js +426 -0
- package/bin/lib/cli-utils.js +206 -143
- package/bootstrap.sh +81 -390
- package/content-validator/index.js +436 -340
- package/lib/expected-guides.js +23 -0
- package/lib/expected-outputs.js +91 -0
- package/lib/language-config.js +35 -0
- package/lib/memory-scaffold.js +1014 -0
- package/lib/plan-parser.js +153 -149
- package/lib/staged-rules.js +118 -0
- package/manifest-generator/index.js +176 -171
- package/package.json +1 -1
- package/pass-json-validator/index.js +337 -299
- package/pass-prompts/templates/common/pass3-footer.md +16 -0
- package/pass-prompts/templates/common/pass4.md +317 -0
- package/pass-prompts/templates/common/staging-override.md +26 -0
- package/pass-prompts/templates/python-flask/pass1.md +119 -0
- package/pass-prompts/templates/python-flask/pass2.md +85 -0
- package/pass-prompts/templates/python-flask/pass3.md +103 -0
- package/plan-installer/domain-grouper.js +2 -1
- package/plan-installer/prompt-generator.js +120 -96
- package/plan-installer/scanners/scan-frontend.js +219 -10
- package/plan-installer/scanners/scan-java.js +226 -223
- package/plan-installer/scanners/scan-python.js +21 -0
- package/sync-checker/index.js +133 -132
package/bin/cli.js
CHANGED
|
@@ -1,140 +1,144 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* ClaudeOS-Core — CLI
|
|
5
|
-
*
|
|
6
|
-
* Node.js replacement for bootstrap.sh with cross-platform support.
|
|
7
|
-
* Usage:
|
|
8
|
-
* npx claudeos-core init --lang ko ← Run
|
|
9
|
-
* npx claudeos-core init ← Interactive language selection
|
|
10
|
-
* npx claudeos-core health ← Run health checker
|
|
11
|
-
* npx claudeos-core validate ← Run plan validator (--check)
|
|
12
|
-
* npx claudeos-core restore ← Restore from Master Plan
|
|
13
|
-
* npx claudeos-core refresh ← Sync disk → Plan
|
|
14
|
-
* npx claudeos-core
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
const {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
--
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
npx claudeos-core
|
|
72
|
-
npx claudeos-core
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ClaudeOS-Core — CLI
|
|
5
|
+
*
|
|
6
|
+
* Node.js replacement for bootstrap.sh with cross-platform support.
|
|
7
|
+
* Usage:
|
|
8
|
+
* npx claudeos-core init --lang ko ← Run 4-Pass pipeline (Korean output)
|
|
9
|
+
* npx claudeos-core init ← Interactive language selection
|
|
10
|
+
* npx claudeos-core health ← Run health checker
|
|
11
|
+
* npx claudeos-core validate ← Run plan validator (--check)
|
|
12
|
+
* npx claudeos-core restore ← Restore from Master Plan
|
|
13
|
+
* npx claudeos-core refresh ← Sync disk → Plan
|
|
14
|
+
* npx claudeos-core memory <sub> ← L4 memory (compact/score/propose-rules)
|
|
15
|
+
* npx claudeos-core --help ← Show help
|
|
16
|
+
*
|
|
17
|
+
* Also works when cloned directly:
|
|
18
|
+
* node claudeos-core-tools/bin/cli.js init
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const path = require("path");
|
|
22
|
+
const { TOOLS_DIR, PROJECT_ROOT, log, run, readFile } = require("./lib/cli-utils");
|
|
23
|
+
const { cmdInit, InitError } = require("./commands/init");
|
|
24
|
+
const { cmdMemory } = require("./commands/memory");
|
|
25
|
+
|
|
26
|
+
// Set env var so sub-tools (plan-installer, etc.) correctly resolve the project root
|
|
27
|
+
process.env.CLAUDEOS_ROOT = PROJECT_ROOT;
|
|
28
|
+
|
|
29
|
+
// ─── Command handlers (simple — delegate to sub-tools) ───────────
|
|
30
|
+
function cmdHealth() {
|
|
31
|
+
run(`node "${path.join(TOOLS_DIR, "health-checker/index.js")}"`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function cmdValidate() {
|
|
35
|
+
run(`node "${path.join(TOOLS_DIR, "plan-validator/index.js")}" --check`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function cmdRestore() {
|
|
39
|
+
run(`node "${path.join(TOOLS_DIR, "plan-validator/index.js")}" --execute`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function cmdRefresh() {
|
|
43
|
+
run(`node "${path.join(TOOLS_DIR, "plan-validator/index.js")}" --refresh`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// ─── Help ───────────────────────────────────────────────────────
|
|
47
|
+
function showHelp() {
|
|
48
|
+
log(`
|
|
49
|
+
ClaudeOS-Core — Auto-generate Claude Code documentation from your source code.
|
|
50
|
+
|
|
51
|
+
Usage:
|
|
52
|
+
claudeos-core <command>
|
|
53
|
+
|
|
54
|
+
Commands:
|
|
55
|
+
init Run the full 4-Pass pipeline (analyze → merge → generate → memory scaffold)
|
|
56
|
+
health Run all verification tools (health checker)
|
|
57
|
+
validate Check Plan ↔ disk consistency
|
|
58
|
+
refresh Sync disk changes → Master Plan
|
|
59
|
+
restore Restore all files from Master Plan
|
|
60
|
+
memory <sub> L4 memory: compact | score | propose-rules
|
|
61
|
+
|
|
62
|
+
Options:
|
|
63
|
+
--lang CODE Output language for generated files (required for init)
|
|
64
|
+
Supported: en, ko, zh-CN, ja, es, vi, hi, ru, fr, de
|
|
65
|
+
If omitted, interactive selection is shown.
|
|
66
|
+
--force Skip resume prompt and start fresh (delete previous results)
|
|
67
|
+
--help Show this help message
|
|
68
|
+
--version Show version
|
|
69
|
+
|
|
70
|
+
Examples:
|
|
71
|
+
npx claudeos-core init --lang ko # Generate in Korean
|
|
72
|
+
npx claudeos-core init --lang ja # Generate in Japanese
|
|
73
|
+
npx claudeos-core init # Interactive language selection
|
|
74
|
+
npx claudeos-core health # Check everything is consistent
|
|
75
|
+
npx claudeos-core restore # Recover from corrupted docs
|
|
76
|
+
`);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// ─── Argument parser ────────────────────────────────────────────
|
|
80
|
+
function parseArgs(argv) {
|
|
81
|
+
const result = { command: null, lang: null };
|
|
82
|
+
for (let i = 0; i < argv.length; i++) {
|
|
83
|
+
if (argv[i] === "--lang" && i + 1 < argv.length) {
|
|
84
|
+
result.lang = argv[++i];
|
|
85
|
+
} else if (argv[i].startsWith("--lang=")) {
|
|
86
|
+
result.lang = argv[i].split("=")[1];
|
|
87
|
+
} else if (argv[i] === "--force" || argv[i] === "-f") {
|
|
88
|
+
result.force = true;
|
|
89
|
+
} else if (argv[i] === "--help" || argv[i] === "-h") {
|
|
90
|
+
result.command = "--help";
|
|
91
|
+
} else if (argv[i] === "--version" || argv[i] === "-v") {
|
|
92
|
+
result.command = "--version";
|
|
93
|
+
} else if (!argv[i].startsWith("-") && !result.command) {
|
|
94
|
+
result.command = argv[i];
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return result;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// ─── Main ───────────────────────────────────────────────────────
|
|
101
|
+
const args = process.argv.slice(2);
|
|
102
|
+
const parsedArgs = parseArgs(args);
|
|
103
|
+
const command = parsedArgs.command;
|
|
104
|
+
|
|
105
|
+
if (!command || command === "--help") {
|
|
106
|
+
showHelp();
|
|
107
|
+
process.exit(0);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (command === "--version") {
|
|
111
|
+
try {
|
|
112
|
+
const pkg = JSON.parse(
|
|
113
|
+
readFile(path.join(TOOLS_DIR, "package.json"))
|
|
114
|
+
);
|
|
115
|
+
log(`claudeos-core v${pkg.version}`);
|
|
116
|
+
} catch (e) {
|
|
117
|
+
log("claudeos-core (version unknown)");
|
|
118
|
+
}
|
|
119
|
+
process.exit(0);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const commands = {
|
|
123
|
+
init: () => cmdInit(parsedArgs),
|
|
124
|
+
health: cmdHealth,
|
|
125
|
+
validate: cmdValidate,
|
|
126
|
+
restore: cmdRestore,
|
|
127
|
+
refresh: cmdRefresh,
|
|
128
|
+
memory: () => cmdMemory(parsedArgs),
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
if (!commands[command]) {
|
|
132
|
+
log(`Unknown command: ${command}`);
|
|
133
|
+
log('Run "claudeos-core --help" for usage.');
|
|
134
|
+
process.exit(1);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
Promise.resolve().then(() => commands[command]()).catch((e) => {
|
|
138
|
+
if (e instanceof InitError) {
|
|
139
|
+
log(`\n ❌ ${e.message}\n`);
|
|
140
|
+
} else {
|
|
141
|
+
console.error(e.message || e);
|
|
142
|
+
}
|
|
143
|
+
process.exit(1);
|
|
144
|
+
});
|