claudeos-core 2.1.1 → 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.
Files changed (62) hide show
  1. package/CHANGELOG.md +1649 -481
  2. package/CONTRIBUTING.md +92 -92
  3. package/README.de.md +64 -5
  4. package/README.es.md +64 -5
  5. package/README.fr.md +64 -5
  6. package/README.hi.md +64 -5
  7. package/README.ja.md +64 -5
  8. package/README.ko.md +1018 -959
  9. package/README.md +1020 -960
  10. package/README.ru.md +66 -5
  11. package/README.vi.md +1019 -960
  12. package/README.zh-CN.md +64 -5
  13. package/bin/cli.js +152 -148
  14. package/bin/commands/init.js +1673 -1518
  15. package/bin/commands/lint.js +62 -0
  16. package/bin/commands/memory.js +438 -438
  17. package/bin/lib/cli-utils.js +206 -206
  18. package/claude-md-validator/index.js +184 -0
  19. package/claude-md-validator/reporter.js +66 -0
  20. package/claude-md-validator/structural-checks.js +528 -0
  21. package/content-validator/index.js +666 -436
  22. package/lib/env-parser.js +317 -0
  23. package/lib/expected-guides.js +23 -23
  24. package/lib/expected-outputs.js +90 -90
  25. package/lib/language-config.js +35 -35
  26. package/lib/memory-scaffold.js +1058 -1052
  27. package/lib/plan-parser.js +165 -165
  28. package/lib/staged-rules.js +118 -118
  29. package/manifest-generator/index.js +174 -174
  30. package/package.json +90 -87
  31. package/pass-json-validator/index.js +337 -337
  32. package/pass-prompts/templates/angular/pass3.md +28 -13
  33. package/pass-prompts/templates/common/claude-md-scaffold.md +686 -0
  34. package/pass-prompts/templates/common/pass3-footer.md +402 -39
  35. package/pass-prompts/templates/common/pass3b-core-header.md +43 -0
  36. package/pass-prompts/templates/common/pass4.md +375 -302
  37. package/pass-prompts/templates/common/staging-override.md +26 -26
  38. package/pass-prompts/templates/java-spring/pass3.md +31 -21
  39. package/pass-prompts/templates/kotlin-spring/pass3.md +34 -22
  40. package/pass-prompts/templates/node-express/pass3.md +30 -21
  41. package/pass-prompts/templates/node-fastify/pass3.md +28 -14
  42. package/pass-prompts/templates/node-nestjs/pass3.md +29 -14
  43. package/pass-prompts/templates/node-nextjs/pass3.md +34 -21
  44. package/pass-prompts/templates/node-vite/pass1.md +117 -117
  45. package/pass-prompts/templates/node-vite/pass2.md +78 -78
  46. package/pass-prompts/templates/node-vite/pass3.md +30 -13
  47. package/pass-prompts/templates/python-django/pass3.md +32 -21
  48. package/pass-prompts/templates/python-fastapi/pass3.md +33 -21
  49. package/pass-prompts/templates/python-flask/pass1.md +119 -119
  50. package/pass-prompts/templates/python-flask/pass2.md +85 -85
  51. package/pass-prompts/templates/python-flask/pass3.md +31 -13
  52. package/pass-prompts/templates/vue-nuxt/pass3.md +32 -13
  53. package/plan-installer/domain-grouper.js +76 -76
  54. package/plan-installer/index.js +137 -129
  55. package/plan-installer/prompt-generator.js +188 -128
  56. package/plan-installer/scanners/scan-frontend.js +505 -473
  57. package/plan-installer/scanners/scan-java.js +226 -226
  58. package/plan-installer/scanners/scan-node.js +57 -57
  59. package/plan-installer/scanners/scan-python.js +85 -85
  60. package/plan-installer/stack-detector.js +482 -466
  61. package/plan-installer/structure-scanner.js +65 -65
  62. package/sync-checker/index.js +177 -177
