claudeos-core 2.4.4 → 2.5.1

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 (49) hide show
  1. package/CHANGELOG.md +125 -0
  2. package/README.de.md +12 -10
  3. package/README.es.md +12 -10
  4. package/README.fr.md +12 -10
  5. package/README.hi.md +12 -10
  6. package/README.ja.md +12 -10
  7. package/README.ko.md +12 -10
  8. package/README.md +12 -10
  9. package/README.ru.md +12 -10
  10. package/README.vi.md +12 -10
  11. package/README.zh-CN.md +12 -10
  12. package/bin/commands/init.js +121 -24
  13. package/bin/commands/lint.js +2 -0
  14. package/bin/commands/memory.js +10 -3
  15. package/content-validator/index.js +82 -13
  16. package/lib/env-parser.js +98 -12
  17. package/lib/memory-scaffold.js +35 -16
  18. package/manifest-generator/index.js +15 -4
  19. package/package.json +92 -92
  20. package/pass-json-validator/index.js +1 -1
  21. package/pass-prompts/templates/angular/pass3.md +2 -1
  22. package/pass-prompts/templates/common/claude-md-scaffold.md +1 -1
  23. package/pass-prompts/templates/common/pass3a-facts.md +11 -9
  24. package/pass-prompts/templates/common/pass4.md +3 -3
  25. package/pass-prompts/templates/java-spring/pass1.md +10 -2
  26. package/pass-prompts/templates/java-spring/pass3.md +5 -4
  27. package/pass-prompts/templates/kotlin-spring/pass3.md +2 -2
  28. package/pass-prompts/templates/node-express/pass3.md +1 -1
  29. package/pass-prompts/templates/node-fastify/pass3.md +1 -0
  30. package/pass-prompts/templates/node-nestjs/pass3.md +1 -0
  31. package/pass-prompts/templates/node-nextjs/pass3.md +1 -1
  32. package/pass-prompts/templates/node-vite/pass3.md +1 -0
  33. package/pass-prompts/templates/python-django/pass3.md +1 -1
  34. package/pass-prompts/templates/python-fastapi/pass3.md +1 -1
  35. package/pass-prompts/templates/python-flask/pass3.md +1 -0
  36. package/pass-prompts/templates/vue-nuxt/pass3.md +1 -0
  37. package/plan-installer/domain-grouper.js +4 -1
  38. package/plan-installer/index.js +26 -7
  39. package/plan-installer/jvm-detect.js +562 -0
  40. package/plan-installer/pass3-context-builder.js +10 -0
  41. package/plan-installer/prompt-generator.js +18 -2
  42. package/plan-installer/scanners/scan-frontend.js +67 -6
  43. package/plan-installer/scanners/scan-java.js +214 -15
  44. package/plan-installer/scanners/scan-kotlin.js +68 -3
  45. package/plan-installer/scanners/scan-node.js +115 -0
  46. package/plan-installer/scanners/scan-python.js +56 -0
  47. package/plan-installer/source-paths.js +61 -0
  48. package/plan-installer/stack-detector.js +726 -51
  49. package/plan-installer/structure-scanner.js +15 -4
@@ -68,7 +68,8 @@ Generation targets:
68
68
  Content within each section adapts to this project based on pass2-merged.json.
69
69
  The scaffold's validation checklist MUST pass.
70
70
 
71
- Stack-specific hints for this project (Java Spring Boot):
71
+ Stack-specific hints for this project (Java Spring Boot, or Spring Framework
72
+ without Boot when `project-analysis.json` says `framework: "spring-framework"`):
72
73
  - Project type for Section 1 PROJECT_CONTEXT: "Backend Application" or "REST API Server"
73
74
  - Architecture diagram (Section 4): layered architecture (Controller → Service → Mapper/Repository)
74
75
  - Section 2 should include: JDK version, Gradle/Maven, DB, session/cache, server port
@@ -89,7 +90,7 @@ Generation targets:
89
90
  - 30.security-db/01.security-auth.md — Authentication, authorization, CORS
90
91
  - 30.security-db/02.database-schema.md — DDL, migrations, audit columns
91
92
  - 30.security-db/03.common-utilities.md — Common utilities, constants, Base classes
