claudeos-core 1.6.2 → 1.7.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 +26 -0
- package/README.de.md +655 -653
- package/README.es.md +657 -655
- package/README.fr.md +657 -655
- package/README.hi.md +656 -654
- package/README.ja.md +675 -673
- package/README.ko.md +692 -690
- package/README.md +712 -710
- package/README.ru.md +656 -654
- package/README.vi.md +656 -654
- package/README.zh-CN.md +656 -654
- package/bin/commands/init.js +386 -357
- package/package.json +1 -1
- package/pass-prompts/templates/common/pass3-footer.md +23 -3
- package/pass-prompts/templates/node-vite/pass1.md +117 -0
- package/pass-prompts/templates/node-vite/pass2.md +78 -0
- package/pass-prompts/templates/node-vite/pass3.md +103 -0
- package/plan-installer/domain-grouper.js +75 -73
- package/plan-installer/index.js +129 -126
- package/plan-installer/scanners/scan-frontend.js +264 -254
- package/plan-installer/scanners/scan-node.js +57 -46
- package/plan-installer/scanners/scan-python.js +64 -55
- package/plan-installer/stack-detector.js +466 -454
- package/plan-installer/structure-scanner.js +65 -65
|
@@ -1,46 +1,57 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ClaudeOS-Core — Node.js Structure Scanner
|
|
3
|
-
*
|
|
4
|
-
* Scans Node.js backend (Express/NestJS/Fastify) project structure to discover domains.
|
|
5
|
-
* Supports monorepo layouts (apps/*, packages/*) in addition to single-project src/.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const path = require("path");
|
|
9
|
-
const { glob } = require("glob");
|
|
10
|
-
|
|
11
|
-
async function scanNodeDomains(stack, ROOT) {
|
|
12
|
-
const backendDomains = [];
|
|
13
|
-
const skipDirs = ["common", "shared", "config", "utils", "lib", "core", "main", "interfaces", "types", "constants", "guards", "decorators", "pipes", "filters", "interceptors"];
|
|
14
|
-
|
|
15
|
-
// Collect candidate directories: standard src/ + monorepo apps/*/src/
|
|
16
|
-
const nestModules = await glob("src/modules/*/", { cwd: ROOT });
|
|
17
|
-
let srcDirs = nestModules.length > 0 ? nestModules : await glob("src/*/", { cwd: ROOT });
|
|
18
|
-
|
|
19
|
-
// Monorepo: scan apps/*/src/ and packages/*/src/ when standard src/ yields nothing backend-relevant
|
|
20
|
-
if (stack.monorepo || srcDirs.length === 0) {
|
|
21
|
-
const monoModules = await glob("{apps,packages}/*/src/modules/*/", { cwd: ROOT, ignore: ["**/node_modules/**"] });
|
|
22
|
-
if (monoModules.length > 0) {
|
|
23
|
-
srcDirs = [...srcDirs, ...monoModules];
|
|
24
|
-
} else {
|
|
25
|
-
const monoDirs = await glob("{apps,packages}/*/src/*/", { cwd: ROOT, ignore: ["**/node_modules/**"] });
|
|
26
|
-
srcDirs = [...srcDirs, ...monoDirs];
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
for (let dir of srcDirs) {
|
|
31
|
-
if (!dir.endsWith("/")) dir += "/";
|
|
32
|
-
const name = path.basename(dir.replace(/\/$/, ""));
|
|
33
|
-
if (skipDirs.includes(name)) continue;
|
|
34
|
-
const files = await glob(`${dir.replace(/\\/g, "/")}**/*.{ts,js}`, { cwd: ROOT, ignore: ["**/*.spec.*", "**/*.test.*"] });
|
|
35
|
-
if (files.length > 0) {
|
|
36
|
-
const controllers = files.filter(f => /controller|router|route/.test(f)).length;
|
|
37
|
-
const services = files.filter(f => /service/.test(f)).length;
|
|
38
|
-
const dtos = files.filter(f => /dto|schema|type/.test(f)).length;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
1
|
+
/**
|
|
2
|
+
* ClaudeOS-Core — Node.js Structure Scanner
|
|
3
|
+
*
|
|
4
|
+
* Scans Node.js backend (Express/NestJS/Fastify) project structure to discover domains.
|
|
5
|
+
* Supports monorepo layouts (apps/*, packages/*) in addition to single-project src/.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const path = require("path");
|
|
9
|
+
const { glob } = require("glob");
|
|
10
|
+
|
|
11
|
+
async function scanNodeDomains(stack, ROOT) {
|
|
12
|
+
const backendDomains = [];
|
|
13
|
+
const skipDirs = ["common", "shared", "config", "utils", "lib", "core", "main", "interfaces", "types", "constants", "guards", "decorators", "pipes", "filters", "interceptors"];
|
|
14
|
+
|
|
15
|
+
// Collect candidate directories: standard src/ + monorepo apps/*/src/
|
|
16
|
+
const nestModules = await glob("src/modules/*/", { cwd: ROOT });
|
|
17
|
+
let srcDirs = nestModules.length > 0 ? nestModules : await glob("src/*/", { cwd: ROOT });
|
|
18
|
+
|
|
19
|
+
// Monorepo: scan apps/*/src/ and packages/*/src/ when standard src/ yields nothing backend-relevant
|
|
20
|
+
if (stack.monorepo || srcDirs.length === 0) {
|
|
21
|
+
const monoModules = await glob("{apps,packages}/*/src/modules/*/", { cwd: ROOT, ignore: ["**/node_modules/**"] });
|
|
22
|
+
if (monoModules.length > 0) {
|
|
23
|
+
srcDirs = [...srcDirs, ...monoModules];
|
|
24
|
+
} else {
|
|
25
|
+
const monoDirs = await glob("{apps,packages}/*/src/*/", { cwd: ROOT, ignore: ["**/node_modules/**"] });
|
|
26
|
+
srcDirs = [...srcDirs, ...monoDirs];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
for (let dir of srcDirs) {
|
|
31
|
+
if (!dir.endsWith("/")) dir += "/";
|
|
32
|
+
const name = path.basename(dir.replace(/\/$/, ""));
|
|
33
|
+
if (skipDirs.includes(name)) continue;
|
|
34
|
+
const files = await glob(`${dir.replace(/\\/g, "/")}**/*.{ts,js}`, { cwd: ROOT, ignore: ["**/*.spec.*", "**/*.test.*"] });
|
|
35
|
+
if (files.length > 0) {
|
|
36
|
+
const controllers = files.filter(f => /controller|router|route|handler/.test(f)).length;
|
|
37
|
+
const services = files.filter(f => /service/.test(f)).length;
|
|
38
|
+
const dtos = files.filter(f => /dto|schema|type/.test(f)).length;
|
|
39
|
+
const entities = files.filter(f => /entity|model/.test(f) && !/controller|service|dto/.test(f)).length;
|
|
40
|
+
const modules = files.filter(f => /\.module\./.test(f)).length;
|
|
41
|
+
const guards = files.filter(f => /guard/.test(f)).length;
|
|
42
|
+
const pipes = files.filter(f => /pipe/.test(f)).length;
|
|
43
|
+
const interceptors = files.filter(f => /interceptor/.test(f)).length;
|
|
44
|
+
const domain = { name, type: "backend", controllers, services, dtos, totalFiles: files.length };
|
|
45
|
+
if (entities > 0) domain.entities = entities;
|
|
46
|
+
if (modules > 0) domain.modules = modules;
|
|
47
|
+
if (guards > 0) domain.guards = guards;
|
|
48
|
+
if (pipes > 0) domain.pipes = pipes;
|
|
49
|
+
if (interceptors > 0) domain.interceptors = interceptors;
|
|
50
|
+
backendDomains.push(domain);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return { backendDomains };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
module.exports = { scanNodeDomains };
|
|
@@ -1,55 +1,64 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ClaudeOS-Core — Python Structure Scanner
|
|
3
|
-
*
|
|
4
|
-
* Scans Python (Django/FastAPI/Flask) project structure to discover domains.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const path = require("path");
|
|
8
|
-
const { glob } = require("glob");
|
|
9
|
-
|
|
10
|
-
async function scanPythonDomains(stack, ROOT) {
|
|
11
|
-
const backendDomains = [];
|
|
12
|
-
|
|
13
|
-
// ── Django ──
|
|
14
|
-
if (stack.framework === "django") {
|
|
15
|
-
const candidates = await glob("**/models.py", { cwd: ROOT, ignore: ["**/node_modules/**", "**/venv/**", "**/.venv/**", "**/env/**", "**/migrations/**"] });
|
|
16
|
-
for (const f of candidates) {
|
|
17
|
-
const dir = path.dirname(f);
|
|
18
|
-
if (dir === "." || dir.includes("venv")) continue;
|
|
19
|
-
const name = path.basename(dir);
|
|
20
|
-
const appFiles = await glob(`${dir.replace(/\\/g, "/")}/*.py`, { cwd: ROOT });
|
|
21
|
-
const views = appFiles.filter(x => x.includes("views")).length;
|
|
22
|
-
const models = appFiles.filter(x => x.includes("models")).length;
|
|
23
|
-
const serializers = appFiles.filter(x => x.includes("serializers")).length;
|
|
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
|
-
|
|
1
|
+
/**
|
|
2
|
+
* ClaudeOS-Core — Python Structure Scanner
|
|
3
|
+
*
|
|
4
|
+
* Scans Python (Django/FastAPI/Flask) project structure to discover domains.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const path = require("path");
|
|
8
|
+
const { glob } = require("glob");
|
|
9
|
+
|
|
10
|
+
async function scanPythonDomains(stack, ROOT) {
|
|
11
|
+
const backendDomains = [];
|
|
12
|
+
|
|
13
|
+
// ── Django ──
|
|
14
|
+
if (stack.framework === "django") {
|
|
15
|
+
const candidates = await glob("**/models.py", { cwd: ROOT, ignore: ["**/node_modules/**", "**/venv/**", "**/.venv/**", "**/env/**", "**/migrations/**"] });
|
|
16
|
+
for (const f of candidates) {
|
|
17
|
+
const dir = path.dirname(f);
|
|
18
|
+
if (dir === "." || dir.includes("venv")) continue;
|
|
19
|
+
const name = path.basename(dir);
|
|
20
|
+
const appFiles = await glob(`${dir.replace(/\\/g, "/")}/*.py`, { cwd: ROOT });
|
|
21
|
+
const views = appFiles.filter(x => x.includes("views")).length;
|
|
22
|
+
const models = appFiles.filter(x => x.includes("models")).length;
|
|
23
|
+
const serializers = appFiles.filter(x => x.includes("serializers")).length;
|
|
24
|
+
const admin = appFiles.filter(x => x.includes("admin")).length;
|
|
25
|
+
const forms = appFiles.filter(x => x.includes("forms")).length;
|
|
26
|
+
const urls = appFiles.filter(x => x.includes("urls")).length;
|
|
27
|
+
const tasks = appFiles.filter(x => x.includes("tasks")).length;
|
|
28
|
+
const domain = { name, type: "backend", views, models, serializers, totalFiles: appFiles.length };
|
|
29
|
+
if (admin > 0) domain.admin = admin;
|
|
30
|
+
if (forms > 0) domain.forms = forms;
|
|
31
|
+
if (urls > 0) domain.urls = urls;
|
|
32
|
+
if (tasks > 0) domain.tasks = tasks;
|
|
33
|
+
backendDomains.push(domain);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// ── FastAPI / Flask / generic Python ──
|
|
38
|
+
if (stack.framework === "fastapi" || stack.framework === "flask" || (stack.language === "python" && stack.framework !== "django")) {
|
|
39
|
+
const routerFiles = await glob("**/{router,routes,endpoints}*.py", { cwd: ROOT, ignore: ["**/venv/**", "**/.venv/**"] });
|
|
40
|
+
const seen = new Set();
|
|
41
|
+
for (const f of routerFiles) {
|
|
42
|
+
const dir = path.dirname(f);
|
|
43
|
+
const name = path.basename(dir);
|
|
44
|
+
if (name === "." || seen.has(name) || ["venv", ".venv", "__pycache__"].includes(name)) continue;
|
|
45
|
+
seen.add(name);
|
|
46
|
+
const appFiles = await glob(`${dir.replace(/\\/g, "/")}/*.py`, { cwd: ROOT });
|
|
47
|
+
backendDomains.push({ name, type: "backend", totalFiles: appFiles.length });
|
|
48
|
+
}
|
|
49
|
+
if (backendDomains.filter(d => d.type === "backend").length === 0) {
|
|
50
|
+
const appDirs = await glob("{app,src/app}/*/", { cwd: ROOT });
|
|
51
|
+
for (let dir of appDirs) {
|
|
52
|
+
if (!dir.endsWith("/")) dir += "/";
|
|
53
|
+
const name = path.basename(dir.replace(/\/$/, ""));
|
|
54
|
+
if (["core", "common", "utils", "__pycache__"].includes(name)) continue;
|
|
55
|
+
const files = await glob(`${dir.replace(/\\/g, "/")}*.py`, { cwd: ROOT });
|
|
56
|
+
if (files.length > 0) backendDomains.push({ name, type: "backend", totalFiles: files.length });
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return { backendDomains };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
module.exports = { scanPythonDomains };
|