claudeos-core 2.2.0 → 2.3.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 +1649 -907
- package/CONTRIBUTING.md +92 -92
- package/README.de.md +32 -0
- package/README.es.md +32 -0
- package/README.fr.md +32 -0
- package/README.hi.md +32 -0
- package/README.ja.md +32 -0
- package/README.ko.md +1018 -986
- package/README.md +1020 -987
- package/README.ru.md +32 -0
- package/README.vi.md +1019 -987
- package/README.zh-CN.md +32 -0
- package/bin/cli.js +152 -148
- package/bin/commands/init.js +1673 -1554
- package/bin/commands/lint.js +62 -0
- package/bin/commands/memory.js +438 -438
- package/bin/lib/cli-utils.js +206 -206
- package/claude-md-validator/index.js +184 -0
- package/claude-md-validator/reporter.js +66 -0
- package/claude-md-validator/structural-checks.js +528 -0
- package/content-validator/index.js +666 -441
- package/lib/expected-guides.js +23 -23
- package/lib/expected-outputs.js +90 -90
- package/lib/language-config.js +35 -35
- package/lib/memory-scaffold.js +1058 -1054
- package/lib/plan-parser.js +165 -165
- package/lib/staged-rules.js +118 -118
- package/manifest-generator/index.js +174 -174
- package/package.json +90 -87
- package/pass-json-validator/index.js +337 -337
- package/pass-prompts/templates/common/claude-md-scaffold.md +52 -10
- package/pass-prompts/templates/common/pass3-footer.md +402 -224
- package/pass-prompts/templates/common/pass3b-core-header.md +43 -0
- package/pass-prompts/templates/common/pass4.md +375 -305
- package/pass-prompts/templates/common/staging-override.md +26 -26
- package/pass-prompts/templates/node-vite/pass1.md +117 -117
- package/pass-prompts/templates/node-vite/pass2.md +78 -78
- package/pass-prompts/templates/python-flask/pass1.md +119 -119
- package/pass-prompts/templates/python-flask/pass2.md +85 -85
- package/plan-installer/domain-grouper.js +76 -76
- package/plan-installer/index.js +137 -137
- package/plan-installer/prompt-generator.js +188 -145
- package/plan-installer/scanners/scan-frontend.js +505 -473
- package/plan-installer/scanners/scan-java.js +226 -226
- package/plan-installer/scanners/scan-node.js +57 -57
- package/plan-installer/scanners/scan-python.js +85 -85
- package/plan-installer/stack-detector.js +482 -482
- package/plan-installer/structure-scanner.js +65 -65
- package/sync-checker/index.js +177 -177
package/lib/expected-guides.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Single source of truth for the 9 guide files Pass 3 must generate.
|
|
3
|
-
*
|
|
4
|
-
* Used by:
|
|
5
|
-
* - bin/commands/init.js Guard 3 (fails Pass 3 if any are missing)
|
|
6
|
-
* - content-validator/index.js [5/9] (reports MISSING/EMPTY)
|
|
7
|
-
*
|
|
8
|
-
* Adding a guide: edit this file only.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
const EXPECTED_GUIDE_FILES = [
|
|
12
|
-
"01.onboarding/01.overview.md",
|
|
13
|
-
"01.onboarding/02.quickstart.md",
|
|
14
|
-
"01.onboarding/03.glossary.md",
|
|
15
|
-
"02.usage/01.faq.md",
|
|
16
|
-
"02.usage/02.real-world-examples.md",
|
|
17
|
-
"02.usage/03.do-and-dont.md",
|
|
18
|
-
"03.troubleshooting/01.troubleshooting.md",
|
|
19
|
-
"04.architecture/01.file-map.md",
|
|
20
|
-
"04.architecture/02.pros-and-cons.md",
|
|
21
|
-
];
|
|
22
|
-
|
|
23
|
-
module.exports = { EXPECTED_GUIDE_FILES };
|
|
1
|
+
/**
|
|
2
|
+
* Single source of truth for the 9 guide files Pass 3 must generate.
|
|
3
|
+
*
|
|
4
|
+
* Used by:
|
|
5
|
+
* - bin/commands/init.js Guard 3 (fails Pass 3 if any are missing)
|
|
6
|
+
* - content-validator/index.js [5/9] (reports MISSING/EMPTY)
|
|
7
|
+
*
|
|
8
|
+
* Adding a guide: edit this file only.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const EXPECTED_GUIDE_FILES = [
|
|
12
|
+
"01.onboarding/01.overview.md",
|
|
13
|
+
"01.onboarding/02.quickstart.md",
|
|
14
|
+
"01.onboarding/03.glossary.md",
|
|
15
|
+
"02.usage/01.faq.md",
|
|
16
|
+
"02.usage/02.real-world-examples.md",
|
|
17
|
+
"02.usage/03.do-and-dont.md",
|
|
18
|
+
"03.troubleshooting/01.troubleshooting.md",
|
|
19
|
+
"04.architecture/01.file-map.md",
|
|
20
|
+
"04.architecture/02.pros-and-cons.md",
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
module.exports = { EXPECTED_GUIDE_FILES };
|
package/lib/expected-outputs.js
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pass 3 output directories that must have real content on success.
|
|
3
|
-
*
|
|
4
|
-
* Complements expected-guides.js (9 guide files). Used by init.js Guard 3
|
|
5
|
-
* to detect truncation that occurs AFTER the guide/ section — e.g. Claude
|
|
6
|
-
* writes guide/ fully but cuts off before skills/ or plan/.
|
|
7
|
-
*
|
|
8
|
-
* Severity source: content-validator/index.js. Entries here map 1:1 to
|
|
9
|
-
* validator ERROR-level checks. database/ and mcp-guide/ are intentionally
|
|
10
|
-
* omitted because the validator flags them as WARNING-level only (stacks
|
|
11
|
-
* legitimately skip when no DB or MCP integration is detected).
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
const fs = require("fs");
|
|
15
|
-
const path = require("path");
|
|
16
|
-
|
|
17
|
-
const EXPECTED_OUTPUTS = [
|
|
18
|
-
{
|
|
19
|
-
// Sentinel file written by every stack's pass3.md template.
|
|
20
|
-
label: "claudeos-core/standard/00.core/01.project-overview.md",
|
|
21
|
-
kind: "file",
|
|
22
|
-
relPath: "claudeos-core/standard/00.core/01.project-overview.md",
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
// Skills/ holds scaffold-crud-feature (backend) and/or scaffold-page-feature
|
|
26
|
-
// (frontend) sub-skills. Zero non-empty .md files = truncation.
|
|
27
|
-
label: "claudeos-core/skills/ (≥1 non-empty .md)",
|
|
28
|
-
kind: "dir-has-nonempty-md",
|
|
29
|
-
relPath: "claudeos-core/skills",
|
|
30
|
-
},
|
|
31
|
-
// Note: claudeos-core/plan/ check was removed in this version because
|
|
32
|
-
// master plan files (10.standard-master.md, 20.rules-master.md, etc.) are
|
|
33
|
-
// no longer generated. Master plans were an internal tool backup not
|
|
34
|
-
// consumed by Claude Code at runtime, and aggregating many files in a
|
|
35
|
-
// single session caused "Prompt is too long" failures on mid-sized
|
|
36
|
-
// projects (confirmed on an 18-domain production run).
|
|
37
|
-
];
|
|
38
|
-
|
|
39
|
-
function readSafe(p) {
|
|
40
|
-
try { return fs.readFileSync(p, "utf-8"); }
|
|
41
|
-
catch (_e) { return null; }
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// BOM-aware emptiness check. String.prototype.trim does NOT remove U+FEFF
|
|
45
|
-
// (not in Unicode White_Space), so a BOM-only file would pass a naive
|
|
46
|
-
// `.trim().length === 0` check — we strip it explicitly first. Mirrors
|
|
47
|
-
// content-validator/index.js:115 and the H2 check in init.js Guard 3.
|
|
48
|
-
function isBlank(text) {
|
|
49
|
-
return text.replace(/^\uFEFF/, "").trim().length === 0;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Stack-based traversal (no recursion limit, same pattern as lib/staged-rules.js
|
|
53
|
-
// walkFiles). Returns true on the first non-empty .md found; unreadable dirs
|
|
54
|
-
// are skipped silently (matches the project's fault-tolerant fs conventions).
|
|
55
|
-
function hasNonEmptyMdRecursive(dir) {
|
|
56
|
-
const stack = [dir];
|
|
57
|
-
while (stack.length) {
|
|
58
|
-
const current = stack.pop();
|
|
59
|
-
let entries;
|
|
60
|
-
try { entries = fs.readdirSync(current, { withFileTypes: true }); }
|
|
61
|
-
catch (_e) { continue; }
|
|
62
|
-
for (const e of entries) {
|
|
63
|
-
const full = path.join(current, e.name);
|
|
64
|
-
if (e.isDirectory()) { stack.push(full); continue; }
|
|
65
|
-
if (!e.isFile() || !e.name.endsWith(".md")) continue;
|
|
66
|
-
const content = readSafe(full);
|
|
67
|
-
if (content !== null && !isBlank(content)) return true;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function findMissingOutputs(projectRoot) {
|
|
74
|
-
const missing = [];
|
|
75
|
-
for (const check of EXPECTED_OUTPUTS) {
|
|
76
|
-
const abs = path.join(projectRoot, check.relPath);
|
|
77
|
-
if (check.kind === "file") {
|
|
78
|
-
if (!fs.existsSync(abs)) { missing.push(`${check.label} — not created`); continue; }
|
|
79
|
-
const c = readSafe(abs);
|
|
80
|
-
if (c === null) { missing.push(`${check.label} — unreadable`); continue; }
|
|
81
|
-
if (isBlank(c)) { missing.push(`${check.label} — empty`); }
|
|
82
|
-
} else if (check.kind === "dir-has-nonempty-md") {
|
|
83
|
-
if (!fs.existsSync(abs)) { missing.push(`${check.label} — directory missing`); continue; }
|
|
84
|
-
if (!hasNonEmptyMdRecursive(abs)) { missing.push(`${check.label} — no non-empty .md files found`); }
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return missing;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
module.exports = { EXPECTED_OUTPUTS, findMissingOutputs, hasNonEmptyMdRecursive };
|
|
1
|
+
/**
|
|
2
|
+
* Pass 3 output directories that must have real content on success.
|
|
3
|
+
*
|
|
4
|
+
* Complements expected-guides.js (9 guide files). Used by init.js Guard 3
|
|
5
|
+
* to detect truncation that occurs AFTER the guide/ section — e.g. Claude
|
|
6
|
+
* writes guide/ fully but cuts off before skills/ or plan/.
|
|
7
|
+
*
|
|
8
|
+
* Severity source: content-validator/index.js. Entries here map 1:1 to
|
|
9
|
+
* validator ERROR-level checks. database/ and mcp-guide/ are intentionally
|
|
10
|
+
* omitted because the validator flags them as WARNING-level only (stacks
|
|
11
|
+
* legitimately skip when no DB or MCP integration is detected).
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const fs = require("fs");
|
|
15
|
+
const path = require("path");
|
|
16
|
+
|
|
17
|
+
const EXPECTED_OUTPUTS = [
|
|
18
|
+
{
|
|
19
|
+
// Sentinel file written by every stack's pass3.md template.
|
|
20
|
+
label: "claudeos-core/standard/00.core/01.project-overview.md",
|
|
21
|
+
kind: "file",
|
|
22
|
+
relPath: "claudeos-core/standard/00.core/01.project-overview.md",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
// Skills/ holds scaffold-crud-feature (backend) and/or scaffold-page-feature
|
|
26
|
+
// (frontend) sub-skills. Zero non-empty .md files = truncation.
|
|
27
|
+
label: "claudeos-core/skills/ (≥1 non-empty .md)",
|
|
28
|
+
kind: "dir-has-nonempty-md",
|
|
29
|
+
relPath: "claudeos-core/skills",
|
|
30
|
+
},
|
|
31
|
+
// Note: claudeos-core/plan/ check was removed in this version because
|
|
32
|
+
// master plan files (10.standard-master.md, 20.rules-master.md, etc.) are
|
|
33
|
+
// no longer generated. Master plans were an internal tool backup not
|
|
34
|
+
// consumed by Claude Code at runtime, and aggregating many files in a
|
|
35
|
+
// single session caused "Prompt is too long" failures on mid-sized
|
|
36
|
+
// projects (confirmed on an 18-domain production run).
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
function readSafe(p) {
|
|
40
|
+
try { return fs.readFileSync(p, "utf-8"); }
|
|
41
|
+
catch (_e) { return null; }
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// BOM-aware emptiness check. String.prototype.trim does NOT remove U+FEFF
|
|
45
|
+
// (not in Unicode White_Space), so a BOM-only file would pass a naive
|
|
46
|
+
// `.trim().length === 0` check — we strip it explicitly first. Mirrors
|
|
47
|
+
// content-validator/index.js:115 and the H2 check in init.js Guard 3.
|
|
48
|
+
function isBlank(text) {
|
|
49
|
+
return text.replace(/^\uFEFF/, "").trim().length === 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Stack-based traversal (no recursion limit, same pattern as lib/staged-rules.js
|
|
53
|
+
// walkFiles). Returns true on the first non-empty .md found; unreadable dirs
|
|
54
|
+
// are skipped silently (matches the project's fault-tolerant fs conventions).
|
|
55
|
+
function hasNonEmptyMdRecursive(dir) {
|
|
56
|
+
const stack = [dir];
|
|
57
|
+
while (stack.length) {
|
|
58
|
+
const current = stack.pop();
|
|
59
|
+
let entries;
|
|
60
|
+
try { entries = fs.readdirSync(current, { withFileTypes: true }); }
|
|
61
|
+
catch (_e) { continue; }
|
|
62
|
+
for (const e of entries) {
|
|
63
|
+
const full = path.join(current, e.name);
|
|
64
|
+
if (e.isDirectory()) { stack.push(full); continue; }
|
|
65
|
+
if (!e.isFile() || !e.name.endsWith(".md")) continue;
|
|
66
|
+
const content = readSafe(full);
|
|
67
|
+
if (content !== null && !isBlank(content)) return true;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function findMissingOutputs(projectRoot) {
|
|
74
|
+
const missing = [];
|
|
75
|
+
for (const check of EXPECTED_OUTPUTS) {
|
|
76
|
+
const abs = path.join(projectRoot, check.relPath);
|
|
77
|
+
if (check.kind === "file") {
|
|
78
|
+
if (!fs.existsSync(abs)) { missing.push(`${check.label} — not created`); continue; }
|
|
79
|
+
const c = readSafe(abs);
|
|
80
|
+
if (c === null) { missing.push(`${check.label} — unreadable`); continue; }
|
|
81
|
+
if (isBlank(c)) { missing.push(`${check.label} — empty`); }
|
|
82
|
+
} else if (check.kind === "dir-has-nonempty-md") {
|
|
83
|
+
if (!fs.existsSync(abs)) { missing.push(`${check.label} — directory missing`); continue; }
|
|
84
|
+
if (!hasNonEmptyMdRecursive(abs)) { missing.push(`${check.label} — no non-empty .md files found`); }
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return missing;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
module.exports = { EXPECTED_OUTPUTS, findMissingOutputs, hasNonEmptyMdRecursive };
|
package/lib/language-config.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ClaudeOS-Core — Language Configuration (single source of truth)
|
|
3
|
-
*
|
|
4
|
-
* The 10-language map for generated documentation output. Used by:
|
|
5
|
-
* - bin/lib/cli-utils.js (re-exports as SUPPORTED_LANGS / LANG_CODES / isValidLang)
|
|
6
|
-
* - bin/lib/lang-selector.js (interactive picker)
|
|
7
|
-
* - lib/memory-scaffold.js (translation prompt — re-exports as LANG_LABELS)
|
|
8
|
-
*
|
|
9
|
-
* Adding a language: add the entry here. All consumers pick it up automatically.
|
|
10
|
-
*
|
|
11
|
-
* Format: lang code → human-readable name (native script + English in parens
|
|
12
|
-
* for non-English languages). Order is preserved by Object.keys, which drives
|
|
13
|
-
* the lang-selector display order — `en` first, then alphabetical-ish.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
const LANGUAGES = {
|
|
17
|
-
en: "English",
|
|
18
|
-
ko: "한국어 (Korean)",
|
|
19
|
-
"zh-CN": "简体中文 (Chinese Simplified)",
|
|
20
|
-
ja: "日本語 (Japanese)",
|
|
21
|
-
es: "Español (Spanish)",
|
|
22
|
-
vi: "Tiếng Việt (Vietnamese)",
|
|
23
|
-
hi: "हिन्दी (Hindi)",
|
|
24
|
-
ru: "Русский (Russian)",
|
|
25
|
-
fr: "Français (French)",
|
|
26
|
-
de: "Deutsch (German)",
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const LANG_CODES = Object.keys(LANGUAGES);
|
|
30
|
-
|
|
31
|
-
function isValidLang(lang) {
|
|
32
|
-
return LANG_CODES.includes(lang);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
module.exports = { LANGUAGES, LANG_CODES, isValidLang };
|
|
1
|
+
/**
|
|
2
|
+
* ClaudeOS-Core — Language Configuration (single source of truth)
|
|
3
|
+
*
|
|
4
|
+
* The 10-language map for generated documentation output. Used by:
|
|
5
|
+
* - bin/lib/cli-utils.js (re-exports as SUPPORTED_LANGS / LANG_CODES / isValidLang)
|
|
6
|
+
* - bin/lib/lang-selector.js (interactive picker)
|
|
7
|
+
* - lib/memory-scaffold.js (translation prompt — re-exports as LANG_LABELS)
|
|
8
|
+
*
|
|
9
|
+
* Adding a language: add the entry here. All consumers pick it up automatically.
|
|
10
|
+
*
|
|
11
|
+
* Format: lang code → human-readable name (native script + English in parens
|
|
12
|
+
* for non-English languages). Order is preserved by Object.keys, which drives
|
|
13
|
+
* the lang-selector display order — `en` first, then alphabetical-ish.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const LANGUAGES = {
|
|
17
|
+
en: "English",
|
|
18
|
+
ko: "한국어 (Korean)",
|
|
19
|
+
"zh-CN": "简体中文 (Chinese Simplified)",
|
|
20
|
+
ja: "日本語 (Japanese)",
|
|
21
|
+
es: "Español (Spanish)",
|
|
22
|
+
vi: "Tiếng Việt (Vietnamese)",
|
|
23
|
+
hi: "हिन्दी (Hindi)",
|
|
24
|
+
ru: "Русский (Russian)",
|
|
25
|
+
fr: "Français (French)",
|
|
26
|
+
de: "Deutsch (German)",
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const LANG_CODES = Object.keys(LANGUAGES);
|
|
30
|
+
|
|
31
|
+
function isValidLang(lang) {
|
|
32
|
+
return LANG_CODES.includes(lang);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
module.exports = { LANGUAGES, LANG_CODES, isValidLang };
|