@@ -1,26 +1,26 @@
1
- ## CRITICAL — Write path redirect for `.claude/rules/` (tool-access workaround)
2
-
3
- Claude Code's sensitive-path policy blocks direct writes under `.claude/` from this subprocess, even with `--dangerously-skip-permissions`. To work around this safely, all rule files must be written to a staging directory and the Node.js orchestrator will move them after you finish.
4
-
5
- **Rule (overrides every instruction below):**
6
-
7
- > Whenever the instructions below tell you to WRITE a file whose path starts with `.claude/rules/`, write it to `claudeos-core/generated/.staged-rules/` instead, **preserving the subpath exactly**.
8
-
9
- Examples (write-target redirect, **subpath preserved**):
10
-
11
- | Instruction says to write | You MUST write to |
12
- |---|---|
13
- | `.claude/rules/00.core/00.standard-reference.md` | `claudeos-core/generated/.staged-rules/00.core/00.standard-reference.md` |
14
- | `.claude/rules/10.backend/01.controller-rules.md` | `claudeos-core/generated/.staged-rules/10.backend/01.controller-rules.md` |
15
- | `.claude/rules/50.sync/01.standard-sync.md` | `claudeos-core/generated/.staged-rules/50.sync/01.standard-sync.md` |
16
- | `.claude/rules/60.memory/01.decision-log.md` | `claudeos-core/generated/.staged-rules/60.memory/01.decision-log.md` |
17
-
18
- **Important clarifications:**
19
-
20
- 1. **Prose references stay as-is.** When the instructions or the file content you generate describe `.claude/rules/` as a concept ("Rules (.claude/rules/) and Standards...", "Each rule file in .claude/rules/ links to..."), keep that text literal. Only the **write-target file paths** are redirected. Generated file bodies will eventually live under `.claude/rules/`, so in-body references should point to the final location, not the staging location.
21
- 2. **Frontmatter `paths:` values stay as-is.** These are glob patterns scoped to project files (`"**/*"`, `"**/*.yml"`, etc.), not self-references.
22
- 3. **Do NOT attempt to write to `.claude/rules/` directly** — those writes will be refused by the tool.
23
- 4. **Create missing staging subdirectories as needed.** `claudeos-core/generated/` exists, but subpaths under `.staged-rules/` do not yet.
24
- 5. **This redirect applies to THIS Pass only.** Files written anywhere else (e.g. `claudeos-core/standard/`, `CLAUDE.md`, `claudeos-core/memory/`) are unaffected — write those to their intended paths as stated in the instructions below.
25
-
26
- ---
1
+ ## CRITICAL — Write path redirect for `.claude/rules/` (tool-access workaround)
2
+
3
+ Claude Code's sensitive-path policy blocks direct writes under `.claude/` from this subprocess, even with `--dangerously-skip-permissions`. To work around this safely, all rule files must be written to a staging directory and the Node.js orchestrator will move them after you finish.
4
+
5
+ **Rule (overrides every instruction below):**
6
+
7
+ > Whenever the instructions below tell you to WRITE a file whose path starts with `.claude/rules/`, write it to `claudeos-core/generated/.staged-rules/` instead, **preserving the subpath exactly**.
8
+
9
+ Examples (write-target redirect, **subpath preserved**):
10
+
11
+ | Instruction says to write | You MUST write to |
12
+ |---|---|
13
+ | `.claude/rules/00.core/00.standard-reference.md` | `claudeos-core/generated/.staged-rules/00.core/00.standard-reference.md` |
14
+ | `.claude/rules/10.backend/01.controller-rules.md` | `claudeos-core/generated/.staged-rules/10.backend/01.controller-rules.md` |
15
+ | `.claude/rules/50.sync/01.doc-sync.md` | `claudeos-core/generated/.staged-rules/50.sync/01.doc-sync.md` |
16
+ | `.claude/rules/60.memory/01.decision-log.md` | `claudeos-core/generated/.staged-rules/60.memory/01.decision-log.md` |
17
+
18
+ **Important clarifications:**
19
+
20
+ 1. **Prose references stay as-is.** When the instructions or the file content you generate describe `.claude/rules/` as a concept ("Rules (.claude/rules/) and Standards...", "Each rule file in .claude/rules/ links to..."), keep that text literal. Only the **write-target file paths** are redirected. Generated file bodies will eventually live under `.claude/rules/`, so in-body references should point to the final location, not the staging location.
21
+ 2. **Frontmatter `paths:` values stay as-is.** These are glob patterns scoped to project files (`"**/*"`, `"**/*.yml"`, etc.), not self-references.
22
+ 3. **Do NOT attempt to write to `.claude/rules/` directly** — those writes will be refused by the tool.
23
+ 4. **Create missing staging subdirectories as needed.** `claudeos-core/generated/` exists, but subpaths under `.staged-rules/` do not yet.
24
+ 5. **This redirect applies to THIS Pass only.** Files written anywhere else (e.g. `claudeos-core/standard/`, `CLAUDE.md`, `claudeos-core/memory/`) are unaffected — write those to their intended paths as stated in the instructions below.
25
+
26
+ ---
@@ -52,20 +52,28 @@ Similarly, if an Aggregator/Orchestrator layer exists, its responsibilities
52
52
  MUST be described identically across architecture.md, controller-patterns.md,
53
53
  response-exception.md, and all skills files.
54
54
 
55
- CRITICAL — CLAUDE.md Reference Table Completeness:
56
- The reference table in CLAUDE.md MUST list ALL generated standard files, not just core.
57
- Include all backend-api, security-db, infra, and verification standards.
58
- Alternatively, add a note directing readers to .claude/rules/00.core/00.standard-reference.md
59
- for the complete list.
60
-
61
55
  Generation targets:
62
56
 
63
57
  1. CLAUDE.md (project root)
64
- - Role definition (based on detected stack)
65
- - Build & Run Commands (Gradle/Maven)
66
- - Core architecture diagram
67
- - DB table naming conventions
68
- - Standard/Skills/Guide reference table
58
+
59
+ Follow the scaffold EXACTLY:
60
+ → `pass-prompts/templates/common/claude-md-scaffold.md`
61
+
62
+ The scaffold enforces an 8-section deterministic structure:
63
+ 1. Role Definition → 2. Project Overview → 3. Build & Run Commands →
64
+ 4. Core Architecture → 5. Directory Structure → 6. Standard / Rules / Skills Reference →
65
+ 7. DO NOT Read → 8. Common Rules & Memory (L4)
66
+
67
+ All section titles, order, and formats are FIXED by the scaffold.
68
+ Content within each section adapts to this project based on pass2-merged.json.
69
+ The scaffold's validation checklist MUST pass.
70
+
71
+ Stack-specific hints for this project (Java Spring Boot):
72
+ - Project type for Section 1 PROJECT_CONTEXT: "Backend Application" or "REST API Server"
73
+ - Architecture diagram (Section 4): layered architecture (Controller → Service → Mapper/Repository)
74
+ - Section 2 should include: JDK version, Gradle/Maven, DB, session/cache, server port
75
+ - DB naming conventions belong in standard/00.core/03.naming-conventions.md (not CLAUDE.md)
76
+ - Multi-DB projects: generalize to "Dual RDBMS" in Section 1, specify actual DBs in Section 2
69
77
 
