claudeos-core 1.6.2 โ†’ 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,710 +1,712 @@
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
- ## Supported Stacks
73
-
74
- | Stack | Detection | Analysis Depth |
75
- |---|---|---|
76
- | **Java / Spring Boot** | `build.gradle`, `pom.xml`, 5 package patterns | 10 categories, 59 sub-items |
77
- | **Kotlin / Spring Boot** | `build.gradle.kts`, kotlin plugin, `settings.gradle.kts`, CQRS/BFF auto-detect | 12 categories, 95 sub-items |
78
- | **Node.js / Express** | `package.json` | 9 categories, 57 sub-items |
79
- | **Node.js / NestJS** | `package.json` (`@nestjs/core`) | 10 categories, 68 sub-items |
80
- | **Next.js / React** | `package.json`, `next.config.*`, FSD support | 9 categories, 55 sub-items |
81
- | **Vue / Nuxt** | `package.json`, `nuxt.config.*`, Composition API | 9 categories, 58 sub-items |
82
- | **Python / Django** | `requirements.txt`, `pyproject.toml` | 10 categories, 55 sub-items |
83
- | **Python / FastAPI** | `requirements.txt`, `pyproject.toml` | 10 categories, 58 sub-items |
84
- | **Node.js / Fastify** | `package.json` | 10 categories, 62 sub-items |
85
- | **Angular** | `package.json`, `angular.json` | 12 categories, 78 sub-items |
86
-
87
- Auto-detected: language & version, framework & version, 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).
88
-
89
- **You don't specify anything. It's all detected automatically.**
90
-
91
- ### Java Domain Detection (5 patterns with fallback)
92
-
93
- | Priority | Pattern | Structure | Example |
94
- |---|---|---|---|
95
- | A | Layer-first | `controller/{domain}/` | `controller/user/UserController.java` |
96
- | B | Domain-first | `{domain}/controller/` | `user/controller/UserController.java` |
97
- | D | Module prefix | `{module}/{domain}/controller/` | `front/member/controller/MemberController.java` |
98
- | E | DDD/Hexagonal | `{domain}/adapter/in/web/` | `user/adapter/in/web/UserController.java` |
99
- | C | Flat | `controller/*.java` | `controller/UserController.java` โ†’ extracts `user` from class name |
100
-
101
- 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.
102
-
103
- ### Kotlin Multi-Module Domain Detection
104
-
105
- For Kotlin projects with Gradle multi-module structure (e.g., CQRS monorepo):
106
-
107
- | Step | What It Does | Example |
108
- |---|---|---|
109
- | 1 | Scan `settings.gradle.kts` for `include()` | Finds 14 modules |
110
- | 2 | Detect module type from name | `reservation-command-server` โ†’ type: `command` |
111
- | 3 | Extract domain from module name | `reservation-command-server` โ†’ domain: `reservation` |
112
- | 4 | Group same domain across modules | `reservation-command-server` + `common-query-server` โ†’ 1 domain |
113
- | 5 | Detect architecture | Has `command` + `query` modules โ†’ CQRS |
114
-
115
- Supported module types: `command`, `query`, `bff`, `integration`, `standalone`, `library`. Shared libraries (`shared-lib`, `integration-lib`) are detected as special domains.
116
-
117
- ### Frontend Domain Detection
118
-
119
- - **App Router**: `app/{domain}/page.tsx` (Next.js)
120
- - **Pages Router**: `pages/{domain}/index.tsx`
121
- - **FSD (Feature-Sliced Design)**: `features/*/`, `widgets/*/`, `entities/*/`
122
- - **RSC/Client split**: Detects `client.tsx` pattern, tracks Server/Client component separation
123
- - **Config fallback**: Detects Next.js/Vite/Nuxt from config files when not in `package.json` (monorepo support)
124
- - **Deep directory fallback**: For React/CRA/Vite/Vue/RN projects, scans `**/components/*/`, `**/views/*/`, `**/screens/*/`, `**/containers/*/`, `**/pages/*/`, `**/routes/*/`, `**/modules/*/`, `**/domains/*/` at any depth
125
-
126
- ---
127
-
128
- ## Quick Start
129
-
130
- ### Prerequisites
131
-
132
- - **Node.js** v18+
133
- - **Claude Code CLI** (installed & authenticated)
134
-
135
- ### Installation
136
-
137
- ```bash
138
- cd /your/project/root
139
-
140
- # Option A: npx (recommended โ€” no install needed)
141
- npx claudeos-core init
142
-
143
- # Option B: global install
144
- npm install -g claudeos-core
145
- claudeos-core init
146
-
147
- # Option C: project devDependency
148
- npm install --save-dev claudeos-core
149
- npx claudeos-core init
150
-
151
- # Option D: git clone (for development/contribution)
152
- git clone https://github.com/claudeos-core/claudeos-core.git claudeos-core-tools
153
-
154
- # Cross-platform (PowerShell, CMD, Bash, Zsh โ€” any terminal)
155
- node claudeos-core-tools/bin/cli.js init
156
-
157
- # Linux/macOS (Bash only)
158
- bash claudeos-core-tools/bootstrap.sh
159
- ```
160
-
161
- ### Output Language (10 languages)
162
-
163
- When you run `init` without `--lang`, an interactive selector appears โ€” use arrow keys or number keys to choose:
164
-
165
- ```
166
- โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
167
- โ•‘ Select generated document language (required) โ•‘
168
- โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
169
-
170
- Generated files (CLAUDE.md, Standards, Rules,
171
- Skills, Guides) will be written in English.
172
-
173
- โฏ 1. en โ€” English
174
- 2. ko โ€” ํ•œ๊ตญ์–ด (Korean)
175
- 3. zh-CN โ€” ็ฎ€ไฝ“ไธญๆ–‡ (Chinese Simplified)
176
- 4. ja โ€” ๆ—ฅๆœฌ่ชž (Japanese)
177
- 5. es โ€” Espaรฑol (Spanish)
178
- 6. vi โ€” Tiแบฟng Viแป‡t (Vietnamese)
179
- 7. hi โ€” เคนเคฟเคจเฅเคฆเฅ€ (Hindi)
180
- 8. ru โ€” ะ ัƒััะบะธะน (Russian)
181
- 9. fr โ€” Franรงais (French)
182
- 10. de โ€” Deutsch (German)
183
-
184
- โ†‘โ†“ Move 1-0 Jump Enter Select ESC Cancel
185
- ```
186
-
187
- The description changes to the selected language as you navigate. To skip the selector, pass `--lang` directly:
188
-
189
- ```bash
190
- npx claudeos-core init --lang ko # Korean
191
- npx claudeos-core init --lang ja # Japanese
192
- npx claudeos-core init --lang en # English (default)
193
- ```
194
-
195
- > **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.
196
-
197
- That's it. After 5โ€“18 minutes, all documentation is generated and ready to use. The CLI shows elapsed time per pass and total time in the completion banner.
198
-
199
- ### Manual Step-by-Step Installation
200
-
201
- 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.
202
-
203
- #### Step 1: Clone and install dependencies
204
-
205
- ```bash
206
- cd /your/project/root
207
-
208
- git clone https://github.com/claudeos-core/claudeos-core.git claudeos-core-tools
209
- cd claudeos-core-tools && npm install && cd ..
210
- ```
211
-
212
- #### Step 2: Create directory structure
213
-
214
- ```bash
215
- # Rules
216
- mkdir -p .claude/rules/{00.core,10.backend,20.frontend,30.security-db,40.infra,50.sync}
217
-
218
- # Standards
219
- mkdir -p claudeos-core/standard/{00.core,10.backend-api,20.frontend-ui,30.security-db,40.infra,50.verification,90.optional}
220
-
221
- # Skills
222
- mkdir -p claudeos-core/skills/{00.shared,10.backend-crud/scaffold-crud-feature,20.frontend-page/scaffold-page-feature,50.testing,90.experimental}
223
-
224
- # Guide, Plan, Database, MCP, Generated
225
- mkdir -p claudeos-core/guide/{01.onboarding,02.usage,03.troubleshooting,04.architecture}
226
- mkdir -p claudeos-core/{plan,database,mcp-guide,generated}
227
- ```
228
-
229
- #### Step 3: Run plan-installer (project analysis)
230
-
231
- This scans your project, detects the stack, finds domains, splits them into groups, and generates prompts.
232
-
233
- ```bash
234
- node claudeos-core-tools/plan-installer/index.js
235
- ```
236
-
237
- **Output (in `claudeos-core/generated/`):**
238
- - `project-analysis.json` โ€” detected stack, domains, frontend info
239
- - `domain-groups.json` โ€” domain groups for Pass 1
240
- - `pass1-backend-prompt.md` / `pass1-frontend-prompt.md` โ€” analysis prompts
241
- - `pass2-prompt.md` โ€” merge prompt
242
- - `pass3-prompt.md` โ€” generation prompt
243
-
244
- You can inspect these files to verify detection accuracy before proceeding.
245
-
246
- #### Step 4: Pass 1 โ€” Deep code analysis (per domain group)
247
-
248
- Run Pass 1 for each domain group. Check `domain-groups.json` for the number of groups.
249
-
250
- ```bash
251
- # Check how many groups
252
- cat claudeos-core/generated/domain-groups.json | node -e "
253
- const g = JSON.parse(require('fs').readFileSync('/dev/stdin','utf-8'));
254
- g.groups.forEach((g,i) => console.log('Group '+(i+1)+': ['+g.domains.join(', ')+'] ('+g.type+', ~'+g.estimatedFiles+' files)'));
255
- "
256
-
257
- # Run Pass 1 for each group (replace domains and group number)
258
- # For group 1:
259
- cp claudeos-core/generated/pass1-backend-prompt.md /tmp/_pass1.md
260
- DOMAIN_LIST="user, order, product" PASS_NUM=1 \
261
- perl -pi -e 's/\{\{DOMAIN_GROUP\}\}/$ENV{DOMAIN_LIST}/g; s/\{\{PASS_NUM\}\}/$ENV{PASS_NUM}/g' /tmp/_pass1.md
262
- cat /tmp/_pass1.md | claude -p --dangerously-skip-permissions
263
-
264
- # For group 2 (if exists):
265
- cp claudeos-core/generated/pass1-backend-prompt.md /tmp/_pass1.md
266
- DOMAIN_LIST="payment, system, delivery" PASS_NUM=2 \
267
- perl -pi -e 's/\{\{DOMAIN_GROUP\}\}/$ENV{DOMAIN_LIST}/g; s/\{\{PASS_NUM\}\}/$ENV{PASS_NUM}/g' /tmp/_pass1.md
268
- cat /tmp/_pass1.md | claude -p --dangerously-skip-permissions
269
-
270
- # For frontend groups, use pass1-frontend-prompt.md instead
271
- ```
272
-
273
- **Verify:** `ls claudeos-core/generated/pass1-*.json` should show one JSON per group.
274
-
275
- #### Step 5: Pass 2 โ€” Merge analysis results
276
-
277
- ```bash
278
- cat claudeos-core/generated/pass2-prompt.md \
279
- | claude -p --dangerously-skip-permissions
280
- ```
281
-
282
- **Verify:** `claudeos-core/generated/pass2-merged.json` should exist with 9+ top-level keys.
283
-
284
- #### Step 6: Pass 3 โ€” Generate all documentation
285
-
286
- ```bash
287
- cat claudeos-core/generated/pass3-prompt.md \
288
- | claude -p --dangerously-skip-permissions
289
- ```
290
-
291
- **Verify:** `CLAUDE.md` should exist in your project root.
292
-
293
- #### Step 7: Run verification tools
294
-
295
- ```bash
296
- # Generate metadata (required before other checks)
297
- node claudeos-core-tools/manifest-generator/index.js
298
-
299
- # Run all checks
300
- node claudeos-core-tools/health-checker/index.js
301
-
302
- # Or run individual checks:
303
- node claudeos-core-tools/plan-validator/index.js --check # Plan โ†” disk consistency
304
- node claudeos-core-tools/sync-checker/index.js # Unregistered/orphaned files
305
- node claudeos-core-tools/content-validator/index.js # File quality checks
306
- node claudeos-core-tools/pass-json-validator/index.js # Pass JSON format checks
307
- ```
308
-
309
- #### Step 8: Verify the results
310
-
311
- ```bash
312
- # Count generated files
313
- find .claude claudeos-core -type f | grep -v node_modules | grep -v '/generated/' | wc -l
314
-
315
- # Check CLAUDE.md
316
- head -30 CLAUDE.md
317
-
318
- # Check a standard file
319
- cat claudeos-core/standard/00.core/01.project-overview.md | head -20
320
-
321
- # Check rules
322
- ls .claude/rules/*/
323
- ```
324
-
325
- > **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.
326
-
327
- ### Start Using
328
-
329
- ```
330
- # In Claude Code โ€” just ask naturally:
331
- "Create a CRUD for the order domain"
332
- "Add user authentication API"
333
- "Refactor this code to match project patterns"
334
-
335
- # Claude Code automatically references your generated Standards, Rules, and Skills.
336
- ```
337
-
338
- ---
339
-
340
- ## How It Works โ€” 3-Pass Pipeline
341
-
342
- ```
343
- npx claudeos-core init
344
- โ”‚
345
- โ”œโ”€โ”€ [1] npm install โ† Dependencies (~10s)
346
- โ”œโ”€โ”€ [2] Directory structure โ† Create folders (~1s)
347
- โ”œโ”€โ”€ [3] plan-installer (Node.js) โ† Project scan (~5s)
348
- โ”‚ โ”œโ”€โ”€ Auto-detect stack (multi-stack aware)
349
- โ”‚ โ”œโ”€โ”€ Extract domain list (tagged: backend/frontend)
350
- โ”‚ โ”œโ”€โ”€ Split into domain groups (per type)
351
- โ”‚ โ””โ”€โ”€ Select stack-specific prompts (per type)
352
- โ”‚
353
- โ”œโ”€โ”€ [4] Pass 1 ร— N (claude -p) โ† Deep code analysis (~2-8min)
354
- โ”‚ โ”œโ”€โ”€ โš™๏ธ Backend groups โ†’ backend-specific prompt
355
- โ”‚ โ””โ”€โ”€ ๐ŸŽจ Frontend groups โ†’ frontend-specific prompt
356
- โ”‚
357
- โ”œโ”€โ”€ [5] Pass 2 ร— 1 (claude -p) โ† Merge analysis (~1min)
358
- โ”‚ โ””โ”€โ”€ Consolidate ALL Pass 1 results (backend + frontend)
359
- โ”‚
360
- โ”œโ”€โ”€ [6] Pass 3 ร— 1 (claude -p) โ† Generate everything (~3-5min)
361
- โ”‚ โ””โ”€โ”€ Combined prompt (backend + frontend targets)
362
- โ”‚
363
- โ””โ”€โ”€ [7] Verification โ† Auto-run health checker
364
- ```
365
-
366
- ### Why 3 Passes?
367
-
368
- **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.
369
-
370
- **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.
371
-
372
- **Pass 3** takes the merged analysis and generates the entire file ecosystem. It never reads source code โ€” only the analysis JSON. In multi-stack mode, the generation prompt combines backend and frontend targets so both sets of standards are generated in a single pass.
373
-
374
- ---
375
-
376
- ## Generated File Structure
377
-
378
- ```
379
- your-project/
380
- โ”‚
381
- โ”œโ”€โ”€ CLAUDE.md โ† Claude Code entry point
382
- โ”‚
383
- โ”œโ”€โ”€ .claude/
384
- โ”‚ โ””โ”€โ”€ rules/ โ† Glob-triggered rules
385
- โ”‚ โ”œโ”€โ”€ 00.core/
386
- โ”‚ โ”œโ”€โ”€ 10.backend/
387
- โ”‚ โ”œโ”€โ”€ 20.frontend/
388
- โ”‚ โ”œโ”€โ”€ 30.security-db/
389
- โ”‚ โ”œโ”€โ”€ 40.infra/
390
- โ”‚ โ””โ”€โ”€ 50.sync/ โ† Sync reminder rules
391
- โ”‚
392
- โ”œโ”€โ”€ claudeos-core/ โ† Main output directory
393
- โ”‚ โ”œโ”€โ”€ generated/ โ† Analysis JSON + dynamic prompts
394
- โ”‚ โ”‚ โ”œโ”€โ”€ project-analysis.json โ† Stack info (multi-stack aware)
395
- โ”‚ โ”‚ โ”œโ”€โ”€ domain-groups.json โ† Groups with type: backend/frontend
396
- โ”‚ โ”‚ โ”œโ”€โ”€ pass1-backend-prompt.md โ† Backend analysis prompt
397
- โ”‚ โ”‚ โ”œโ”€โ”€ pass1-frontend-prompt.md โ† Frontend analysis prompt (if detected)
398
- โ”‚ โ”‚ โ”œโ”€โ”€ pass2-prompt.md โ† Merge prompt
399
- โ”‚ โ”‚ โ””โ”€โ”€ pass3-prompt.md โ† Generation prompt (combined)
400
- โ”‚ โ”œโ”€โ”€ standard/ โ† Coding standards (15-19 files)
401
- โ”‚ โ”‚ โ”œโ”€โ”€ 00.core/ โ† Overview, architecture, naming
402
- โ”‚ โ”‚ โ”œโ”€โ”€ 10.backend-api/ โ† API patterns (stack-specific)
403
- โ”‚ โ”‚ โ”œโ”€โ”€ 20.frontend-ui/ โ† Frontend patterns (if detected)
404
- โ”‚ โ”‚ โ”œโ”€โ”€ 30.security-db/ โ† Security, DB schema, utilities
405
- โ”‚ โ”‚ โ”œโ”€โ”€ 40.infra/ โ† Config, logging, CI/CD
406
- โ”‚ โ”‚ โ””โ”€โ”€ 50.verification/ โ† Build verification, testing
407
- โ”‚ โ”œโ”€โ”€ skills/ โ† CRUD scaffolding skills
408
- โ”‚ โ”œโ”€โ”€ guide/ โ† Onboarding, FAQ, troubleshooting (9 files)
409
- โ”‚ โ”œโ”€โ”€ plan/ โ† Master plans (backup/restore)
410
- โ”‚ โ”œโ”€โ”€ database/ โ† DB schema, migration guide
411
- โ”‚ โ””โ”€โ”€ mcp-guide/ โ† MCP server integration guide
412
- โ”‚
413
- โ””โ”€โ”€ claudeos-core-tools/ โ† This toolkit (don't modify)
414
- ```
415
-
416
- Every standard file includes โœ… correct examples, โŒ incorrect examples, and a rules summary table โ€” all derived from your actual code patterns, not generic templates.
417
-
418
- ---
419
-
420
- ## Auto-scaling by Project Size
421
-
422
- | Size | Domains | Pass 1 Runs | Total `claude -p` | Est. Time |
423
- |---|---|---|---|---|
424
- | Small | 1โ€“4 | 1 | 3 | ~5min |
425
- | Medium | 5โ€“8 | 2 | 4 | ~8min |
426
- | Large | 9โ€“16 | 3โ€“4 | 5โ€“6 | ~12min |
427
- | X-Large | 17+ | 5+ | 7+ | ~18min+ |
428
-
429
- 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, scaling as "Large".
430
-
431
- ---
432
-
433
- ## Verification Tools
434
-
435
- ClaudeOS-Core includes 5 built-in verification tools that run automatically after generation:
436
-
437
- ```bash
438
- # Run all checks at once (recommended)
439
- npx claudeos-core health
440
-
441
- # Individual commands
442
- npx claudeos-core validate # Plan โ†” disk comparison
443
- npx claudeos-core refresh # Disk โ†’ Plan sync
444
- npx claudeos-core restore # Plan โ†’ Disk restore
445
-
446
- # Or use node directly (git clone users)
447
- node claudeos-core-tools/health-checker/index.js
448
- node claudeos-core-tools/manifest-generator/index.js
449
- node claudeos-core-tools/plan-validator/index.js --check
450
- node claudeos-core-tools/sync-checker/index.js
451
- ```
452
-
453
- | Tool | What It Does |
454
- |---|---|
455
- | **manifest-generator** | Builds metadata JSON (rule-manifest, sync-map, plan-manifest) |
456
- | **plan-validator** | Compares Master Plan `<file>` blocks against disk โ€” 3 modes: check, refresh, restore |
457
- | **sync-checker** | Detects unregistered files (on disk but not in plan) and orphaned entries |
458
- | **content-validator** | Validates file quality โ€” empty files, missing โœ…/โŒ examples, required sections |
459
- | **pass-json-validator** | Validates Pass 1โ€“3 JSON structure, required keys, and section completeness |
460
-
461
- ---
462
-
463
- ## How Claude Code Uses Your Documentation
464
-
465
- ClaudeOS-Core generates documentation that Claude Code actually reads โ€” here's how:
466
-
467
- ### What Claude Code reads automatically
468
-
469
- | File | When | Guaranteed |
470
- |---|---|---|
471
- | `CLAUDE.md` | Every conversation start | Always |
472
- | `.claude/rules/00.core/*` | When any file is edited (`paths: ["**/*"]`) | Always |
473
- | `.claude/rules/10.backend/*` | When any file is edited (`paths: ["**/*"]`) | Always |
474
- | `.claude/rules/30.security-db/*` | When any file is edited (`paths: ["**/*"]`) | Always |
475
- | `.claude/rules/40.infra/*` | Only when editing config/infra files (scoped paths) | Conditional |
476
- | `.claude/rules/50.sync/*` | Only when editing claudeos-core files (scoped paths) | Conditional |
477
-
478
- ### What Claude Code reads on-demand via rule references
479
-
480
- Each rule file links to its corresponding standard via a `## Reference` section. Claude reads only the relevant standard for the current task:
481
-
482
- - `claudeos-core/standard/**` โ€” coding patterns, โœ…/โŒ examples, naming conventions
483
- - `claudeos-core/database/**` โ€” DB schema (for queries, mappers, migrations)
484
-
485
- The `00.standard-reference.md` serves as a directory of all standard files for discovering standards that have no corresponding rule.
486
-
487
- ### What Claude Code does NOT read (saves context)
488
-
489
- These folders are explicitly excluded via the `DO NOT Read` section in the standard-reference rule:
490
-
491
- | Folder | Why excluded |
492
- |---|---|
493
- | `claudeos-core/plan/` | Master Plan backups (~340KB). Use `npx claudeos-core refresh` to sync. |
494
- | `claudeos-core/generated/` | Build metadata JSON. Not for coding. |
495
- | `claudeos-core/guide/` | Onboarding guides for humans. |
496
- | `claudeos-core/mcp-guide/` | MCP server docs. Not for coding. |
497
-
498
- ---
499
-
500
- ## Daily Workflow
501
-
502
- ### After Installation
503
-
504
- ```
505
- # Just use Claude Code as normal โ€” it references your standards automatically:
506
- "Create a CRUD for the order domain"
507
- "Add user profile update API"
508
- "Refactor this code to match project patterns"
509
- ```
510
-
511
- ### After Manually Editing Standards
512
-
513
- ```bash
514
- # After editing standards or rules files:
515
- npx claudeos-core refresh
516
-
517
- # Verify everything is consistent
518
- npx claudeos-core health
519
- ```
520
-
521
- ### When Docs Get Corrupted
522
-
523
- ```bash
524
- # Restore everything from Master Plan
525
- npx claudeos-core restore
526
- ```
527
-
528
- ### CI/CD Integration
529
-
530
- ```yaml
531
- # GitHub Actions example
532
- - run: npx claudeos-core validate
533
- # Exit code 1 blocks the PR
534
- ```
535
-
536
- ---
537
-
538
- ## How Is This Different?
539
-
540
- ### vs Other Claude Code Tools
541
-
542
- | | ClaudeOS-Core | Everything Claude Code (50K+ โญ) | Harness | specs-generator | Claude `/init` |
543
- |---|---|---|---|---|---|
544
- | **Approach** | Code analyzes first, then LLM generates | Pre-built config presets | LLM designs agent teams | LLM generates spec docs | LLM writes CLAUDE.md |
545
- | **Reads your source code** | โœ… Deterministic static analysis | โŒ | โŒ | โŒ (LLM reads) | โŒ (LLM reads) |
546
- | **Stack detection** | Code confirms (ORM, DB, build tool, pkg manager) | N/A (stack-agnostic) | LLM guesses | LLM guesses | LLM guesses |
547
- | **Domain detection** | Code confirms (Java 5 patterns, Kotlin CQRS, Next.js FSD) | N/A | LLM guesses | N/A | N/A |
548
- | **Same project โ†’ Same result** | โœ… Deterministic analysis | โœ… (static files) | โŒ (LLM varies) | โŒ (LLM varies) | โŒ (LLM varies) |
549
- | **Large project handling** | Domain group splitting (4 domains / 40 files per group) | N/A | No splitting | No splitting | Context window limit |
550
- | **Output** | CLAUDE.md + Rules + Standards + Skills + Guides + Plans (40-50+ files) | Agents + Skills + Commands + Hooks | Agents + Skills | 6 spec documents | CLAUDE.md (1 file) |
551
- | **Output location** | `.claude/rules/` (auto-loaded by Claude Code) | `.claude/` various | `.claude/agents/` + `.claude/skills/` | `.claude/steering/` + `specs/` | `CLAUDE.md` |
552
- | **Post-generation verification** | โœ… 5 automated validators | โŒ | โŒ | โŒ | โŒ |
553
- | **Multi-language output** | โœ… 10 languages | โŒ | โŒ | โŒ | โŒ |
554
- | **Multi-stack** | โœ… Backend + Frontend simultaneous | โŒ Stack-agnostic | โŒ | โŒ | Partial |
555
- | **Agent orchestration** | โŒ | โœ… 28 agents | โœ… 6 patterns | โŒ | โŒ |
556
-
557
- ### The key difference in one sentence
558
-
559
- **Other tools give Claude "generally good instructions." ClaudeOS-Core gives Claude "instructions extracted from your actual code."**
560
-
561
- That's why Claude Code stops generating JPA code in your MyBatis project,
562
- stops using `success()` when your codebase uses `ok()`,
563
- and stops creating `user/controller/` directories when your project uses `controller/user/`.
564
-
565
- ### Complementary, not competing
566
-
567
- ClaudeOS-Core focuses on **project-specific rules and standards**.
568
- Other tools focus on **agent orchestration and workflows**.
569
-
570
- 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.
571
-
572
- ---
573
-
574
- ## FAQ
575
-
576
- **Q: Does it modify my source code?**
577
- No. It only creates `CLAUDE.md`, `.claude/rules/`, and `claudeos-core/`. Your existing code is never modified.
578
-
579
- **Q: How much does it cost?**
580
- It calls `claude -p` 3โ€“7 times. This is within normal Claude Code usage.
581
-
582
- **Q: Should I commit the generated files to Git?**
583
- Yes, recommended. Your team can share the same Claude Code standards. Consider adding `claudeos-core/generated/` to `.gitignore` (analysis JSON is regeneratable).
584
-
585
- **Q: What about mixed-stack projects (e.g., Java backend + React frontend)?**
586
- 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 in one pass.
587
-
588
- **Q: Does it work with Turborepo / pnpm workspaces / Lerna monorepos?**
589
- 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.
590
-
591
- **Q: What happens on re-run?**
592
- 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. Pass 3 always re-runs. Previous versions can be restored from Master Plans.
593
-
594
- **Q: Does NestJS get its own template or use the Express one?**
595
- 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.
596
-
597
- **Q: What about Vue / Nuxt projects?**
598
- 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.
599
-
600
- **Q: Does it support Kotlin?**
601
- 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.).
602
-
603
- **Q: What about CQRS / BFF architecture?**
604
- 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.
605
-
606
- **Q: What about Gradle multi-module monorepos?**
607
- 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.
608
-
609
- ---
610
-
611
- ## Template Structure
612
-
613
- ```
614
- pass-prompts/templates/
615
- โ”œโ”€โ”€ common/ # Shared header/footer
616
- โ”œโ”€โ”€ java-spring/ # Java / Spring Boot
617
- โ”œโ”€โ”€ kotlin-spring/ # Kotlin / Spring Boot (CQRS, BFF, multi-module)
618
- โ”œโ”€โ”€ node-express/ # Node.js / Express
619
- โ”œโ”€โ”€ node-nestjs/ # Node.js / NestJS (Module, DI, Guard, Pipe, Interceptor)
620
- โ”œโ”€โ”€ node-fastify/ # Node.js / Fastify
621
- โ”œโ”€โ”€ node-nextjs/ # Next.js / React
622
- โ”œโ”€โ”€ vue-nuxt/ # Vue / Nuxt (Composition API, Pinia, Nitro)
623
- โ”œโ”€โ”€ angular/ # Angular
624
- โ”œโ”€โ”€ python-django/ # Python / Django (DRF)
625
- โ””โ”€โ”€ python-fastapi/ # Python / FastAPI
626
- ```
627
-
628
- `plan-installer` auto-detects your stack(s), then assembles type-specific prompts. NestJS and Vue/Nuxt use dedicated templates with framework-specific analysis categories (e.g., `@Module`/`@Injectable`/Guards for NestJS, `<script setup>`/Pinia/useFetch for Vue). 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.
629
-
630
- ---
631
-
632
- ## Monorepo Support
633
-
634
- ClaudeOS-Core automatically detects JS/TS monorepo setups and scans sub-packages for dependencies.
635
-
636
- **Supported monorepo markers** (auto-detected):
637
- - `turbo.json` (Turborepo)
638
- - `pnpm-workspace.yaml` (pnpm workspaces)
639
- - `lerna.json` (Lerna)
640
- - `package.json#workspaces` (npm/yarn workspaces)
641
-
642
- **Run from the monorepo root** โ€” ClaudeOS-Core reads `apps/*/package.json` and `packages/*/package.json` to discover framework/ORM/DB dependencies across sub-packages:
643
-
644
- ```bash
645
- cd my-monorepo
646
- npx claudeos-core init
647
- ```
648
-
649
- **What gets detected:**
650
- - Dependencies from `apps/web/package.json` (e.g., `next`, `react`) โ†’ frontend stack
651
- - Dependencies from `apps/api/package.json` (e.g., `express`, `prisma`) โ†’ backend stack
652
- - Dependencies from `packages/db/package.json` (e.g., `drizzle-orm`) โ†’ ORM/DB
653
- - Custom workspace paths from `pnpm-workspace.yaml` (e.g., `services/*`)
654
-
655
- **Domain scanning also covers monorepo layouts:**
656
- - `apps/api/src/modules/*/` and `apps/api/src/*/` for backend domains
657
- - `apps/web/app/*/`, `apps/web/src/app/*/`, `apps/web/pages/*/` for frontend domains
658
- - `packages/*/src/*/` for shared package domains
659
-
660
- ```
661
- my-monorepo/ โ† Run here: npx claudeos-core init
662
- โ”œโ”€โ”€ turbo.json โ† Auto-detected as Turborepo
663
- โ”œโ”€โ”€ apps/
664
- โ”‚ โ”œโ”€โ”€ web/ โ† Next.js detected from apps/web/package.json
665
- โ”‚ โ”‚ โ”œโ”€โ”€ app/dashboard/ โ† Frontend domain detected
666
- โ”‚ โ”‚ โ””โ”€โ”€ package.json โ† { "dependencies": { "next": "^14" } }
667
- โ”‚ โ””โ”€โ”€ api/ โ† Express detected from apps/api/package.json
668
- โ”‚ โ”œโ”€โ”€ src/modules/users/ โ† Backend domain detected
669
- โ”‚ โ””โ”€โ”€ package.json โ† { "dependencies": { "express": "^4" } }
670
- โ”œโ”€โ”€ packages/
671
- โ”‚ โ”œโ”€โ”€ db/ โ† Drizzle detected from packages/db/package.json
672
- โ”‚ โ””โ”€โ”€ ui/
673
- โ””โ”€โ”€ package.json โ† { "workspaces": ["apps/*", "packages/*"] }
674
- ```
675
-
676
- > **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.
677
-
678
- ## Troubleshooting
679
-
680
- **"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).
681
-
682
- **"npm install failed"** โ€” Node.js version may be too low. Requires v18+.
683
-
684
- **"0 domains detected"** โ€” Your project structure may be non-standard. See the detection patterns above for your stack.
685
-
686
- **"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/`.
687
-
688
- **"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`.
689
-
690
- **"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.
691
-
692
- ---
693
-
694
- ## Contributing
695
-
696
- Contributions are welcome! Areas where help is most needed:
697
-
698
- - **New stack templates** โ€” Ruby/Rails, Go/Gin, PHP/Laravel, Rust/Axum
699
- - **Monorepo deep support** โ€” Separate sub-project roots, workspace detection
700
- - **Test coverage** โ€” Expanding test suite (currently 256 tests covering all scanners, stack detection, domain grouping, plan parsing, prompt generation, CLI selectors, monorepo detection, and verification tools)
701
-
702
- ---
703
-
704
- ## Author
705
-
706
- Created by **claudeos-core** โ€” [GitHub](https://github.com/claudeos-core) ยท [Email](mailto:claudeoscore@gmail.com)
707
-
708
- ## License
709
-
710
- ISC
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
+ ## Supported Stacks
73
+
74
+ | Stack | Detection | Analysis Depth |
75
+ |---|---|---|
76
+ | **Java / Spring Boot** | `build.gradle`, `pom.xml`, 5 package patterns | 10 categories, 59 sub-items |
77
+ | **Kotlin / Spring Boot** | `build.gradle.kts`, kotlin plugin, `settings.gradle.kts`, CQRS/BFF auto-detect | 12 categories, 95 sub-items |
78
+ | **Node.js / Express** | `package.json` | 9 categories, 57 sub-items |
79
+ | **Node.js / NestJS** | `package.json` (`@nestjs/core`) | 10 categories, 68 sub-items |
80
+ | **Next.js / React** | `package.json`, `next.config.*`, FSD support | 9 categories, 55 sub-items |
81
+ | **Vue / Nuxt** | `package.json`, `nuxt.config.*`, Composition API | 9 categories, 58 sub-items |
82
+ | **Python / Django** | `requirements.txt`, `pyproject.toml` | 10 categories, 55 sub-items |
83
+ | **Python / FastAPI** | `requirements.txt`, `pyproject.toml` | 10 categories, 58 sub-items |
84
+ | **Node.js / Fastify** | `package.json` | 10 categories, 62 sub-items |
85
+ | **Vite / React SPA** | `package.json`, `vite.config.*` | 9 categories, 55 sub-items |
86
+ | **Angular** | `package.json`, `angular.json` | 12 categories, 78 sub-items |
87
+
88
+ 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).
89
+
90
+ **You don't specify anything. It's all detected automatically.**
91
+
92
+ ### Java Domain Detection (5 patterns with fallback)
93
+
94
+ | Priority | Pattern | Structure | Example |
95
+ |---|---|---|---|
96
+ | A | Layer-first | `controller/{domain}/` | `controller/user/UserController.java` |
97
+ | B | Domain-first | `{domain}/controller/` | `user/controller/UserController.java` |
98
+ | D | Module prefix | `{module}/{domain}/controller/` | `front/member/controller/MemberController.java` |
99
+ | E | DDD/Hexagonal | `{domain}/adapter/in/web/` | `user/adapter/in/web/UserController.java` |
100
+ | C | Flat | `controller/*.java` | `controller/UserController.java` โ†’ extracts `user` from class name |
101
+
102
+ 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.
103
+
104
+ ### Kotlin Multi-Module Domain Detection
105
+
106
+ For Kotlin projects with Gradle multi-module structure (e.g., CQRS monorepo):
107
+
108
+ | Step | What It Does | Example |
109
+ |---|---|---|
110
+ | 1 | Scan `settings.gradle.kts` for `include()` | Finds 14 modules |
111
+ | 2 | Detect module type from name | `reservation-command-server` โ†’ type: `command` |
112
+ | 3 | Extract domain from module name | `reservation-command-server` โ†’ domain: `reservation` |
113
+ | 4 | Group same domain across modules | `reservation-command-server` + `common-query-server` โ†’ 1 domain |
114
+ | 5 | Detect architecture | Has `command` + `query` modules โ†’ CQRS |
115
+
116
+ Supported module types: `command`, `query`, `bff`, `integration`, `standalone`, `library`. Shared libraries (`shared-lib`, `integration-lib`) are detected as special domains.
117
+
118
+ ### Frontend Domain Detection
119
+
120
+ - **App Router**: `app/{domain}/page.tsx` (Next.js)
121
+ - **Pages Router**: `pages/{domain}/index.tsx`
122
+ - **FSD (Feature-Sliced Design)**: `features/*/`, `widgets/*/`, `entities/*/`
123
+ - **RSC/Client split**: Detects `client.tsx` pattern, tracks Server/Client component separation
124
+ - **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/`)
125
+ - **Config fallback**: Detects Next.js/Vite/Nuxt from config files when not in `package.json` (monorepo support)
126
+ - **Deep directory fallback**: For React/CRA/Vite/Vue/RN projects, scans `**/components/*/`, `**/views/*/`, `**/screens/*/`, `**/containers/*/`, `**/pages/*/`, `**/routes/*/`, `**/modules/*/`, `**/domains/*/` at any depth
127
+
128
+ ---
129
+
130
+ ## Quick Start
131
+
132
+ ### Prerequisites
133
+
134
+ - **Node.js** v18+
135
+ - **Claude Code CLI** (installed & authenticated)
136
+
137
+ ### Installation
138
+
139
+ ```bash
140
+ cd /your/project/root
141
+
142
+ # Option A: npx (recommended โ€” no install needed)
143
+ npx claudeos-core init
144
+
145
+ # Option B: global install
146
+ npm install -g claudeos-core
147
+ claudeos-core init
148
+
149
+ # Option C: project devDependency
150
+ npm install --save-dev claudeos-core
151
+ npx claudeos-core init
152
+
153
+ # Option D: git clone (for development/contribution)
154
+ git clone https://github.com/claudeos-core/claudeos-core.git claudeos-core-tools
155
+
156
+ # Cross-platform (PowerShell, CMD, Bash, Zsh โ€” any terminal)
157
+ node claudeos-core-tools/bin/cli.js init
158
+
159
+ # Linux/macOS (Bash only)
160
+ bash claudeos-core-tools/bootstrap.sh
161
+ ```
162
+
163
+ ### Output Language (10 languages)
164
+
165
+ When you run `init` without `--lang`, an interactive selector appears โ€” use arrow keys or number keys to choose:
166
+
167
+ ```
168
+ โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
169
+ โ•‘ Select generated document language (required) โ•‘
170
+ โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
171
+
172
+ Generated files (CLAUDE.md, Standards, Rules,
173
+ Skills, Guides) will be written in English.
174
+
175
+ โฏ 1. en โ€” English
176
+ 2. ko โ€” ํ•œ๊ตญ์–ด (Korean)
177
+ 3. zh-CN โ€” ็ฎ€ไฝ“ไธญๆ–‡ (Chinese Simplified)
178
+ 4. ja โ€” ๆ—ฅๆœฌ่ชž (Japanese)
179
+ 5. es โ€” Espaรฑol (Spanish)
180
+ 6. vi โ€” Tiแบฟng Viแป‡t (Vietnamese)
181
+ 7. hi โ€” เคนเคฟเคจเฅเคฆเฅ€ (Hindi)
182
+ 8. ru โ€” ะ ัƒััะบะธะน (Russian)
183
+ 9. fr โ€” Franรงais (French)
184
+ 10. de โ€” Deutsch (German)
185
+
186
+ โ†‘โ†“ Move 1-0 Jump Enter Select ESC Cancel
187
+ ```
188
+
189
+ The description changes to the selected language as you navigate. To skip the selector, pass `--lang` directly:
190
+
191
+ ```bash
192
+ npx claudeos-core init --lang ko # Korean
193
+ npx claudeos-core init --lang ja # Japanese
194
+ npx claudeos-core init --lang en # English (default)
195
+ ```
196
+
197
+ > **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.
198
+
199
+ That's it. After 5โ€“18 minutes, all documentation is generated and ready to use. The CLI shows a progress bar with percentage, elapsed time, and ETA for each pass.
200
+
201
+ ### Manual Step-by-Step Installation
202
+
203
+ 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.
204
+
205
+ #### Step 1: Clone and install dependencies
206
+
207
+ ```bash
208
+ cd /your/project/root
209
+
210
+ git clone https://github.com/claudeos-core/claudeos-core.git claudeos-core-tools
211
+ cd claudeos-core-tools && npm install && cd ..
212
+ ```
213
+
214
+ #### Step 2: Create directory structure
215
+
216
+ ```bash
217
+ # Rules
218
+ mkdir -p .claude/rules/{00.core,10.backend,20.frontend,30.security-db,40.infra,50.sync}
219
+
220
+ # Standards
221
+ mkdir -p claudeos-core/standard/{00.core,10.backend-api,20.frontend-ui,30.security-db,40.infra,50.verification,90.optional}
222
+
223
+ # Skills
224
+ mkdir -p claudeos-core/skills/{00.shared,10.backend-crud/scaffold-crud-feature,20.frontend-page/scaffold-page-feature,50.testing,90.experimental}
225
+
226
+ # Guide, Plan, Database, MCP, Generated
227
+ mkdir -p claudeos-core/guide/{01.onboarding,02.usage,03.troubleshooting,04.architecture}
228
+ mkdir -p claudeos-core/{plan,database,mcp-guide,generated}
229
+ ```
230
+
231
+ #### Step 3: Run plan-installer (project analysis)
232
+
233
+ This scans your project, detects the stack, finds domains, splits them into groups, and generates prompts.
234
+
235
+ ```bash
236
+ node claudeos-core-tools/plan-installer/index.js
237
+ ```
238
+
239
+ **Output (in `claudeos-core/generated/`):**
240
+ - `project-analysis.json` โ€” detected stack, domains, frontend info
241
+ - `domain-groups.json` โ€” domain groups for Pass 1
242
+ - `pass1-backend-prompt.md` / `pass1-frontend-prompt.md` โ€” analysis prompts
243
+ - `pass2-prompt.md` โ€” merge prompt
244
+ - `pass3-prompt.md` โ€” generation prompt
245
+
246
+ You can inspect these files to verify detection accuracy before proceeding.
247
+
248
+ #### Step 4: Pass 1 โ€” Deep code analysis (per domain group)
249
+
250
+ Run Pass 1 for each domain group. Check `domain-groups.json` for the number of groups.
251
+
252
+ ```bash
253
+ # Check how many groups
254
+ cat claudeos-core/generated/domain-groups.json | node -e "
255
+ const g = JSON.parse(require('fs').readFileSync('/dev/stdin','utf-8'));
256
+ g.groups.forEach((g,i) => console.log('Group '+(i+1)+': ['+g.domains.join(', ')+'] ('+g.type+', ~'+g.estimatedFiles+' files)'));
257
+ "
258
+
259
+ # Run Pass 1 for each group (replace domains and group number)
260
+ # For group 1:
261
+ cp claudeos-core/generated/pass1-backend-prompt.md /tmp/_pass1.md
262
+ DOMAIN_LIST="user, order, product" PASS_NUM=1 \
263
+ perl -pi -e 's/\{\{DOMAIN_GROUP\}\}/$ENV{DOMAIN_LIST}/g; s/\{\{PASS_NUM\}\}/$ENV{PASS_NUM}/g' /tmp/_pass1.md
264
+ cat /tmp/_pass1.md | claude -p --dangerously-skip-permissions
265
+
266
+ # For group 2 (if exists):
267
+ cp claudeos-core/generated/pass1-backend-prompt.md /tmp/_pass1.md
268
+ DOMAIN_LIST="payment, system, delivery" PASS_NUM=2 \
269
+ perl -pi -e 's/\{\{DOMAIN_GROUP\}\}/$ENV{DOMAIN_LIST}/g; s/\{\{PASS_NUM\}\}/$ENV{PASS_NUM}/g' /tmp/_pass1.md
270
+ cat /tmp/_pass1.md | claude -p --dangerously-skip-permissions
271
+
272
+ # For frontend groups, use pass1-frontend-prompt.md instead
273
+ ```
274
+
275
+ **Verify:** `ls claudeos-core/generated/pass1-*.json` should show one JSON per group.
276
+
277
+ #### Step 5: Pass 2 โ€” Merge analysis results
278
+
279
+ ```bash
280
+ cat claudeos-core/generated/pass2-prompt.md \
281
+ | claude -p --dangerously-skip-permissions
282
+ ```
283
+
284
+ **Verify:** `claudeos-core/generated/pass2-merged.json` should exist with 9+ top-level keys.
285
+
286
+ #### Step 6: Pass 3 โ€” Generate all documentation
287
+
288
+ ```bash
289
+ cat claudeos-core/generated/pass3-prompt.md \
290
+ | claude -p --dangerously-skip-permissions
291
+ ```
292
+
293
+ **Verify:** `CLAUDE.md` should exist in your project root.
294
+
295
+ #### Step 7: Run verification tools
296
+
297
+ ```bash
298
+ # Generate metadata (required before other checks)
299
+ node claudeos-core-tools/manifest-generator/index.js
300
+
301
+ # Run all checks
302
+ node claudeos-core-tools/health-checker/index.js
303
+
304
+ # Or run individual checks:
305
+ node claudeos-core-tools/plan-validator/index.js --check # Plan โ†” disk consistency
306
+ node claudeos-core-tools/sync-checker/index.js # Unregistered/orphaned files
307
+ node claudeos-core-tools/content-validator/index.js # File quality checks
308
+ node claudeos-core-tools/pass-json-validator/index.js # Pass JSON format checks
309
+ ```
310
+
311
+ #### Step 8: Verify the results
312
+
313
+ ```bash
314
+ # Count generated files
315
+ find .claude claudeos-core -type f | grep -v node_modules | grep -v '/generated/' | wc -l
316
+
317
+ # Check CLAUDE.md
318
+ head -30 CLAUDE.md
319
+
320
+ # Check a standard file
321
+ cat claudeos-core/standard/00.core/01.project-overview.md | head -20
322
+
323
+ # Check rules
324
+ ls .claude/rules/*/
325
+ ```
326
+
327
+ > **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.
328
+
329
+ ### Start Using
330
+
331
+ ```
332
+ # In Claude Code โ€” just ask naturally:
333
+ "Create a CRUD for the order domain"
334
+ "Add user authentication API"
335
+ "Refactor this code to match project patterns"
336
+
337
+ # Claude Code automatically references your generated Standards, Rules, and Skills.
338
+ ```
339
+
340
+ ---
341
+
342
+ ## How It Works โ€” 3-Pass Pipeline
343
+
344
+ ```
345
+ npx claudeos-core init
346
+ โ”‚
347
+ โ”œโ”€โ”€ [1] npm install โ† Dependencies (~10s)
348
+ โ”œโ”€โ”€ [2] Directory structure โ† Create folders (~1s)
349
+ โ”œโ”€โ”€ [3] plan-installer (Node.js) โ† Project scan (~5s)
350
+ โ”‚ โ”œโ”€โ”€ Auto-detect stack (multi-stack aware)
351
+ โ”‚ โ”œโ”€โ”€ Extract domain list (tagged: backend/frontend)
352
+ โ”‚ โ”œโ”€โ”€ Split into domain groups (per type)
353
+ โ”‚ โ””โ”€โ”€ Select stack-specific prompts (per type)
354
+ โ”‚
355
+ โ”œโ”€โ”€ [4] Pass 1 ร— N (claude -p) โ† Deep code analysis (~2-8min)
356
+ โ”‚ โ”œโ”€โ”€ โš™๏ธ Backend groups โ†’ backend-specific prompt
357
+ โ”‚ โ””โ”€โ”€ ๐ŸŽจ Frontend groups โ†’ frontend-specific prompt
358
+ โ”‚
359
+ โ”œโ”€โ”€ [5] Pass 2 ร— 1 (claude -p) โ† Merge analysis (~1min)
360
+ โ”‚ โ””โ”€โ”€ Consolidate ALL Pass 1 results (backend + frontend)
361
+ โ”‚
362
+ โ”œโ”€โ”€ [6] Pass 3 ร— 1 (claude -p) โ† Generate everything (~3-5min)
363
+ โ”‚ โ””โ”€โ”€ Combined prompt (backend + frontend targets)
364
+ โ”‚
365
+ โ””โ”€โ”€ [7] Verification โ† Auto-run health checker
366
+ ```
367
+
368
+ ### Why 3 Passes?
369
+
370
+ **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.
371
+
372
+ **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.
373
+
374
+ **Pass 3** takes the merged analysis and generates the entire file ecosystem. It never reads source code โ€” only the analysis JSON. In multi-stack mode, the generation prompt combines backend and frontend targets so both sets of standards are generated in a single pass.
375
+
376
+ ---
377
+
378
+ ## Generated File Structure
379
+
380
+ ```
381
+ your-project/
382
+ โ”‚
383
+ โ”œโ”€โ”€ CLAUDE.md โ† Claude Code entry point
384
+ โ”‚
385
+ โ”œโ”€โ”€ .claude/
386
+ โ”‚ โ””โ”€โ”€ rules/ โ† Glob-triggered rules
387
+ โ”‚ โ”œโ”€โ”€ 00.core/
388
+ โ”‚ โ”œโ”€โ”€ 10.backend/
389
+ โ”‚ โ”œโ”€โ”€ 20.frontend/
390
+ โ”‚ โ”œโ”€โ”€ 30.security-db/
391
+ โ”‚ โ”œโ”€โ”€ 40.infra/
392
+ โ”‚ โ””โ”€โ”€ 50.sync/ โ† Sync reminder rules
393
+ โ”‚
394
+ โ”œโ”€โ”€ claudeos-core/ โ† Main output directory
395
+ โ”‚ โ”œโ”€โ”€ generated/ โ† Analysis JSON + dynamic prompts
396
+ โ”‚ โ”‚ โ”œโ”€โ”€ project-analysis.json โ† Stack info (multi-stack aware)
397
+ โ”‚ โ”‚ โ”œโ”€โ”€ domain-groups.json โ† Groups with type: backend/frontend
398
+ โ”‚ โ”‚ โ”œโ”€โ”€ pass1-backend-prompt.md โ† Backend analysis prompt
399
+ โ”‚ โ”‚ โ”œโ”€โ”€ pass1-frontend-prompt.md โ† Frontend analysis prompt (if detected)
400
+ โ”‚ โ”‚ โ”œโ”€โ”€ pass2-prompt.md โ† Merge prompt
401
+ โ”‚ โ”‚ โ””โ”€โ”€ pass3-prompt.md โ† Generation prompt (combined)
402
+ โ”‚ โ”œโ”€โ”€ standard/ โ† Coding standards (15-19 files)
403
+ โ”‚ โ”‚ โ”œโ”€โ”€ 00.core/ โ† Overview, architecture, naming
404
+ โ”‚ โ”‚ โ”œโ”€โ”€ 10.backend-api/ โ† API patterns (stack-specific)
405
+ โ”‚ โ”‚ โ”œโ”€โ”€ 20.frontend-ui/ โ† Frontend patterns (if detected)
406
+ โ”‚ โ”‚ โ”œโ”€โ”€ 30.security-db/ โ† Security, DB schema, utilities
407
+ โ”‚ โ”‚ โ”œโ”€โ”€ 40.infra/ โ† Config, logging, CI/CD
408
+ โ”‚ โ”‚ โ””โ”€โ”€ 50.verification/ โ† Build verification, testing
409
+ โ”‚ โ”œโ”€โ”€ skills/ โ† CRUD scaffolding skills
410
+ โ”‚ โ”œโ”€โ”€ guide/ โ† Onboarding, FAQ, troubleshooting (9 files)
411
+ โ”‚ โ”œโ”€โ”€ plan/ โ† Master plans (backup/restore)
412
+ โ”‚ โ”œโ”€โ”€ database/ โ† DB schema, migration guide
413
+ โ”‚ โ””โ”€โ”€ mcp-guide/ โ† MCP server integration guide
414
+ โ”‚
415
+ โ””โ”€โ”€ claudeos-core-tools/ โ† This toolkit (don't modify)
416
+ ```
417
+
418
+ Every standard file includes โœ… correct examples, โŒ incorrect examples, and a rules summary table โ€” all derived from your actual code patterns, not generic templates.
419
+
420
+ ---
421
+
422
+ ## Auto-scaling by Project Size
423
+
424
+ | Size | Domains | Pass 1 Runs | Total `claude -p` | Est. Time |
425
+ |---|---|---|---|---|
426
+ | Small | 1โ€“4 | 1 | 3 | ~5min |
427
+ | Medium | 5โ€“8 | 2 | 4 | ~8min |
428
+ | Large | 9โ€“16 | 3โ€“4 | 5โ€“6 | ~12min |
429
+ | X-Large | 17+ | 5+ | 7+ | ~18min+ |
430
+
431
+ 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, scaling as "Large".
432
+
433
+ ---
434
+
435
+ ## Verification Tools
436
+
437
+ ClaudeOS-Core includes 5 built-in verification tools that run automatically after generation:
438
+
439
+ ```bash
440
+ # Run all checks at once (recommended)
441
+ npx claudeos-core health
442
+
443
+ # Individual commands
444
+ npx claudeos-core validate # Plan โ†” disk comparison
445
+ npx claudeos-core refresh # Disk โ†’ Plan sync
446
+ npx claudeos-core restore # Plan โ†’ Disk restore
447
+
448
+ # Or use node directly (git clone users)
449
+ node claudeos-core-tools/health-checker/index.js
450
+ node claudeos-core-tools/manifest-generator/index.js
451
+ node claudeos-core-tools/plan-validator/index.js --check
452
+ node claudeos-core-tools/sync-checker/index.js
453
+ ```
454
+
455
+ | Tool | What It Does |
456
+ |---|---|
457
+ | **manifest-generator** | Builds metadata JSON (rule-manifest, sync-map, plan-manifest) |
458
+ | **plan-validator** | Compares Master Plan `<file>` blocks against disk โ€” 3 modes: check, refresh, restore |
459
+ | **sync-checker** | Detects unregistered files (on disk but not in plan) and orphaned entries |
460
+ | **content-validator** | Validates file quality โ€” empty files, missing โœ…/โŒ examples, required sections |
461
+ | **pass-json-validator** | Validates Pass 1โ€“3 JSON structure, required keys, and section completeness |
462
+
463
+ ---
464
+
465
+ ## How Claude Code Uses Your Documentation
466
+
467
+ ClaudeOS-Core generates documentation that Claude Code actually reads โ€” here's how:
468
+
469
+ ### What Claude Code reads automatically
470
+
471
+ | File | When | Guaranteed |
472
+ |---|---|---|
473
+ | `CLAUDE.md` | Every conversation start | Always |
474
+ | `.claude/rules/00.core/*` | When any file is edited (`paths: ["**/*"]`) | Always |
475
+ | `.claude/rules/10.backend/*` | When any file is edited (`paths: ["**/*"]`) | Always |
476
+ | `.claude/rules/30.security-db/*` | When any file is edited (`paths: ["**/*"]`) | Always |
477
+ | `.claude/rules/40.infra/*` | Only when editing config/infra files (scoped paths) | Conditional |
478
+ | `.claude/rules/50.sync/*` | Only when editing claudeos-core files (scoped paths) | Conditional |
479
+
480
+ ### What Claude Code reads on-demand via rule references
481
+
482
+ Each rule file links to its corresponding standard via a `## Reference` section. Claude reads only the relevant standard for the current task:
483
+
484
+ - `claudeos-core/standard/**` โ€” coding patterns, โœ…/โŒ examples, naming conventions
485
+ - `claudeos-core/database/**` โ€” DB schema (for queries, mappers, migrations)
486
+
487
+ The `00.standard-reference.md` serves as a directory of all standard files for discovering standards that have no corresponding rule.
488
+
489
+ ### What Claude Code does NOT read (saves context)
490
+
491
+ These folders are explicitly excluded via the `DO NOT Read` section in the standard-reference rule:
492
+
493
+ | Folder | Why excluded |
494
+ |---|---|
495
+ | `claudeos-core/plan/` | Master Plan backups (~340KB). Use `npx claudeos-core refresh` to sync. |
496
+ | `claudeos-core/generated/` | Build metadata JSON. Not for coding. |
497
+ | `claudeos-core/guide/` | Onboarding guides for humans. |
498
+ | `claudeos-core/mcp-guide/` | MCP server docs. Not for coding. |
499
+
500
+ ---
501
+
502
+ ## Daily Workflow
503
+
504
+ ### After Installation
505
+
506
+ ```
507
+ # Just use Claude Code as normal โ€” it references your standards automatically:
508
+ "Create a CRUD for the order domain"
509
+ "Add user profile update API"
510
+ "Refactor this code to match project patterns"
511
+ ```
512
+
513
+ ### After Manually Editing Standards
514
+
515
+ ```bash
516
+ # After editing standards or rules files:
517
+ npx claudeos-core refresh
518
+
519
+ # Verify everything is consistent
520
+ npx claudeos-core health
521
+ ```
522
+
523
+ ### When Docs Get Corrupted
524
+
525
+ ```bash
526
+ # Restore everything from Master Plan
527
+ npx claudeos-core restore
528
+ ```
529
+
530
+ ### CI/CD Integration
531
+
532
+ ```yaml
533
+ # GitHub Actions example
534
+ - run: npx claudeos-core validate
535
+ # Exit code 1 blocks the PR
536
+ ```
537
+
538
+ ---
539
+
540
+ ## How Is This Different?
541
+
542
+ ### vs Other Claude Code Tools
543
+
544
+ | | ClaudeOS-Core | Everything Claude Code (50K+ โญ) | Harness | specs-generator | Claude `/init` |
545
+ |---|---|---|---|---|---|
546
+ | **Approach** | Code analyzes first, then LLM generates | Pre-built config presets | LLM designs agent teams | LLM generates spec docs | LLM writes CLAUDE.md |
547
+ | **Reads your source code** | โœ… Deterministic static analysis | โŒ | โŒ | โŒ (LLM reads) | โŒ (LLM reads) |
548
+ | **Stack detection** | Code confirms (ORM, DB, build tool, pkg manager) | N/A (stack-agnostic) | LLM guesses | LLM guesses | LLM guesses |
549
+ | **Domain detection** | Code confirms (Java 5 patterns, Kotlin CQRS, Next.js FSD) | N/A | LLM guesses | N/A | N/A |
550
+ | **Same project โ†’ Same result** | โœ… Deterministic analysis | โœ… (static files) | โŒ (LLM varies) | โŒ (LLM varies) | โŒ (LLM varies) |
551
+ | **Large project handling** | Domain group splitting (4 domains / 40 files per group) | N/A | No splitting | No splitting | Context window limit |
552
+ | **Output** | CLAUDE.md + Rules + Standards + Skills + Guides + Plans (40-50+ files) | Agents + Skills + Commands + Hooks | Agents + Skills | 6 spec documents | CLAUDE.md (1 file) |
553
+ | **Output location** | `.claude/rules/` (auto-loaded by Claude Code) | `.claude/` various | `.claude/agents/` + `.claude/skills/` | `.claude/steering/` + `specs/` | `CLAUDE.md` |
554
+ | **Post-generation verification** | โœ… 5 automated validators | โŒ | โŒ | โŒ | โŒ |
555
+ | **Multi-language output** | โœ… 10 languages | โŒ | โŒ | โŒ | โŒ |
556
+ | **Multi-stack** | โœ… Backend + Frontend simultaneous | โŒ Stack-agnostic | โŒ | โŒ | Partial |
557
+ | **Agent orchestration** | โŒ | โœ… 28 agents | โœ… 6 patterns | โŒ | โŒ |
558
+
559
+ ### The key difference in one sentence
560
+
561
+ **Other tools give Claude "generally good instructions." ClaudeOS-Core gives Claude "instructions extracted from your actual code."**
562
+
563
+ That's why Claude Code stops generating JPA code in your MyBatis project,
564
+ stops using `success()` when your codebase uses `ok()`,
565
+ and stops creating `user/controller/` directories when your project uses `controller/user/`.
566
+
567
+ ### Complementary, not competing
568
+
569
+ ClaudeOS-Core focuses on **project-specific rules and standards**.
570
+ Other tools focus on **agent orchestration and workflows**.
571
+
572
+ 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.
573
+
574
+ ---
575
+
576
+ ## FAQ
577
+
578
+ **Q: Does it modify my source code?**
579
+ No. It only creates `CLAUDE.md`, `.claude/rules/`, and `claudeos-core/`. Your existing code is never modified.
580
+
581
+ **Q: How much does it cost?**
582
+ It calls `claude -p` 3โ€“7 times. This is within normal Claude Code usage.
583
+
584
+ **Q: Should I commit the generated files to Git?**
585
+ Yes, recommended. Your team can share the same Claude Code standards. Consider adding `claudeos-core/generated/` to `.gitignore` (analysis JSON is regeneratable).
586
+
587
+ **Q: What about mixed-stack projects (e.g., Java backend + React frontend)?**
588
+ 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 in one pass.
589
+
590
+ **Q: Does it work with Turborepo / pnpm workspaces / Lerna monorepos?**
591
+ 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.
592
+
593
+ **Q: What happens on re-run?**
594
+ 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. Pass 3 always re-runs. Previous versions can be restored from Master Plans.
595
+
596
+ **Q: Does NestJS get its own template or use the Express one?**
597
+ 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.
598
+
599
+ **Q: What about Vue / Nuxt projects?**
600
+ 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.
601
+
602
+ **Q: Does it support Kotlin?**
603
+ 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.).
604
+
605
+ **Q: What about CQRS / BFF architecture?**
606
+ 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.
607
+
608
+ **Q: What about Gradle multi-module monorepos?**
609
+ 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.
610
+
611
+ ---
612
+
613
+ ## Template Structure
614
+
615
+ ```
616
+ pass-prompts/templates/
617
+ โ”œโ”€โ”€ common/ # Shared header/footer
618
+ โ”œโ”€โ”€ java-spring/ # Java / Spring Boot
619
+ โ”œโ”€โ”€ kotlin-spring/ # Kotlin / Spring Boot (CQRS, BFF, multi-module)
620
+ โ”œโ”€โ”€ node-express/ # Node.js / Express
621
+ โ”œโ”€โ”€ node-nestjs/ # Node.js / NestJS (Module, DI, Guard, Pipe, Interceptor)
622
+ โ”œโ”€โ”€ node-fastify/ # Node.js / Fastify
623
+ โ”œโ”€โ”€ node-nextjs/ # Next.js / React
624
+ โ”œโ”€โ”€ vue-nuxt/ # Vue / Nuxt (Composition API, Pinia, Nitro)
625
+ โ”œโ”€โ”€ angular/ # Angular
626
+ โ”œโ”€โ”€ python-django/ # Python / Django (DRF)
627
+ โ””โ”€โ”€ python-fastapi/ # Python / FastAPI
628
+ ```
629
+
630
+ `plan-installer` auto-detects your stack(s), then assembles type-specific prompts. NestJS and Vue/Nuxt use dedicated templates with framework-specific analysis categories (e.g., `@Module`/`@Injectable`/Guards for NestJS, `<script setup>`/Pinia/useFetch for Vue). 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.
631
+
632
+ ---
633
+
634
+ ## Monorepo Support
635
+
636
+ ClaudeOS-Core automatically detects JS/TS monorepo setups and scans sub-packages for dependencies.
637
+
638
+ **Supported monorepo markers** (auto-detected):
639
+ - `turbo.json` (Turborepo)
640
+ - `pnpm-workspace.yaml` (pnpm workspaces)
641
+ - `lerna.json` (Lerna)
642
+ - `package.json#workspaces` (npm/yarn workspaces)
643
+
644
+ **Run from the monorepo root** โ€” ClaudeOS-Core reads `apps/*/package.json` and `packages/*/package.json` to discover framework/ORM/DB dependencies across sub-packages:
645
+
646
+ ```bash
647
+ cd my-monorepo
648
+ npx claudeos-core init
649
+ ```
650
+
651
+ **What gets detected:**
652
+ - Dependencies from `apps/web/package.json` (e.g., `next`, `react`) โ†’ frontend stack
653
+ - Dependencies from `apps/api/package.json` (e.g., `express`, `prisma`) โ†’ backend stack
654
+ - Dependencies from `packages/db/package.json` (e.g., `drizzle-orm`) โ†’ ORM/DB
655
+ - Custom workspace paths from `pnpm-workspace.yaml` (e.g., `services/*`)
656
+
657
+ **Domain scanning also covers monorepo layouts:**
658
+ - `apps/api/src/modules/*/` and `apps/api/src/*/` for backend domains
659
+ - `apps/web/app/*/`, `apps/web/src/app/*/`, `apps/web/pages/*/` for frontend domains
660
+ - `packages/*/src/*/` for shared package domains
661
+
662
+ ```
663
+ my-monorepo/ โ† Run here: npx claudeos-core init
664
+ โ”œโ”€โ”€ turbo.json โ† Auto-detected as Turborepo
665
+ โ”œโ”€โ”€ apps/
666
+ โ”‚ โ”œโ”€โ”€ web/ โ† Next.js detected from apps/web/package.json
667
+ โ”‚ โ”‚ โ”œโ”€โ”€ app/dashboard/ โ† Frontend domain detected
668
+ โ”‚ โ”‚ โ””โ”€โ”€ package.json โ† { "dependencies": { "next": "^14" } }
669
+ โ”‚ โ””โ”€โ”€ api/ โ† Express detected from apps/api/package.json
670
+ โ”‚ โ”œโ”€โ”€ src/modules/users/ โ† Backend domain detected
671
+ โ”‚ โ””โ”€โ”€ package.json โ† { "dependencies": { "express": "^4" } }
672
+ โ”œโ”€โ”€ packages/
673
+ โ”‚ โ”œโ”€โ”€ db/ โ† Drizzle detected from packages/db/package.json
674
+ โ”‚ โ””โ”€โ”€ ui/
675
+ โ””โ”€โ”€ package.json โ† { "workspaces": ["apps/*", "packages/*"] }
676
+ ```
677
+
678
+ > **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.
679
+
680
+ ## Troubleshooting
681
+
682
+ **"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).
683
+
684
+ **"npm install failed"** โ€” Node.js version may be too low. Requires v18+.
685
+
686
+ **"0 domains detected"** โ€” Your project structure may be non-standard. See the detection patterns above for your stack.
687
+
688
+ **"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/`.
689
+
690
+ **"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`.
691
+
692
+ **"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.
693
+
694
+ ---
695
+
696
+ ## Contributing
697
+
698
+ Contributions are welcome! Areas where help is most needed:
699
+
700
+ - **New stack templates** โ€” Ruby/Rails, Go/Gin, PHP/Laravel, Rust/Axum
701
+ - **Monorepo deep support** โ€” Separate sub-project roots, workspace detection
702
+ - **Test coverage** โ€” Expanding test suite (currently 269 tests covering all scanners, stack detection, domain grouping, plan parsing, prompt generation, CLI selectors, monorepo detection, Vite SPA detection, and verification tools)
703
+
704
+ ---
705
+
706
+ ## Author
707
+
708
+ Created by **claudeos-core** โ€” [GitHub](https://github.com/claudeos-core) ยท [Email](mailto:claudeoscore@gmail.com)
709
+
710
+ ## License
711
+
712
+ ISC