claudeos-core 2.4.0 → 2.4.2

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
@@ -7,31 +7,27 @@
7
7
  [![license](https://img.shields.io/npm/l/claudeos-core.svg?color=blue)](LICENSE)
8
8
  [![downloads](https://img.shields.io/npm/dm/claudeos-core.svg?logo=npm&color=blue&label=downloads)](https://www.npmjs.com/package/claudeos-core)
9
9
 
10
- **Auto-generate Claude Code documentation from your actual source code.** A CLI tool that statically analyzes your project, then runs a 4-pass Claude pipeline to generate `.claude/rules/`, standards, skills, and guides — so Claude Code follows your project's conventions, not generic ones.
10
+ **A deterministic CLI that auto-generates `CLAUDE.md` + `.claude/rules/` from your actual source code Node.js scanner + 4-pass Claude pipeline + 5 validators. 12 stacks, 10 languages, no invented paths.**
11
11
 
12
12
  ```bash
13
13
  npx claudeos-core init
14
14
  ```
15
15
 
16
+ Works on [**12 stacks**](#supported-stacks) (monorepos included) — one command, no config, resume-safe, idempotent.
17
+
16
18
  [🇰🇷 한국어](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)
17
19
 
18
20
  ---
19
21
 
20
22
  ## What is this?
21
23
 
22
- You use Claude Code. It's smart, but it doesn't know **your project's conventions**:
23
- - Your team uses MyBatis, but Claude generates JPA code.
24
- - Your wrapper is `ApiResponse.ok()`, but Claude writes `ResponseEntity.success()`.
25
- - Your packages are `controller/order/`, but Claude creates `order/controller/`.
24
+ Claude Code falls back to framework defaults every session. Your team uses **MyBatis**, but Claude writes JPA. Your wrapper is `ApiResponse.ok()`, but Claude writes `ResponseEntity.success()`. Your packages are layer-first, but Claude generates domain-first. Hand-writing `.claude/rules/` for each repo solves it until the code evolves and your rules drift.
26
25
 
27
- So you spend a chunk of time fixing every generated file.
26
+ **ClaudeOS-Core regenerates them deterministically, from your actual source code.** A Node.js scanner reads first (stack, ORM, package layout, file paths). A 4-pass Claude pipeline then writes the full set — `CLAUDE.md` + auto-loaded `.claude/rules/` + standards + skills — constrained by an explicit path allowlist that the LLM cannot escape. Five validators verify the output before it ships.
28
27
 
29
- **ClaudeOS-Core fixes this.** It scans your actual source code, figures out your conventions, and writes a complete set of rules into `.claude/rules/` the directory Claude Code reads automatically. Next time you say *"Create a CRUD for orders"*, Claude follows your conventions on the first try.
28
+ The result: same input byte-identical output, in any of 10 languages, with no invented paths. (Detail in [What makes this different](#what-makes-this-different) below.)
30
29
 
31
- ```
32
- Before: You → Claude Code → "generally good" code → manual fixing
33
- After: You → Claude Code → code that matches your project → ship it
34
- ```
30
+ A separate [Memory Layer](#memory-layer-optional-for-long-running-projects) is seeded for long-running projects.
35
31
 
36
32
  ---
37
33
 
@@ -44,7 +40,7 @@ Run on [`spring-boot-realworld-example-app`](https://github.com/gothinkster/spri
44
40
  </p>
45
41
 
46
42
  <details>
47
- <summary><strong>📺 Terminal output (text version, for search & copy)</strong></summary>
43
+ <summary><strong>Terminal output (text version, for search & copy)</strong></summary>
48
44
 
49
45
  ```text
50
46
  ╔════════════════════════════════════════════════════╗
@@ -79,18 +75,18 @@ Run on [`spring-boot-realworld-example-app`](https://github.com/gothinkster/spri
79
75
  [██████████░░░░░░░░░░] 50% (2/4)
80
76
 
81
77
  [6] Pass 3 — Generating all files...
82
- 🚀 Pass 3 split mode (3a → 3b → 3c → 3d-aux)
78
+ Pass 3 split mode (3a → 3b → 3c → 3d-aux)
83
79
  ✅ 3a complete (2m 57s) — pass3a-facts.md (187-path allowlist)
84
80
  ✅ 3b complete (18m 49s) — CLAUDE.md + 19 standards + 20 rules
85
81
  ✅ 3c complete (12m 35s) — 13 skills + 9 guides
86
82
  ✅ 3d-aux complete (3m 18s) — database/ + mcp-guide/
87
- 🎉 Pass 3 split complete: 4/4 stages successful
83
+ Pass 3 split complete: 4/4 stages successful
88
84
  [███████████████░░░░░] 75% (3/4)
89
85
 
90
86
  [7] Pass 4 — Memory scaffolding...
91
- 📦 Pass 4 staged-rules: 6 rule files moved to .claude/rules/
87
+ Pass 4 staged-rules: 6 rule files moved to .claude/rules/
92
88
  ✅ Pass 4 complete (5m)
93
- 📋 Gap-fill: all 12 expected files already present
89
+ Gap-fill: all 12 expected files already present
94
90
  [████████████████████] 100% (4/4)
95
91
 
96
92
  ╔═══════════════════════════════════════╗
@@ -119,37 +115,45 @@ Run on [`spring-boot-realworld-example-app`](https://github.com/gothinkster/spri
119
115
  </details>
120
116
 
121
117
  <details>
122
- <summary><strong>📄 What ends up in your <code>CLAUDE.md</code> (real excerpt)</strong></summary>
118
+ <summary><strong>What ends up in your <code>CLAUDE.md</code> (real excerpt — Section 1 + 2)</strong></summary>
123
119
 
124
120
  ```markdown
125
- ## 4. Core Architecture
126
-
127
- ### Core Patterns
128
-
129
- - **Hexagonal ports & adapters**: domain ports live in `io.spring.core.{aggregate}`
130
- and are implemented by `io.spring.infrastructure.repository.MyBatis{Aggregate}Repository`.
131
- The domain layer has zero MyBatis imports.
132
- - **CQRS-lite read/write split (same DB)**: write side goes through repository ports
133
- + entities; read side is a separate `readservice` package whose `@Mapper`
134
- interfaces return `*Data` DTOs directly (no entity hydration).
135
- - **No aggregator/orchestrator layer**: multi-source orchestration happens inside
136
- application services (e.g., `ArticleQueryService`); there is no `*Aggregator`
137
- class in the codebase.
138
- - **Application-supplied UUIDs**: entity constructors assign their own UUID; PK is
139
- passed via `#{user.id}` on INSERT. The global
140
- `mybatis.configuration.use-generated-keys=true` flag is dead config
141
- (auto-increment is unused).
142
- - **JWT HS512 authentication**: `io.spring.infrastructure.service.DefaultJwtService`
143
- is the sole token subject in/out; `io.spring.api.security.JwtTokenFilter`
144
- extracts the token at the servlet layer.
121
+ # CLAUDE.md spring-boot-realworld-example-app
122
+
123
+ > Reference implementation of the RealWorld backend specification on
124
+ > Java 11 + Spring Boot 2.6, exposing both REST and GraphQL endpoints
125
+ > over a hexagonal MyBatis persistence layer.
126
+
127
+ #### 1. Role Definition
128
+
129
+ As the senior developer for this repository, you are responsible for
130
+ writing, modifying, and reviewing code. Responses must be written in English.
131
+ A Java Spring Boot REST + GraphQL API server organized around a hexagonal
132
+ (ports & adapters) architecture, with a CQRS-lite read/write split inside
133
+ an XML-driven MyBatis persistence layer and JWT-based authentication.
134
+
135
+ #### 2. Project Overview
136
+
137
+ | Item | Value |
138
+ |---|---|
139
+ | Language | Java 11 |
140
+ | Framework | Spring Boot 2.6.3 |
141
+ | Build Tool | Gradle (Groovy DSL) |
142
+ | Persistence | MyBatis 3 via `mybatis-spring-boot-starter:2.2.2` (no JPA) |
143
+ | Database | SQLite (`org.xerial:sqlite-jdbc:3.36.0.3`) — `dev.db` (default), `:memory:` (test) |
144
+ | Migration | Flyway — single baseline `V1__create_tables.sql` |
145
+ | API Style | REST (`io.spring.api.*`) + GraphQL via Netflix DGS `:4.9.21` |
146
+ | Authentication | JWT HS512 (`jjwt-api:0.11.2`) + Spring Security `PasswordEncoder` |
147
+ | Server Port | 8080 (default) |
148
+ | Test Stack | JUnit Jupiter 5, Mockito, AssertJ, rest-assured, spring-mock-mvc |
145
149
  ```
146
150
 
147
- Note: every claim above is grounded in the actual source class names, package paths, configuration keys, and the dead-config flag are all extracted by the scanner before Claude writes the file.
151
+ Every value above exact dependency coordinates, the `dev.db` filename, the `V1__create_tables.sql` migration name, "no JPA" is extracted by the scanner from `build.gradle` / `application.properties` / source tree before Claude writes the file. Nothing is guessed.
148
152
 
149
153
  </details>
150
154
 
151
155
  <details>
152
- <summary><strong>🛡️ A real auto-loaded rule (<code>.claude/rules/10.backend/03.data-access-rules.md</code>)</strong></summary>
156
+ <summary><strong>A real auto-loaded rule (<code>.claude/rules/10.backend/01.controller-rules.md</code>)</strong></summary>
153
157
 
154
158
  ````markdown
155
159
  ---
@@ -157,73 +161,98 @@ paths:
157
161
  - "**/*"
158
162
  ---
159
163
 
160
- # Data Access Rules
164
+ #### Controller Rules
165
+
166
+ ##### REST (`io.spring.api.*`)
167
+
168
+ - Controllers are the SOLE response wrapper for HTTP — no aggregator/facade above them.
169
+ Return `ResponseEntity<?>` or a body Spring serializes via `JacksonCustomizations`.
170
+ - Each controller method calls exactly ONE application service method. Multi-source
171
+ composition lives in the application service.
172
+ - Controllers MUST NOT import `io.spring.infrastructure.*`. No direct `@Mapper` access.
173
+ - Validate command-param arguments with `@Valid`. Custom JSR-303 constraints live under
174
+ `io.spring.application.{aggregate}.*`.
175
+ - Resolve the current user via `@AuthenticationPrincipal User`.
176
+ - Let exceptions propagate to `io.spring.api.exception.CustomizeExceptionHandler`
177
+ (`@ControllerAdvice`). Do NOT `try/catch` business exceptions inside the controller.
161
178
 
162
- ## XML-only SQL
163
- - Every SQL statement lives in `src/main/resources/mapper/*.xml`.
164
- NO `@Select` / `@Insert` / `@Update` / `@Delete` annotations on `@Mapper` methods.
165
- - Each `@Mapper` interface has exactly one XML file at
166
- `src/main/resources/mapper/{InterfaceName}.xml`.
167
- - `<mapper namespace="...">` MUST be the fully qualified Java interface name.
168
- The single existing exception is `TransferData.xml` (free-form `transfer.data`).
179
+ ##### GraphQL (`io.spring.graphql.*`)
169
180
 
170
- ## Dynamic SQL
171
- - `<if>` predicates MUST guard both null and empty:
172
- `<if test="X != null and X != ''">`. Empty-only is the existing HIGH-severity bug pattern.
173
- - Prefer `LIMIT n OFFSET m` over MySQL-style `LIMIT m, n`.
181
+ - DGS components (`@DgsComponent`) are the sole GraphQL response wrappers.
182
+ Use `@DgsQuery` / `@DgsData` / `@DgsMutation`.
183
+ - Resolve the current user via `io.spring.graphql.SecurityUtil.getCurrentUser()`.
174
184
 
175
- ## Examples
185
+ ##### Examples
176
186
 
177
187
  ✅ Correct:
178
- ```xml
179
- <update id="update">
180
- UPDATE articles
181
- <set>
182
- <if test="article.title != null and article.title != ''">title = #{article.title},</if>
183
- updated_at = #{article.updatedAt}
184
- </set>
185
- WHERE id = #{article.id}
186
- </update>
188
+ ```java
189
+ @PostMapping
190
+ public ResponseEntity<?> createArticle(@AuthenticationPrincipal User user,
191
+ @Valid @RequestBody NewArticleParam param) {
192
+ Article article = articleCommandService.createArticle(param, user);
193
+ ArticleData data = articleQueryService.findById(article.getId(), user)
194
+ .orElseThrow(ResourceNotFoundException::new);
195
+ return ResponseEntity.ok(Map.of("article", data));
196
+ }
187
197
  ```
188
198
 
189
199
  ❌ Incorrect:
190
- ```xml
191
- <mapper namespace="article.mapper"> <!-- NO — namespace MUST be FQCN -->
200
+ ```java
201
+ @PostMapping
202
+ public ResponseEntity<?> create(@RequestBody NewArticleParam p) {
203
+ try {
204
+ articleCommandService.createArticle(p, currentUser);
205
+ } catch (Exception e) { // NO — let CustomizeExceptionHandler handle it
206
+ return ResponseEntity.status(500).body(e.getMessage()); // NO — leaks raw message
207
+ }
208
+ return ResponseEntity.ok().build();
209
+ }
192
210
  ```
193
211
  ````
194
212
 
195
- The `paths: ["**/*"]` glob means Claude Code auto-loads this rule whenever you edit any file in the project. The ✅/❌ examples come straight from this codebase's actual conventions and existing bug patterns.
213
+ The `paths: ["**/*"]` glob means Claude Code auto-loads this rule whenever you edit any file in the project. Every class name, package path, and exception handler in the rule comes directly from the scanned source — including the project's actual `CustomizeExceptionHandler` and `JacksonCustomizations`.
196
214
 
197
215
  </details>
198
216
 
199
217
  <details>
200
- <summary><strong>🧠 An auto-generated <code>decision-log.md</code> seed (real excerpt)</strong></summary>
218
+ <summary><strong>An auto-generated <code>decision-log.md</code> seed (real excerpt)</strong></summary>
201
219
 
202
220
  ```markdown
203
- ## 2026-04-26 — CQRS-lite read/write split inside the persistence layer
204
-
205
- - **Context:** Writes go through `core.*Repository` port → `MyBatis*Repository`
206
- adapter → `io.spring.infrastructure.mybatis.mapper.{Aggregate}Mapper`.
207
- Reads bypass the domain port: application service →
208
- `io.spring.infrastructure.mybatis.readservice.{Concept}ReadService` directly,
209
- returning flat `*Data` DTOs from `io.spring.application.data.*`.
210
- - **Options considered:** Single repository surface returning hydrated entities
211
- for both reads and writes.
212
- - **Decision:** Same database, two `@Mapper` packages — `mapper/` (write side,
213
- operates on core entities) and `readservice/` (read side, returns `*Data` DTOs).
214
- Read DTOs avoid entity hydration overhead.
215
- - **Consequences:** Reads are NOT routed through the domain port this is
216
- intentional, not a bug. Application services may inject both a `*Repository`
217
- (writes) and one or more `*ReadService` interfaces (reads) at the same time.
218
- Do NOT add hydrate-then-map glue in the read path.
221
+ #### 2026-04-26 — Hexagonal ports & adapters with MyBatis-only persistence
222
+
223
+ - **Context:** `io.spring.core.*` exposes `*Repository` ports (e.g.,
224
+ `io.spring.core.article.ArticleRepository`) implemented by
225
+ `io.spring.infrastructure.repository.MyBatis*Repository` adapters.
226
+ The domain layer has zero `org.springframework.*` /
227
+ `org.apache.ibatis.*` / `io.spring.infrastructure.*` imports.
228
+ - **Options considered:** JPA/Hibernate, Spring Data, MyBatis-Plus
229
+ `BaseMapper`. None adopted.
230
+ - **Decision:** MyBatis 3 (`mybatis-spring-boot-starter:2.2.2`) with
231
+ hand-written XML statements under `src/main/resources/mapper/*.xml`.
232
+ Hexagonal port/adapter wiring keeps the domain framework-free.
233
+ - **Consequences:** Every SQL lives in XML`@Select`/`@Insert`/`@Update`/`@Delete`
234
+ annotations are forbidden. New aggregates require both a
235
+ `core.{aggregate}.{Aggregate}Repository` port AND a
236
+ `MyBatis{Aggregate}Repository` adapter; introducing a JPA repository would
237
+ split the persistence model.
219
238
  ```
220
239
 
221
- Pass 4 seeds `decision-log.md` with the architectural decisions extracted from `pass2-merged.json` so future sessions remember *why* the codebase looks the way it does — not just *what* it looks like.
240
+ Pass 4 seeds `decision-log.md` with the architectural decisions extracted from `pass2-merged.json` so future sessions remember *why* the codebase looks the way it does — not just *what* it looks like. Every option ("JPA/Hibernate", "MyBatis-Plus") and every consequence is grounded in the actual `build.gradle` dependency block.
222
241
 
223
242
  </details>
224
243
 
225
244
  ---
226
245
 
246
+ ## Tested on
247
+
248
+ ClaudeOS-Core ships with reference benchmarks on real OSS projects. If you've used it on a public repo, please [open an issue](https://github.com/claudeos-core/claudeos-core/issues) — we'll add it to this table.
249
+
250
+ | Project | Stack | Scanned → Generated | Status |
251
+ |---|---|---|---|
252
+ | [`spring-boot-realworld-example-app`](https://github.com/gothinkster/spring-boot-realworld-example-app) | Java 11 · Spring Boot 2.6 · MyBatis · SQLite | 187 → 75 files | ✅ all 5 validators pass |
253
+
254
+ ---
255
+
227
256
  ## Quick Start
228
257
 
229
258
  **Prerequisites:** Node.js 18+, [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed and authenticated.
@@ -277,13 +306,17 @@ Categories sharing the same number prefix between `rules/` and `standard/` repre
277
306
 
278
307
  ## Who is this for?
279
308
 
280
- | You are... | This helps you... |
309
+ | You are... | The pain this removes |
281
310
  |---|---|
282
- | **A solo dev** starting a new project with Claude Code | Skip the "teach Claude my conventions" phase entirely |
283
- | **A team lead** maintaining shared standards | Automate the tedious part of keeping `.claude/rules/` up to date |
284
- | **Already using Claude Code** but tired of fixing generated code | Make Claude follow YOUR patterns, not "generally good" patterns |
311
+ | **A solo dev** starting a new project with Claude Code | "Teach Claude my conventions every session" gone. `CLAUDE.md` + 8-category `.claude/rules/` generated in one pass. |
312
+ | **A team lead** maintaining shared standards across repos | `.claude/rules/` drift as people rename packages, switch ORMs, or change response wrappers. ClaudeOS-Core re-syncs deterministically — same input, byte-identical output, no diff noise. |
313
+ | **Already using Claude Code** but tired of fixing generated code | Wrong response wrapper, wrong package layout, JPA when you use MyBatis, `try/catch` scattered when your project uses centralized middleware. The scanner extracts your real conventions; every Claude pass runs against an explicit path allowlist. |
314
+ | **Onboarding to a new repo** (existing project, joining a team) | Run `init` on the repo, get a living architecture map: stack table in CLAUDE.md, per-layer rules with ✅/❌ examples, decision log seeded with "why" behind major choices (JPA vs MyBatis, REST vs GraphQL, etc.). Reading 5 files beats reading 5,000 source files. |
315
+ | **Working in Korean / Japanese / Chinese / 7 more languages** | Most Claude Code rule generators are English-only. ClaudeOS-Core writes the full set in **10 languages** (`en/ko/ja/zh-CN/es/vi/hi/ru/fr/de`) with **byte-identical structural validation** — same `claude-md-validator` verdict regardless of output language. |
316
+ | **Running on a monorepo** (Turborepo, pnpm/yarn workspaces, Lerna) | Backend + frontend domains analyzed in one run with separate prompts; `apps/*/` and `packages/*/` walked automatically; per-stack rules emitted under `70.domains/{type}/`. |
317
+ | **Contributing to OSS or experimenting** | Output is gitignore-friendly — `claudeos-core/` is your local working dir, only `CLAUDE.md` + `.claude/` need to ship. Resume-safe if interrupted; idempotent on re-runs (your manual edits to rules survive without `--force`). |
285
318
 
286
- **Not a fit if:** you want a one-size-fits-all preset bundle of agents/skills/rules that works on day one without a scan step (see [docs/comparison.md](docs/comparison.md) for what fits where), or your project doesn't fit one of the [supported stacks](#supported-stacks) yet.
319
+ **Not a fit if:** you want a one-size-fits-all preset bundle of agents/skills/rules that works on day one without a scan step (see [docs/comparison.md](docs/comparison.md) for what fits where), your project doesn't match one of the [supported stacks](#supported-stacks) yet, or you only need a single `CLAUDE.md` (built-in `claude /init` is enough — no need to install another tool).
287
320
 
288
321
  ---
289
322
 
@@ -296,9 +329,28 @@ Usual: You describe project → Claude guesses your stack → Claude writes d
296
329
  This: Code reads your stack → Code passes confirmed facts to Claude → Claude writes docs from facts
297
330
  ```
298
331
 
299
- The key idea: **a Node.js scanner reads your source code first** (deterministic, no AI), then a 4-pass Claude pipeline writes the documentation, constrained by what the scanner found. Claude can't invent paths or frameworks that aren't actually in your code.
332
+ The pipeline runs in **three stages**, with code on both sides of the LLM call:
333
+
334
+ **1. Step A — Scanner (deterministic, no LLM).** A Node.js scanner walks your project root, reads `package.json` / `build.gradle` / `pom.xml` / `pyproject.toml`, parses `.env*` files (with sensitive-variable redaction for `PASSWORD/SECRET/TOKEN/JWT_SECRET/...`), classifies your architecture pattern (Java's 5 patterns A/B/C/D/E, Kotlin CQRS / multi-module, Next.js App vs. Pages Router, FSD, components-pattern), discovers domains, and builds an explicit allowlist of every source file path that exists. Output: `project-analysis.json` — the single source of truth for what follows.
300
335
 
301
- For the full architecture, see [docs/architecture.md](docs/architecture.md).
336
+ **2. Step B 4-Pass Claude pipeline (constrained by Step A's facts).**
337
+ - **Pass 1** reads representative files per domain group and extracts ~50–100 conventions per domain — response wrappers, logging libraries, error handling, naming conventions, test patterns. Runs once per domain group (`max 4 domains, 40 files per group`) so context never overflows.
338
+ - **Pass 2** merges all per-domain analysis into a project-wide picture and resolves disagreements by picking the dominant convention.
339
+ - **Pass 3** writes `CLAUDE.md` + `.claude/rules/` + `claudeos-core/standard/` + skills + guides — split into stages (`3a` facts → `3b-core/3b-N` rules+standards → `3c-core/3c-N` skills+guides → `3d-aux` database+mcp-guide) so each stage's prompt fits the LLM's context window even when `pass2-merged.json` is large. Sub-divides 3b/3c into ≤15-domain batches for ≥16-domain projects.
340
+ - **Pass 4** seeds the L4 memory layer (`decision-log.md`, `failure-patterns.md`, `compaction.md`, `auto-rule-update.md`) and adds universal scaffold rules. Pass 4 is **forbidden from modifying `CLAUDE.md`** — Pass 3's Section 8 is authoritative.
341
+
342
+ **3. Step C — Verification (deterministic, no LLM).** Five validators check the output:
343
+ - `claude-md-validator` — 25 structural checks on `CLAUDE.md` (8 sections, H3/H4 counts, memory file uniqueness, T1 canonical heading invariant). Language-invariant: same verdict regardless of `--lang`.
344
+ - `content-validator` — 10 content checks including path-claim verification (`STALE_PATH` catches invented `src/...` references) and MANIFEST drift detection.
345
+ - `pass-json-validator` — Pass 1/2/3/4 JSON well-formedness + stack-aware section count.
346
+ - `plan-validator` — plan ↔ disk consistency (legacy, mostly no-op since v2.1.0).
347
+ - `sync-checker` — disk ↔ `sync-map.json` registration consistency across 7 tracked dirs.
348
+
349
+ Three severity tiers (`fail` / `warn` / `advisory`) so warnings never deadlock CI on LLM hallucinations the user can fix manually.
350
+
351
+ The invariant that ties it all together: **Claude can only cite paths that actually exist in your code**, because Step A hands it a finite allowlist. If the LLM still tries to invent something (rare but happens on certain seeds), Step C catches it before the docs ship.
352
+
353
+ For per-pass details, marker-based resume, the staged-rules workaround for Claude Code's `.claude/` sensitive-path block, and stack detection internals, see [docs/architecture.md](docs/architecture.md).
302
354
 
303
355
  ---
304
356
 
@@ -331,17 +383,7 @@ npx claudeos-core lint
331
383
  npx claudeos-core health
332
384
  ```
333
385
 
334
- Two more for memory layer maintenance:
335
-
336
- ```bash
337
- # Compact the failure-patterns log (run periodically)
338
- npx claudeos-core memory compact
339
-
340
- # Promote frequent failure patterns into proposed rules
341
- npx claudeos-core memory propose-rules
342
- ```
343
-
344
- For each command's full options, see [docs/commands.md](docs/commands.md).
386
+ For each command's full options, see [docs/commands.md](docs/commands.md). Memory layer commands (`memory compact`, `memory propose-rules`) are documented in the [Memory Layer](#memory-layer-optional-for-long-running-projects) section below.
345
387
 
346
388
  ---
347
389
 
@@ -383,14 +425,24 @@ For each validator's checks in detail, see [docs/verification.md](docs/verificat
383
425
 
384
426
  ## Memory Layer (optional, for long-running projects)
385
427
 
386
- After v2.0, ClaudeOS-Core writes a `claudeos-core/memory/` folder with four files:
428
+ Beyond the scaffolding pipeline above, ClaudeOS-Core seeds a `claudeos-core/memory/` folder for projects where context outlives a single session. It's optional — you can ignore it if all you want is `CLAUDE.md` + rules.
429
+
430
+ Four files, all written by Pass 4:
387
431
 
388
- - `decision-log.md` — append-only "why we chose X over Y"
432
+ - `decision-log.md` — append-only "why we chose X over Y", seeded from `pass2-merged.json`
389
433
  - `failure-patterns.md` — recurring errors with frequency/importance scores
390
434
  - `compaction.md` — how memory is auto-compacted over time
391
435
  - `auto-rule-update.md` — patterns that should become new rules
392
436
 
393
- You can run `npx claudeos-core memory propose-rules` to ask Claude to look at recent failure patterns and suggest new rules to add.
437
+ Two commands maintain this layer over time:
438
+
439
+ ```bash
440
+ # Compact the failure-patterns log (run periodically)
441
+ npx claudeos-core memory compact
442
+
443
+ # Promote frequent failure patterns into proposed rules
444
+ npx claudeos-core memory propose-rules
445
+ ```
394
446
 
395
447
  For the memory model and lifecycle, see [docs/memory-layer.md](docs/memory-layer.md).
396
448
 
@@ -421,6 +473,12 @@ A: [GitHub Issues](https://github.com/claudeos-core/claudeos-core/issues). For s
421
473
 
422
474
  ---
423
475
 
476
+ ## If this saved you time
477
+
478
+ A ⭐ on GitHub keeps the project visible and helps others find it. Issues, PRs, and stack template contributions are all welcome — see [CONTRIBUTING.md](CONTRIBUTING.md).
479
+
480
+ ---
481
+
424
482
  ## Documentation
425
483
 
426
484
  | Topic | Read this |
@@ -447,8 +505,8 @@ For Code of Conduct and security policy, see [CODE_OF_CONDUCT.md](CODE_OF_CONDUC
447
505
 
448
506
  ## License
449
507
 
450
- [ISC](LICENSE) free for any use, including commercial.
508
+ [ISC License](LICENSE). Free for any use, including commercial. © 2025–2026 ClaudeOS-Core contributors.
451
509
 
452
510
  ---
453
511
 
454
- <sub>Built with care by [@claudeos-core](https://github.com/claudeos-core). If this saved you time, a ⭐ on GitHub keeps it visible.</sub>
512
+ <sub>Maintained by the [claudeos-core](https://github.com/claudeos-core) team. Issues and PRs at <https://github.com/claudeos-core/claudeos-core>.</sub>