70
78
  2. claudeos-core/standard/ (active domains only)
71
79
  - 00.core/01.project-overview.md — Stack, modules, API server info
@@ -105,8 +113,11 @@ Generation targets:
105
113
  - `00.core/*` rules: `paths: ["**/*"]` — always loaded (architecture, naming are universally needed)
106
114
  - `10.backend/*` rules: `paths: ["**/*"]` — always loaded (backend rules needed for any source editing)
107
115
  - `30.security-db/*` rules: `paths: ["**/*"]` — always loaded (cross-cutting concerns)
108
- - `40.infra/*` rules: `paths: ["**/*.yml", "**/*.yaml", "**/*.properties", "**/config/**", "**/*.gradle*", "**/Dockerfile*", "**/.env*"]` — loaded only for config/infra files
116
+ - `40.infra/01.environment-config-rules.md` paths: `["**/*.properties", "**/*.yml", "**/*.yaml", "**/.env*", "**/config/**", "**/application*.properties"]` — Spring config files
117
+ - `40.infra/02.logging-monitoring-rules.md` paths: `["**/*.java", "**/logback*.xml", "**/log4j*.xml"]` — source code where logs live + log config
118
+ - `40.infra/03.cicd-deployment-rules.md` paths: `["**/*.yml", "**/*.yaml", "**/Dockerfile*", "**/*.gradle*", "**/pom.xml", "**/*.java"]` — CI / build config + source
109
119
  - `50.sync/*` rules: `paths: ["**/claudeos-core/**", "**/.claude/**"]` — loaded only when editing claudeos-core files
120
+ - `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.
110
121
  - MUST generate `.claude/rules/00.core/00.standard-reference.md` — a directory of all standard files. This is NOT a "read all" instruction. Claude should Read ONLY the standards relevant to the current task. Structure it as:
111
122
  ```
112
123
  ---
@@ -121,6 +132,7 @@ Generation targets:
121
132
  - claudeos-core/standard/00.core/01.project-overview.md
122
133
  - claudeos-core/standard/00.core/02.architecture.md
123
134
  - claudeos-core/standard/00.core/03.naming-conventions.md
135
+ - claudeos-core/standard/00.core/04.doc-writing-guide.md
124
136
  ## Backend API
125
137
  - claudeos-core/standard/10.backend-api/01.controller-patterns.md
126
138
  - claudeos-core/standard/10.backend-api/02.service-patterns.md
@@ -138,18 +150,16 @@ Generation targets:
138
150
  - claudeos-core/standard/40.infra/03.cicd-deployment.md
139
151
  - claudeos-core/standard/50.verification/01.development-verification.md
140
152
  - claudeos-core/standard/50.verification/02.testing-strategy.md
141
- ## DO NOT Read (context waste)
142
- - claudeos-core/generated/ — Build metadata. Not for coding reference.
143
- - claudeos-core/guide/ — Onboarding/usage guides for humans. Not for coding reference.
144
- - claudeos-core/mcp-guide/ — MCP server integration docs. Not for coding reference.
145
153
  ```
146
- List only the standard files that were actually generated above. Include frontend standards only if frontend was detected.
154
+ 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).
147
155
 
148
- 4. .claude/rules/50.sync/ (3 sync rules — AI fallback reminders)
156
+ 4. .claude/rules/50.sync/ (2 sync rules — AI fallback reminders)
149
157
  - NOTE: These rules remind AI to run `npx claudeos-core refresh` after modifying standard/rules/skills files.
150
- - 01.standard-sync.md — Remind AI to update corresponding rule when standard is modified
151
- - 02.rules-sync.md Remind AI to update corresponding standard when rules are modified
152
- - 03.skills-sync.md Remind AI to update MANIFEST.md when skills are modified
158
+ - 01.doc-sync.md — Bidirectional standard rules sync reminder (both directions in ONE rule).
159
+ Do NOT generate a separate 02.rules-sync.md mirror file redundant.
160
+ Express the mapping as a naming convention (standard/<N>.<dir>/<M>.<n>.md
161
+ .claude/rules/<N>.<dir>/<M>.<n>-rules.md), NOT a hardcoded file-to-file table.
162
+ - 02.skills-sync.md — Remind AI to update MANIFEST.md when skills are modified
153
163
 
154
164
  5. claudeos-core/skills/ (active domains only)
155
165
  - 10.backend-crud/01.scaffold-crud-feature.md (orchestrator)
@@ -51,21 +51,31 @@ its responsibilities (DTO↔VO conversion, multi-service orchestration, response
51
51
  MUST be described identically across architecture.md, controller-patterns.md,
52
52
  response-exception.md, and all skills files.
53
53
 
54
- CRITICAL — CLAUDE.md Reference Table Completeness:
55
- The reference table in CLAUDE.md MUST list ALL generated standard files, not just core.
56
- Include all backend-api, security-db, infra, and verification standards.
57
- Alternatively, add a note directing readers to .claude/rules/00.core/00.standard-reference.md
58
- for the complete list.
59
-
60
54
  Generation targets:
61
55
 
62
56
  1. CLAUDE.md (project root)
63
- - Role definition (Kotlin + Spring Boot + multi-module, mention CQRS if detected)
64
- - Build & Run Commands (Gradle tasks per module, e.g., :servers:command:reservation-command-server:bootRun)
65
- - Multi-module architecture diagram (BFF → Feign → Command/Query → DB)
66
- - Module list with ports and roles
67
- - DB table naming conventions
68
- - Standard/Skills/Guide reference table
57
+
58
+ Follow the scaffold EXACTLY:
59
+ `pass-prompts/templates/common/claude-md-scaffold.md`
60
+
61
+ The scaffold enforces an 8-section deterministic structure:
62
+ 1. Role Definition → 2. Project Overview → 3. Build & Run Commands →
63
+ 4. Core Architecture → 5. Directory Structure → 6. Standard / Rules / Skills Reference →
64
+ 7. DO NOT Read → 8. Common Rules & Memory (L4)
65
+
66
+ All section titles, order, and formats are FIXED by the scaffold.
67
+ Content within each section adapts to this project based on pass2-merged.json.
68
+ The scaffold's validation checklist MUST pass.
69
+
70
+ Stack-specific hints for this project (Kotlin + Spring Boot):
71
+ - Project type for Section 1 PROJECT_CONTEXT: "Backend Application"
72
+ (when CQRS/BFF is detected, reflect as e.g. "CQRS-based Microservices")
73
+ - Multi-module projects: represent in Section 4 diagram and Section 5 tree
74
+ - Architecture diagram (Section 4): BFF → Feign → Command/Query → DB (if CQRS detected)
75
+ - Module ports and roles: include in Section 2 Project Overview (generic form)
76
+ - DB naming conventions: belong in standard/00.core/03.naming-conventions.md (not CLAUDE.md)
77
+ - Gradle tasks per module: Section 3 examples should show the pattern generically
78
+ then let developers refer to build.gradle.kts for specifics
69
79
 
70
80
  2. claudeos-core/standard/ (active domains only)
71
81
  - 00.core/01.project-overview.md — Stack (Kotlin version, Spring Boot version), module list, server ports
@@ -108,8 +118,11 @@ Generation targets:
108
118
  - `00.core/*` rules: `paths: ["**/*"]` — always loaded (architecture, naming are universally needed)
