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.
- package/CHANGELOG.md +1649 -481
- package/CONTRIBUTING.md +92 -92
- package/README.de.md +64 -5
- package/README.es.md +64 -5
- package/README.fr.md +64 -5
- package/README.hi.md +64 -5
- package/README.ja.md +64 -5
- package/README.ko.md +1018 -959
- package/README.md +1020 -960
- package/README.ru.md +66 -5
- package/README.vi.md +1019 -960
- package/README.zh-CN.md +64 -5
- package/bin/cli.js +152 -148
- package/bin/commands/init.js +1673 -1518
- package/bin/commands/lint.js +62 -0
- package/bin/commands/memory.js +438 -438
- package/bin/lib/cli-utils.js +206 -206
- package/claude-md-validator/index.js +184 -0
- package/claude-md-validator/reporter.js +66 -0
- package/claude-md-validator/structural-checks.js +528 -0
- package/content-validator/index.js +666 -436
- package/lib/env-parser.js +317 -0
- package/lib/expected-guides.js +23 -23
- package/lib/expected-outputs.js +90 -90
- package/lib/language-config.js +35 -35
- package/lib/memory-scaffold.js +1058 -1052
- package/lib/plan-parser.js +165 -165
- package/lib/staged-rules.js +118 -118
- package/manifest-generator/index.js +174 -174
- package/package.json +90 -87
- package/pass-json-validator/index.js +337 -337
- package/pass-prompts/templates/angular/pass3.md +28 -13
- package/pass-prompts/templates/common/claude-md-scaffold.md +686 -0
- package/pass-prompts/templates/common/pass3-footer.md +402 -39
- package/pass-prompts/templates/common/pass3b-core-header.md +43 -0
- package/pass-prompts/templates/common/pass4.md +375 -302
- package/pass-prompts/templates/common/staging-override.md +26 -26
- package/pass-prompts/templates/java-spring/pass3.md +31 -21
- package/pass-prompts/templates/kotlin-spring/pass3.md +34 -22
- package/pass-prompts/templates/node-express/pass3.md +30 -21
- package/pass-prompts/templates/node-fastify/pass3.md +28 -14
- package/pass-prompts/templates/node-nestjs/pass3.md +29 -14
- package/pass-prompts/templates/node-nextjs/pass3.md +34 -21
- package/pass-prompts/templates/node-vite/pass1.md +117 -117
- package/pass-prompts/templates/node-vite/pass2.md +78 -78
- package/pass-prompts/templates/node-vite/pass3.md +30 -13
- package/pass-prompts/templates/python-django/pass3.md +32 -21
- package/pass-prompts/templates/python-fastapi/pass3.md +33 -21
- package/pass-prompts/templates/python-flask/pass1.md +119 -119
- package/pass-prompts/templates/python-flask/pass2.md +85 -85
- package/pass-prompts/templates/python-flask/pass3.md +31 -13
- package/pass-prompts/templates/vue-nuxt/pass3.md +32 -13
- package/plan-installer/domain-grouper.js +76 -76
- package/plan-installer/index.js +137 -129
- package/plan-installer/prompt-generator.js +188 -128
- package/plan-installer/scanners/scan-frontend.js +505 -473
- package/plan-installer/scanners/scan-java.js +226 -226
- package/plan-installer/scanners/scan-node.js +57 -57
- package/plan-installer/scanners/scan-python.js +85 -85
- package/plan-installer/stack-detector.js +482 -466
- package/plan-installer/structure-scanner.js +65 -65
- package/sync-checker/index.js +177 -177
package/README.md
CHANGED
|
@@ -1,960 +1,1020 @@
|
|
|
1
|
-
# ClaudeOS-Core
|
|
2
|
-
|
|
3
|
-
**The only tool that reads your source code first, confirms your stack and patterns with deterministic analysis, then generates Claude Code rules tailored to your exact project.**
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
npx claudeos-core init
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
ClaudeOS-Core reads your codebase, extracts every pattern it finds, and generates a complete set of Standards, Rules, Skills, and Guides tailored to _your_ project. After that, when you tell Claude Code "Create a CRUD for orders", it produces code that matches your existing patterns exactly.
|
|
10
|
-
|
|
11
|
-
[๐ฐ๐ท ํ๊ตญ์ด](./README.ko.md) ยท [๐จ๐ณ ไธญๆ](./README.zh-CN.md) ยท [๐ฏ๐ต ๆฅๆฌ่ช](./README.ja.md) ยท [๐ช๐ธ Espaรฑol](./README.es.md) ยท [๐ป๐ณ Tiแบฟng Viแปt](./README.vi.md) ยท [๐ฎ๐ณ เคนเคฟเคจเฅเคฆเฅ](./README.hi.md) ยท [๐ท๐บ ะ ัััะบะธะน](./README.ru.md) ยท [๐ซ๐ท Franรงais](./README.fr.md) ยท [๐ฉ๐ช Deutsch](./README.de.md)
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Why ClaudeOS-Core?
|
|
16
|
-
|
|
17
|
-
Every other Claude Code tool works like this:
|
|
18
|
-
|
|
19
|
-
> **Human describes the project โ LLM generates documentation**
|
|
20
|
-
|
|
21
|
-
ClaudeOS-Core works like this:
|
|
22
|
-
|
|
23
|
-
> **Code analyzes your source โ Code builds a tailored prompt โ LLM generates documentation โ Code verifies the output**
|
|
24
|
-
|
|
25
|
-
This is not a small difference. Here's why it matters:
|
|
26
|
-
|
|
27
|
-
### The core problem: LLMs guess. Code doesn't.
|
|
28
|
-
|
|
29
|
-
When you ask Claude to "analyze this project," it **guesses** your stack, your ORM, your domain structure.
|
|
30
|
-
It might see `spring-boot` in your `build.gradle` but miss that you use MyBatis (not JPA).
|
|
31
|
-
It might detect a `user/` directory but not realize your project uses layer-first packaging (Pattern A), not domain-first (Pattern B).
|
|
32
|
-
|
|
33
|
-
**ClaudeOS-Core doesn't guess.** Before Claude ever sees your project, Node.js code has already:
|
|
34
|
-
|
|
35
|
-
- Parsed `build.gradle` / `package.json` / `pyproject.toml` and **confirmed** your stack, ORM, DB, and package manager
|
|
36
|
-
- Scanned your directory structure and **confirmed** your domain list with file counts
|
|
37
|
-
- Classified your project structure into one of 5 Java patterns, Kotlin CQRS/BFF, or Next.js App Router/FSD
|
|
38
|
-
- Split domains into optimally-sized groups that fit Claude's context window
|
|
39
|
-
- Assembled a stack-specific prompt with all confirmed facts injected
|
|
40
|
-
|
|
41
|
-
By the time Claude receives the prompt, there's nothing left to guess. The stack is confirmed. The domains are confirmed. The structure pattern is confirmed. Claude's only job is to generate documentation that matches these **confirmed facts**.
|
|
42
|
-
|
|
43
|
-
### The result
|
|
44
|
-
|
|
45
|
-
Other tools produce "generally good" documentation.
|
|
46
|
-
ClaudeOS-Core produces documentation that knows your project uses `ApiResponse.ok()` (not `ResponseEntity.success()`), that your MyBatis XML mappers live in `src/main/resources/mybatis/mappers/`, and that your package structure is `com.company.module.{domain}.controller` โ because it read your actual code.
|
|
47
|
-
|
|
48
|
-
### Before & After
|
|
49
|
-
|
|
50
|
-
**Without ClaudeOS-Core** โ you ask Claude Code to create an Order CRUD:
|
|
51
|
-
```
|
|
52
|
-
โ Uses JPA-style repository (your project uses MyBatis)
|
|
53
|
-
โ Creates ResponseEntity.success() (your wrapper is ApiResponse.ok())
|
|
54
|
-
โ Places files in order/controller/ (your project uses controller/order/)
|
|
55
|
-
โ Generates English comments (your team writes Korean comments)
|
|
56
|
-
โ You spend 20 minutes fixing every generated file
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
**With ClaudeOS-Core** โ `.claude/rules/` already contains your confirmed patterns:
|
|
60
|
-
```
|
|
61
|
-
โ
Generates MyBatis mapper + XML (detected from build.gradle)
|
|
62
|
-
โ
Uses ApiResponse.ok() (extracted from your actual source)
|
|
63
|
-
โ
Places files in controller/order/ (Pattern A confirmed by structure scan)
|
|
64
|
-
โ
Korean comments (--lang ko applied)
|
|
65
|
-
โ Generated code matches your project conventions immediately
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
This difference compounds. 10 tasks/day ร 20 minutes saved = **3+ hours/day**.
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
##
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
npx claudeos-core init
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
#
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
#
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
โ
|
|
486
|
-
โโโ CLAUDE.md
|
|
487
|
-
โ
|
|
488
|
-
|
|
489
|
-
โ
|
|
490
|
-
โ โโโ
|
|
491
|
-
โ
|
|
492
|
-
โ
|
|
493
|
-
โ
|
|
494
|
-
|
|
495
|
-
โ โโโ
|
|
496
|
-
โ
|
|
497
|
-
โ
|
|
498
|
-
|
|
499
|
-
โ
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
โ
|
|
530
|
-
|
|
531
|
-
โ
|
|
532
|
-
|
|
533
|
-
โ
|
|
534
|
-
โ โโโ
|
|
535
|
-
โ
|
|
536
|
-
โ
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
-
|
|
548
|
-
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
|
647
|
-
|
|
648
|
-
| `
|
|
649
|
-
|
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
###
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
#
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
#
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
**
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
**
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
**
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
**
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
**Q:
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
- `
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
npx claudeos-core init
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
**What
|
|
873
|
-
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
-
|
|
881
|
-
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
โโโ
|
|
886
|
-
โโโ
|
|
887
|
-
โ โโโ
|
|
888
|
-
โ
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
โโโ
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
**
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
**
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
**
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
1
|
+
# ClaudeOS-Core
|
|
2
|
+
|
|
3
|
+
**The only tool that reads your source code first, confirms your stack and patterns with deterministic analysis, then generates Claude Code rules tailored to your exact project.**
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npx claudeos-core init
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
ClaudeOS-Core reads your codebase, extracts every pattern it finds, and generates a complete set of Standards, Rules, Skills, and Guides tailored to _your_ project. After that, when you tell Claude Code "Create a CRUD for orders", it produces code that matches your existing patterns exactly.
|
|
10
|
+
|
|
11
|
+
[๐ฐ๐ท ํ๊ตญ์ด](./README.ko.md) ยท [๐จ๐ณ ไธญๆ](./README.zh-CN.md) ยท [๐ฏ๐ต ๆฅๆฌ่ช](./README.ja.md) ยท [๐ช๐ธ Espaรฑol](./README.es.md) ยท [๐ป๐ณ Tiแบฟng Viแปt](./README.vi.md) ยท [๐ฎ๐ณ เคนเคฟเคจเฅเคฆเฅ](./README.hi.md) ยท [๐ท๐บ ะ ัััะบะธะน](./README.ru.md) ยท [๐ซ๐ท Franรงais](./README.fr.md) ยท [๐ฉ๐ช Deutsch](./README.de.md)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Why ClaudeOS-Core?
|
|
16
|
+
|
|
17
|
+
Every other Claude Code tool works like this:
|
|
18
|
+
|
|
19
|
+
> **Human describes the project โ LLM generates documentation**
|
|
20
|
+
|
|
21
|
+
ClaudeOS-Core works like this:
|
|
22
|
+
|
|
23
|
+
> **Code analyzes your source โ Code builds a tailored prompt โ LLM generates documentation โ Code verifies the output**
|
|
24
|
+
|
|
25
|
+
This is not a small difference. Here's why it matters:
|
|
26
|
+
|
|
27
|
+
### The core problem: LLMs guess. Code doesn't.
|
|
28
|
+
|
|
29
|
+
When you ask Claude to "analyze this project," it **guesses** your stack, your ORM, your domain structure.
|
|
30
|
+
It might see `spring-boot` in your `build.gradle` but miss that you use MyBatis (not JPA).
|
|
31
|
+
It might detect a `user/` directory but not realize your project uses layer-first packaging (Pattern A), not domain-first (Pattern B).
|
|
32
|
+
|
|
33
|
+
**ClaudeOS-Core doesn't guess.** Before Claude ever sees your project, Node.js code has already:
|
|
34
|
+
|
|
35
|
+
- Parsed `build.gradle` / `package.json` / `pyproject.toml` and **confirmed** your stack, ORM, DB, and package manager
|
|
36
|
+
- Scanned your directory structure and **confirmed** your domain list with file counts
|
|
37
|
+
- Classified your project structure into one of 5 Java patterns, Kotlin CQRS/BFF, or Next.js App Router/FSD
|
|
38
|
+
- Split domains into optimally-sized groups that fit Claude's context window
|
|
39
|
+
- Assembled a stack-specific prompt with all confirmed facts injected
|
|
40
|
+
|
|
41
|
+
By the time Claude receives the prompt, there's nothing left to guess. The stack is confirmed. The domains are confirmed. The structure pattern is confirmed. Claude's only job is to generate documentation that matches these **confirmed facts**.
|
|
42
|
+
|
|
43
|
+
### The result
|
|
44
|
+
|
|
45
|
+
Other tools produce "generally good" documentation.
|
|
46
|
+
ClaudeOS-Core produces documentation that knows your project uses `ApiResponse.ok()` (not `ResponseEntity.success()`), that your MyBatis XML mappers live in `src/main/resources/mybatis/mappers/`, and that your package structure is `com.company.module.{domain}.controller` โ because it read your actual code.
|
|
47
|
+
|
|
48
|
+
### Before & After
|
|
49
|
+
|
|
50
|
+
**Without ClaudeOS-Core** โ you ask Claude Code to create an Order CRUD:
|
|
51
|
+
```
|
|
52
|
+
โ Uses JPA-style repository (your project uses MyBatis)
|
|
53
|
+
โ Creates ResponseEntity.success() (your wrapper is ApiResponse.ok())
|
|
54
|
+
โ Places files in order/controller/ (your project uses controller/order/)
|
|
55
|
+
โ Generates English comments (your team writes Korean comments)
|
|
56
|
+
โ You spend 20 minutes fixing every generated file
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**With ClaudeOS-Core** โ `.claude/rules/` already contains your confirmed patterns:
|
|
60
|
+
```
|
|
61
|
+
โ
Generates MyBatis mapper + XML (detected from build.gradle)
|
|
62
|
+
โ
Uses ApiResponse.ok() (extracted from your actual source)
|
|
63
|
+
โ
Places files in controller/order/ (Pattern A confirmed by structure scan)
|
|
64
|
+
โ
Korean comments (--lang ko applied)
|
|
65
|
+
โ Generated code matches your project conventions immediately
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
This difference compounds. 10 tasks/day ร 20 minutes saved = **3+ hours/day**.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Post-Generation Quality Assurance (v2.3.0)
|
|
73
|
+
|
|
74
|
+
Generation is only half the problem. The other half is **knowing the output is correct** โ across 10 output languages, across 11 stack templates, across projects of any size. v2.3.0 adds two deterministic validators that run after generation and do not depend on LLM self-checks:
|
|
75
|
+
|
|
76
|
+
### `claude-md-validator` โ structural invariants
|
|
77
|
+
|
|
78
|
+
Every generated `CLAUDE.md` is checked against 25 structural invariants that use only language-invariant signals: markdown syntax (`^## `, `^### `), literal file names (`decision-log.md`, `failure-patterns.md` โ never translated), section counts, sub-section counts per section, and table-row counts. The same validator, byte-for-byte, produces identical verdicts on a `CLAUDE.md` generated in English, Korean, Japanese, Vietnamese, Hindi, Russian, Spanish, Chinese, French, or German.
|
|
79
|
+
|
|
80
|
+
The cross-language guarantee is verified by test fixtures in all 10 languages, including bad-case fixtures in 6 of those languages that produce identical error signatures. When an invariant fails on a Vietnamese project, the fix is the same as when it fails on a German project.
|
|
81
|
+
|
|
82
|
+
### `content-validator [10/10]` โ path-claim verification and MANIFEST consistency
|
|
83
|
+
|
|
84
|
+
Reads every backticked path reference (`src/...`, `.claude/rules/...`, `claudeos-core/skills/...`) from all generated `.md` files and verifies them against the actual file system. Catches two classes of LLM failure that no tool detected before:
|
|
85
|
+
|
|
86
|
+
- **`STALE_PATH`** โ when Pass 3 or Pass 4 fabricates a plausible-but-nonexistent path. Typical cases: inferring `featureRoutePath.ts` from a TypeScript constant named `FEATURE_ROUTE_PATH` when the actual file is `routePath.ts`; assuming `src/main.tsx` from Vite convention in a multi-entry project; assuming `src/__mocks__/handlers.ts` from MSW documentation even when the project has no tests.
|
|
87
|
+
- **`MANIFEST_DRIFT`** โ when `claudeos-core/skills/00.shared/MANIFEST.md` registers a skill that `CLAUDE.md ยง6` doesn't mention (or vice versa). Recognizes the common orchestrator + sub-skills layout where `CLAUDE.md ยง6` is an entry point and `MANIFEST.md` is the full registry โ sub-skills are considered covered via their parent orchestrator.
|
|
88
|
+
|
|
89
|
+
The validator is paired with prompt-time prevention in `pass3-footer.md` and `pass4.md`: anti-pattern blocks documenting the specific hallucination classes (parent-directory prefix, Vite/MSW/Vitest/Jest/RTL library conventions), and explicit positive guidance to scope rules by directory when a concrete filename isn't in `pass3a-facts.md`.
|
|
90
|
+
|
|
91
|
+
### Run validation on any project
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
npx claudeos-core health # all validators โ single go/no-go verdict
|
|
95
|
+
npx claudeos-core lint # CLAUDE.md structural invariants only (any language)
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Real-world verification
|
|
99
|
+
|
|
100
|
+
v2.3.0 was validated end-to-end on two real-world Korean sibling projects before release: a single-SPA Vite + React 19 frontend with 14 domains and an 8-sub-skill `scaffold-page-feature` orchestrator, and a Spring Boot + MyBatis backend with 8 domains and an 8-sub-skill `scaffold-crud-feature` orchestrator undergoing a PostgreSQL โ MariaDB migration. Both settled at **0 errors, 0 warnings** on the full health check โ `STALE_PATH` 0, `MANIFEST_DRIFT` 0, 25/25 structural invariants passing โ without any manual edits to the generated output.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Supported Stacks
|
|
105
|
+
|
|
106
|
+
| Stack | Detection | Analysis Depth |
|
|
107
|
+
|---|---|---|
|
|
108
|
+
| **Java / Spring Boot** | `build.gradle`, `pom.xml`, 5 package patterns | 10 categories, 59 sub-items |
|
|
109
|
+
| **Kotlin / Spring Boot** | `build.gradle.kts`, kotlin plugin, `settings.gradle.kts`, CQRS/BFF auto-detect | 12 categories, 95 sub-items |
|
|
110
|
+
| **Node.js / Express** | `package.json` | 9 categories, 57 sub-items |
|
|
111
|
+
| **Node.js / NestJS** | `package.json` (`@nestjs/core`) | 10 categories, 68 sub-items |
|
|
112
|
+
| **Next.js / React** | `package.json`, `next.config.*`, FSD support | 9 categories, 55 sub-items |
|
|
113
|
+
| **Vue / Nuxt** | `package.json`, `nuxt.config.*`, Composition API | 9 categories, 58 sub-items |
|
|
114
|
+
| **Python / Django** | `requirements.txt`, `pyproject.toml` | 10 categories, 55 sub-items |
|
|
115
|
+
| **Python / FastAPI** | `requirements.txt`, `pyproject.toml` | 10 categories, 58 sub-items |
|
|
116
|
+
| **Node.js / Fastify** | `package.json` | 10 categories, 62 sub-items |
|
|
117
|
+
| **Vite / React SPA** | `package.json`, `vite.config.*` | 9 categories, 55 sub-items |
|
|
118
|
+
| **Angular** | `package.json`, `angular.json` | 12 categories, 78 sub-items |
|
|
119
|
+
|
|
120
|
+
Auto-detected: language & version, framework & version (including Vite as SPA framework), ORM (MyBatis, JPA, Exposed, Prisma, TypeORM, SQLAlchemy, etc.), database (PostgreSQL, MySQL, Oracle, MongoDB, SQLite), package manager (Gradle, Maven, npm, yarn, pnpm, pip, poetry), architecture (CQRS, BFF โ from module names), multi-module structure (from settings.gradle), monorepo (Turborepo, pnpm-workspace, Lerna, npm/yarn workspaces), **runtime configuration from `.env.example`** (v2.2.0 โ port/host/API-target across 16+ convention variable names for Vite, Next.js, Nuxt, Angular, Node, Python frameworks).
|
|
121
|
+
|
|
122
|
+
**You don't specify anything. It's all detected automatically.**
|
|
123
|
+
|
|
124
|
+
### `.env`-driven runtime configuration (v2.2.0)
|
|
125
|
+
|
|
126
|
+
v2.2.0 adds `lib/env-parser.js` so generated `CLAUDE.md` reflects what the project actually declares rather than framework defaults.
|
|
127
|
+
|
|
128
|
+
- **Search order**: `.env.example` (canonical, committed) โ `.env.local.example` โ `.env.sample` โ `.env.template` โ `.env` โ `.env.local` โ `.env.development`. The `.example` variant wins because it is the developer-neutral shape-of-truth, not one contributor's local overrides.
|
|
129
|
+
- **Port variable conventions recognised**: `VITE_PORT` / `VITE_DEV_PORT` / `VITE_DESKTOP_PORT` / `NEXT_PUBLIC_PORT` / `NUXT_PORT` / `NG_PORT` / `APP_PORT` / `SERVER_PORT` / `HTTP_PORT` / `DEV_PORT` / `FLASK_RUN_PORT` / `UVICORN_PORT` / `DJANGO_PORT` / generic `PORT`. Framework-specific names win over the generic `PORT` when both are present.
|
|
130
|
+
- **Host & API target**: `VITE_DEV_HOST` / `VITE_API_TARGET` / `NEXT_PUBLIC_API_URL` / `NUXT_PUBLIC_API_BASE` / `BACKEND_URL` / `PROXY_TARGET` etc.
|
|
131
|
+
- **Precedence**: Spring Boot `application.yml` `server.port` still wins (framework-native config), then `.env`-declared port, then framework default (Vite 5173, Next.js 3000, Django 8000, etc.) as last resort.
|
|
132
|
+
- **Sensitive-variable redaction**: values of variables matching `PASSWORD` / `SECRET` / `TOKEN` / `API_KEY` / `ACCESS_KEY` / `PRIVATE_KEY` / `CREDENTIAL` / `JWT_SECRET` / `CLIENT_SECRET` / `SESSION_SECRET` / `BEARER` / `SALT` patterns are replaced with `***REDACTED***` before reaching any downstream generator. Defense-in-depth against accidentally committed secrets in `.env.example`. `DATABASE_URL` is explicitly whitelisted for stack-detector DB-identification back-compat.
|
|
133
|
+
|
|
134
|
+
### Java Domain Detection (5 patterns with fallback)
|
|
135
|
+
|
|
136
|
+
| Priority | Pattern | Structure | Example |
|
|
137
|
+
|---|---|---|---|
|
|
138
|
+
| A | Layer-first | `controller/{domain}/` | `controller/user/UserController.java` |
|
|
139
|
+
| B | Domain-first | `{domain}/controller/` | `user/controller/UserController.java` |
|
|
140
|
+
| D | Module prefix | `{module}/{domain}/controller/` | `front/member/controller/MemberController.java` |
|
|
141
|
+
| E | DDD/Hexagonal | `{domain}/adapter/in/web/` | `user/adapter/in/web/UserController.java` |
|
|
142
|
+
| C | Flat | `controller/*.java` | `controller/UserController.java` โ extracts `user` from class name |
|
|
143
|
+
|
|
144
|
+
Service-only domains (without controllers) are also detected via `service/`, `dao/`, `aggregator/`, `facade/`, `usecase/`, `orchestrator/`, `mapper/`, `repository/` directories. Skips: `common`, `config`, `util`, `core`, `front`, `admin`, `v1`, `v2`, etc.
|
|
145
|
+
|
|
146
|
+
### Kotlin Multi-Module Domain Detection
|
|
147
|
+
|
|
148
|
+
For Kotlin projects with Gradle multi-module structure (e.g., CQRS monorepo):
|
|
149
|
+
|
|
150
|
+
| Step | What It Does | Example |
|
|
151
|
+
|---|---|---|
|
|
152
|
+
| 1 | Scan `settings.gradle.kts` for `include()` | Finds 14 modules |
|
|
153
|
+
| 2 | Detect module type from name | `reservation-command-server` โ type: `command` |
|
|
154
|
+
| 3 | Extract domain from module name | `reservation-command-server` โ domain: `reservation` |
|
|
155
|
+
| 4 | Group same domain across modules | `reservation-command-server` + `common-query-server` โ 1 domain |
|
|
156
|
+
| 5 | Detect architecture | Has `command` + `query` modules โ CQRS |
|
|
157
|
+
|
|
158
|
+
Supported module types: `command`, `query`, `bff`, `integration`, `standalone`, `library`. Shared libraries (`shared-lib`, `integration-lib`) are detected as special domains.
|
|
159
|
+
|
|
160
|
+
### Frontend Domain Detection
|
|
161
|
+
|
|
162
|
+
- **App Router**: `app/{domain}/page.tsx` (Next.js)
|
|
163
|
+
- **Pages Router**: `pages/{domain}/index.tsx`
|
|
164
|
+
- **FSD (Feature-Sliced Design)**: `features/*/`, `widgets/*/`, `entities/*/`
|
|
165
|
+
- **RSC/Client split**: Detects `client.tsx` pattern, tracks Server/Client component separation
|
|
166
|
+
- **Non-standard nested paths**: Detects pages, components, and FSD layers under `src/*/` paths (e.g., `src/admin/pages/dashboard/`, `src/admin/components/form/`, `src/admin/features/billing/`)
|
|
167
|
+
- **Platform/tier-split detection (v2.0.0)**: Recognizes `src/{platform}/{subapp}/` layouts โ `{platform}` can be a device/target keyword (`desktop`, `pc`, `web`, `mobile`, `mc`, `mo`, `sp`, `tablet`, `tab`, `pwa`, `tv`, `ctv`, `ott`, `watch`, `wear`) or an access-tier keyword (`admin`, `cms`, `backoffice`, `back-office`, `portal`). Emits one domain per `(platform, subapp)` pair named `{platform}-{subapp}` with per-domain counts for routes/components/layouts/hooks. Runs across Angular, Next.js, React, and Vue simultaneously (multi-extension glob `{tsx,jsx,ts,js,vue}`). Requires โฅ2 source files per subapp to avoid noisy 1-file domains.
|
|
168
|
+
- **Monorepo platform split (v2.0.0)**: The platform scan also matches `{apps,packages}/*/src/{platform}/{subapp}/` (Turborepo/pnpm workspace with `src/`) and `{apps,packages}/{platform}/{subapp}/` (workspaces without `src/` wrapper).
|
|
169
|
+
- **Fallback E โ routes-file (v2.0.0)**: When primary scanners + Fallbacks AโD all return 0, globs `**/routes/*.{tsx,jsx,ts,js,vue}` and groups by the parent-of-`routes` directory name. Catches React Router file-routing projects (CRA/Vite + `react-router`) that don't match Next.js `page.tsx` or FSD layouts. Generic parent names (`src`, `app`, `pages`) are filtered out.
|
|
170
|
+
- **Config fallback**: Detects Next.js/Vite/Nuxt from config files when not in `package.json` (monorepo support)
|
|
171
|
+
- **Deep directory fallback**: For React/CRA/Vite/Vue/RN projects, scans `**/components/*/`, `**/views/*/`, `**/screens/*/`, `**/containers/*/`, `**/pages/*/`, `**/routes/*/`, `**/modules/*/`, `**/domains/*/` at any depth
|
|
172
|
+
- **Shared ignore lists (v2.0.0)**: All scanners share `BUILD_IGNORE_DIRS` (`node_modules`, `build`, `dist`, `out`, `.next`, `.nuxt`, `.svelte-kit`, `.angular`, `.turbo`, `.cache`, `.parcel-cache`, `coverage`, `storybook-static`, `.vercel`, `.netlify`) and `TEST_FILE_IGNORE` (spec/test/stories/e2e/cy + `__snapshots__`/`__tests__`) so build outputs and test fixtures don't inflate per-domain file counts.
|
|
173
|
+
|
|
174
|
+
### Scanner Overrides (v2.0.0)
|
|
175
|
+
|
|
176
|
+
Drop an optional `.claudeos-scan.json` at your project root to extend scanner defaults without editing the toolkit. All fields are **additive** โ user entries extend defaults, never replace:
|
|
177
|
+
|
|
178
|
+
```json
|
|
179
|
+
{
|
|
180
|
+
"frontendScan": {
|
|
181
|
+
"platformKeywords": ["kiosk"],
|
|
182
|
+
"skipSubappNames": ["legacy"],
|
|
183
|
+
"minSubappFiles": 3
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
| Field | Default | Purpose |
|
|
189
|
+
|---|---|---|
|
|
190
|
+
| `platformKeywords` | built-in list above | Additional `{platform}` keywords for the platform scan (e.g., `kiosk`, `vr`, `embedded`) |
|
|
191
|
+
| `skipSubappNames` | structural dirs only | Additional subapp names to exclude from platform-scan domain emission |
|
|
192
|
+
| `minSubappFiles` | `2` | Override the minimum file count required before a subapp becomes a domain |
|
|
193
|
+
|
|
194
|
+
Missing file or malformed JSON โ silently falls back to defaults (no crash). Typical use: opt-in a short abbreviation (`adm`, `bo`) that the built-in list excludes as too ambiguous, or raise `minSubappFiles` for noisy monorepos.
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Quick Start
|
|
199
|
+
|
|
200
|
+
### Prerequisites
|
|
201
|
+
|
|
202
|
+
- **Node.js** v18+
|
|
203
|
+
- **Claude Code CLI** (installed & authenticated)
|
|
204
|
+
|
|
205
|
+
### Installation
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
cd /your/project/root
|
|
209
|
+
|
|
210
|
+
# Option A: npx (recommended โ no install needed)
|
|
211
|
+
npx claudeos-core init
|
|
212
|
+
|
|
213
|
+
# Option B: global install
|
|
214
|
+
npm install -g claudeos-core
|
|
215
|
+
claudeos-core init
|
|
216
|
+
|
|
217
|
+
# Option C: project devDependency
|
|
218
|
+
npm install --save-dev claudeos-core
|
|
219
|
+
npx claudeos-core init
|
|
220
|
+
|
|
221
|
+
# Option D: git clone (for development/contribution)
|
|
222
|
+
git clone https://github.com/claudeos-core/claudeos-core.git claudeos-core-tools
|
|
223
|
+
|
|
224
|
+
# Cross-platform (PowerShell, CMD, Bash, Zsh โ any terminal)
|
|
225
|
+
node claudeos-core-tools/bin/cli.js init
|
|
226
|
+
|
|
227
|
+
# Linux/macOS (Bash only)
|
|
228
|
+
bash claudeos-core-tools/bootstrap.sh
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Output Language (10 languages)
|
|
232
|
+
|
|
233
|
+
When you run `init` without `--lang`, an interactive selector appears โ use arrow keys or number keys to choose:
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
237
|
+
โ Select generated document language (required) โ
|
|
238
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
239
|
+
|
|
240
|
+
Generated files (CLAUDE.md, Standards, Rules,
|
|
241
|
+
Skills, Guides) will be written in English.
|
|
242
|
+
|
|
243
|
+
โฏ 1. en โ English
|
|
244
|
+
2. ko โ ํ๊ตญ์ด (Korean)
|
|
245
|
+
3. zh-CN โ ็ฎไฝไธญๆ (Chinese Simplified)
|
|
246
|
+
4. ja โ ๆฅๆฌ่ช (Japanese)
|
|
247
|
+
5. es โ Espaรฑol (Spanish)
|
|
248
|
+
6. vi โ Tiแบฟng Viแปt (Vietnamese)
|
|
249
|
+
7. hi โ เคนเคฟเคจเฅเคฆเฅ (Hindi)
|
|
250
|
+
8. ru โ ะ ัััะบะธะน (Russian)
|
|
251
|
+
9. fr โ Franรงais (French)
|
|
252
|
+
10. de โ Deutsch (German)
|
|
253
|
+
|
|
254
|
+
โโ Move 1-0 Jump Enter Select ESC Cancel
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
The description changes to the selected language as you navigate. To skip the selector, pass `--lang` directly:
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
npx claudeos-core init --lang ko # Korean
|
|
261
|
+
npx claudeos-core init --lang ja # Japanese
|
|
262
|
+
npx claudeos-core init --lang en # English (default)
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
> **Note:** This sets the language for generated documentation files only. Code analysis (Pass 1โ2) always runs in English; generated output (Pass 3) is written in your chosen language. Code examples inside the generated files remain in their original programming language syntax.
|
|
266
|
+
|
|
267
|
+
That's it. After 10 minutes (small project) to 2 hours (60+ domain monorepo), all documentation is generated and ready to use. The CLI shows a progress bar with percentage, elapsed time, and ETA for each pass. See [Auto-scaling by Project Size](#auto-scaling-by-project-size) for detailed timing by project size.
|
|
268
|
+
|
|
269
|
+
### Manual Step-by-Step Installation
|
|
270
|
+
|
|
271
|
+
If you want full control over each phase โ or if the automated pipeline fails at any step โ you can run each stage manually. This is also useful for understanding how ClaudeOS-Core works internally.
|
|
272
|
+
|
|
273
|
+
#### Step 1: Clone and install dependencies
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
cd /your/project/root
|
|
277
|
+
|
|
278
|
+
git clone https://github.com/claudeos-core/claudeos-core.git claudeos-core-tools
|
|
279
|
+
cd claudeos-core-tools && npm install && cd ..
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
#### Step 2: Create directory structure
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
# Rules (v2.0.0: added 60.memory)
|
|
286
|
+
mkdir -p .claude/rules/{00.core,10.backend,20.frontend,30.security-db,40.infra,50.sync,60.memory}
|
|
287
|
+
|
|
288
|
+
# Standards
|
|
289
|
+
mkdir -p claudeos-core/standard/{00.core,10.backend-api,20.frontend-ui,30.security-db,40.infra,50.verification,90.optional}
|
|
290
|
+
|
|
291
|
+
# Skills
|
|
292
|
+
mkdir -p claudeos-core/skills/{00.shared,10.backend-crud/scaffold-crud-feature,20.frontend-page/scaffold-page-feature,50.testing,90.experimental}
|
|
293
|
+
|
|
294
|
+
# Guide, Database, MCP, Generated, Memory (v2.0.0: added memory; v2.1.0: removed plan)
|
|
295
|
+
mkdir -p claudeos-core/guide/{01.onboarding,02.usage,03.troubleshooting,04.architecture}
|
|
296
|
+
mkdir -p claudeos-core/{database,mcp-guide,generated,memory}
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
> **v2.1.0 note:** The `claudeos-core/plan/` directory is no longer created. Master plan generation was removed because master plans were an internal backup Claude Code never reads at runtime, and aggregating them triggered `Prompt is too long` failures. Use `git` for backup/restore.
|
|
300
|
+
|
|
301
|
+
#### Step 3: Run plan-installer (project analysis)
|
|
302
|
+
|
|
303
|
+
This scans your project, detects the stack, finds domains, splits them into groups, and generates prompts.
|
|
304
|
+
|
|
305
|
+
```bash
|
|
306
|
+
node claudeos-core-tools/plan-installer/index.js
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
**Output (in `claudeos-core/generated/`):**
|
|
310
|
+
- `project-analysis.json` โ detected stack, domains, frontend info
|
|
311
|
+
- `domain-groups.json` โ domain groups for Pass 1
|
|
312
|
+
- `pass1-backend-prompt.md` / `pass1-frontend-prompt.md` โ analysis prompts
|
|
313
|
+
- `pass2-prompt.md` โ merge prompt
|
|
314
|
+
- `pass3-prompt.md` โ Pass 3 prompt template with the Phase 1 "Read Once, Extract Facts" block prepended (Rules AโE). The automated pipeline splits Pass 3 into multiple stages at runtime; this template feeds each stage.
|
|
315
|
+
- `pass3-context.json` โ slim project summary (< 5 KB, built after Pass 2) that Pass 3 prompts prefer over the full `pass2-merged.json` (v2.1.0)
|
|
316
|
+
- `pass4-prompt.md` โ L4 memory scaffolding prompt (v2.0.0; uses the same `staging-override.md` for `60.memory/` rule writes)
|
|
317
|
+
|
|
318
|
+
You can inspect these files to verify detection accuracy before proceeding.
|
|
319
|
+
|
|
320
|
+
#### Step 4: Pass 1 โ Deep code analysis (per domain group)
|
|
321
|
+
|
|
322
|
+
Run Pass 1 for each domain group. Check `domain-groups.json` for the number of groups.
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
# Check how many groups
|
|
326
|
+
cat claudeos-core/generated/domain-groups.json | node -e "
|
|
327
|
+
const g = JSON.parse(require('fs').readFileSync('/dev/stdin','utf-8'));
|
|
328
|
+
g.groups.forEach((g,i) => console.log('Group '+(i+1)+': ['+g.domains.join(', ')+'] ('+g.type+', ~'+g.estimatedFiles+' files)'));
|
|
329
|
+
"
|
|
330
|
+
|
|
331
|
+
# Run Pass 1 for each group (replace domains and group number)
|
|
332
|
+
# Note: v1.6.1+ uses Node.js String.replace() instead of perl โ perl is no
|
|
333
|
+
# longer required, and replacement-function semantics prevent regex injection
|
|
334
|
+
# from $/&/$1 characters that may appear in domain names.
|
|
335
|
+
#
|
|
336
|
+
# For group 1:
|
|
337
|
+
DOMAIN_LIST="user, order, product" PASS_NUM=1 node -e "
|
|
338
|
+
const fs = require('fs');
|
|
339
|
+
const tpl = fs.readFileSync('claudeos-core/generated/pass1-backend-prompt.md','utf-8');
|
|
340
|
+
const out = tpl
|
|
341
|
+
.replace(/\{\{DOMAIN_GROUP\}\}/g, () => process.env.DOMAIN_LIST)
|
|
342
|
+
.replace(/\{\{PASS_NUM\}\}/g, () => process.env.PASS_NUM);
|
|
343
|
+
process.stdout.write(out);
|
|
344
|
+
" | claude -p --dangerously-skip-permissions
|
|
345
|
+
|
|
346
|
+
# For group 2 (if exists):
|
|
347
|
+
DOMAIN_LIST="payment, system, delivery" PASS_NUM=2 node -e "
|
|
348
|
+
const fs = require('fs');
|
|
349
|
+
const tpl = fs.readFileSync('claudeos-core/generated/pass1-backend-prompt.md','utf-8');
|
|
350
|
+
const out = tpl
|
|
351
|
+
.replace(/\{\{DOMAIN_GROUP\}\}/g, () => process.env.DOMAIN_LIST)
|
|
352
|
+
.replace(/\{\{PASS_NUM\}\}/g, () => process.env.PASS_NUM);
|
|
353
|
+
process.stdout.write(out);
|
|
354
|
+
" | claude -p --dangerously-skip-permissions
|
|
355
|
+
|
|
356
|
+
# For frontend groups, swap pass1-backend-prompt.md โ pass1-frontend-prompt.md
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
**Verify:** `ls claudeos-core/generated/pass1-*.json` should show one JSON per group.
|
|
360
|
+
|
|
361
|
+
#### Step 5: Pass 2 โ Merge analysis results
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
cat claudeos-core/generated/pass2-prompt.md \
|
|
365
|
+
| claude -p --dangerously-skip-permissions
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
**Verify:** `claudeos-core/generated/pass2-merged.json` should exist with 9+ top-level keys.
|
|
369
|
+
|
|
370
|
+
#### Step 6: Pass 3 โ Generate all documentation (split into multiple stages)
|
|
371
|
+
|
|
372
|
+
**v2.1.0 note:** Pass 3 is **always run in split mode** by the automated pipeline. Each stage is a separate `claude -p` call with a fresh context window, so output-accumulation overflow is structurally impossible regardless of project size. The `pass3-prompt.md` template is assembled per-stage with a `STAGE:` directive that tells Claude which subset of files to emit. For manual mode, the simplest path is still to feed the full template and let Claude generate everything in one call โ but this is only reliable on small projects (โค5 domains). For anything larger, use `npx claudeos-core init` so the split runner handles stage orchestration.
|
|
373
|
+
|
|
374
|
+
**Single-call mode (small projects only, โค5 domains):**
|
|
375
|
+
|
|
376
|
+
```bash
|
|
377
|
+
cat claudeos-core/generated/pass3-prompt.md \
|
|
378
|
+
| claude -p --dangerously-skip-permissions
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
**Stage-by-stage mode (recommended for all project sizes):**
|
|
382
|
+
|
|
383
|
+
The automated pipeline runs these stages. The stage list is:
|
|
384
|
+
|
|
385
|
+
| Stage | Writes | Notes |
|
|
386
|
+
|---|---|---|
|
|
387
|
+
| `3a` | `pass3a-facts.md` (5โ10 KB distilled fact sheet) | Reads `pass2-merged.json` once; later stages reference this file |
|
|
388
|
+
| `3b-core` | `CLAUDE.md`, common `standard/`, common `.claude/rules/` | Cross-project files; no domain-specific output |
|
|
389
|
+
| `3b-1..N` | Domain-specific `standard/60.domains/*.md` + domain rules | Batch of โค15 domains per stage (auto-divided at โฅ16 domains) |
|
|
390
|
+
| `3c-core` | `guide/` (9 files), `skills/00.shared/MANIFEST.md`, `skills/*/` orchestrators | Shared skills and all user-facing guides |
|
|
391
|
+
| `3c-1..N` | Domain sub-skills under `skills/20.frontend-page/scaffold-page-feature/` | Batch of โค15 domains per stage |
|
|
392
|
+
| `3d-aux` | `database/`, `mcp-guide/` | Fixed-size, independent of domain count |
|
|
393
|
+
|
|
394
|
+
For a 1โ15 domain project this expands to 4 stages (`3a`, `3b-core`, `3c-core`, `3d-aux` โ no batch sub-division). For 16โ30 domains it expands to 8 stages (`3b` and `3c` each sub-divided into 2 batches). See [Auto-scaling by Project Size](#auto-scaling-by-project-size) for the full table.
|
|
395
|
+
|
|
396
|
+
**Verify:** `CLAUDE.md` should exist in your project root, and `claudeos-core/generated/pass3-complete.json` marker should be written. In split mode, the marker contains `mode: "split"` and a `groupsCompleted` array listing every stage that finished โ the partial-marker logic uses this to resume from the right stage after a crash rather than restarting from `3a` (which would double the token cost).
|
|
397
|
+
|
|
398
|
+
> **Staging note:** Pass 3 writes rule files to `claudeos-core/generated/.staged-rules/` first because Claude Code's sensitive-path policy blocks direct writes to `.claude/`. The automated pipeline handles the move automatically after each stage. If you run a stage manually, you'll need to move the staged tree yourself: `mv claudeos-core/generated/.staged-rules/* .claude/rules/` (preserve subpaths).
|
|
399
|
+
|
|
400
|
+
#### Step 7: Pass 4 โ Memory scaffolding
|
|
401
|
+
|
|
402
|
+
```bash
|
|
403
|
+
cat claudeos-core/generated/pass4-prompt.md \
|
|
404
|
+
| claude -p --dangerously-skip-permissions
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
**Verify:** `claudeos-core/memory/` should contain 4 files (`decision-log.md`, `failure-patterns.md`, `compaction.md`, `auto-rule-update.md`), `.claude/rules/60.memory/` should contain 4 rule files, and `CLAUDE.md` should have a `## Memory (L4)` section appended. Marker: `claudeos-core/generated/pass4-memory.json`.
|
|
408
|
+
|
|
409
|
+
> **v2.1.0 gap-fill:** Pass 4 also ensures `claudeos-core/skills/00.shared/MANIFEST.md` exists. If Pass 3c omitted it (possible on skill-sparse projects because the stack `pass3.md` templates list `MANIFEST.md` among generation targets without marking it REQUIRED), the gap-fill creates a minimal stub so that `.claude/rules/50.sync/02.skills-sync.md` (v2.2.0 path โ the sync rule count was reduced from 3 to 2, so what was `03` is now `02`) always has a valid reference target. Idempotent: skips if the file already has real content (>20 chars).
|
|
410
|
+
|
|
411
|
+
> **Note:** If `claude -p` fails or `pass4-prompt.md` is missing, the automated pipeline falls back to a static scaffold via `lib/memory-scaffold.js` (with Claude-driven translation when `--lang` is non-English). The static fallback runs only inside `npx claudeos-core init` โ manual mode requires Pass 4 to succeed.
|
|
412
|
+
|
|
413
|
+
#### Step 8: Run verification tools
|
|
414
|
+
|
|
415
|
+
```bash
|
|
416
|
+
# Generate metadata (required before other checks)
|
|
417
|
+
node claudeos-core-tools/manifest-generator/index.js
|
|
418
|
+
|
|
419
|
+
# Run all checks
|
|
420
|
+
node claudeos-core-tools/health-checker/index.js
|
|
421
|
+
|
|
422
|
+
# Or run individual checks:
|
|
423
|
+
node claudeos-core-tools/plan-validator/index.js --check # Plan โ disk consistency
|
|
424
|
+
node claudeos-core-tools/sync-checker/index.js # Unregistered/orphaned files
|
|
425
|
+
node claudeos-core-tools/content-validator/index.js # File quality checks (incl. memory/ section [9/9])
|
|
426
|
+
node claudeos-core-tools/pass-json-validator/index.js # Pass 1โ4 JSON + completion marker checks
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
#### Step 9: Verify the results
|
|
430
|
+
|
|
431
|
+
```bash
|
|
432
|
+
# Count generated files
|
|
433
|
+
find .claude claudeos-core -type f | grep -v node_modules | grep -v '/generated/' | wc -l
|
|
434
|
+
|
|
435
|
+
# Check CLAUDE.md
|
|
436
|
+
head -30 CLAUDE.md
|
|
437
|
+
|
|
438
|
+
# Check a standard file
|
|
439
|
+
cat claudeos-core/standard/00.core/01.project-overview.md | head -20
|
|
440
|
+
|
|
441
|
+
# Check rules
|
|
442
|
+
ls .claude/rules/*/
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
> **Tip:** If any step fails, you can fix the issue and re-run just that step. Pass 1/2 results are cached โ if `pass1-N.json` or `pass2-merged.json` already exists, the automated pipeline skips them. Use `npx claudeos-core init --force` to delete previous results and start fresh.
|
|
446
|
+
|
|
447
|
+
### Start Using
|
|
448
|
+
|
|
449
|
+
```
|
|
450
|
+
# In Claude Code โ just ask naturally:
|
|
451
|
+
"Create a CRUD for the order domain"
|
|
452
|
+
"Add user authentication API"
|
|
453
|
+
"Refactor this code to match project patterns"
|
|
454
|
+
|
|
455
|
+
# Claude Code automatically references your generated Standards, Rules, and Skills.
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
---
|
|
459
|
+
|
|
460
|
+
## How It Works โ 4-Pass Pipeline
|
|
461
|
+
|
|
462
|
+
```
|
|
463
|
+
npx claudeos-core init
|
|
464
|
+
โ
|
|
465
|
+
โโโ [1] npm install โ Dependencies (~10s)
|
|
466
|
+
โโโ [2] Directory structure โ Create folders (~1s)
|
|
467
|
+
โโโ [3] plan-installer (Node.js) โ Project scan (~5s)
|
|
468
|
+
โ โโโ Auto-detect stack (multi-stack aware)
|
|
469
|
+
โ โโโ Extract domain list (tagged: backend/frontend)
|
|
470
|
+
โ โโโ Split into domain groups (per type)
|
|
471
|
+
โ โโโ Build pass3-context.json (slim summary, v2.1.0)
|
|
472
|
+
โ โโโ Select stack-specific prompts (per type)
|
|
473
|
+
โ
|
|
474
|
+
โโโ [4] Pass 1 ร N (claude -p) โ Deep code analysis (~2-8min)
|
|
475
|
+
โ โโโ โ๏ธ Backend groups โ backend-specific prompt
|
|
476
|
+
โ โโโ ๐จ Frontend groups โ frontend-specific prompt
|
|
477
|
+
โ
|
|
478
|
+
โโโ [5] Pass 2 ร 1 (claude -p) โ Merge analysis (~1min)
|
|
479
|
+
โ โโโ Consolidate ALL Pass 1 results into pass2-merged.json
|
|
480
|
+
โ
|
|
481
|
+
โโโ [6] Pass 3 (split mode, v2.1.0) โ Generate everything
|
|
482
|
+
โ โ
|
|
483
|
+
โ โโโ 3a ร 1 (claude -p) โ Fact extraction (~5-10min)
|
|
484
|
+
โ โ โโโ Read pass2-merged.json once โ pass3a-facts.md
|
|
485
|
+
โ โ
|
|
486
|
+
โ โโโ 3b-core ร 1 (claude -p) โ CLAUDE.md + common standard/rules
|
|
487
|
+
โ โโโ 3b-1..N ร N (claude -p) โ Domain standards/rules (โค15 domains/batch)
|
|
488
|
+
โ โ
|
|
489
|
+
โ โโโ 3c-core ร 1 (claude -p) โ Guides + shared skills + MANIFEST.md
|
|
490
|
+
โ โโโ 3c-1..N ร N (claude -p) โ Domain sub-skills (โค15 domains/batch)
|
|
491
|
+
โ โ
|
|
492
|
+
โ โโโ 3d-aux ร 1 (claude -p) โ database/ + mcp-guide/ stubs
|
|
493
|
+
โ
|
|
494
|
+
โโโ [7] Pass 4 ร 1 (claude -p) โ Memory scaffolding (~30s-5min)
|
|
495
|
+
โ โโโ Seed memory/ (decision-log, failure-patterns, โฆ)
|
|
496
|
+
โ โโโ Generate 60.memory/ rules
|
|
497
|
+
โ โโโ Append "Memory (L4)" section to CLAUDE.md
|
|
498
|
+
โ โโโ Gap-fill: ensure skills/00.shared/MANIFEST.md exists (v2.1.0)
|
|
499
|
+
โ
|
|
500
|
+
โโโ [8] Verification โ Auto-run health checker
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
### Why 4 Passes?
|
|
504
|
+
|
|
505
|
+
**Pass 1** is the only pass that reads your source code. It selects representative files per domain and extracts patterns across 55โ95 analysis categories (per stack). For large projects, Pass 1 runs multiple times โ one per domain group. In multi-stack projects (e.g., Java backend + React frontend), backend and frontend domains use **different analysis prompts** tailored to each stack.
|
|
506
|
+
|
|
507
|
+
**Pass 2** merges all Pass 1 results into a unified analysis: common patterns (100% shared), majority patterns (50%+ shared), domain-specific patterns, anti-patterns by severity, and cross-cutting concerns (naming, security, DB, testing, logging, performance). Backend and frontend results are merged together.
|
|
508
|
+
|
|
509
|
+
**Pass 3** (split mode, v2.1.0) takes the merged analysis and generates the entire file ecosystem (CLAUDE.md, rules, standards, skills, guides) across multiple sequential `claude -p` calls. The key insight is that output-accumulation overflow is not predictable from input size: single-call Pass 3 worked fine on 2-domain projects and reliably failed at ~5 domains, and the failure boundary shifted depending on how verbose each file happened to be. Split mode sidesteps this entirely โ each stage starts with a fresh context window and writes a bounded subset of files. Cross-stage consistency (which was the main advantage of the single-call approach) is preserved by `pass3a-facts.md`, a 5โ10 KB distilled fact sheet that every subsequent stage references.
|
|
510
|
+
|
|
511
|
+
The Pass 3 prompt template also includes a **Phase 1 "Read Once, Extract Facts" block** with five rules that further constrain output volume:
|
|
512
|
+
|
|
513
|
+
- **Rule A** โ Reference the fact table; don't re-read `pass2-merged.json`.
|
|
514
|
+
- **Rule B** โ Idempotent file writing (skip if target exists with real content), making Pass 3 safely re-runnable after interruption.
|
|
515
|
+
- **Rule C** โ Cross-file consistency enforced via the fact table as single source of truth.
|
|
516
|
+
- **Rule D** โ Output conciseness: one line (`[WRITE]`/`[SKIP]`) between file writes, no restating the fact table, no echoing file content.
|
|
517
|
+
- **Rule E** โ Batch idempotent check: one `Glob` at PHASE 2 start instead of per-target `Read` calls.
|
|
518
|
+
|
|
519
|
+
In **v2.2.0**, Pass 3 also inlines a deterministic CLAUDE.md scaffold (`pass-prompts/templates/common/claude-md-scaffold.md`) into the prompt. This fixes the 8 top-level section titles and order so the generated `CLAUDE.md` no longer drifts across projects, while still letting per-section content adapt to each project. The stack-detector's new `.env`-parser (`lib/env-parser.js`) supplies `stack.envInfo` to the prompt so port/host/API-target rows match what the project actually declares rather than framework defaults.
|
|
520
|
+
|
|
521
|
+
**Pass 4** scaffolds the L4 Memory layer: persistent team knowledge files (decision-log, failure-patterns, compaction policy, auto-rule-update) plus the `60.memory/` rules that tell future sessions when and how to read/write those files. The memory layer is what lets Claude Code accumulate lessons across sessions instead of re-discovering them each time. When `--lang` is non-English, the fallback static content is translated via Claude before being written. v2.1.0 adds a gap-fill for `skills/00.shared/MANIFEST.md` in case Pass 3c omitted it.
|
|
522
|
+
|
|
523
|
+
---
|
|
524
|
+
|
|
525
|
+
## Generated File Structure
|
|
526
|
+
|
|
527
|
+
```
|
|
528
|
+
your-project/
|
|
529
|
+
โ
|
|
530
|
+
โโโ CLAUDE.md โ Claude Code entry point (deterministic 8-section structure, v2.2.0)
|
|
531
|
+
โ
|
|
532
|
+
โโโ .claude/
|
|
533
|
+
โ โโโ rules/ โ Glob-triggered rules
|
|
534
|
+
โ โโโ 00.core/
|
|
535
|
+
โ โโโ 10.backend/
|
|
536
|
+
โ โโโ 20.frontend/
|
|
537
|
+
โ โโโ 30.security-db/
|
|
538
|
+
โ โโโ 40.infra/
|
|
539
|
+
โ โโโ 50.sync/ โ Sync reminder rules
|
|
540
|
+
โ โโโ 60.memory/ โ L4 memory on-demand scope rules (v2.0.0)
|
|
541
|
+
โ
|
|
542
|
+
โโโ claudeos-core/ โ Main output directory
|
|
543
|
+
โ โโโ generated/ โ Analysis JSON + dynamic prompts + Pass markers (gitignore this)
|
|
544
|
+
โ โ โโโ project-analysis.json โ Stack info (multi-stack aware)
|
|
545
|
+
โ โ โโโ domain-groups.json โ Groups with type: backend/frontend
|
|
546
|
+
โ โ โโโ pass1-backend-prompt.md โ Backend analysis prompt
|
|
547
|
+
โ โ โโโ pass1-frontend-prompt.md โ Frontend analysis prompt (if detected)
|
|
548
|
+
โ โ โโโ pass2-prompt.md โ Merge prompt
|
|
549
|
+
โ โ โโโ pass2-merged.json โ Pass 2 output (consumed by Pass 3a only)
|
|
550
|
+
โ โ โโโ pass3-context.json โ Slim summary (< 5 KB) for Pass 3 (v2.1.0)
|
|
551
|
+
โ โ โโโ pass3-prompt.md โ Pass 3 prompt template (Phase 1 block prepended)
|
|
552
|
+
โ โ โโโ pass3a-facts.md โ Fact sheet written by Pass 3a, read by 3b/3c/3d (v2.1.0)
|
|
553
|
+
โ โ โโโ pass4-prompt.md โ Memory scaffolding prompt (v2.0.0)
|
|
554
|
+
โ โ โโโ pass3-complete.json โ Pass 3 completion marker (split mode: includes groupsCompleted, v2.1.0)
|
|
555
|
+
โ โ โโโ pass4-memory.json โ Pass 4 completion marker (skip on resume)
|
|
556
|
+
โ โ โโโ rule-manifest.json โ File index for verification tools
|
|
557
|
+
โ โ โโโ sync-map.json โ Plan โ disk mapping (empty in v2.1.0; kept for sync-checker compat)
|
|
558
|
+
โ โ โโโ stale-report.json โ Consolidated verification results
|
|
559
|
+
โ โ โโโ .i18n-cache-<lang>.json โ Translation cache (non-English `--lang`)
|
|
560
|
+
โ โ โโโ .staged-rules/ โ Transient staging dir for `.claude/rules/` writes (auto-moved + cleaned)
|
|
561
|
+
โ โโโ standard/ โ Coding standards (15-19 files + per-domain in 60.domains/)
|
|
562
|
+
โ โ โโโ 00.core/ โ Overview, architecture, naming
|
|
563
|
+
โ โ โโโ 10.backend-api/ โ API patterns (stack-specific)
|
|
564
|
+
โ โ โโโ 20.frontend-ui/ โ Frontend patterns (if detected)
|
|
565
|
+
โ โ โโโ 30.security-db/ โ Security, DB schema, utilities
|
|
566
|
+
โ โ โโโ 40.infra/ โ Config, logging, CI/CD
|
|
567
|
+
โ โ โโโ 50.verification/ โ Build verification, testing
|
|
568
|
+
โ โ โโโ 60.domains/ โ Per-domain standards (written by Pass 3b-N, v2.1.0)
|
|
569
|
+
โ โ โโโ 90.optional/ โ Optional conventions (stack-specific extras)
|
|
570
|
+
โ โโโ skills/ โ CRUD/page scaffolding skills
|
|
571
|
+
โ โ โโโ 00.shared/MANIFEST.md โ Single source of truth for registered skills
|
|
572
|
+
โ โโโ guide/ โ Onboarding, FAQ, troubleshooting (9 files)
|
|
573
|
+
โ โโโ database/ โ DB schema, migration guide
|
|
574
|
+
โ โโโ mcp-guide/ โ MCP server integration guide
|
|
575
|
+
โ โโโ memory/ โ L4: team knowledge (4 files) โ commit these
|
|
576
|
+
โ โโโ decision-log.md โ "Why" behind design decisions
|
|
577
|
+
โ โโโ failure-patterns.md โ Recurring errors & fixes (auto-scored โ `npx claudeos-core memory score`)
|
|
578
|
+
โ โโโ compaction.md โ 4-stage compaction strategy (run `npx claudeos-core memory compact`)
|
|
579
|
+
โ โโโ auto-rule-update.md โ Rule improvement proposals (`npx claudeos-core memory propose-rules`)
|
|
580
|
+
โ
|
|
581
|
+
โโโ claudeos-core-tools/ โ This toolkit (don't modify)
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
Every standard file includes โ
correct examples, โ incorrect examples, and a rules summary table โ all derived from your actual code patterns, not generic templates.
|
|
585
|
+
|
|
586
|
+
> **v2.1.0 note:** `claudeos-core/plan/` is no longer generated. Master plans were an internal backup that Claude Code didn't consume at runtime, and aggregating them in Pass 3 was a primary cause of output-accumulation overflow. Use `git` for backup/restore instead. Projects upgrading from v2.0.x can safely delete any existing `claudeos-core/plan/` directory.
|
|
587
|
+
|
|
588
|
+
### Gitignore recommendations
|
|
589
|
+
|
|
590
|
+
**Do commit** (team knowledge โ meant to be shared):
|
|
591
|
+
- `CLAUDE.md` โ Claude Code entry point
|
|
592
|
+
- `.claude/rules/**` โ auto-loaded rules
|
|
593
|
+
- `claudeos-core/standard/**`, `skills/**`, `guide/**`, `database/**`, `mcp-guide/**`, `plan/**` โ generated documentation
|
|
594
|
+
- `claudeos-core/memory/**` โ decision history, failure patterns, rule proposals
|
|
595
|
+
|
|
596
|
+
**Do NOT commit** (regeneratable build artifacts):
|
|
597
|
+
|
|
598
|
+
```gitignore
|
|
599
|
+
# ClaudeOS-Core โ generated analysis & translation cache
|
|
600
|
+
claudeos-core/generated/
|
|
601
|
+
```
|
|
602
|
+
|
|
603
|
+
The `generated/` directory contains analysis JSON (`pass1-*.json`, `pass2-merged.json`), prompts (`pass1/2/3/4-prompt.md`), Pass completion markers (`pass3-complete.json`, `pass4-memory.json`), translation cache (`.i18n-cache-<lang>.json`), and the transient staging directory (`.staged-rules/`) โ all rebuildable by re-running `npx claudeos-core init`.
|
|
604
|
+
|
|
605
|
+
---
|
|
606
|
+
|
|
607
|
+
## Auto-scaling by Project Size
|
|
608
|
+
|
|
609
|
+
Pass 3's split mode scales stage count with domain count. The batch sub-division kicks in at 16 domains to keep each stage under ~50 files of output, which is the empirical safe range for `claude -p` before output-accumulation overflow starts.
|
|
610
|
+
|
|
611
|
+
| Project Size | Domains | Pass 3 Stages | Total `claude -p` | Est. Time |
|
|
612
|
+
|---|---|---|---|---|
|
|
613
|
+
| Small | 1โ4 | 4 (`3a`, `3b-core`, `3c-core`, `3d-aux`) | 7 (Pass 1 + 2 + 4 stages of Pass 3 + Pass 4) | ~10โ15 min |
|
|
614
|
+
| Medium | 5โ15 | 4 | 8โ9 | ~25โ45 min |
|
|
615
|
+
| Large | 16โ30 | **8** (3b, 3c each split into 2 batches) | 11โ12 | **~60โ105 min** |
|
|
616
|
+
| X-Large | 31โ45 | 10 | 13โ14 | ~100โ150 min |
|
|
617
|
+
| XX-Large | 46โ60 | 12 | 15โ16 | ~150โ200 min |
|
|
618
|
+
| XXX-Large | 61+ | 14+ | 17+ | 200 min+ |
|
|
619
|
+
|
|
620
|
+
Stage count formula (when batched): `1 (3a) + 1 (3b-core) + N (3b-1..N) + 1 (3c-core) + N (3c-1..N) + 1 (3d-aux) = 2N + 4`, where `N = ceil(totalDomains / 15)`.
|
|
621
|
+
|
|
622
|
+
Pass 4 (memory scaffolding) adds ~30 seconds to 5 minutes on top depending on whether Claude-driven generation or static fallback runs. For multi-stack projects (e.g., Java + React), backend and frontend domains are counted together. A project with 6 backend + 4 frontend domains = 10 total = Medium tier.
|
|
623
|
+
|
|
624
|
+
---
|
|
625
|
+
|
|
626
|
+
## Verification Tools
|
|
627
|
+
|
|
628
|
+
ClaudeOS-Core includes 5 built-in verification tools that run automatically after generation:
|
|
629
|
+
|
|
630
|
+
```bash
|
|
631
|
+
# Run all checks at once (recommended)
|
|
632
|
+
npx claudeos-core health
|
|
633
|
+
|
|
634
|
+
# Individual commands
|
|
635
|
+
npx claudeos-core validate # Plan โ disk comparison
|
|
636
|
+
npx claudeos-core refresh # Disk โ Plan sync
|
|
637
|
+
npx claudeos-core restore # Plan โ Disk restore
|
|
638
|
+
|
|
639
|
+
# Or use node directly (git clone users)
|
|
640
|
+
node claudeos-core-tools/health-checker/index.js
|
|
641
|
+
node claudeos-core-tools/manifest-generator/index.js
|
|
642
|
+
node claudeos-core-tools/plan-validator/index.js --check
|
|
643
|
+
node claudeos-core-tools/sync-checker/index.js
|
|
644
|
+
```
|
|
645
|
+
|
|
646
|
+
| Tool | What It Does |
|
|
647
|
+
|---|---|
|
|
648
|
+
| **manifest-generator** | Builds metadata JSON (`rule-manifest.json`, `sync-map.json`, initializes `stale-report.json`); indexes 7 directories including `memory/` (`totalMemory` in summary). v2.1.0: `plan-manifest.json` is no longer generated since master plans were removed. |
|
|
649
|
+
| **plan-validator** | Validates master plan `<file>` blocks against disk for projects that still have `claudeos-core/plan/` (legacy upgrade case). v2.1.0: skips `plan-sync-status.json` emission when `plan/` is absent or empty โ `stale-report.json` still records a passing no-op. |
|
|
650
|
+
| **sync-checker** | Detects unregistered files (on disk but not in plan) and orphaned entries โ covers 7 directories (added `memory/` in v2.0.0). Exits cleanly when `sync-map.json` has no mappings (v2.1.0 default state). |
|
|
651
|
+
| **content-validator** | 10-check quality gate. Checks 1โ9 cover empty files, missing โ
/โ examples, required sections, and L4 memory scaffold integrity (decision-log heading dates, failure-pattern required fields, fence-aware parsing). **Check 10 (v2.3.0)** adds path-claim verification across all generated `.md` files and MANIFEST โ CLAUDE.md ยง6 cross-reference โ catches `STALE_PATH` (fabricated paths like `featureRoutePath.ts`, `src/__mocks__/handlers.ts`) and `MANIFEST_DRIFT` (registered skills not mentioned in CLAUDE.md or vice versa), with an orchestrator/sub-skill exception that recognizes the canonical "ยง6 entry point + MANIFEST registry" split. |
|
|
652
|
+
| **claude-md-validator (v2.3.0)** | Structural invariant check on `CLAUDE.md` using only language-invariant signals (markdown syntax, literal file names, section/sub-section/table-row counts). 25 checks, language-agnostic โ identical verdicts across all 10 output languages. Invoked via `npx claudeos-core lint`. |
|
|
653
|
+
| **pass-json-validator** | Validates Pass 1โ4 JSON structure plus the `pass3-complete.json` (split-mode shape, v2.1.0) and `pass4-memory.json` completion markers |
|
|
654
|
+
|
|
655
|
+
---
|
|
656
|
+
|
|
657
|
+
## How Claude Code Uses Your Documentation
|
|
658
|
+
|
|
659
|
+
ClaudeOS-Core generates documentation that Claude Code actually reads โ here's how:
|
|
660
|
+
|
|
661
|
+
### What Claude Code reads automatically
|
|
662
|
+
|
|
663
|
+
| File | When | Guaranteed |
|
|
664
|
+
|---|---|---|
|
|
665
|
+
| `CLAUDE.md` | Every conversation start | Always |
|
|
666
|
+
| `.claude/rules/00.core/*` | When any file is edited (`paths: ["**/*"]`) | Always |
|
|
667
|
+
| `.claude/rules/10.backend/*` | When any file is edited (`paths: ["**/*"]`) | Always |
|
|
668
|
+
| `.claude/rules/20.frontend/*` | When any frontend file is edited (scoped to component/page/style paths) | Conditional |
|
|
669
|
+
| `.claude/rules/30.security-db/*` | When any file is edited (`paths: ["**/*"]`) | Always |
|
|
670
|
+
| `.claude/rules/40.infra/*` | Only when editing config/infra files (scoped paths) | Conditional |
|
|
671
|
+
| `.claude/rules/50.sync/*` | Only when editing claudeos-core files (scoped paths) | Conditional |
|
|
672
|
+
| `.claude/rules/60.memory/*` | When `claudeos-core/memory/*` is edited (scoped to memory paths) โ instructs **how** to read/write the on-demand memory layer | Conditional (v2.0.0) |
|
|
673
|
+
|
|
674
|
+
### What Claude Code reads on-demand via rule references
|
|
675
|
+
|
|
676
|
+
Each rule file links to its corresponding standard via a `## Reference` section. Claude reads only the relevant standard for the current task:
|
|
677
|
+
|
|
678
|
+
- `claudeos-core/standard/**` โ coding patterns, โ
/โ examples, naming conventions
|
|
679
|
+
- `claudeos-core/database/**` โ DB schema (for queries, mappers, migrations)
|
|
680
|
+
- `claudeos-core/memory/**` (v2.0.0) โ L4 team knowledge layer; **not** auto-loaded (would be too noisy on every conversation). Instead, the `60.memory/*` rules tell Claude *when* to Read these files: at session start (skim recent `decision-log.md` + high-importance `failure-patterns.md`), and append-on-demand when making decisions or hitting recurring errors.
|
|
681
|
+
|
|
682
|
+
The `00.standard-reference.md` serves as a directory of all standard files for discovering standards that have no corresponding rule.
|
|
683
|
+
|
|
684
|
+
### What Claude Code does NOT read (saves context)
|
|
685
|
+
|
|
686
|
+
These folders are explicitly excluded via the `DO NOT Read` section in the standard-reference rule:
|
|
687
|
+
|
|
688
|
+
| Folder | Why excluded |
|
|
689
|
+
|---|---|
|
|
690
|
+
| `claudeos-core/plan/` | Master plan backups from legacy projects (v2.0.x and earlier). Not generated in v2.1.0. If present, Claude Code won't load it automatically โ read-on-demand only. |
|
|
691
|
+
| `claudeos-core/generated/` | Build metadata JSON, prompts, Pass markers, translation cache, `.staged-rules/`. Not for coding. |
|
|
692
|
+
| `claudeos-core/guide/` | Onboarding guides for humans. |
|
|
693
|
+
| `claudeos-core/mcp-guide/` | MCP server docs. Not for coding. |
|
|
694
|
+
| `claudeos-core/memory/` (auto-load) | **Auto-load disabled** by design โ would balloon context on every conversation. Read on-demand via the `60.memory/*` rules instead (e.g. session-start scan of `failure-patterns.md`). Always commit these files. |
|
|
695
|
+
|
|
696
|
+
---
|
|
697
|
+
|
|
698
|
+
## Daily Workflow
|
|
699
|
+
|
|
700
|
+
### After Installation
|
|
701
|
+
|
|
702
|
+
```
|
|
703
|
+
# Just use Claude Code as normal โ it references your standards automatically:
|
|
704
|
+
"Create a CRUD for the order domain"
|
|
705
|
+
"Add user profile update API"
|
|
706
|
+
"Refactor this code to match project patterns"
|
|
707
|
+
```
|
|
708
|
+
|
|
709
|
+
### After Manually Editing Standards
|
|
710
|
+
|
|
711
|
+
```bash
|
|
712
|
+
# After editing standards or rules files:
|
|
713
|
+
npx claudeos-core refresh
|
|
714
|
+
|
|
715
|
+
# Verify everything is consistent
|
|
716
|
+
npx claudeos-core health
|
|
717
|
+
```
|
|
718
|
+
|
|
719
|
+
### When Docs Get Corrupted
|
|
720
|
+
|
|
721
|
+
```bash
|
|
722
|
+
# v2.1.0 recommendation: use git to restore (since master plans are no
|
|
723
|
+
# longer generated). Commit your generated docs regularly so you can roll
|
|
724
|
+
# back specific files without regenerating:
|
|
725
|
+
git checkout HEAD -- .claude/rules/ claudeos-core/
|
|
726
|
+
|
|
727
|
+
# Legacy (v2.0.x projects with claudeos-core/plan/ still present):
|
|
728
|
+
npx claudeos-core restore
|
|
729
|
+
```
|
|
730
|
+
|
|
731
|
+
### Memory Layer Maintenance (v2.0.0)
|
|
732
|
+
|
|
733
|
+
The L4 Memory layer (`claudeos-core/memory/`) accumulates team knowledge across sessions. Three CLI subcommands keep it healthy:
|
|
734
|
+
|
|
735
|
+
```bash
|
|
736
|
+
# Compact: enforce 4-stage compaction policy (run periodically โ e.g. monthly)
|
|
737
|
+
npx claudeos-core memory compact
|
|
738
|
+
# Stage 1: summarize aged entries (>30 days, body โ one-line)
|
|
739
|
+
# Stage 2: merge duplicate headings (frequency summed, latest fix kept)
|
|
740
|
+
# Stage 3: drop low-importance + aged (importance <3 AND lastSeen >60 days)
|
|
741
|
+
# Stage 4: enforce 400-line cap per file (oldest low-importance dropped first)
|
|
742
|
+
|
|
743
|
+
# Score: re-rank failure-patterns.md entries by importance
|
|
744
|
+
npx claudeos-core memory score
|
|
745
|
+
# importance = round(frequency ร 1.5 + recency ร 5), capped at 10
|
|
746
|
+
# Run after appending several new failure patterns
|
|
747
|
+
|
|
748
|
+
# Propose-rules: surface candidate rule additions from recurring failures
|
|
749
|
+
npx claudeos-core memory propose-rules
|
|
750
|
+
# Reads failure-patterns.md entries with frequency โฅ 3
|
|
751
|
+
# Computes confidence (sigmoid on weighted evidence ร anchor multiplier)
|
|
752
|
+
# Writes proposals to memory/auto-rule-update.md (NOT auto-applied)
|
|
753
|
+
# Confidence โฅ 0.70 deserves serious review; accept โ edit rule + log decision
|
|
754
|
+
|
|
755
|
+
# v2.1.0: `memory --help` now routes to subcommand help (was showing top-level)
|
|
756
|
+
npx claudeos-core memory --help
|
|
757
|
+
```
|
|
758
|
+
|
|
759
|
+
> **v2.1.0 fixes:** `memory score` no longer leaves duplicate `importance` lines after the first run (previously the auto-scored line was added on top while the original plain line was left below). `memory compact`'s Stage 1 summary marker is now a proper markdown list item (`- _Summarized on ..._`) so it renders cleanly and is correctly re-parsed on subsequent compactions.
|
|
760
|
+
|
|
761
|
+
When to write to memory (Claude does this on-demand, but you can edit manually too):
|
|
762
|
+
- **`decision-log.md`** โ append a new entry whenever you choose between competing patterns, select a library, define a team convention, or decide NOT to do something. Append-only; never edit historical entries.
|
|
763
|
+
- **`failure-patterns.md`** โ append on the **second occurrence** of a recurring error or non-obvious root cause. First-time errors don't need an entry.
|
|
764
|
+
- `compaction.md` and `auto-rule-update.md` โ generated/managed by the CLI subcommands above; don't edit by hand.
|
|
765
|
+
|
|
766
|
+
### CI/CD Integration
|
|
767
|
+
|
|
768
|
+
```yaml
|
|
769
|
+
# GitHub Actions example
|
|
770
|
+
- run: npx claudeos-core validate
|
|
771
|
+
# Exit code 1 blocks the PR
|
|
772
|
+
|
|
773
|
+
# Optional: monthly memory housekeeping (separate cron workflow)
|
|
774
|
+
- run: npx claudeos-core memory compact
|
|
775
|
+
- run: npx claudeos-core memory score
|
|
776
|
+
```
|
|
777
|
+
|
|
778
|
+
---
|
|
779
|
+
|
|
780
|
+
## How Is This Different?
|
|
781
|
+
|
|
782
|
+
### vs Other Claude Code Tools
|
|
783
|
+
|
|
784
|
+
| | ClaudeOS-Core | Everything Claude Code (50K+ โญ) | Harness | specs-generator | Claude `/init` |
|
|
785
|
+
|---|---|---|---|---|---|
|
|
786
|
+
| **Approach** | Code analyzes first, then LLM generates | Pre-built config presets | LLM designs agent teams | LLM generates spec docs | LLM writes CLAUDE.md |
|
|
787
|
+
| **Reads your source code** | โ
Deterministic static analysis | โ | โ | โ (LLM reads) | โ (LLM reads) |
|
|
788
|
+
| **Stack detection** | Code confirms (ORM, DB, build tool, pkg manager) | N/A (stack-agnostic) | LLM guesses | LLM guesses | LLM guesses |
|
|
789
|
+
| **Domain detection** | Code confirms (Java 5 patterns, Kotlin CQRS, Next.js FSD) | N/A | LLM guesses | N/A | N/A |
|
|
790
|
+
| **Same project โ Same result** | โ
Deterministic analysis | โ
(static files) | โ (LLM varies) | โ (LLM varies) | โ (LLM varies) |
|
|
791
|
+
| **Large project handling** | Domain group splitting (4 domains / 40 files per group) | N/A | No splitting | No splitting | Context window limit |
|
|
792
|
+
| **Output** | CLAUDE.md + Rules + Standards + Skills + Guides + Plans (40-50+ files) | Agents + Skills + Commands + Hooks | Agents + Skills | 6 spec documents | CLAUDE.md (1 file) |
|
|
793
|
+
| **Output location** | `.claude/rules/` (auto-loaded by Claude Code) | `.claude/` various | `.claude/agents/` + `.claude/skills/` | `.claude/steering/` + `specs/` | `CLAUDE.md` |
|
|
794
|
+
| **Post-generation verification** | โ
5 automated validators | โ | โ | โ | โ |
|
|
795
|
+
| **Multi-language output** | โ
10 languages | โ | โ | โ | โ |
|
|
796
|
+
| **Multi-stack** | โ
Backend + Frontend simultaneous | โ Stack-agnostic | โ | โ | Partial |
|
|
797
|
+
| **Persistent memory layer** | โ
L4 โ decision log + failure patterns + auto-scored rule proposals (v2.0.0) | โ | โ | โ | โ |
|
|
798
|
+
| **Agent orchestration** | โ | โ
28 agents | โ
6 patterns | โ | โ |
|
|
799
|
+
|
|
800
|
+
### The key difference in one sentence
|
|
801
|
+
|
|
802
|
+
**Other tools give Claude "generally good instructions." ClaudeOS-Core gives Claude "instructions extracted from your actual code."**
|
|
803
|
+
|
|
804
|
+
That's why Claude Code stops generating JPA code in your MyBatis project,
|
|
805
|
+
stops using `success()` when your codebase uses `ok()`,
|
|
806
|
+
and stops creating `user/controller/` directories when your project uses `controller/user/`.
|
|
807
|
+
|
|
808
|
+
### Complementary, not competing
|
|
809
|
+
|
|
810
|
+
ClaudeOS-Core focuses on **project-specific rules and standards**.
|
|
811
|
+
Other tools focus on **agent orchestration and workflows**.
|
|
812
|
+
|
|
813
|
+
You can use ClaudeOS-Core to generate your project's rules, then use ECC or Harness on top for agent teams and workflow automation. They solve different problems.
|
|
814
|
+
|
|
815
|
+
---
|
|
816
|
+
|
|
817
|
+
## FAQ
|
|
818
|
+
|
|
819
|
+
**Q: Does it modify my source code?**
|
|
820
|
+
No. It only creates `CLAUDE.md`, `.claude/rules/`, and `claudeos-core/`. Your existing code is never modified.
|
|
821
|
+
|
|
822
|
+
**Q: How much does it cost?**
|
|
823
|
+
It calls `claude -p` several times across 4 passes. In v2.1.0 split mode, Pass 3 alone expands into 4โ14+ stages depending on project size (see [Auto-scaling](#auto-scaling-by-project-size)). A typical small project (1โ15 domains) uses 8โ9 `claude -p` calls total; an 18-domain project uses 11; a 60-domain project uses 15โ17. Each stage runs with a fresh context window โ the per-call token cost is actually lower than single-call Pass 3 was, because no stage has to hold the entire file tree in one context. When `--lang` is non-English, the static fallback path may invoke a few additional `claude -p` calls for translation; results are cached in `claudeos-core/generated/.i18n-cache-<lang>.json` so subsequent runs reuse them. This is within normal Claude Code usage.
|
|
824
|
+
|
|
825
|
+
**Q: What is Pass 3 split mode and why was it added in v2.1.0?**
|
|
826
|
+
Before v2.1.0, Pass 3 made a single `claude -p` call that had to emit the entire generated file tree (`CLAUDE.md`, standards, rules, skills, guides โ typically 30โ60 files) in one response. This worked on small projects but reliably hit `Prompt is too long` output-accumulation failures at ~5 domains. The failure was not predictable from input size โ it depended on how verbose each generated file happened to be, and could strike the same project intermittently. Split mode sidesteps the problem structurally: Pass 3 is broken into sequential stages (`3a` โ `3b-core` โ `3b-N` โ `3c-core` โ `3c-N` โ `3d-aux`), each a separate `claude -p` call with a fresh context window. Cross-stage consistency is preserved by `pass3a-facts.md`, a 5โ10 KB distilled fact sheet that every later stage references instead of re-reading `pass2-merged.json`. The `pass3-complete.json` marker carries a `groupsCompleted` array so a crash during `3c-2` resumes from `3c-2` (not from `3a`), avoiding double token cost.
|
|
827
|
+
**Q: Should I commit the generated files to Git?**
|
|
828
|
+
Yes, recommended. Your team can share the same Claude Code standards. Consider adding `claudeos-core/generated/` to `.gitignore` (analysis JSON is regeneratable).
|
|
829
|
+
|
|
830
|
+
**Q: What about mixed-stack projects (e.g., Java backend + React frontend)?**
|
|
831
|
+
Fully supported. ClaudeOS-Core auto-detects both stacks, tags domains as `backend` or `frontend`, and uses stack-specific analysis prompts for each. Pass 2 merges everything, and Pass 3 generates both backend and frontend standards across its split stages โ backend domains go into some 3b/3c batches, frontend domains into others, all referencing the same `pass3a-facts.md` for consistency.
|
|
832
|
+
|
|
833
|
+
**Q: Does it work with Turborepo / pnpm workspaces / Lerna monorepos?**
|
|
834
|
+
Yes. ClaudeOS-Core detects `turbo.json`, `pnpm-workspace.yaml`, `lerna.json`, or `package.json#workspaces` and automatically scans sub-package `package.json` files for framework/ORM/DB dependencies. Domain scanning covers `apps/*/src/` and `packages/*/src/` patterns. Run from the monorepo root.
|
|
835
|
+
|
|
836
|
+
**Q: What happens on re-run?**
|
|
837
|
+
If previous Pass 1/2 results exist, an interactive prompt lets you choose: **Continue** (resume from where it stopped) or **Fresh** (delete all and start over). Use `--force` to skip the prompt and always start fresh. In v2.1.0 split mode, Pass 3 resume works at stage granularity โ if the run crashed during `3c-2`, the next `init` resumes from `3c-2` rather than restarting from `3a` (which would double the token cost). The `pass3-complete.json` marker records `mode: "split"` plus a `groupsCompleted` array to drive this logic.
|
|
838
|
+
|
|
839
|
+
**Q: Does NestJS get its own template or use the Express one?**
|
|
840
|
+
NestJS uses a dedicated `node-nestjs` template with NestJS-specific analysis categories: `@Module`, `@Injectable`, `@Controller` decorators, Guards, Pipes, Interceptors, DI container, CQRS patterns, and `Test.createTestingModule`. Express projects use the separate `node-express` template.
|
|
841
|
+
|
|
842
|
+
**Q: What about Vue / Nuxt projects?**
|
|
843
|
+
Vue/Nuxt uses a dedicated `vue-nuxt` template covering Composition API, `<script setup>`, defineProps/defineEmits, Pinia stores, `useFetch`/`useAsyncData`, Nitro server routes, and `@nuxt/test-utils`. Next.js/React projects use the `node-nextjs` template.
|
|
844
|
+
|
|
845
|
+
**Q: Does it support Kotlin?**
|
|
846
|
+
Yes. ClaudeOS-Core auto-detects Kotlin from `build.gradle.kts` or the kotlin plugin in `build.gradle`. It uses a dedicated `kotlin-spring` template with Kotlin-specific analysis (data classes, sealed classes, coroutines, extension functions, MockK, etc.).
|
|
847
|
+
|
|
848
|
+
**Q: What about CQRS / BFF architecture?**
|
|
849
|
+
Fully supported for Kotlin multi-module projects. ClaudeOS-Core reads `settings.gradle.kts`, detects module types (command, query, bff, integration) from module names, and groups the same domain across Command/Query modules. The generated standards include separate rules for command controllers vs query controllers, BFF/Feign patterns, and inter-module communication conventions.
|
|
850
|
+
|
|
851
|
+
**Q: What about Gradle multi-module monorepos?**
|
|
852
|
+
ClaudeOS-Core scans all submodules (`**/src/main/kotlin/**/*.kt`) regardless of nesting depth. Module types are inferred from naming conventions (e.g., `reservation-command-server` โ domain: `reservation`, type: `command`). Shared libraries (`shared-lib`, `integration-lib`) are also detected.
|
|
853
|
+
|
|
854
|
+
**Q: What is the L4 Memory layer (v2.0.0)? Should I commit `claudeos-core/memory/`?**
|
|
855
|
+
Yes โ **always commit** `claudeos-core/memory/`. It's persistent team knowledge: `decision-log.md` records the *why* behind architectural choices (append-only), `failure-patterns.md` registers recurring errors with importance scores so future sessions avoid them, `compaction.md` defines the 4-stage compaction policy, and `auto-rule-update.md` collects machine-generated rule improvement proposals. Unlike rules (auto-loaded by path), memory files are **on-demand** โ Claude reads them only when the `60.memory/*` rules direct it to (e.g. session-start scan of high-importance failures). This keeps context cost low while preserving long-term knowledge.
|
|
856
|
+
|
|
857
|
+
**Q: What if Pass 4 fails?**
|
|
858
|
+
The automated pipeline (`npx claudeos-core init`) has a static fallback: if `claude -p` fails or `pass4-prompt.md` is missing, it scaffolds the memory layer directly via `lib/memory-scaffold.js`. When `--lang` is non-English, the static fallback **must** translate via the `claude` CLI โ if that fails too, the run aborts with `InitError` (no silent English fallback). Re-run when `claude` is authenticated, or use `--lang en` to skip translation. Translation results are cached in `claudeos-core/generated/.i18n-cache-<lang>.json` so subsequent runs reuse them.
|
|
859
|
+
|
|
860
|
+
**Q: What do `memory compact` / `memory score` / `memory propose-rules` do?**
|
|
861
|
+
See the [Memory Layer Maintenance](#memory-layer-maintenance-v200) section above. Short version: `compact` runs the 4-stage policy (summarize aged, merge duplicates, drop low-importance aged, enforce 400-line cap); `score` re-ranks `failure-patterns.md` by importance (frequency ร recency); `propose-rules` surfaces candidate rule additions from recurring failures into `auto-rule-update.md` (not auto-applied โ review and accept/reject manually).
|
|
862
|
+
|
|
863
|
+
**Q: Why does `--force` (or "fresh" resume mode) delete `.claude/rules/`?**
|
|
864
|
+
v2.0.0 added three Pass 3 silent-failure guards (Guard 3 covers two incomplete-output variants: H2 for `guide/` and H1 for `standard/skills`). Guard 1 ("partial staged-rules move") and Guard 3 ("incomplete output โ missing/empty guide files or missing standard sentinel / empty skills") don't depend on existing rules, but Guard 2 ("zero rules detected") does โ it fires when Claude ignored the `staging-override.md` directive and tried to write directly to `.claude/` (where Claude Code's sensitive-path policy blocks it). Stale rules from a prior run would let Guard 2 false-negative โ so `--force`/`fresh` wipes `.claude/rules/` to ensure a clean detection. **Manual edits to rule files will be lost** under `--force`/`fresh`; back them up first if needed. (v2.1.0 note: Guard 3 H1 no longer checks `plan/` since master plans are no longer generated.)
|
|
865
|
+
|
|
866
|
+
**Q: What is `claudeos-core/generated/.staged-rules/` and why does it exist?**
|
|
867
|
+
Claude Code's sensitive-path policy refuses direct writes to `.claude/` from the `claude -p` subprocess (even with `--dangerously-skip-permissions`). v2.0.0 works around this by having Pass 3/4 prompts redirect all `.claude/rules/` writes to the staging directory; the Node.js orchestrator (not subject to that policy) then moves the staged tree into `.claude/rules/` after each pass. This is transparent to the user โ the directory is auto-created, auto-cleaned, and auto-moved. If a prior run crashed mid-move, the next run wipes the staging dir before retrying. In v2.1.0 split mode, the stage runner moves staged rules to `.claude/rules/` after every stage (not just at the end), so a crash mid-Pass-3 still leaves previously completed stages' rules in place.
|
|
868
|
+
|
|
869
|
+
**Q: Can I run Pass 3 manually instead of `npx claudeos-core init`?**
|
|
870
|
+
Yes for small projects (โค5 domains) โ the single-call manual instructions in [Step 6](#step-6-pass-3--generate-all-documentation-split-into-multiple-stages) still work. For larger projects you should use `npx claudeos-core init` because the split runner is what orchestrates stage-by-stage execution with fresh contexts, handles batch sub-division at โฅ16 domains, writes the correct `pass3-complete.json` marker shape (`mode: "split"` + `groupsCompleted`), and moves staged rules between stages. Reproducing that orchestration by hand is possible but tedious. If you have a reason to run stages manually (e.g., debugging a specific stage), you can template `pass3-prompt.md` with the appropriate `STAGE:` directive and feed it to `claude -p` directly โ but remember to move `.staged-rules/` after each stage and update the marker yourself.
|
|
871
|
+
|
|
872
|
+
**Q: My project is an upgrade from v2.0.x and has an existing `claudeos-core/plan/` directory. What do I do?**
|
|
873
|
+
Nothing required โ v2.1.0 tools ignore `plan/` when it's absent or empty, and `plan-validator` still handles legacy projects with populated `plan/` directories for backward compatibility. You can safely delete `claudeos-core/plan/` if you don't need the master plan backups (git history is a better backup anyway). If you keep `plan/`, running `npx claudeos-core init` won't update it โ new content is not aggregated into master plans in v2.1.0. Verification tools handle both cases cleanly.
|
|
874
|
+
|
|
875
|
+
---
|
|
876
|
+
|
|
877
|
+
## Template Structure
|
|
878
|
+
|
|
879
|
+
```
|
|
880
|
+
pass-prompts/templates/
|
|
881
|
+
โโโ common/ # Shared header/footer + pass4 + staging-override + CLAUDE.md scaffold (v2.2.0)
|
|
882
|
+
โ โโโ header.md # Role + output-format directive (all passes)
|
|
883
|
+
โ โโโ pass3-footer.md # Post-Pass-3 health-check instruction + 5 CRITICAL guardrail blocks (v2.2.0)
|
|
884
|
+
โ โโโ pass3-phase1.md # "Read Once, Extract Facts" block with Rules A-E (v2.1.0)
|
|
885
|
+
โ โโโ pass4.md # Memory scaffolding prompt (v2.0.0)
|
|
886
|
+
โ โโโ staging-override.md # Redirects .claude/rules/** writes to .staged-rules/** (v2.0.0)
|
|
887
|
+
โ โโโ claude-md-scaffold.md # Deterministic 8-section CLAUDE.md template (v2.2.0)
|
|
888
|
+
โ โโโ lang-instructions.json # Per-language output directives (10 languages)
|
|
889
|
+
โโโ java-spring/ # Java / Spring Boot
|
|
890
|
+
โโโ kotlin-spring/ # Kotlin / Spring Boot (CQRS, BFF, multi-module)
|
|
891
|
+
โโโ node-express/ # Node.js / Express
|
|
892
|
+
โโโ node-nestjs/ # Node.js / NestJS (Module, DI, Guard, Pipe, Interceptor)
|
|
893
|
+
โโโ node-fastify/ # Node.js / Fastify
|
|
894
|
+
โโโ node-nextjs/ # Next.js / React (App Router, RSC)
|
|
895
|
+
โโโ node-vite/ # Vite SPA (React, client-side routing, VITE_ env, Vitest)
|
|
896
|
+
โโโ vue-nuxt/ # Vue / Nuxt (Composition API, Pinia, Nitro)
|
|
897
|
+
โโโ angular/ # Angular
|
|
898
|
+
โโโ python-django/ # Python / Django (DRF)
|
|
899
|
+
โโโ python-fastapi/ # Python / FastAPI
|
|
900
|
+
โโโ python-flask/ # Python / Flask (Blueprint, app factory, Jinja2)
|
|
901
|
+
```
|
|
902
|
+
|
|
903
|
+
`plan-installer` auto-detects your stack(s), then assembles type-specific prompts. NestJS, Vue/Nuxt, Vite SPA, and Flask each use dedicated templates with framework-specific analysis categories (e.g., `@Module`/`@Injectable`/Guards for NestJS; `<script setup>`/Pinia/useFetch for Vue; client-side routing/`VITE_` env for Vite; Blueprint/`app.factory`/Flask-SQLAlchemy for Flask). For multi-stack projects, separate `pass1-backend-prompt.md` and `pass1-frontend-prompt.md` are generated, while `pass3-prompt.md` combines both stacks' generation targets. In v2.1.0, the Pass 3 template is prepended with `common/pass3-phase1.md` (the "Read Once, Extract Facts" block with Rules AโE) before being sliced per split-mode stage. Pass 4 uses the shared `common/pass4.md` template (memory scaffolding) regardless of stack.
|
|
904
|
+
|
|
905
|
+
**In v2.2.0**, the Pass 3 prompt also inlines `common/claude-md-scaffold.md` (the deterministic 8-section CLAUDE.md template) between the phase1 block and the stack-specific body โ this fixes the section structure so generated CLAUDE.md files don't drift across projects while letting content adapt per-project. Templates are written **English-first**; the language injection from `lang-instructions.json` tells the LLM to translate section titles and prose at emit time into the target output language.
|
|
906
|
+
|
|
907
|
+
---
|
|
908
|
+
|
|
909
|
+
## Monorepo Support
|
|
910
|
+
|
|
911
|
+
ClaudeOS-Core automatically detects JS/TS monorepo setups and scans sub-packages for dependencies.
|
|
912
|
+
|
|
913
|
+
**Supported monorepo markers** (auto-detected):
|
|
914
|
+
- `turbo.json` (Turborepo)
|
|
915
|
+
- `pnpm-workspace.yaml` (pnpm workspaces)
|
|
916
|
+
- `lerna.json` (Lerna)
|
|
917
|
+
- `package.json#workspaces` (npm/yarn workspaces)
|
|
918
|
+
|
|
919
|
+
**Run from the monorepo root** โ ClaudeOS-Core reads `apps/*/package.json` and `packages/*/package.json` to discover framework/ORM/DB dependencies across sub-packages:
|
|
920
|
+
|
|
921
|
+
```bash
|
|
922
|
+
cd my-monorepo
|
|
923
|
+
npx claudeos-core init
|
|
924
|
+
```
|
|
925
|
+
|
|
926
|
+
**What gets detected:**
|
|
927
|
+
- Dependencies from `apps/web/package.json` (e.g., `next`, `react`) โ frontend stack
|
|
928
|
+
- Dependencies from `apps/api/package.json` (e.g., `express`, `prisma`) โ backend stack
|
|
929
|
+
- Dependencies from `packages/db/package.json` (e.g., `drizzle-orm`) โ ORM/DB
|
|
930
|
+
- Custom workspace paths from `pnpm-workspace.yaml` (e.g., `services/*`)
|
|
931
|
+
|
|
932
|
+
**Domain scanning also covers monorepo layouts:**
|
|
933
|
+
- `apps/api/src/modules/*/` and `apps/api/src/*/` for backend domains
|
|
934
|
+
- `apps/web/app/*/`, `apps/web/src/app/*/`, `apps/web/pages/*/` for frontend domains
|
|
935
|
+
- `packages/*/src/*/` for shared package domains
|
|
936
|
+
|
|
937
|
+
```
|
|
938
|
+
my-monorepo/ โ Run here: npx claudeos-core init
|
|
939
|
+
โโโ turbo.json โ Auto-detected as Turborepo
|
|
940
|
+
โโโ apps/
|
|
941
|
+
โ โโโ web/ โ Next.js detected from apps/web/package.json
|
|
942
|
+
โ โ โโโ app/dashboard/ โ Frontend domain detected
|
|
943
|
+
โ โ โโโ package.json โ { "dependencies": { "next": "^14" } }
|
|
944
|
+
โ โโโ api/ โ Express detected from apps/api/package.json
|
|
945
|
+
โ โโโ src/modules/users/ โ Backend domain detected
|
|
946
|
+
โ โโโ package.json โ { "dependencies": { "express": "^4" } }
|
|
947
|
+
โโโ packages/
|
|
948
|
+
โ โโโ db/ โ Drizzle detected from packages/db/package.json
|
|
949
|
+
โ โโโ ui/
|
|
950
|
+
โโโ package.json โ { "workspaces": ["apps/*", "packages/*"] }
|
|
951
|
+
```
|
|
952
|
+
|
|
953
|
+
> **Note:** For Kotlin/Java monorepos, multi-module detection uses `settings.gradle.kts` (see [Kotlin Multi-Module Detection](#kotlin-multi-module-domain-detection) above) and does not require JS monorepo markers.
|
|
954
|
+
|
|
955
|
+
## Troubleshooting
|
|
956
|
+
|
|
957
|
+
**"claude: command not found"** โ Claude Code CLI is not installed or not in PATH. See [Claude Code docs](https://code.claude.com/docs/en/overview).
|
|
958
|
+
|
|
959
|
+
**"npm install failed"** โ Node.js version may be too low. Requires v18+.
|
|
960
|
+
|
|
961
|
+
**"0 domains detected"** โ Your project structure may be non-standard. See the detection patterns above for your stack.
|
|
962
|
+
|
|
963
|
+
**"0 domains detected" on Kotlin project** โ Ensure your project has `build.gradle.kts` (or `build.gradle` with kotlin plugin) at the root, and source files are under `**/src/main/kotlin/`. For multi-module projects, ensure `settings.gradle.kts` contains `include()` statements. Single-module Kotlin projects (without `settings.gradle`) are also supported โ domains are extracted from package/class structure under `src/main/kotlin/`.
|
|
964
|
+
|
|
965
|
+
**"Language detected as java instead of kotlin"** โ ClaudeOS-Core checks the root `build.gradle(.kts)` first, then submodule build files. If the root build file uses `java` plugin without `kotlin`, but submodules use Kotlin, the tool checks up to 5 submodule build files as fallback. If still not detected, ensure at least one `build.gradle.kts` contains `kotlin("jvm")` or `org.jetbrains.kotlin`.
|
|
966
|
+
|
|
967
|
+
**"CQRS not detected"** โ Architecture detection relies on module names containing `command` and `query` keywords. If your modules use different naming (e.g., `write-server`, `read-server`), the CQRS architecture won't be auto-detected. You can manually adjust the generated prompts after plan-installer runs.
|
|
968
|
+
|
|
969
|
+
**"Pass 3 produced 0 rule files under .claude/rules/" (v2.0.0)** โ Guard 2 fired: Claude ignored the `staging-override.md` directive and tried to write directly to `.claude/`, where Claude Code's sensitive-path policy blocks writes. Re-run with `npx claudeos-core init --force`. If the error persists, inspect `claudeos-core/generated/pass3-prompt.md` to verify the `staging-override.md` block is at the top.
|
|
970
|
+
|
|
971
|
+
**"Pass 3 finished but N rule file(s) could not be moved from staging" (v2.0.0)** โ Guard 1 fired: the staging move hit a transient file lock (typically Windows antivirus or file-watcher). The marker is NOT written, so the next `init` run automatically retries Pass 3. Just re-run `npx claudeos-core init`.
|
|
972
|
+
|
|
973
|
+
**"Pass 3 produced CLAUDE.md and rules but N/9 guide files are missing or empty" (v2.0.0)** โ Guard 3 (H2) fired: Claude truncated mid-response after writing CLAUDE.md + rules but before finishing (or starting) the `claudeos-core/guide/` section (9 files expected). Also fires on a BOM-only or whitespace-only file (heading was written but the body was truncated). Without this guard the completion marker would still be written, leaving `guide/` permanently empty on subsequent runs. The marker is NOT written here, so the next `init` run retries Pass 3 from the same Pass 2 results. If it keeps repeating, re-run with `npx claudeos-core init --force` to regenerate from scratch.
|
|
974
|
+
|
|
975
|
+
**"Pass 3 finished but the following required output(s) are missing or empty" (v2.0.0, updated v2.1.0)** โ Guard 3 (H1) fired: Claude truncated AFTER `claudeos-core/guide/` but before (or during) `claudeos-core/standard/` or `claudeos-core/skills/`. Requirements: (a) `standard/00.core/01.project-overview.md` exists and is non-empty (sentinel written by every stack's Pass 3 prompt), (b) `skills/` has โฅ1 non-empty `.md`. `database/` and `mcp-guide/` are intentionally excluded (some stacks legitimately produce zero files). `plan/` is no longer checked as of v2.1.0 (master plans were removed). Same recovery path as Guard 3 (H2): re-run `init`, or `--force` if it persists.
|
|
976
|
+
|
|
977
|
+
**"Pass 3 split stage crashed partway through (v2.1.0)"** โ When one of the split stages (e.g., `3b-1`, `3c-2`) fails mid-run, the stage-level marker is NOT written, but completed stages ARE recorded in `pass3-complete.json.groupsCompleted`. The next `init` run reads this array and resumes from the first uncompleted stage, skipping all earlier completed work. You don't need to do anything manually โ just re-run `npx claudeos-core init`. If resume keeps failing at the same stage, inspect `claudeos-core/generated/pass3-prompt.md` for malformed content, then try `--force` for a full restart. The `pass3-complete.json` shape (`mode: "split"`, `groupsCompleted: [...]`) is stable; a missing or malformed marker causes the full Pass 3 to re-run from `3a`.
|
|
978
|
+
|
|
979
|
+
**"Pass 3 stale marker (shape mismatch) โ treating as incomplete" (v2.1.0)** โ A `pass3-complete.json` from a pre-v2.1.0 single-call run is being interpreted under the new split-mode rules. The shape check looks for `mode: "split"` and a `groupsCompleted` array; if either is missing, the marker is treated as partial and Pass 3 re-runs in split mode. If you upgraded from v2.0.x, this is expected once โ the next run will write the correct marker shape. No action needed.
|
|
980
|
+
|
|
981
|
+
**"pass2-merged.json exists but is malformed or incomplete (<5 top-level keys), re-running" (v2.0.0)** โ Info log, not an error. On resume, `init` now parses and validates `pass2-merged.json` (โฅ5 top-level keys required, mirroring `pass-json-validator`'s `INSUFFICIENT_KEYS` threshold). Skeleton `{}` or malformed JSON from a prior crashed run is automatically deleted and Pass 2 re-runs. No manual action needed โ the pipeline self-heals. If it keeps recurring, inspect `claudeos-core/generated/pass2-prompt.md` and retry with `--force`.
|
|
982
|
+
|
|
983
|
+
**"Static fallback failed while translating to lang='ko'" (v2.0.0)** โ When `--lang` is non-English, Pass 4 / static fallback / gap-fill all require `claude` CLI to translate. If translation fails (CLI not authenticated, network timeout, or strict validation rejected the output: <40% length, broken code fences, lost frontmatter, etc.), the run aborts rather than silently writing English. Fix: ensure `claude` is authenticated, or re-run with `--lang en` to skip translation.
|
|
984
|
+
|
|
985
|
+
**"pass4-memory.json exists but memory/ is empty" (v2.0.0)** โ A previous run wrote the marker but the user (or a cleanup script) deleted `claudeos-core/memory/`. The CLI auto-detects this stale marker and re-runs Pass 4 on the next `init`. No manual action needed.
|
|
986
|
+
|
|
987
|
+
**"pass4-memory.json exists but is malformed (missing passNum/memoryFiles) โ re-running Pass 4" (v2.0.0)** โ Info log, not an error. The Pass 4 marker content is now validated (`passNum === 4` + non-empty `memoryFiles` array), not just its existence. A partial Claude failure that emitted something like `{"error":"timeout"}` as the marker body would previously be accepted as success forever; now the marker is deleted and Pass 4 re-runs automatically.
|
|
988
|
+
|
|
989
|
+
**"Could not delete stale pass3-complete.json / pass4-memory.json" InitError (v2.0.0)** โ `init` detected a stale marker (Pass 3: CLAUDE.md was externally deleted; Pass 4: memory/ empty or marker body malformed) and tried to remove it, but the `unlinkSync` call failed โ typically because Windows antivirus or a file-watcher (editor, IDE indexer) is holding the file handle. Previously this was silently ignored, causing the pipeline to skip the pass and re-use the stale marker. Now it fails loudly. Fix: close any editor/AV scanner that might have the file open, then re-run `npx claudeos-core init`.
|
|
990
|
+
|
|
991
|
+
**"CLAUDEOS_SKIP_TRANSLATION=1 is set but --lang='ko' requires translation" InitError (v2.0.0)** โ You have the test-only env var `CLAUDEOS_SKIP_TRANSLATION=1` set in your shell (likely a leftover from CI/test setup) AND picked a non-English `--lang`. This env var short-circuits the translation path that Pass 4's static-fallback and gap-fill depend on for non-English output. `init` detects the conflict at language-selection time and aborts immediately (rather than crashing mid-Pass-4 with a confusing nested error). Fix: either `unset CLAUDEOS_SKIP_TRANSLATION` before running, or use `npx claudeos-core init --lang en`.
|
|
992
|
+
|
|
993
|
+
**"โ ๏ธ v2.2.0 upgrade detected" warning (v2.2.0)** โ Your existing `CLAUDE.md` was generated with a pre-v2.2.0 version. The default resume-mode regeneration will skip existing files under Rule B idempotency, so v2.2.0's structural improvements (8-section CLAUDE.md scaffold, per-file `40.infra/*` paths, `.env.example`-based port accuracy, Section 8 redesign into `Common Rules & Memory (L4)` with two sub-sections, `60.memory/*` rule row, forward-referenced `04.doc-writing-guide.md`) would NOT be applied. Fix: re-run with `npx claudeos-core init --force` โ this overwrites generated files (`CLAUDE.md`, `.claude/rules/`, `claudeos-core/standard/`, `claudeos-core/skills/`, `claudeos-core/guide/`) while preserving `claudeos-core/memory/` content (decision-log, failure-patterns entries you've accumulated are append-only and kept intact). Commit your project first if you want to diff the overwrites before accepting them.
|
|
994
|
+
|
|
995
|
+
**Port in CLAUDE.md differs from `.env.example` (v2.2.0)** โ The stack-detector's new `.env`-parser (`lib/env-parser.js`) reads `.env.example` first (canonical, committed), then `.env` variants as fallback. Port variables it recognizes include `PORT`, `VITE_PORT`, `VITE_DESKTOP_PORT`, `NEXT_PUBLIC_PORT`, `NUXT_PORT`, `DJANGO_PORT`, etc. For Spring Boot, `application.yml`'s `server.port` still takes precedence over `.env` (framework-native config wins). If your project uses an unusual env var name, either rename it to a recognized convention or raise an issue for us to extend `PORT_VAR_KEYS`. Framework defaults (Vite 5173, Next.js 3000, Django 8000) are used only when both direct detection and `.env` are silent.
|
|
996
|
+
|
|
997
|
+
**Secret values redacted as `***REDACTED***` in generated docs (v2.2.0)** โ Expected behavior. The v2.2.0 `.env`-parser automatically redacts values of variables matching `PASSWORD`/`SECRET`/`TOKEN`/`API_KEY`/`CREDENTIAL`/`PRIVATE_KEY` patterns before they reach any generator. This is defense-in-depth against accidentally committed secrets in `.env.example`. `DATABASE_URL` is kept as-is for stack-detector DB identification back-compat. If you see `***REDACTED***` somewhere in the generated `CLAUDE.md`, that's a bug โ redacted values should never reach the table; please file an issue. Non-sensitive runtime config (port, host, API target, NODE_ENV, etc.) pass through unchanged.
|
|
998
|
+
|
|
999
|
+
---
|
|
1000
|
+
|
|
1001
|
+
## Contributing
|
|
1002
|
+
|
|
1003
|
+
Contributions are welcome! Areas where help is most needed:
|
|
1004
|
+
|
|
1005
|
+
- **New stack templates** โ Ruby/Rails, Go (Gin/Fiber/Echo), PHP (Laravel/Symfony), Rust (Axum/Actix), Svelte/SvelteKit, Remix
|
|
1006
|
+
- **IDE integration** โ VS Code extension, IntelliJ plugin
|
|
1007
|
+
- **CI/CD templates** โ GitLab CI, CircleCI, Jenkins examples (GitHub Actions already shipped โ see `.github/workflows/test.yml`)
|
|
1008
|
+
- **Test coverage** โ Expanding test suite (currently 602 tests across 30 test files covering scanners, stack detection, domain grouping, plan parsing, prompt generation, CLI selectors, monorepo detection, Vite SPA detection, verification tools, L4 memory scaffold, Pass 2 resume validation, Pass 3 Guards 1/2/3 (H1 sentinel + H2 BOM-aware empty-file + strict stale-marker unlink), Pass 3 split-mode batch subdivision, Pass 3 partial-marker resume (v2.1.0), Pass 4 marker content validation + stale-marker unlink strictness + scaffoldSkillsManifest gap-fill (v2.1.0), translation env-skip guard + early fail-fast + CI workflow, staged-rules move, lang-aware translation fallback, master plan removal regression suite (v2.1.0), memory score/compact formatting regression (v2.1.0), AI Work Rules template structure, and `.env`-parser port/host/API-target extraction + sensitive-variable redaction (v2.2.0))
|
|
1009
|
+
|
|
1010
|
+
See [`CONTRIBUTING.md`](./CONTRIBUTING.md) for the full list of areas, code style, commit convention, and the step-by-step guide for adding a new stack template.
|
|
1011
|
+
|
|
1012
|
+
---
|
|
1013
|
+
|
|
1014
|
+
## Author
|
|
1015
|
+
|
|
1016
|
+
Created by **claudeos-core** โ [GitHub](https://github.com/claudeos-core) ยท [Email](mailto:claudeoscore@gmail.com)
|
|
1017
|
+
|
|
1018
|
+
## License
|
|
1019
|
+
|
|
1020
|
+
ISC
|