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