109
119
  - `10.backend/*` rules: `paths: ["**/*"]` — always loaded (backend rules needed for any source editing)
110
120
  - `30.security-db/*` rules: `paths: ["**/*"]` — always loaded (cross-cutting concerns)
111
- - `40.infra/*` rules: `paths: ["**/*.yml", "**/*.yaml", "**/*.properties", "**/config/**", "**/*.gradle*", "**/Dockerfile*", "**/.env*"]` — loaded only for config/infra files
121
+ - `40.infra/01.environment-config-rules.md` paths: `["**/*.properties", "**/*.yml", "**/*.yaml", "**/.env*", "**/config/**", "**/application*.properties"]` — Spring config files
122
+ - `40.infra/02.logging-monitoring-rules.md` paths: `["**/*.kt", "**/*.kts", "**/logback*.xml"]` — source code where logs live + log config
123
+ - `40.infra/03.cicd-deployment-rules.md` paths: `["**/*.yml", "**/*.yaml", "**/Dockerfile*", "**/*.gradle*", "**/*.kt", "**/*.kts"]` — CI / build config + source
112
124
  - `50.sync/*` rules: `paths: ["**/claudeos-core/**", "**/.claude/**"]` — loaded only when editing claudeos-core files
125
+ - `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.
113
126
  - MUST generate `.claude/rules/00.core/00.standard-reference.md` — a directory of all standard files. This is NOT a "read all" instruction. Claude should Read ONLY the standards relevant to the current task. Structure it as:
114
127
  ```
115
128
  ---
@@ -124,6 +137,7 @@ Generation targets:
124
137
  - claudeos-core/standard/00.core/01.project-overview.md
125
138
  - claudeos-core/standard/00.core/02.architecture.md
126
139
  - claudeos-core/standard/00.core/03.naming-conventions.md
140
+ - claudeos-core/standard/00.core/04.doc-writing-guide.md
127
141
  ## Backend API
128
142
  - claudeos-core/standard/10.backend-api/01.controller-patterns.md
129
143
  - claudeos-core/standard/10.backend-api/02.service-patterns.md
@@ -143,18 +157,16 @@ Generation targets:
143
157
  - claudeos-core/standard/40.infra/03.cicd-deployment.md
144
158
  - claudeos-core/standard/50.verification/01.development-verification.md
145
159
  - claudeos-core/standard/50.verification/02.testing-strategy.md