92
- - 40.infra/01.environment-config.md — Profiles, environment variables, configuration management
93
+ - 40.infra/01.environment-config.md — Profiles, environment variables, configuration management, build scripts (`build.gradle` / `build.gradle.kts` / `pom.xml`) and the Gradle version catalog
93
94
  - 40.infra/02.logging-monitoring.md — Logging standards, monitoring, alerts
94
95
  - 40.infra/03.cicd-deployment.md — CI/CD pipeline, deployment strategy
95
96
  - 80.verification/01.development-verification.md — Build, startup, API testing
@@ -113,7 +114,7 @@ Generation targets:
113
114
  - `00.core/*` rules: `paths: ["**/*"]` — always loaded (architecture, naming are universally needed)
114
115
  - `10.backend/*` rules: `paths: ["**/*"]` — always loaded (backend rules needed for any source editing)
115
116
  - `30.security-db/*` rules: `paths: ["**/*"]` — always loaded (cross-cutting concerns)
116
- - `40.infra/01.environment-config-rules.md` paths: `["**/*.properties", "**/*.yml", "**/*.yaml", "**/.env*", "**/config/**", "**/application*.properties"]` — Spring config files
117
+ - `40.infra/01.environment-config-rules.md` paths: `["**/*.properties", "**/*.yml", "**/*.yaml", "**/.env*", "**/config/**", "**/application*.properties", "**/*.gradle", "**/*.gradle.kts", "**/gradle/libs.versions.toml", "**/pom.xml"]` — Spring config files + build scripts (Groovy and Kotlin DSL) + version catalog
117
118
  - `40.infra/02.logging-monitoring-rules.md` paths: `["**/*.java", "**/logback*.xml", "**/logback*.groovy", "**/log4j*.xml", "**/log4j*.properties", "**/log4jdbc*.properties"]` — source code where logs live + log config (covers Logback XML/Groovy DSL, Log4j/Log4j2 XML/properties, and log4jdbc JDBC-logging adapter properties)
118
119
  - `40.infra/03.cicd-deployment-rules.md` paths: `["**/*.yml", "**/*.yaml", "**/Dockerfile*", "**/*.gradle*", "**/pom.xml", "**/*.java"]` — CI / build config + source
119
120
  - `50.sync/*` rules: `paths: ["**/claudeos-core/**", "**/.claude/**"]` — loaded only when editing claudeos-core files
@@ -155,7 +156,7 @@ Generation targets:
155
156
  List only the standard files that were actually generated above. Include frontend standards only if frontend was detected. NOTE: `00.core/04.doc-writing-guide.md` is a FORWARD REFERENCE — Pass 4 will generate it; include it anyway. Do NOT add a "DO NOT Read" section here — that information lives in CLAUDE.md Section 7 (the single source of truth).
156
157
 
157
158
  4. .claude/rules/50.sync/ (2 sync rules — AI fallback reminders)
158
- - NOTE: These rules remind AI to run `npx claudeos-core refresh` after modifying standard/rules/skills files.
159
+ - NOTE: These rules remind AI to keep standard ↔ rules ↔ MANIFEST in sync when it edits any of them (`npx claudeos-core health` reports drift). Do NOT reference `npx claudeos-core refresh` it is a no-op since v2.1.0.
159
160
  - 01.doc-sync.md — Bidirectional standard ↔ rules sync reminder (both directions in ONE rule).
160
161
  Do NOT generate a separate 02.rules-sync.md mirror file — redundant.
