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
|
@@ -1,171 +1,176 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* ClaudeOS-Core — Manifest Generator
|
|
5
|
-
*
|
|
6
|
-
* Role: Generate metadata JSON + initialize stale-report
|
|
7
|
-
* Output (claudeos-core/generated/):
|
|
8
|
-
* - rule-manifest.json : rules/standard/skills/guide file list + frontmatter
|
|
9
|
-
* - sync-map.json : plan/ <file> block → file path mapping
|
|
10
|
-
* - plan-manifest.json : plan/ file list + <file> block count
|
|
11
|
-
* - stale-report.json : initialized (each verification tool appends results)
|
|
12
|
-
*
|
|
13
|
-
* Usage: npx claudeos-core <cmd> or node claudeos-core-tools/manifest-generator/index.js
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
const fs = require("fs");
|
|
17
|
-
const path = require("path");
|
|
18
|
-
const matter = require("gray-matter");
|
|
19
|
-
const { glob } = require("glob");
|
|
20
|
-
const { parseFileBlocks, parseCodeBlocks, CODE_BLOCK_PLANS } = require("../lib/plan-parser");
|
|
21
|
-
const { updateStaleReport } = require("../lib/stale-report");
|
|
22
|
-
|
|
23
|
-
const ROOT = process.env.CLAUDEOS_ROOT || path.resolve(__dirname, "../..");
|
|
24
|
-
const GEN = path.join(ROOT, "claudeos-core/generated");
|
|
25
|
-
|
|
26
|
-
const DIRS = {
|
|
27
|
-
rules: path.join(ROOT, ".claude/rules"),
|
|
28
|
-
standard: path.join(ROOT, "claudeos-core/standard"),
|
|
29
|
-
skills: path.join(ROOT, "claudeos-core/skills"),
|
|
30
|
-
plan: path.join(ROOT, "claudeos-core/plan"),
|
|
31
|
-
guide: path.join(ROOT, "claudeos-core/guide"),
|
|
32
|
-
database: path.join(ROOT, "claudeos-core/database"),
|
|
33
|
-
mcpGuide: path.join(ROOT, "claudeos-core/mcp-guide"),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
console.log("
|
|
79
|
-
console.log("
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
console.log(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ClaudeOS-Core — Manifest Generator
|
|
5
|
+
*
|
|
6
|
+
* Role: Generate metadata JSON + initialize stale-report
|
|
7
|
+
* Output (claudeos-core/generated/):
|
|
8
|
+
* - rule-manifest.json : rules/standard/skills/guide file list + frontmatter
|
|
9
|
+
* - sync-map.json : plan/ <file> block → file path mapping
|
|
10
|
+
* - plan-manifest.json : plan/ file list + <file> block count
|
|
11
|
+
* - stale-report.json : initialized (each verification tool appends results)
|
|
12
|
+
*
|
|
13
|
+
* Usage: npx claudeos-core <cmd> or node claudeos-core-tools/manifest-generator/index.js
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const fs = require("fs");
|
|
17
|
+
const path = require("path");
|
|
18
|
+
const matter = require("gray-matter");
|
|
19
|
+
const { glob } = require("glob");
|
|
20
|
+
const { parseFileBlocks, parseCodeBlocks, CODE_BLOCK_PLANS } = require("../lib/plan-parser");
|
|
21
|
+
const { updateStaleReport } = require("../lib/stale-report");
|
|
22
|
+
|
|
23
|
+
const ROOT = process.env.CLAUDEOS_ROOT || path.resolve(__dirname, "../..");
|
|
24
|
+
const GEN = path.join(ROOT, "claudeos-core/generated");
|
|
25
|
+
|
|
26
|
+
const DIRS = {
|
|
27
|
+
rules: path.join(ROOT, ".claude/rules"),
|
|
28
|
+
standard: path.join(ROOT, "claudeos-core/standard"),
|
|
29
|
+
skills: path.join(ROOT, "claudeos-core/skills"),
|
|
30
|
+
plan: path.join(ROOT, "claudeos-core/plan"),
|
|
31
|
+
guide: path.join(ROOT, "claudeos-core/guide"),
|
|
32
|
+
database: path.join(ROOT, "claudeos-core/database"),
|
|
33
|
+
mcpGuide: path.join(ROOT, "claudeos-core/mcp-guide"),
|
|
34
|
+
memory: path.join(ROOT, "claudeos-core/memory"),
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
function rel(p) {
|
|
38
|
+
return path.relative(ROOT, p).replace(/\\/g, "/");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function stat(f) {
|
|
42
|
+
try {
|
|
43
|
+
const s = fs.statSync(f);
|
|
44
|
+
const c = fs.readFileSync(f, "utf-8");
|
|
45
|
+
return {
|
|
46
|
+
lines: c.endsWith("\n") ? c.split("\n").length - 1 : c.split("\n").length,
|
|
47
|
+
bytes: s.size,
|
|
48
|
+
modified: s.mtime.toISOString().split("T")[0],
|
|
49
|
+
};
|
|
50
|
+
} catch (_e) {
|
|
51
|
+
return { lines: 0, bytes: 0, modified: "unknown" };
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function frontmatter(f) {
|
|
56
|
+
try {
|
|
57
|
+
return matter(fs.readFileSync(f, "utf-8")).data || {};
|
|
58
|
+
} catch (_e) {
|
|
59
|
+
return {};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
// Wrappers: read file → parse → attach planFile metadata
|
|
65
|
+
function extractFileBlocksFromFile(f) {
|
|
66
|
+
if (!fs.existsSync(f)) return [];
|
|
67
|
+
const content = fs.readFileSync(f, "utf-8");
|
|
68
|
+
return parseFileBlocks(content).map(b => ({ sourcePath: b.path, planFile: rel(f) }));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function extractCodeBlockPathsFromFile(f) {
|
|
72
|
+
if (!fs.existsSync(f)) return [];
|
|
73
|
+
const content = fs.readFileSync(f, "utf-8");
|
|
74
|
+
return parseCodeBlocks(content).map(b => ({ sourcePath: b.path, planFile: rel(f) }));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async function main() {
|
|
78
|
+
console.log("\n╔═══════════════════════════════════════╗");
|
|
79
|
+
console.log("║ ClaudeOS-Core — Manifest Generator ║");
|
|
80
|
+
console.log("╚═══════════════════════════════════════╝\n");
|
|
81
|
+
|
|
82
|
+
if (!fs.existsSync(GEN)) fs.mkdirSync(GEN, { recursive: true });
|
|
83
|
+
|
|
84
|
+
// ─── rule-manifest.json ────────────────────────────────
|
|
85
|
+
const mf = {
|
|
86
|
+
generatedAt: new Date().toISOString(),
|
|
87
|
+
rules: [], standards: [], skills: [], guides: [], database: [], mcpGuide: [],
|
|
88
|
+
memory: [],
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const scanTargets = [
|
|
92
|
+
["rules", DIRS.rules],
|
|
93
|
+
["standards", DIRS.standard],
|
|
94
|
+
["skills", DIRS.skills],
|
|
95
|
+
["guides", DIRS.guide],
|
|
96
|
+
["database", DIRS.database],
|
|
97
|
+
["mcpGuide", DIRS.mcpGuide],
|
|
98
|
+
["memory", DIRS.memory],
|
|
99
|
+
];
|
|
100
|
+
|
|
101
|
+
for (const [key, dir] of scanTargets) {
|
|
102
|
+
if (!fs.existsSync(dir)) continue;
|
|
103
|
+
for (const f of await glob("**/*.md", { cwd: dir, absolute: true })) {
|
|
104
|
+
const r = rel(f);
|
|
105
|
+
const s = stat(f);
|
|
106
|
+
const fm = frontmatter(f);
|
|
107
|
+
mf[key].push({
|
|
108
|
+
path: r,
|
|
109
|
+
paths: fm.paths || undefined,
|
|
110
|
+
name: fm.name || undefined,
|
|
111
|
+
...s,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
mf.summary = {
|
|
117
|
+
totalRules: mf.rules.length,
|
|
118
|
+
totalStandards: mf.standards.length,
|
|
119
|
+
totalSkills: mf.skills.length,
|
|
120
|
+
totalGuides: mf.guides.length,
|
|
121
|
+
totalDatabase: mf.database.length,
|
|
122
|
+
totalMcpGuide: mf.mcpGuide.length,
|
|
123
|
+
totalMemory: mf.memory.length,
|
|
124
|
+
total: mf.rules.length + mf.standards.length + mf.skills.length +
|
|
125
|
+
mf.guides.length + mf.database.length + mf.mcpGuide.length +
|
|
126
|
+
mf.memory.length,
|
|
127
|
+
};
|
|
128
|
+
fs.writeFileSync(path.join(GEN, "rule-manifest.json"), JSON.stringify(mf, null, 2));
|
|
129
|
+
console.log(` ✅ rule-manifest.json — ${mf.summary.total} files indexed`);
|
|
130
|
+
|
|
131
|
+
// import-graph.json removed — @import was never a Claude Code feature
|
|
132
|
+
|
|
133
|
+
// ─── sync-map.json ─────────────────────────────────────
|
|
134
|
+
// CODE_BLOCK_PLANS imported from lib/plan-parser.js
|
|
135
|
+
const sm = { generatedAt: new Date().toISOString(), mappings: [] };
|
|
136
|
+
if (fs.existsSync(DIRS.plan)) {
|
|
137
|
+
for (const p of await glob("*.md", { cwd: DIRS.plan, absolute: true })) {
|
|
138
|
+
const bn = path.basename(p);
|
|
139
|
+
if (CODE_BLOCK_PLANS.includes(bn)) {
|
|
140
|
+
sm.mappings.push(...extractCodeBlockPathsFromFile(p));
|
|
141
|
+
} else {
|
|
142
|
+
sm.mappings.push(...extractFileBlocksFromFile(p));
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
sm.summary = { totalMappings: sm.mappings.length };
|
|
147
|
+
fs.writeFileSync(path.join(GEN, "sync-map.json"), JSON.stringify(sm, null, 2));
|
|
148
|
+
console.log(` ✅ sync-map.json — ${sm.summary.totalMappings} mappings`);
|
|
149
|
+
|
|
150
|
+
// ─── plan-manifest.json ────────────────────────────────
|
|
151
|
+
const pm = { generatedAt: new Date().toISOString(), plans: [] };
|
|
152
|
+
if (fs.existsSync(DIRS.plan)) {
|
|
153
|
+
for (const p of await glob("*.md", { cwd: DIRS.plan, absolute: true })) {
|
|
154
|
+
const r = rel(p);
|
|
155
|
+
const s = stat(p);
|
|
156
|
+
const bn = path.basename(p);
|
|
157
|
+
const blocks = CODE_BLOCK_PLANS.includes(bn)
|
|
158
|
+
? extractCodeBlockPathsFromFile(p)
|
|
159
|
+
: extractFileBlocksFromFile(p);
|
|
160
|
+
pm.plans.push({ path: r, ...s, fileBlocks: blocks.length, status: "ok" });
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
fs.writeFileSync(path.join(GEN, "plan-manifest.json"), JSON.stringify(pm, null, 2));
|
|
164
|
+
console.log(` ✅ plan-manifest.json — ${pm.plans.length} plans`);
|
|
165
|
+
|
|
166
|
+
// ─── Initialize stale-report.json (preserve existing sub-tool results) ──
|
|
167
|
+
updateStaleReport(GEN, "generatedAt", new Date().toISOString(), { totalIssues: 0, status: "initial" });
|
|
168
|
+
console.log(" ✅ stale-report.json — initialized");
|
|
169
|
+
console.log("\n 📁 Output: claudeos-core/generated/ (4 files)\n");
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (require.main === module) {
|
|
173
|
+
main().catch(e => { console.error(`\n ❌ Manifest Generator failed: ${e.message || e}`); process.exit(1); });
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
module.exports = { main };
|
package/package.json
CHANGED