146
- ## DO NOT Read (context waste)
147
- - claudeos-core/generated/ — Build metadata. Not for coding reference.
148
- - claudeos-core/guide/ — Onboarding/usage guides for humans. Not for coding reference.
149
- - claudeos-core/mcp-guide/ — MCP server integration docs. Not for coding reference.
150
160
  ```
151
- List only the standard files that were actually generated above. Include frontend standards only if frontend was detected.
161
+ 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).
152
162
 
153
- 4. .claude/rules/50.sync/ (3 sync rules — AI fallback reminders)
163
+ 4. .claude/rules/50.sync/ (2 sync rules — AI fallback reminders)
154
164
  - NOTE: These rules remind AI to run `npx claudeos-core refresh` after modifying standard/rules/skills files.
155
- - 01.standard-sync.md — Remind AI to update corresponding rule when standard is modified
156
- - 02.rules-sync.md Remind AI to update corresponding standard when rules are modified
157
- - 03.skills-sync.md Remind AI to update MANIFEST.md when skills are modified
165
+ - 01.doc-sync.md — Bidirectional standard rules sync reminder (both directions in ONE rule).
166
+ Do NOT generate a separate 02.rules-sync.md mirror file redundant.
167
+ Express the mapping as a naming convention (standard/<N>.<dir>/<M>.<n>.md
168
+ .claude/rules/<N>.<dir>/<M>.<n>-rules.md), NOT a hardcoded file-to-file table.
169
+ - 02.skills-sync.md — Remind AI to update MANIFEST.md when skills are modified
158
170
 
159
171
  5. claudeos-core/skills/ (active domains only)
160
172
  - 10.backend-crud/01.scaffold-crud-feature.md (orchestrator — CQRS-aware: creates both command and query modules)
@@ -29,20 +29,27 @@ Determine from pass2-merged.json which layer (Controller/Router vs Service/UseCa
29
29
  the response wrapper. This MUST be identical across architecture.md, controller/router-patterns.md,
30
30
  response-exception.md, and controller-rules.md. Do NOT describe different response flows in different files.
31
31
 
32
- CRITICAL — CLAUDE.md Reference Table Completeness:
33
- The reference table in CLAUDE.md MUST list ALL generated standard files, not just core.
34
- Include all frontend-ui, backend-api, security-db, infra, and verification standards.
35
- Alternatively, add a note directing readers to .claude/rules/00.core/00.standard-reference.md
36
- for the complete list.
37
-
38
32
  Generation targets:
39
33
 
40
34
  1. CLAUDE.md (project root)
41
- - Role definition (based on detected stack)
42
- - Build & Run Commands (use ONLY the detected packageManager — never hardcode npm/yarn/pnpm)
43
- - Core architecture diagram
44
- - DB table/collection naming
45
- - Standard/Skills/Guide reference table
35
+
36
+ Follow the scaffold EXACTLY:
37
+ → `pass-prompts/templates/common/claude-md-scaffold.md`
38
+
39
+ The scaffold enforces an 8-section deterministic structure:
40
+ 1. Role Definition → 2. Project Overview → 3. Build & Run Commands →
41
+ 4. Core Architecture → 5. Directory Structure → 6. Standard / Rules / Skills Reference →
42
+ 7. DO NOT Read → 8. Common Rules & Memory (L4)
43
+
44
+ All section titles, order, and formats are FIXED by the scaffold.
45
+ Content within each section adapts to this project based on pass2-merged.json.
46
+ The scaffold's validation checklist MUST pass.
47
+
48
+ Stack-specific hints for this project (Node.js Express):
49
+ - Project type for Section 1 PROJECT_CONTEXT: "API Server" or the actual character of the project
50
+ - Architecture diagram (Section 4): middleware → route → controller → service layers
51
+ - Use ONLY the detected packageManager in Section 3 (never mix npm/yarn/pnpm)
52
+ - DB naming conventions: belong in standard/00.core/03.naming-conventions.md (not CLAUDE.md)
46
53
 
47
54
  2. claudeos-core/standard/ (active domains only)
48
55
  - 00.core/01.project-overview.md — Stack, modules, API server info
@@ -81,8 +88,11 @@ Generation targets:
81
88
  - `00.core/*` rules: `paths: ["**/*"]` — always loaded (architecture, naming are universally needed)
82
89
  - `10.backend/*` rules: `paths: ["**/*"]` — always loaded (backend rules needed for any source editing)
83
90
  - `30.security-db/*` rules: `paths: ["**/*"]` — always loaded (cross-cutting concerns)
84
- - `40.infra/*` rules: `paths: ["**/*.json", "**/*.env*", "**/config/**", "**/Dockerfile*", "**/*.yml", "**/*.yaml"]` — loaded only for config/infra files
91
+ - `40.infra/01.environment-config-rules.md` paths: `["**/.env*", "**/config/**", "**/*.json"]` — env / config files
92
+ - `40.infra/02.logging-monitoring-rules.md` paths: `["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"]` — source code where logs live
93
+ - `40.infra/03.cicd-deployment-rules.md` paths: `["**/*.yml", "**/*.yaml", "**/Dockerfile*", "**/*.ts", "**/*.js"]` — CI config + source
85
94
  - `50.sync/*` rules: `paths: ["**/claudeos-core/**", "**/.claude/**"]` — loaded only when editing claudeos-core files
95
+ - `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.
86
96
  - MUST generate `.claude/rules/00.core/00.standard-reference.md` — a directory of all standard files. This is NOT a "read all" instruction. Claude should Read ONLY the standards relevant to the current task. Structure it as:
87
97
  ```
88
98
  ---
@@ -97,6 +107,7 @@ Generation targets:
97
107
  - claudeos-core/standard/00.core/01.project-overview.md
98
108
  - claudeos-core/standard/00.core/02.architecture.md
99
109
  - claudeos-core/standard/00.core/03.naming-conventions.md
110
+ - claudeos-core/standard/00.core/04.doc-writing-guide.md
100
111
  ## Backend API
101
112
  - claudeos-core/standard/10.backend-api/01.router-controller-patterns.md
102
113
  - claudeos-core/standard/10.backend-api/02.service-patterns.md
@@ -114,18 +125,16 @@ Generation targets:
114
125
  - claudeos-core/standard/40.infra/03.cicd-deployment.md
115
126
  - claudeos-core/standard/50.verification/01.development-verification.md
116
127
  - claudeos-core/standard/50.verification/02.testing-strategy.md