161
162
  Express the mapping as a naming convention (standard/<N>.<dir>/<M>.<n>.md ↔
@@ -118,7 +118,7 @@ Generation targets:
118
118
  - `00.core/*` rules: `paths: ["**/*"]` — always loaded (architecture, naming are universally needed)
119
119
  - `10.backend/*` rules: `paths: ["**/*"]` — always loaded (backend rules needed for any source editing)
120
120
  - `30.security-db/*` rules: `paths: ["**/*"]` — always loaded (cross-cutting concerns)
121
- - `40.infra/01.environment-config-rules.md` paths: `["**/*.properties", "**/*.yml", "**/*.yaml", "**/.env*", "**/config/**", "**/application*.properties"]` — Spring config files
121
+ - `40.infra/01.environment-config-rules.md` paths: `["**/*.properties", "**/*.yml", "**/*.yaml", "**/.env*", "**/config/**", "**/application*.properties", "**/*.gradle", "**/*.gradle.kts", "**/gradle/libs.versions.toml", "**/pom.xml"]` — Spring config files + build scripts (Groovy and Kotlin DSL) + version catalog
122
122
  - `40.infra/02.logging-monitoring-rules.md` paths: `["**/*.kt", "**/*.kts", "**/logback*.xml", "**/logback*.groovy", "**/log4j*.xml", "**/log4j*.properties", "**/log4jdbc*.properties"]` — source code where logs live + log config (covers Logback XML/Groovy DSL, Log4j/Log4j2 XML/properties, and log4jdbc JDBC-logging adapter properties)
123
123
  - `40.infra/03.cicd-deployment-rules.md` paths: `["**/*.yml", "**/*.yaml", "**/Dockerfile*", "**/*.gradle*", "**/*.kt", "**/*.kts"]` — CI / build config + source
124
124
  - `50.sync/*` rules: `paths: ["**/claudeos-core/**", "**/.claude/**"]` — loaded only when editing claudeos-core files
@@ -162,7 +162,7 @@ Generation targets:
162
162
  List only the standard files that were actually generated above. Include frontend standards only if frontend was detected. NOTE: `00.core/04.doc-writing-guide.md` is a FORWARD REFERENCE — Pass 4 will generate it; include it anyway. Do NOT add a "DO NOT Read" section here — that information lives in CLAUDE.md Section 7 (the single source of truth).
163
163
 
164
164
  4. .claude/rules/50.sync/ (2 sync rules — AI fallback reminders)
165
- - NOTE: These rules remind AI to run `npx claudeos-core refresh` after modifying standard/rules/skills files.
165
+ - NOTE: These rules remind AI to keep standard ↔ rules ↔ MANIFEST in sync when it edits any of them (`npx claudeos-core health` reports drift). Do NOT reference `npx claudeos-core refresh` it is a no-op since v2.1.0.
166
166
  - 01.doc-sync.md — Bidirectional standard ↔ rules sync reminder (both directions in ONE rule).
167
167
  Do NOT generate a separate 02.rules-sync.md mirror file — redundant.
168
168
  Express the mapping as a naming convention (standard/<N>.<dir>/<M>.<n>.md ↔
@@ -130,7 +130,7 @@ Generation targets:
130
130
  List only the standard files that were actually generated above. NOTE: `00.core/04.doc-writing-guide.md` is a FORWARD REFERENCE — Pass 4 will generate it; include it anyway. Do NOT add a "DO NOT Read" section here — that information lives in CLAUDE.md Section 7 (the single source of truth).
131
131
 
132
132
  4. .claude/rules/50.sync/ (2 sync rules — AI fallback reminders)
133
- - NOTE: These rules remind AI to run `npx claudeos-core refresh` after modifying standard/rules/skills files.
133
+ - NOTE: These rules remind AI to keep standard ↔ rules ↔ MANIFEST in sync when it edits any of them (`npx claudeos-core health` reports drift). Do NOT reference `npx claudeos-core refresh` it is a no-op since v2.1.0.
134
134
  - 01.doc-sync.md — Bidirectional standard ↔ rules sync reminder (both directions in ONE rule).
135
135
  Do NOT generate a separate 02.rules-sync.md mirror file — redundant.
136
136
  Express the mapping as a naming convention (standard/<N>.<dir>/<M>.<n>.md ↔
@@ -89,6 +89,7 @@ Generation targets:
89
89
  - `60.memory/*` rules: forward reference — Pass 4 will generate 4 files (01.decision-log, 02.failure-patterns, 03.compaction, 04.auto-rule-update), each with file-specific `paths`. Pass 3 must STILL list ```.claude/rules/60.memory/*``` as a row in CLAUDE.md Section 6 Rules table so developers/Claude see the category exists.
90
90
  - `70.domains/*` rules (multi-domain projects only): per-domain rules at `.claude/rules/70.domains/{type}/{domain}-rules.md` (where `{type}` is `backend` or `frontend`, ALWAYS present even in single-stack projects for uniform layout + zero-migration future-proofing), each with a `paths:` glob scoped to that domain's source directories so the rule auto-loads only when editing files within the relevant domain. Folder name is PLURAL (`domains/`) — collection of N per-domain files — and each file inside uses the SINGULAR domain name (`{domain}-rules.md`). DO NOT use `60.domains/` (collides with `60.memory/`) and DO NOT skip the `{type}/` sub-folder. See pass3-footer.md "Per-domain folder convention" for the full rationale.
91
91
  - MUST generate `.claude/rules/00.core/00.standard-reference.md` as a directory of all standard files
92
+ (paths only, grouped by category). Include the FORWARD REFERENCE `claudeos-core/standard/00.core/04.doc-writing-guide.md` under `## Core` — Pass 4 generates it; omitting it leaves an index gap the moment Pass 4 runs. Do NOT add a "DO NOT Read" section here — CLAUDE.md Section 7 is the single source of truth.
92
93
 
93
94
  4. .claude/rules/50.sync/ (2 sync rules)
94
95
  - 01.doc-sync.md — Bidirectional standard ↔ rules sync reminder (both directions in ONE rule).
@@ -97,6 +97,7 @@ Generation targets:
97
97
  - `60.memory/*` rules: forward reference — Pass 4 will generate 4 files (01.decision-log, 02.failure-patterns, 03.compaction, 04.auto-rule-update), each with file-specific `paths`. Pass 3 must STILL list ```.claude/rules/60.memory/*``` as a row in CLAUDE.md Section 6 Rules table so developers/Claude see the category exists.
98
98
  - `70.domains/*` rules (multi-domain projects only): per-domain rules at `.claude/rules/70.domains/{type}/{domain}-rules.md` (where `{type}` is `backend` or `frontend`, ALWAYS present even in single-stack projects for uniform layout + zero-migration future-proofing), each with a `paths:` glob scoped to that domain's source directories so the rule auto-loads only when editing files within the relevant domain. Folder name is PLURAL (`domains/`) — collection of N per-domain files — and each file inside uses the SINGULAR domain name (`{domain}-rules.md`). DO NOT use `60.domains/` (collides with `60.memory/`) and DO NOT skip the `{type}/` sub-folder. See pass3-footer.md "Per-domain folder convention" for the full rationale.
99
99
  - MUST generate `.claude/rules/00.core/00.standard-reference.md` — directory of all standard files.
100
+ (paths only, grouped by category). Include the FORWARD REFERENCE `claudeos-core/standard/00.core/04.doc-writing-guide.md` under `## Core` — Pass 4 generates it; omitting it leaves an index gap the moment Pass 4 runs. Do NOT add a "DO NOT Read" section here — CLAUDE.md Section 7 is the single source of truth.
100
101
  List only the standard files that were actually generated above.
101
102
 
102
103
  4. .claude/rules/50.sync/ (2 sync rules)
@@ -132,7 +132,7 @@ Generation targets:
132
132
  List only the standard files that were actually generated above. NOTE: `00.core/04.doc-writing-guide.md` is a FORWARD REFERENCE — Pass 4 will generate it; include it anyway. Do NOT add a "DO NOT Read" section here — that information lives in CLAUDE.md Section 7 (the single source of truth).
133
133
 
134
134
  4. .claude/rules/50.sync/ (2 sync rules — AI fallback reminders)
135
- - NOTE: These rules remind AI to run `npx claudeos-core refresh` after modifying standard/rules/skills files.
135
+ - NOTE: These rules remind AI to keep standard ↔ rules ↔ MANIFEST in sync when it edits any of them (`npx claudeos-core health` reports drift). Do NOT reference `npx claudeos-core refresh` it is a no-op since v2.1.0.
136
136
  - 01.doc-sync.md — Bidirectional standard ↔ rules sync reminder (both directions in ONE rule).
137
137
  Do NOT generate a separate 02.rules-sync.md mirror file — redundant.
138
138
  Express the mapping as a naming convention (standard/<N>.<dir>/<M>.<n>.md ↔
@@ -83,6 +83,7 @@ Generation targets:
83
83
  - `60.memory/*` rules: forward reference — Pass 4 will generate 4 files (01.decision-log, 02.failure-patterns, 03.compaction, 04.auto-rule-update), each with file-specific `paths`. Pass 3 must STILL list ```.claude/rules/60.memory/*``` as a row in CLAUDE.md Section 6 Rules table so developers/Claude see the category exists.
84
84
  - `70.domains/*` rules (multi-domain projects only): per-domain rules at `.claude/rules/70.domains/{type}/{domain}-rules.md` (where `{type}` is `backend` or `frontend`, ALWAYS present even in single-stack projects for uniform layout + zero-migration future-proofing), each with a `paths:` glob scoped to that domain's source directories so the rule auto-loads only when editing files within the relevant domain. Folder name is PLURAL (`domains/`) — collection of N per-domain files — and each file inside uses the SINGULAR domain name (`{domain}-rules.md`). DO NOT use `60.domains/` (collides with `60.memory/`) and DO NOT skip the `{type}/` sub-folder. See pass3-footer.md "Per-domain folder convention" for the full rationale.
85
85
  - MUST generate `.claude/rules/00.core/00.standard-reference.md` — directory of all standard files.
86
+ (paths only, grouped by category). Include the FORWARD REFERENCE `claudeos-core/standard/00.core/04.doc-writing-guide.md` under `## Core` — Pass 4 generates it; omitting it leaves an index gap the moment Pass 4 runs. Do NOT add a "DO NOT Read" section here — CLAUDE.md Section 7 is the single source of truth.
86
87
 
87
88
  4. .claude/rules/50.sync/ (2 sync rules)
88
89
  - 01.doc-sync.md — Bidirectional standard ↔ rules sync reminder (both directions in ONE rule).
@@ -131,7 +131,7 @@ Generation targets:
131
131
  List only the standard files that were actually generated above. NOTE: `00.core/04.doc-writing-guide.md` is a FORWARD REFERENCE — Pass 4 will generate it; include it anyway. Do NOT add a "DO NOT Read" section here — that information lives in CLAUDE.md Section 7 (the single source of truth).
132
132
 
133
133
  4. .claude/rules/50.sync/ (2 sync rules — AI fallback reminders)
134
- - NOTE: These rules remind AI to run `npx claudeos-core refresh` after modifying standard/rules/skills files.
134
+ - NOTE: These rules remind AI to keep standard ↔ rules ↔ MANIFEST in sync when it edits any of them (`npx claudeos-core health` reports drift). Do NOT reference `npx claudeos-core refresh` it is a no-op since v2.1.0.
135
135
  - 01.doc-sync.md — Bidirectional standard ↔ rules sync reminder (both directions in ONE rule).
136
136
  Do NOT generate a separate 02.rules-sync.md mirror file — redundant.
137
137
  Express the mapping as a naming convention (standard/<N>.<dir>/<M>.<n>.md ↔
@@ -132,7 +132,7 @@ Generation targets:
132
132
  List only the standard files that were actually generated above. NOTE: `00.core/04.doc-writing-guide.md` is a FORWARD REFERENCE — Pass 4 will generate it; include it anyway. Do NOT add a "DO NOT Read" section here — that information lives in CLAUDE.md Section 7 (the single source of truth).
133
133
 
134
134
  4. .claude/rules/50.sync/ (2 sync rules — AI fallback reminders)
135
- - NOTE: These rules remind AI to run `npx claudeos-core refresh` after modifying standard/rules/skills files.
135
+ - NOTE: These rules remind AI to keep standard ↔ rules ↔ MANIFEST in sync when it edits any of them (`npx claudeos-core health` reports drift). Do NOT reference `npx claudeos-core refresh` it is a no-op since v2.1.0.
136
136
  - 01.doc-sync.md — Bidirectional standard ↔ rules sync reminder (both directions in ONE rule).
137
137
  Do NOT generate a separate 02.rules-sync.md mirror file — redundant.
138
138
  Express the mapping as a naming convention (standard/<N>.<dir>/<M>.<n>.md ↔
@@ -84,6 +84,7 @@ Generation targets:
84
84
  - `60.memory/*` rules: forward reference — Pass 4 will generate 4 files (01.decision-log, 02.failure-patterns, 03.compaction, 04.auto-rule-update), each with file-specific `paths`. Pass 3 must STILL list ```.claude/rules/60.memory/*``` as a row in CLAUDE.md Section 6 Rules table so developers/Claude see the category exists.
85
85
  - `70.domains/*` rules (multi-domain projects only): per-domain rules at `.claude/rules/70.domains/{type}/{domain}-rules.md` (where `{type}` is `backend` or `frontend`, ALWAYS present even in single-stack projects for uniform layout + zero-migration future-proofing), each with a `paths:` glob scoped to that domain's source directories so the rule auto-loads only when editing files within the relevant domain. Folder name is PLURAL (`domains/`) — collection of N per-domain files — and each file inside uses the SINGULAR domain name (`{domain}-rules.md`). DO NOT use `60.domains/` (collides with `60.memory/`) and DO NOT skip the `{type}/` sub-folder. See pass3-footer.md "Per-domain folder convention" for the full rationale.
86
86
  - MUST generate `.claude/rules/00.core/00.standard-reference.md` — directory of all standard files
87
+ (paths only, grouped by category). Include the FORWARD REFERENCE `claudeos-core/standard/00.core/04.doc-writing-guide.md` under `## Core` — Pass 4 generates it; omitting it leaves an index gap the moment Pass 4 runs. Do NOT add a "DO NOT Read" section here — CLAUDE.md Section 7 is the single source of truth.
87
88
 
88
89
  4. .claude/rules/50.sync/ (2 sync rules)
89
90
  - 01.doc-sync.md — Bidirectional standard ↔ rules sync reminder (both directions in ONE rule).
@@ -82,6 +82,7 @@ Generation targets:
82
82
  - `60.memory/*` rules: forward reference — Pass 4 will generate 4 files (01.decision-log, 02.failure-patterns, 03.compaction, 04.auto-rule-update), each with file-specific `paths`. Pass 3 must STILL list ```.claude/rules/60.memory/*``` as a row in CLAUDE.md Section 6 Rules table so developers/Claude see the category exists.
83
83
  - `70.domains/*` rules (multi-domain projects only): per-domain rules at `.claude/rules/70.domains/{type}/{domain}-rules.md` (where `{type}` is `backend` or `frontend`, ALWAYS present even in single-stack projects for uniform layout + zero-migration future-proofing), each with a `paths:` glob scoped to that domain's source directories so the rule auto-loads only when editing files within the relevant domain. Folder name is PLURAL (`domains/`) — collection of N per-domain files — and each file inside uses the SINGULAR domain name (`{domain}-rules.md`). DO NOT use `60.domains/` (collides with `60.memory/`) and DO NOT skip the `{type}/` sub-folder. See pass3-footer.md "Per-domain folder convention" for the full rationale.
84
84
  - MUST generate `.claude/rules/00.core/00.standard-reference.md` — directory of all standard files
85
+ (paths only, grouped by category). Include the FORWARD REFERENCE `claudeos-core/standard/00.core/04.doc-writing-guide.md` under `## Core` — Pass 4 generates it; omitting it leaves an index gap the moment Pass 4 runs. Do NOT add a "DO NOT Read" section here — CLAUDE.md Section 7 is the single source of truth.
85
86
 
86
87
  4. .claude/rules/50.sync/ (2 sync rules)
87
88
  - 01.doc-sync.md — Bidirectional standard ↔ rules sync reminder (both directions in ONE rule).
@@ -103,7 +103,10 @@ function selectTemplates(stack) {
103
103
  if (stack.frontend === "nextjs") {
104
104
  templates.frontend = "node-nextjs";
105
105
  } else if (stack.frontend === "react") {
106
- templates.frontend = stack.framework === "vite" ? "node-vite" : "node-nextjs";
106
+ // `framework === "vite"` only when no backend framework was detected;
107
+ // `frontendBundler === "vite"` (v2.5.0) covers Spring/Django + React/Vite
108
+ // repos (root or `frontend/` sub-directory) where `framework` is the backend.
109
+ templates.frontend = (stack.framework === "vite" || stack.frontendBundler === "vite") ? "node-vite" : "node-nextjs";
107
110
  } else if (stack.frontend === "vue") {
108
111
  templates.frontend = "vue-nuxt";
109
112
  } else if (stack.frontend === "angular") {
@@ -37,7 +37,7 @@ async function main() {
37
37
  if (!stack.language && !stack.framework) {
38
38
  console.warn("\n ⚠️ No language or framework detected.");
39
39
  console.warn(" Supported: Java, Kotlin, TypeScript, JavaScript, Python");
40
- console.warn(" Ensure you have build.gradle, package.json, pyproject.toml, or requirements.txt in the project root.\n");
40
+ console.warn(" Ensure you have build.gradle(.kts), pom.xml, package.json, pyproject.toml, or requirements.txt in the project root.\n");
41
41
  }
42
42
  console.log(` Frontend: ${stack.frontend || "none"} ${stack.frontendVersion || ""}`);
43
43
  // v2.4.0 — when a project ships more than one DB driver (e.g. Oracle +
@@ -115,7 +115,7 @@ async function main() {
115
115
  // Phase 6: Prompt generation
116
116
  const lang = process.env.CLAUDEOS_LANG || "en";
117
117
  console.log(` [Phase 6] Generating prompts (lang: ${lang})...`);
118
- generatePrompts(templates, lang, TEMPLATES_DIR, GENERATED_DIR);
118
+ generatePrompts(templates, lang, TEMPLATES_DIR, GENERATED_DIR, stack);
119
119
  console.log();
120
120
 
121
121
  // Save outputs
@@ -127,15 +127,34 @@ async function main() {
127
127
  // the project declares no port of its own. This is a last-resort
128
128
  // default; prefer that stack-detector extract it from .env.example
129
129
  // to keep CLAUDE.md truthful to what the project actually runs.
130
- const defaultPort = (stack.framework === "fastapi" || stack.framework === "django") ? 8000
130
+ //
131
+ // v2.5.0 — backend port and frontend dev-server port are resolved
132
+ // SEPARATELY. Pre-v2.5.0 the single chain (`stack.frontend === "angular"
133
+ // ? 4200 …`) handed a Spring/Django backend the Angular/Next dev-server
134
+ // port whenever a SPA lived beside it. Now:
135
+ // stack.port — the backend's port when a backend exists; for a
136
+ // frontend-only project it is the dev-server port.
137
+ // stack.frontendPort — the SPA's dev-server port whenever a frontend
138
+ // exists: sub-directory `.env*` (stack-detector) →
139
+ // root `.env*` PORT for a root SPA → convention.
140
+ // Same definition as stack-detector's env-port split: a JVM/Python project
141
+ // is a backend even when no framework was recognized (plain Maven/Gradle
142
+ // project without Spring Boot coordinates).
143
+ const hasBackend = (!!stack.framework && stack.framework !== "vite") || ["java", "kotlin", "python"].includes(stack.language);
144
+ const backendDefaultPort = (stack.framework === "fastapi" || stack.framework === "django") ? 8000
131
145
  : stack.framework === "flask" ? 5000
132
- : stack.framework === "vite" ? 5173
133
- : stack.frontend === "angular" ? 4200
134
- : stack.frontend === "nextjs" ? 3000
135
146
  : (stack.framework === "express" || stack.framework === "nestjs" || stack.framework === "fastify") ? 3000 : 8080;
147
+ const frontendDefaultPort = (stack.frontendBundler === "vite" || stack.framework === "vite") ? 5173
148
+ : stack.frontend === "angular" ? 4200
149
+ : 3000;
150
+ const frontendPort = !stack.frontend ? null
151
+ : stack.frontendPort ? stack.frontendPort
152
+ : (!hasBackend && stack.port) ? stack.port
153
+ : frontendDefaultPort;
154
+ const defaultPort = hasBackend ? backendDefaultPort : (stack.frontend ? frontendPort : backendDefaultPort);
136
155
  const analysis = {
137
156
  analyzedAt: new Date().toISOString(), lang,
138
- stack: { ...stack, port: stack.port || defaultPort },
157
+ stack: { ...stack, port: stack.port || defaultPort, ...(frontendPort ? { frontendPort } : {}) },
139
158
  templates, isMultiStack, rootPackage,
140
159
  domains, backendDomains, frontendDomains, frontend,
141
160
  activeDomains: active,