117
- ## DO NOT Read (context waste)
118
- - claudeos-core/generated/ — Build metadata. Not for coding reference.
119
- - claudeos-core/guide/ — Onboarding/usage guides for humans. Not for coding reference.
120
- - claudeos-core/mcp-guide/ — MCP server integration docs. Not for coding reference.
121
128
  ```
122
- List only the standard files that were actually generated above.
129
+ 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).
123
130
 
124
- 4. .claude/rules/50.sync/ (3 sync rules — AI fallback reminders)
131
+ 4. .claude/rules/50.sync/ (2 sync rules — AI fallback reminders)
125
132
  - NOTE: These rules remind AI to run `npx claudeos-core refresh` after modifying standard/rules/skills files.
126
- - 01.standard-sync.md — Remind AI to update corresponding rule when standard is modified
127
- - 02.rules-sync.md Remind AI to update corresponding standard when rules are modified
128
- - 03.skills-sync.md Remind AI to update MANIFEST.md when skills are modified
133
+ - 01.doc-sync.md — Bidirectional standard rules sync reminder (both directions in ONE rule).
134
+ Do NOT generate a separate 02.rules-sync.md mirror file redundant.
135
+ Express the mapping as a naming convention (standard/<N>.<dir>/<M>.<n>.md
136
+ .claude/rules/<N>.<dir>/<M>.<n>-rules.md), NOT a hardcoded file-to-file table.
137
+ - 02.skills-sync.md — Remind AI to update MANIFEST.md when skills are modified
129
138
 
130
139
  5. claudeos-core/skills/ (active domains only)
131
140
  - 10.backend-crud/01.scaffold-crud-feature.md (orchestrator)
@@ -27,18 +27,27 @@ Determine from pass2-merged.json which layer (route handler vs service/plugin) c
27
27
  the response wrapper. This MUST be identical across architecture.md, route-plugin-patterns.md,
28
28
  response-exception.md, and all rules files. Do NOT describe different response flows in different files.
29
29
 
30
- CRITICAL — CLAUDE.md Reference Table Completeness:
31
- The reference table in CLAUDE.md MUST list ALL generated standard files.
32
- Alternatively, add a note directing readers to .claude/rules/00.core/00.standard-reference.md.
33
-
34
30
  Generation targets:
35
31
 
36
32
  1. CLAUDE.md (project root)
37
- - Role definition (Fastify backend)
38
- - Build & Run Commands (use ONLY the detected packageManager)
39
- - Core architecture diagram (plugin-based)
40
- - DB table/collection naming
41
- - Standard/Skills/Guide reference table
33
+
34
+ Follow the scaffold EXACTLY:
35
+ `pass-prompts/templates/common/claude-md-scaffold.md`
36
+
37
+ The scaffold enforces an 8-section deterministic structure:
38
+ 1. Role Definition → 2. Project Overview → 3. Build & Run Commands →
39
+ 4. Core Architecture → 5. Directory Structure → 6. Standard / Rules / Skills Reference →
40
+ 7. DO NOT Read → 8. Common Rules & Memory (L4)
41
+
42
+ All section titles, order, and formats are FIXED by the scaffold.
43
+ Content within each section adapts to this project based on pass2-merged.json.
44
+ The scaffold's validation checklist MUST pass.
45
+
46
+ Stack-specific hints for this project (Node.js Fastify):
47
+ - Project type for Section 1 PROJECT_CONTEXT: "High-performance API Server" or the actual character of the project
48
+ - Architecture diagram (Section 4): plugin-based architecture, request lifecycle, hooks
49
+ - Use ONLY the detected packageManager in Section 3
50
+ - DB naming conventions: belong in standard/00.core/03.naming-conventions.md (not CLAUDE.md)
42
51
 
43
52
  2. claudeos-core/standard/ (active domains only)
44
53
  - 00.core/01.project-overview.md — Stack, modules, server info
@@ -73,14 +82,19 @@ Generation targets:
73
82
  - `00.core/*` rules: `paths: ["**/*"]`
74
83
  - `10.backend/*` rules: `paths: ["**/*"]`
75
84
  - `30.security-db/*` rules: `paths: ["**/*"]`
76
- - `40.infra/*` rules: `paths: ["**/*.json", "**/*.env*", "**/config/**", "**/Dockerfile*", "**/*.yml", "**/*.yaml"]`
85
+ - `40.infra/01.environment-config-rules.md` paths: `["**/.env*", "**/config/**", "**/*.json"]` — env / config files
86
+ - `40.infra/02.logging-monitoring-rules.md` paths: `["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"]` — source code where logs live
87
+ - `40.infra/03.cicd-deployment-rules.md` paths: `["**/*.yml", "**/*.yaml", "**/Dockerfile*", "**/*.ts", "**/*.js"]` — CI config + source
77
88
  - `50.sync/*` rules: `paths: ["**/claudeos-core/**", "**/.claude/**"]`
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.
78
90
  - MUST generate `.claude/rules/00.core/00.standard-reference.md` as a directory of all standard files
79
91
 
80
- 4. .claude/rules/50.sync/ (3 sync rules)
81
- - 01.standard-sync.md
82
- - 02.rules-sync.md
83
- - 03.skills-sync.md
92
+ 4. .claude/rules/50.sync/ (2 sync rules)
93
+ - 01.doc-sync.md — Bidirectional standard ↔ rules sync reminder (both directions in ONE rule).
94
+ Do NOT generate a separate 02.rules-sync.md mirror file — redundant.
95
+ Express the mapping as a naming convention (standard/<N>.<dir>/<M>.<n>.md
96
+ .claude/rules/<N>.<dir>/<M>.<n>-rules.md), NOT a hardcoded file-to-file table.
97
+ - 02.skills-sync.md — Remind AI to update MANIFEST.md when skills are modified
84
98
 
85
99
  5. claudeos-core/skills/ (active domains only)
86
100
  - 10.backend-crud/01.scaffold-crud-feature.md (orchestrator)
@@ -29,18 +29,28 @@ Determine from pass2-merged.json which layer (Controller vs Service/UseCase) cal
29
29
  the response wrapper. This MUST be identical across architecture.md, controller-patterns.md,
30
30
  response-exception.md, and controller-rules.md. Do NOT describe different response flows in different files.
31
31
 
32
- CRITICAL — CLAUDE.md Reference Table Completeness:
33
- The reference table in CLAUDE.md MUST list ALL generated standard files, not just core.
34
- Include all frontend-ui, backend-api, security-db, infra, and verification standards.
35
-
36
32
  Generation targets:
37
33
 
38
34
  1. CLAUDE.md (project root)
39
- - Role definition (NestJS backend developer)
40
- - Build & Run Commands (use ONLY the detected packageManager)
41
- - Core architecture diagram (Module Controller → Service → Repository)
42
- - DB table/collection naming
43
- - Standard/Skills/Guide reference table
35
+
36
+ Follow the scaffold EXACTLY:
37
+ `pass-prompts/templates/common/claude-md-scaffold.md`
38
+
39
+ The scaffold enforces an 8-section deterministic structure:
40
+ 1. Role Definition → 2. Project Overview → 3. Build & Run Commands →
41
+ 4. Core Architecture → 5. Directory Structure → 6. Standard / Rules / Skills Reference →
42
+ 7. DO NOT Read → 8. Common Rules & Memory (L4)
43
+
44
+ All section titles, order, and formats are FIXED by the scaffold.
45
+ Content within each section adapts to this project based on pass2-merged.json.
46
+ The scaffold's validation checklist MUST pass.
47
+
48
+ Stack-specific hints for this project (Node.js NestJS):
49
+ - Project type for Section 1 PROJECT_CONTEXT: "Backend Application" or "API Server"
50
+ - Architecture diagram (Section 4): Module → Controller → Service → Repository,
51
+ with DI container and request lifecycle (middleware → guard → interceptor → pipe → handler)
52
+ - Use ONLY the detected packageManager in Section 3
53
+ - DB naming conventions: belong in standard/00.core/03.naming-conventions.md (not CLAUDE.md)
44
54
 
45
55
  2. claudeos-core/standard/ (active domains only)
46
56
  - 00.core/01.project-overview.md — Stack, modules, API server info
@@ -80,15 +90,20 @@ Generation targets:
80
90
  - `00.core/*` rules: `paths: ["**/*"]`
81
91
  - `10.backend/*` rules: `paths: ["**/*"]`
82
92
  - `30.security-db/*` rules: `paths: ["**/*"]`
83
- - `40.infra/*` rules: `paths: ["**/*.json", "**/*.env*", "**/config/**", "**/Dockerfile*", "**/*.yml", "**/*.yaml"]`
93
+ - `40.infra/01.environment-config-rules.md` paths: `["**/.env*", "**/config/**", "**/*.json"]` — env / config files
94
+ - `40.infra/02.logging-monitoring-rules.md` paths: `["**/*.ts", "**/*.tsx"]` — source code where logs live
95
+ - `40.infra/03.cicd-deployment-rules.md` paths: `["**/*.yml", "**/*.yaml", "**/Dockerfile*", "**/*.ts"]` — CI config + source
84
96
  - `50.sync/*` rules: `paths: ["**/claudeos-core/**", "**/.claude/**"]`
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.
85
98
  - MUST generate `.claude/rules/00.core/00.standard-reference.md` — directory of all standard files.
86
99
  List only the standard files that were actually generated above.
87
100
 
88
- 4. .claude/rules/50.sync/ (3 sync rules)
89
- - 01.standard-sync.md — Remind AI to update corresponding rule when standard is modified
90
- - 02.rules-sync.md Remind AI to update corresponding standard when rules are modified
91
- - 03.skills-sync.md Remind AI to update MANIFEST.md when skills are modified
101
+ 4. .claude/rules/50.sync/ (2 sync rules)
102
+ - 01.doc-sync.md — Bidirectional standard rules sync reminder (both directions in ONE rule).
103
+ Do NOT generate a separate 02.rules-sync.md mirror file redundant.
104
+ Express the mapping as a naming convention (standard/<N>.<dir>/<M>.<n>.md
105
+ .claude/rules/<N>.<dir>/<M>.<n>-rules.md), NOT a hardcoded file-to-file table.
106
+ - 02.skills-sync.md — Remind AI to update MANIFEST.md when skills are modified
92
107
 
93
108
  5. claudeos-core/skills/ (active domains only)
94
109
  - 10.backend-crud/01.scaffold-crud-feature.md (orchestrator)
@@ -29,20 +29,31 @@ Determine from pass2-merged.json which layer handles response formatting (API Ro
29
29
  service/utility layer). This MUST be identical across architecture.md, api-routes.md,
30
30
  and all rules files. Do NOT describe different response flows in different files.
31
31
 
32
- CRITICAL — CLAUDE.md Reference Table Completeness:
33
- The reference table in CLAUDE.md MUST list ALL generated standard files, not just core.
34
- Include all frontend-ui, backend-api, security-db, infra, and verification standards.
35
- Alternatively, add a note directing readers to .claude/rules/00.core/00.standard-reference.md
36
- for the complete list.
37
-
38
32
  Generation targets:
39
33
 
40
34
  1. CLAUDE.md (project root)
41
- - Role definition (based on detected stack)
42
- - Build & Run Commands (use ONLY the detected packageManager — never hardcode npm/yarn/pnpm)
43
- - Core architecture diagram
44
- - Directory structure description
45
- - Standard/Skills/Guide reference table
35
+
36
+ Follow the scaffold EXACTLY:
37
+ → `pass-prompts/templates/common/claude-md-scaffold.md`
38
+
39
+ The scaffold enforces an 8-section deterministic structure:
40
+ 1. Role Definition → 2. Project Overview → 3. Build & Run Commands →
41
+ 4. Core Architecture → 5. Directory Structure → 6. Standard / Rules / Skills Reference →
42
+ 7. DO NOT Read → 8. Common Rules & Memory (L4)
43
+
44
+ All section titles, order, and formats are FIXED by the scaffold.
45
+ Content within each section adapts to this project based on pass2-merged.json.
46
+ The scaffold's validation checklist MUST pass.
47
+
48
+ Stack-specific hints for this project (Next.js):
49
+ - Project type for Section 1 PROJECT_CONTEXT: "Full-stack Web Application"
50
+ (detect App Router vs Pages Router and reflect, e.g., "Next.js App Router-based")
51
+ - Architecture diagram (Section 4): server components vs client components,
52
+ data fetching (server actions / route handlers), middleware flow
53
+ - Use ONLY the detected packageManager in Section 3
54
+ - Section 5 tree: distinguish app/ (App Router) vs pages/ (Pages Router) as applicable
55
+ - Detect codegen tools (orval, graphql-codegen, prisma generate)
56
+ and reflect in Section 5 emphasis ("Do Not Modify Manually")
46
57
 
47
58
  2. claudeos-core/standard/ (active domains only)
48
59
  - 00.core/01.project-overview.md — Stack, routing approach, deployment environment
@@ -80,8 +91,11 @@ Generation targets:
80
91
  - `10.backend/*` rules: `paths: ["**/*"]` — always loaded (backend rules needed for any source editing)
81
92
  - `20.frontend/*` rules: `paths: ["**/*"]` — always loaded (frontend rules needed for any source editing)
82
93
  - `30.security-db/*` rules: `paths: ["**/*"]` — always loaded (cross-cutting concerns)
83
- - `40.infra/*` rules: `paths: ["**/*.json", "**/*.env*", "**/next.config.*", "**/Dockerfile*", "**/*.yml", "**/*.yaml"]` — loaded only for config/infra files
94
+ - `40.infra/01.environment-config-rules.md` paths: `["**/.env*", "**/next.config.*", "**/*.json"]` — env / Next.js config
95
+ - `40.infra/02.logging-monitoring-rules.md` paths: `["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"]` — source code where logs live
96
+ - `40.infra/03.cicd-deployment-rules.md` paths: `["**/*.yml", "**/*.yaml", "**/Dockerfile*", "**/*.ts", "**/*.tsx"]` — CI config + source
84
97
  - `50.sync/*` rules: `paths: ["**/claudeos-core/**", "**/.claude/**"]` — loaded only when editing claudeos-core files
98
+ - `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
99
  - MUST generate `.claude/rules/00.core/00.standard-reference.md` — a directory of all standard files. This is NOT a "read all" instruction. Claude should Read ONLY the standards relevant to the current task. Structure it as:
86
100
  ```
87
101
  ---
@@ -96,6 +110,7 @@ Generation targets:
96
110
  - claudeos-core/standard/00.core/01.project-overview.md
97
111
  - claudeos-core/standard/00.core/02.architecture.md
98
112
  - claudeos-core/standard/00.core/03.naming-conventions.md
113
+ - claudeos-core/standard/00.core/04.doc-writing-guide.md
99
114
  ## Frontend UI
100
115
  - claudeos-core/standard/20.frontend-ui/01.component-patterns.md
101
116
  - claudeos-core/standard/20.frontend-ui/02.page-routing-patterns.md
@@ -112,18 +127,16 @@ Generation targets:
112
127
  - claudeos-core/standard/40.infra/03.cicd-deployment.md
113
128
  - claudeos-core/standard/50.verification/01.development-verification.md
114
129
  - claudeos-core/standard/50.verification/02.testing-strategy.md
115
- ## DO NOT Read (context waste)
116
- - claudeos-core/generated/ — Build metadata. Not for coding reference.
117
- - claudeos-core/guide/ — Onboarding/usage guides for humans. Not for coding reference.
118
- - claudeos-core/mcp-guide/ — MCP server integration docs. Not for coding reference.
119
130
  ```
120
- List only the standard files that were actually generated above.
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).
121
132
 
122
- 4. .claude/rules/50.sync/ (3 sync rules — AI fallback reminders)
133
+ 4. .claude/rules/50.sync/ (2 sync rules — AI fallback reminders)
123
134
  - NOTE: These rules remind AI to run `npx claudeos-core refresh` after modifying standard/rules/skills files.
124
- - 01.standard-sync.md — Remind AI to update corresponding rule when standard is modified
125
- - 02.rules-sync.md Remind AI to update corresponding standard when rules are modified
126
- - 03.skills-sync.md Remind AI to update MANIFEST.md when skills are modified
135
+ - 01.doc-sync.md — Bidirectional standard rules sync reminder (both directions in ONE rule).
136
+ Do NOT generate a separate 02.rules-sync.md mirror file redundant.
137
+ Express the mapping as a naming convention (standard/<N>.<dir>/<M>.<n>.md
138
+ .claude/rules/<N>.<dir>/<M>.<n>-rules.md), NOT a hardcoded file-to-file table.
139
+ - 02.skills-sync.md — Remind AI to update MANIFEST.md when skills are modified
127
140
 
128
141
  5. claudeos-core/skills/ (active domains only)
129
142
  - 20.frontend-page/01.scaffold-page-feature.md (orchestrator)