@nurix/etna 0.18.11 → 0.18.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +8 -9
  2. package/bin/etna.js +63 -2
  3. package/data/harness-index.json +1 -1
  4. package/data/harnesses/code/CLAUDE.md +9 -10
  5. package/data/harnesses/code/agents/brainstorm.md +3 -3
  6. package/data/harnesses/code/agents/change-review.md +4 -4
  7. package/data/harnesses/code/agents/maintenance.md +177 -59
  8. package/data/harnesses/code/agents/spec-mode.md +3 -3
  9. package/data/harnesses/code/harness.json +2 -2
  10. package/data/harnesses/code/hooks/generate-ownership-index.mjs +148 -0
  11. package/data/harnesses/code/hooks/hooks.json +12 -0
  12. package/data/harnesses/code/skills/boundary/references/boundary-taxonomy.md +3 -3
  13. package/data/harnesses/code/skills/brainstorm/README.md +20 -12
  14. package/data/harnesses/code/skills/brainstorm/SKILL.md +4 -4
  15. package/data/harnesses/code/skills/brainstorm/exit-artifacts.md +62 -0
  16. package/data/harnesses/code/skills/brainstorm/templates/source-of-truth.md +49 -0
  17. package/data/harnesses/code/skills/distiller/SKILL.md +3 -3
  18. package/data/harnesses/code/skills/distiller/references/docs-mode.md +7 -7
  19. package/data/harnesses/code/skills/documentation/SKILL.md +23 -23
  20. package/data/harnesses/code/skills/documentation/references/templates.md +24 -65
  21. package/data/harnesses/etna/CLAUDE.md +18 -27
  22. package/data/harnesses/etna/agents/brainstorm.md +3 -3
  23. package/data/harnesses/etna/agents/change-review.md +4 -4
  24. package/data/harnesses/etna/agents/maintenance.md +177 -59
  25. package/data/harnesses/etna/agents/spec-mode.md +3 -3
  26. package/data/harnesses/etna/harness.json +2 -2
  27. package/data/harnesses/etna/hooks/generate-ownership-index.mjs +148 -0
  28. package/data/harnesses/etna/hooks/hooks.json +12 -0
  29. package/data/harnesses/etna/rules/npm-cli.md +88 -0
  30. package/data/harnesses/etna/skills/boundary/references/boundary-taxonomy.md +3 -3
  31. package/data/harnesses/etna/skills/brainstorm/README.md +20 -12
  32. package/data/harnesses/etna/skills/brainstorm/SKILL.md +4 -4
  33. package/data/harnesses/etna/skills/brainstorm/exit-artifacts.md +62 -0
  34. package/data/harnesses/etna/skills/brainstorm/templates/source-of-truth.md +49 -0
  35. package/data/harnesses/etna/skills/distiller/SKILL.md +3 -3
  36. package/data/harnesses/etna/skills/distiller/references/docs-mode.md +7 -7
  37. package/data/harnesses/etna/skills/documentation/SKILL.md +23 -23
  38. package/data/harnesses/etna/skills/documentation/references/templates.md +24 -65
  39. package/data/harnesses/hr/harness.json +2 -2
  40. package/data/harnesses/hr/skills/evaluator/criteria/testing.md +4 -4
  41. package/data/harnesses/mobile/CLAUDE.md +9 -10
  42. package/data/harnesses/mobile/agents/brainstorm.md +3 -3
  43. package/data/harnesses/mobile/agents/change-review.md +4 -4
  44. package/data/harnesses/mobile/agents/maintenance.md +177 -59
  45. package/data/harnesses/mobile/agents/spec-mode.md +3 -3
  46. package/data/harnesses/mobile/harness.json +2 -2
  47. package/data/harnesses/mobile/hooks/generate-ownership-index.mjs +148 -0
  48. package/data/harnesses/mobile/hooks/hooks.json +12 -0
  49. package/data/harnesses/mobile/skills/boundary/references/boundary-taxonomy.md +3 -3
  50. package/data/harnesses/mobile/skills/brainstorm/README.md +20 -12
  51. package/data/harnesses/mobile/skills/brainstorm/SKILL.md +4 -4
  52. package/data/harnesses/mobile/skills/brainstorm/exit-artifacts.md +62 -0
  53. package/data/harnesses/mobile/skills/brainstorm/templates/source-of-truth.md +49 -0
  54. package/data/harnesses/mobile/skills/distiller/SKILL.md +3 -3
  55. package/data/harnesses/mobile/skills/distiller/references/docs-mode.md +7 -7
  56. package/data/harnesses/mobile/skills/documentation/SKILL.md +23 -23
  57. package/data/harnesses/mobile/skills/documentation/references/templates.md +24 -65
  58. package/package.json +1 -1
  59. package/data/harnesses/code/agents/harness-manager.md +0 -184
  60. package/data/harnesses/code/skills/brainstorm/harvest.md +0 -26
  61. package/data/harnesses/etna/agents/harness-manager.md +0 -184
  62. package/data/harnesses/etna/skills/brainstorm/harvest.md +0 -26
  63. package/data/harnesses/mobile/agents/harness-manager.md +0 -184
  64. package/data/harnesses/mobile/skills/brainstorm/harvest.md +0 -26
@@ -84,7 +84,7 @@ harness-version: 1.0.0
84
84
  # Documentation Structure
85
85
 
86
86
  > This file is the entry point for understanding the docs folder.
87
- > `harness-version` above is the repo's single baseline/version sentinel — the `harness-manager` agent owns it and stamps the installed harness version (semver) on every reconcile.
87
+ > `harness-version` above is the repo's single baseline/version sentinel — the `maintenance` agent (baseline mode) owns it and stamps the installed harness version (semver) on every reconcile.
88
88
 
89
89
  ## Authority Map
90
90
 
@@ -92,14 +92,14 @@ Each topic has one canonical location. Read from here, not from plans or changel
92
92
 
93
93
  | Topic | Authority | Key Files |
94
94
  | ----- | --------- | --------- |
95
- | Code-path ownership (path → doc + module) | `docs/routing.md` | File-Pattern Routes |
95
+ | Code-path ownership (path → doc + module) | feature `owns:` frontmatter | the generated ownership index |
96
96
  | System architecture + steering | `docs/architecture/` | domain-model, glossary, non-goals, references, adr/ |
97
- | Feature behavior | `docs/features/` (or `docs/modules/{m}/features/`) | {key files} |
98
- | Declared modules (bounded contexts) | `docs/modules/{m}/` | `features/` + `pillars/` |
97
+ | Feature behavior | `docs/features/` | {key files} |
99
98
  | Setup & development | `docs/operations/` | {key files} |
100
99
  | Historical plans | `docs/history/plans/` | YYYY-MM-DD-name.md |
101
100
  | Change records | `docs/history/changelog/` | Individual entries |
102
101
  | Deep-research artifacts | `docs/history/research/{topic}/` | README.md + findings.md + sources.md |
102
+ | Brainstorm design records | `docs/brainstorm/{topic}/` | state.md + pillars/ |
103
103
  | Backlog | `docs/history/` | backlog.md |
104
104
 
105
105
  ## Document Lifecycle
@@ -112,14 +112,13 @@ Plan (Status: Draft) → Implementation → Feature Doc or Architecture Update
112
112
 
113
113
  ## Folder Rules
114
114
 
115
- - `docs/routing.md`: The single hand-maintained map from code paths (and keywords) to the canonical doc and module for each. Code ownership lives here, not in feature-doc frontmatter. Update it whenever you add/move/delete a doc or move/rename owned source.
116
- - `docs/features/`: Living reference for implemented features. Carry **no** ownership frontmatter — a feature doc's code paths are declared by its row(s) in `docs/routing.md`. (An optional `anchors:` block — a qmd drift tripwire, see §3 — is the only frontmatter a doc may carry.)
117
- - `docs/architecture/`: System-wide patterns and the cross-module steering layer (domain model, glossary, non-goals, references, ADRs). Update when cross-cutting concerns change.
118
- - `docs/modules/{m}/`: Vertical bounded contexts, **declared** (not inferred from layout) and tied to code by their `docs/routing.md` patterns (the Module column groups routes into modules). Each owns `features/` + module-local `pillars/` (doctrine, lazy). There is no repo-wide `docs/pillars/`. Worth declaring at ≥2 genuine bounded contexts; a single-context app stays flat under `docs/features/`.
115
+ - `docs/features/`: Living reference for implemented features. Each feature doc **carries** the `owns:` / `module:` / `keywords:` / `status:` frontmatter — `owns:` declares the code-path globs it owns (the only ownership key), `module:` is an optional bounded-context label, `keywords:` are discovery terms, `status:` is `active`/`draft`/`deprecated`. The SessionStart hook unions every feature's `owns:` globs into the injected ownership index. (An optional `anchors:` block — a qmd drift tripwire, see §3 — is a separate tooling key a doc may additionally carry.)
116
+ - `docs/architecture/`: System-wide patterns and the cross-module steering layer (domain model, glossary, non-goals, references, ADRs). A module's cross-cutting prose lives here (or in a browse-folder `Readme.md`). Update when cross-cutting concerns change.
119
117
  - `docs/operations/`: How-to procedures for setup, development, and deployment. Update when workflows change.
120
118
  - `docs/history/plans/`: Historical. Must have `Status:` field. Never modify after completion.
121
119
  - `docs/history/changelog/`: Historical. Append-only.
122
- - `docs/history/research/{topic}/`: Deep-research artifacts — the dumped output of a research pass, one folder per topic (conventionally `README.md` synthesis + `findings.md` verified claims & citations + `sources.md`). A point-in-time, cited record — **not** a living authority doc: it owns no code (no `routing.md` row, no frontmatter) and is never edited to "stay current." A spec/plan links to it for grounding; a new question gets a new topic folder.
120
+ - `docs/history/research/{topic}/`: Deep-research artifacts — the dumped output of a research pass, one folder per topic (conventionally `README.md` synthesis + `findings.md` verified claims & citations + `sources.md`). A point-in-time, cited record — **not** a living authority doc: it owns no code (no `owns:` frontmatter) and is never edited to "stay current." A spec/plan links to it for grounding; a new question gets a new topic folder.
121
+ - `docs/brainstorm/{topic}/`: Kept design records — the committed Brainstorming-Mode session for a topic (`state.md` + `pillars/`), written by the `brainstorm` skill and **kept** after harvest as the provenance the steering pillars distil from. Author-created (never scaffolded empty), one subfolder per design conversation. Owns no code (no `owns:` frontmatter); the harvest copies its conclusions into `architecture/`/`history/` while the record stays in place. Retire a topic's folder by hand only when the design line is dead.
123
122
  - `docs/history/backlog.md`: Tracked work items. Append new items under appropriate priority.
124
123
 
125
124
  ## Health Log
@@ -132,55 +131,11 @@ Plan (Status: Draft) → Implementation → Feature Doc or Architecture Update
132
131
 
133
132
  ---
134
133
 
135
- ## 2.5 docs/routing.md (Code-Path Ownership Map)
136
-
137
- Use for: the single hand-maintained map from code paths (and keywords) to the canonical doc + module. This is the source of truth for code ownership — feature docs carry no ownership frontmatter. Scaffold it once any feature doc owns code.
138
-
139
- ```
140
- # Routing
141
-
142
- The single map from code paths (and keywords) to the doc that is canonical for them, and the module each belongs to. The source of truth for code-path ownership — feature docs carry no ownership frontmatter. Read this before touching unfamiliar code, then read the mapped doc.
143
-
144
- > **One canonical doc per path.** When two patterns match the same path, the **narrower** pattern wins; an equal-specificity overlap is a conflict — resolve it before merging. Hand-maintained — there is no generator. Keep it in sync when you add/move/delete a doc or move/rename owned source.
145
-
146
- ## File-Pattern Routes
147
-
148
- | Pattern | Module | Canonical Doc | Memory |
149
- | ------- | ------ | ------------- | ------ |
150
- | `src/auth/**` | auth | features/login.md | memory/main.md |
151
- | `src/billing/**` | billing | modules/billing/features/invoicing.md | — |
152
-
153
- - **Pattern** — the narrowest glob covering the files the doc is canonical for. A doc may have several rows.
154
- - **Module** — the declared module the pattern belongs to, or `—` if the repo is flat (no module declared). Grouping rows by this column is how a module is tied to code.
155
- - **Canonical Doc** — the one doc to read before changing matching files (`features/…` when flat, `modules/{m}/features/…` when the module is declared).
156
- - **Memory** — the `docs/memory/` file with domain knowledge for this area, or `—`.
157
-
158
- ## Keyword Routes
159
-
160
- | Keyword / topic | Canonical Doc |
161
- | --------------- | ------------- |
162
- | auth, login, SSO, refresh | features/login.md |
163
-
164
- ## Top-Level Folders
165
-
166
- | Folder | Purpose | Doc |
167
- | ------ | ------- | --- |
168
- | `src/` | {what lives here} | {doc} |
169
-
170
- ## How to Add a Route
171
-
172
- 1. Add/extend a **File-Pattern Routes** row — narrowest pattern that doesn't overlap an existing row at equal specificity; set its Module (or `—`).
173
- 2. Add keyword row(s) for discoverability.
174
- 3. When you move/rename owned source, update the matching pattern(s) here — this map is hand-maintained.
175
- ```
176
-
177
- ---
178
-
179
134
  ## 3. Code-Path Ownership & Anchors
180
135
 
181
- **Ownership.** A feature doc is the canonical reference for the code paths mapped to it in `docs/routing.md` (File-Pattern Routes). Feature docs declare ownership through their routing row(s), **not** through frontmatter. To find what a doc owns, read its rows in `routing.md`; to find the doc for a path, match the path against the patterns there (narrower wins). See the **routing-map derivation** in `SKILL.md` for turning code into routing rows.
136
+ **Ownership.** A feature doc is the canonical reference for the code paths in its **`owns:` frontmatter** — the only ownership key. To find what a doc owns, read its `owns:` globs; to find the doc for a path, match the path against the injected ownership index (the union of every feature's `owns:` globs), narrower glob wins. See **Frontmatter Derivation** in `SKILL.md` for turning code into `owns:` globs.
182
137
 
183
- **Anchors (optional — the only frontmatter a living doc may carry).** A doc may carry an `anchors:` block — a qmd drift tripwire, orthogonal to ownership:
138
+ **Anchors (optional tooling key).** A doc may additionally carry an `anchors:` block — a qmd drift tripwire, orthogonal to ownership:
184
139
 
185
140
  ```yaml
186
141
  ---
@@ -189,7 +144,7 @@ anchors:
189
144
  ---
190
145
  ```
191
146
 
192
- `anchors` is a list of qmd queries (or `#docid`s) that re-resolve to the code/facts this doc abstracts as they move; anchors are retrieval context plus a drift tripwire, never a contract — an anchor that returns nothing IS the drift signal, nothing auto-rewrites from an anchor result, and the doc's prose stays the human-owned abstraction. They detect **doc-area drift** (the subject moving or vanishing from the corpus), not a pure code rename — the query also matches the doc's own prose, so a rename that leaves the text unchanged won't shift the result; code-symbol drift is the maintenance named-referent check's job, and anchors complement it rather than replace it. Resolved via `qmd query --format json -c <collection>` against this repo's collections; absent qmd ⇒ anchors are inert (no error). Never required on any doc. `anchors:` may appear on any living doc the maintenance anchor-drift check globs — `docs/features/`, `docs/architecture/`, and `docs/operations/`.
147
+ `anchors` is an optional list of qmd queries (or `#docid`s) that re-resolve to the code a doc abstracts as it moves. It is a drift tripwire, never a contract — an anchor that returns nothing IS the drift signal, and nothing auto-rewrites from an anchor result. It is read on demand by the maintenance anchor-drift check, never injected, and inert when qmd is absent.
193
148
 
194
149
  ---
195
150
 
@@ -282,7 +237,7 @@ description: Shared knowledge accumulated across agent sessions. All agents shou
282
237
  ## Documentation Baseline
283
238
 
284
239
  - **Baselined:** {today}
285
- - **Structure:** v{harness-version} (architecture, features, operations, history, memory; + modules/, tests/ when present)
240
+ - **Structure:** v{harness-version} (architecture, features, operations, history, memory; + tests/ when present)
286
241
  - **Spec version:** v{harness-version}
287
242
  <!-- v{harness-version} resolves to the installed harness version — read it from `.claude/harness.json` (`version`) / `docs/structure.md` frontmatter (`harness-version`); never hardcode a literal version here. -->
288
243
 
@@ -335,17 +290,21 @@ The four research-derived sections (**Affected Modules**, **Conventions to Follo
335
290
 
336
291
  ```yaml
337
292
  ---
338
- anchors: # optional — the only frontmatter a feature doc may carry; see §3
293
+ owns: ["src/feature/**", "src/other/file.ts"] # required — code-path globs this doc owns (the only ownership key)
294
+ module: billing # optional — single bounded-context label; omit if cross-cutting
295
+ keywords: [invoice, pdf] # required — discovery terms
296
+ status: active # required — active | draft | deprecated
297
+ anchors: # optional extra — a qmd drift tripwire; see §3
339
298
  - "qmd query: wire envelope invariants"
340
299
  ---
341
300
  ```
342
301
 
343
- > This doc carries **no** ownership frontmatter. Declare the code paths it owns as File-Pattern Routes row(s) in `docs/routing.md` (§2.5) — projected at Draft, confirmed at Active.
302
+ > Declare the code paths it owns in its `owns:` frontmatter — projected at Draft, confirmed against real code at Active.
344
303
 
345
304
  ```
346
305
  # {Feature Name}
347
306
 
348
- **Status:** Draft | Active <!-- Draft: in design or in flight. Active: implemented and maintained. -->
307
+ <!-- Lifecycle lives in the frontmatter `status:` key (active | draft | deprecated) — the single source of truth. Don't restate it in the body. -->
349
308
  **Plan:** [history/plans/YYYY-MM-DD-feature-name.md](../history/plans/YYYY-MM-DD-feature-name.md) <!-- added once a plan exists -->
350
309
 
351
310
  ## Goal
@@ -388,7 +347,7 @@ High-level shape of the solution. ASCII diagram if it helps. Implementation spec
388
347
 
389
348
  ## Ownership Conflicts
390
349
 
391
- (From spec-mode research) Existing feature docs whose `docs/routing.md` patterns overlap with the projected scope. Resolve per row before the plan starts — leave nothing unresolved.
350
+ (From spec-mode research) Existing feature docs whose `owns:` globs overlap with the projected scope. Resolve before the plan starts — leave nothing unresolved.
392
351
 
393
352
  | Conflicting doc | Overlapping path(s) | Resolution |
394
353
  |-----------------|---------------------|------------|
@@ -468,7 +427,7 @@ Sections fill in across the feature's lifecycle. No template swap — they accum
468
427
  | --- | --- | --- |
469
428
  | Status: Draft (design) | Goal, Goals & Non-Goals, Background, Approach, Open Questions, Risks | User interview |
470
429
  | Status: Draft (research) | Affected Modules, Conventions to Follow, Current Behavior, Ownership Conflicts | spec-mode agent |
471
- | Status: Draft → Active (implementation lands) | Architecture, Key Functions, State, Redux, Files; `docs/routing.md` row(s) confirmed against real code | Main agent (from actual code) |
430
+ | Status: Draft → Active (implementation lands) | Architecture, Key Functions, State, Redux, Files; `owns:` globs confirmed against real code | Main agent (from actual code) |
472
431
 
473
432
  Resolved Open Questions can be summarized into Background; unresolved ones stay visible.
474
433
 
@@ -563,7 +522,7 @@ Why this work is happening *now*. Link to the spec for *what* we're building; th
563
522
 
564
523
  ### Cross-Module Contracts Affected
565
524
 
566
- - List which cross-cutting contracts this plan touches (db schema, wire envelope, auth, events, env/config, …)
525
+ - List which cross-cutting contracts this plan affects (db schema, wire envelope, auth, events, env/config, …)
567
526
  - "None" is a valid answer and means the `boundary` check will pass cleanly
568
527
 
569
528
  ## Implementation Steps
@@ -575,7 +534,7 @@ Why this work is happening *now*. Link to the spec for *what* we're building; th
575
534
  ## Done Criteria
576
535
 
577
536
  - [ ] Implementation complete and verified
578
- - [ ] Affected docs updated (use `docs/routing.md` to find them)
537
+ - [ ] Affected docs updated (use the injected ownership index to find them)
579
538
  - [ ] Changelog entry created in `docs/history/changelog/`
580
539
  - [ ] Plan marked `Status: Complete`, **Completed:** date filled
581
540
 
@@ -637,7 +596,7 @@ path/to/another/file.js
637
596
 
638
597
  ## 9. Architecture Decision Record (ADR)
639
598
 
640
- Use for: capturing a single, point-in-time architectural decision with its context, alternatives considered, and consequences. Lives in `docs/history/adr/` — an ADR is a **historical decision record**, not the deployed-design source of truth (which lives in `docs/architecture/`). When the design later changes, update `docs/architecture/` and write a new superseding ADR; never rewrite a shipped ADR.
599
+ Use for: capturing a single, point-in-time architectural decision with its context, alternatives considered, and consequences. Lives in `docs/architecture/adr/` — co-located with the architecture it decides. An ADR is **immutable** once shipped: it records the decision as made, not the deployed-design source of truth (the living prose in `docs/architecture/`). When the design later changes, update `docs/architecture/` and write a new superseding ADR; never rewrite a shipped ADR.
641
600
 
642
601
  ### When to write an ADR
643
602
 
@@ -26,12 +26,12 @@ For new features or new systems, enter **Spec Mode** before Plan Mode.
26
26
 
27
27
  1. **Spec Mode**: Create or update a feature spec in `docs/features/{feature}.md` using the **Feature Documentation template** (Status: Draft) — see `.claude/skills/documentation/references/templates.md` §6. Use the **`spec-mode`** agent (`.claude/agents/spec-mode.md`) for codebase research; its findings drop directly into the template's research-derived sections (Affected Modules, Conventions to Follow, Current Behavior, Ownership Conflicts). Interview the user for the design-intent sections (Goal, Goals & Non-Goals, Background, Approach). Present the spec for approval before proceeding.
28
28
 
29
- 2. **Plan Mode**: Once the spec is approved, create a plan in `docs/history/plans/YYYY-MM-DD-feature-name.md` using the **Plan template** (see `.claude/skills/documentation/references/templates.md` §8). Link back to the feature spec in the **Spec** field. The template's **Proposed Changes** sections are load-bearing — the `boundary` skill (`check` mode) parses them to check boundary impact.
29
+ 2. **Plan Mode**: Once the spec is approved, create a plan in `docs/history/plans/YYYY-MM-DD-feature-name.md` using the **Plan template** (see `.claude/skills/documentation/references/templates.md` §8). Link back to the feature spec in the **Spec** field. The template's **Proposed Changes** sections are load-bearing — the `boundary` skill parses them to check boundary impact.
30
30
 
31
31
  3. **Completion**: When a plan is fully implemented:
32
32
  - Mark the plan `Status: Complete` in `docs/history/plans/` and fill the **Completed:** date. The plan is now frozen.
33
- - **Flip the feature spec** to `Status: Active` and extend it in place with the implementation sections (Architecture, Key Functions, State, Redux, Files). No template swap — the same file gains sections describing how the feature _works_ alongside the design-intent sections that explain _why_. Confirm `owns`/`touches` frontmatter against actual code; resolve any unresolved Open Questions by folding them into Background.
34
- - If `docs/routing.md` exists, use it to find other docs affected by the changes; otherwise glob `docs/features/**/*.md` and check `owns`/`touches` frontmatter. Update affected docs — or create new ones if a touched area has no doc yet.
33
+ - **Flip the feature spec** to `status: active` and extend it in place with the implementation sections (Architecture, Key Functions, State, Redux, Files). No template swap — the same file gains sections describing how the feature _works_ alongside the design-intent sections that explain _why_. Confirm the feature's `owns:` globs against actual code; resolve any unresolved Open Questions by folding them into Background.
34
+ - Use the injected ownership index to find other docs affected by the changes (and update the `owns:` globs of any feature doc whose source you moved or added). Update affected docs — or create new ones if a touched area has no doc yet.
35
35
 
36
36
  For **Product-level** work (new systems, unclear scope), the spec should also include: problem statement, key hypotheses, and open questions.
37
37
 
@@ -41,9 +41,10 @@ For **Product-level** work (new systems, unclear scope), the spec should also in
41
41
 
42
42
  Before modifying code in an unfamiliar area:
43
43
 
44
- 1. If **[`docs/routing.md`](docs/routing.md)** exists, read it for file-pattern → doc/agent mapping. If it doesn't exist yet, skip — the codebase may not have owned features.
45
- 2. Glob `docs/features/**/*.md` and check `owns` frontmatter to find the owning feature doc; read it before making changes.
46
- 3. If a `docs/memory/` file exists for the domain you're working in, read it for domain knowledge and failure modes
44
+ 1. Consult the **injected ownership index** — the generated `glob → doc · module · keywords · status` map, surfaced into context at session start (the union of every feature doc's `owns:` frontmatter). Match your path or topic (its `keywords:`) to the owning doc and read it before changes. (If no ownership index appears in context, the repo isn't reconciled — run `maintenance` in baseline mode to reconcile it.)
45
+ 2. If `qmd` is installed, run `qmd query --format json -c <collection> "<topic>"` for semantic recall over the indexed docs — prefer it when entering an unfamiliar area; absent ⇒ skip.
46
+ 3. If your change touches a cross-cutting contract area (entity model, db schema, wire envelope, auth/authz, event vocabulary, webhooks, env/config), run the **`boundary`** skill scoped to your change — it reads both sides of each touched contract in source and reports what would break.
47
+ 4. If a `docs/memory/` file exists for the domain you're working in, read it for domain knowledge and failure modes
47
48
 
48
49
  For the protocol on _writing_ to memory (which file, what belongs there, what doesn't), see **Project Memory** below.
49
50
 
@@ -71,24 +72,19 @@ When implementing a plan, if you discover work that is important but outside the
71
72
 
72
73
  ### Doc Ownership
73
74
 
74
- Feature docs in `docs/features/` must include YAML frontmatter with `owns`, `touches`, and `depends_on` fields. Architecture docs describe cross-cutting patterns and don't own specific files; operations docs describe procedures. Only feature docs need frontmatter.
75
+ Which doc is canonical for which code paths is the **feature doc's own frontmatter**. A feature doc (flat in `docs/features/`) carries `owns:` (code-path globs — the only ownership key), `module:` (a bounded-context label, omitted when cross-cutting), `keywords:` (discovery), and `status:`. Code → doc ownership is the union of every feature doc's `owns:` globs, surfaced as the generated ownership index at session start. Architecture docs describe cross-cutting patterns and don't own specific files; operations docs describe procedures. A living doc may additionally carry an optional `anchors:` block (a qmd drift tripwire, not ownership).
75
76
 
76
- The spec-mode agent checks for ownership conflicts during research. If conflicts are found, address them in the spec before proceeding.
77
+ The spec-mode agent checks for ownership conflicts during research — feature docs whose `owns:` globs overlap at equal specificity. If conflicts are found, address them in the spec before proceeding.
77
78
 
78
79
  ---
79
80
 
80
81
  ## Boundaries
81
82
 
82
- `docs/boundaries/` documents the repo's **typed application boundaries** — cascading failure boundaries where editing one module silently breaks another (shared state shapes, entity registration, cross-module string coupling, persistence rehydration, etc.). One component owns this surface — the **`boundary` skill** — with four modes over a shared `references/boundary-taxonomy.md`:
83
+ A boundary is a horizontal cross-cutting contract — entity model, db schema, wire envelope, auth/authz, event vocabulary, webhooks, env/config — where editing one side silently breaks the other. Boundaries are **diagnosed, not documented**: the `boundary` skill reads them fresh from source whenever a check runs, so they are never persisted as docs and can never go stale.
83
84
 
84
- - **`generate`** — baseline `docs/boundaries/` from the detected stack + IA
85
- - **`create`** — add or update a single boundary file
86
- - **`check`** — pre-implementation: check a proposed plan against `docs/boundaries/`, surfacing cascading risk early (the boundary's severity sets review depth)
87
- - **`init`** — reconcile + scan the live codebase for boundary violations + drift
85
+ **Invoke the `boundary` skill after a plan is approved and before its first implementation step.** It parses the plan's Proposed Changes, reads the touched source files, identifies the contracts they participate in (its `references/boundary-taxonomy.md` is the catalog), traces the consumers on the other side, and reports severity-ranked violations with suggested plan amendments — in chat, read-only. Fold the amendments into the plan before coding. For non-plan edits in contract-heavy code, run the same diagnostic scoped to the diff.
88
86
 
89
- Without `docs/boundaries/` populated (`generate`), the `check` and `init` modes have nothing to check against.
90
-
91
- > Agents and skills available in this harness come from the bound plugin (`plugin: code` above). Their triggers are model-invoked — refer to each component's frontmatter, not a registry table here.
87
+ > Agents and skills live under `.claude/agents/` and `.claude/skills/`. Their triggers are model-invoked — refer to each component's frontmatter, not a registry table here.
92
88
 
93
89
  ---
94
90
 
@@ -117,7 +113,7 @@ Unless explicitly requested:
117
113
 
118
114
  ### Folder Structure
119
115
 
120
- The six procedural folders below are fixed. Domain folders (e.g. `core/`) live as subfolders inside these — `docs/architecture/core/` for core module internals, `docs/features/{feature}/` for deep features. Discovery still flows through **[`docs/routing.md`](docs/routing.md)** when present.
116
+ The six procedural folders below are fixed. Domain folders (e.g. `core/`) live as subfolders inside these — `docs/architecture/core/` for core module internals, `docs/features/{group}/` as browse-only groupings (never modules). Discovery flows through the generated **ownership index** (from feature `owns:`/`keywords:` frontmatter), injected at session start.
121
117
 
122
118
  | Folder | Purpose | Mutability |
123
119
  | --- | --- | --- |
@@ -139,22 +135,17 @@ The six procedural folders below are fixed. Domain folders (e.g. `core/`) live a
139
135
 
140
136
  - **Prerequisite**: Before creating changelogs, feature docs, or plans, check that `docs/memory/index.md` exists and records a baseline. If not, prompt the user to baseline docs first.
141
137
  - After plan completion: create a `docs/history/changelog/YYYY-MM-DD-feature-name.md` entry + update the index in `docs/history/CHANGELOG.md` (no confirmation needed). Root-level `CHANGELOG.md` is not used — only `CLAUDE.md`, `AGENTS.md`, and `README.md` live in the repo root.
142
- - Update related docs affected by the changes (use `docs/routing.md` to find the right files if present; otherwise check `owns`/`touches` frontmatter in `docs/features/`)
138
+ - Update related docs affected by the changes (use the injected ownership index — feature `owns:` globs — to find the right files)
143
139
  - Non-plan changes (refactors, bug fixes, API changes): prompt user first
144
140
  - Multi-commit changes: include `Commits: abc1234, def5678`
145
141
 
146
142
  ### Keeping the Loop Tight
147
143
 
148
- When you create, move, or delete a doc:
144
+ When you create a new doc that owns code:
149
145
 
150
- - If **[`docs/routing.md`](docs/routing.md)** exists, update it — file-pattern routes and keyword routes
151
- - If creating a new top-level domain folder and routing.md exists: add the folder to routing.md's **Top-Level Folders** table
146
+ - Declare the code paths it owns in its own `owns:` frontmatter (plus `module:`/`keywords:`/`status:`); the generated ownership index picks it up at the next session start.
147
+ - Verify its `owns:` globs don't overlap another feature doc's at equal specificity.
152
148
 
153
149
  When you move or rename source files:
154
150
 
155
- - Check `owns`/`touches` frontmatter in the owning doc. Find the owning doc via `docs/routing.md` if present; otherwise glob `docs/features/**/*.md` and match against `owns` patterns. Update paths to match the new locations.
156
-
157
- When you create a new doc that owns code:
158
-
159
- - Add `owns`, `touches`, `depends_on` YAML frontmatter
160
- - Verify `owns` globs don't conflict with existing docs (compare against `owns` frontmatter across `docs/features/`)
151
+ - Update the `owns:` globs of the feature doc that owns them to the new paths.
@@ -14,7 +14,7 @@ You are a **thin orchestrator.** Every mechanic — the constant loop, the four
14
14
  ## When to offer a session
15
15
 
16
16
  - An explicit ask to think through a design at a strategic level (not "fix this bug" / "add this button"). This is the user invoking the work; hand it to `/brainstorm start`.
17
- - A user utterance **challenges a loaded pillar headline.** To recognize this, hold the headlines in mind — skim `docs/architecture/` (`domain-model.md`, `glossary.md`, `non-goals.md`, `open-questions.md`) and any `docs/modules/*/pillars/`. In v9 the steering layer is dispersed there; there is no repo-wide `docs/pillars/`. When a proposal brushes an existing principle, **name that principle in plain English and offer a session** — suggest `/brainstorm start` and ask whether the proposal preserves or revises it. Detection is yours; entry is the user's. **Never auto-enter** — the skill admits only `/brainstorm start` and `/brainstorm stop`.
17
+ - A user utterance **challenges a loaded pillar headline.** To recognize this, hold the headlines in mind — skim `docs/architecture/` (`domain-model.md`, `glossary.md`, `non-goals.md`, `open-questions.md`) and its `adr/` decision titles. The steering layer lives there; there are no `docs/modules/` or `docs/pillars/` folders. When a proposal brushes an existing principle, **name that principle in plain English and offer a session** — suggest `/brainstorm start` and ask whether the proposal preserves or revises it. Detection is yours; entry is the user's. **Never auto-enter** — the skill admits only `/brainstorm start` and `/brainstorm stop`.
18
18
 
19
19
  If none of those steering files exist yet (a freshly-baselined repo), a session still runs from the skill's templates, and the basis gate seeds it from a reference doc or a one-shot brain dump.
20
20
 
@@ -28,8 +28,8 @@ Four modes exist — **dump / interview / probe / converge** — and they change
28
28
  - **Suggest, never seize.** Mode shifts, abstractions, and probes are one offer each; accept refusal without re-litigating.
29
29
  - **Never write production code** while a session is open — load-bearing snippets are illustration only, inside the session folder.
30
30
 
31
- You don't perform the harvest yourself, and you don't presume a destination. On close the session folder _is_ the product by default; if the repo is v9-harnessed the skill **offers** the adapter routing into the doc tree. The skill's `## stop` section is the canonical harvest map — don't duplicate it.
31
+ You don't perform the harvest yourself, and you don't presume a destination. On close the skill **offers** the harvest, distilling the pillars' conclusions into wherever the harness routes them. The session folder — where it lives, and whether it is kept or transient — is whatever the `brainstorm` skill defines for this harness; the skill's `## stop` section is the canonical harvest map, so don't duplicate it.
32
32
 
33
33
  ## What you may write
34
34
 
35
- The transient session folder only (its pillars and `state.md`). Never edit the live docs directly — the harvest does that.
35
+ The session folder only (its pillars and `state.md`), wherever the `brainstorm` skill places it for this harness. Never edit the live docs directly — the harvest does that.
@@ -33,7 +33,7 @@ The heatmap needs rolling 1w / 1m / 3m windows, so default `since` to 3 months e
33
33
 
34
34
  1. If `./docs/memory/change-review.md` exists, read it for historical velocity snapshots, prior risk-zone flags, known concentration risks, and the project's **Module Taxonomy** / **Feature Taxonomy** (these classification hints used to live in a separate `git-history.md` memory file — they now live here).
35
35
  2. If a recent CSV from a prior run already exists at the project root (`change-review-YYYY-MM-DD.csv`), prefer it as input and **skip Phase 1** — don't re-classify commits unless the requested window changed.
36
- 3. Read `./docs/routing.md` File-Pattern Routes to map churn to owning feature docs (and their modules).
36
+ 3. Build the ownership map from feature `owns:` frontmatter — consult the injected ownership index (`glob → doc · module · keywords · status`), or glob `docs/features/**/*.md` and read each doc's `owns:` globs — to map churn to owning feature docs (and their `module:` labels).
37
37
 
38
38
  ---
39
39
 
@@ -207,8 +207,8 @@ Trend column: ↑ rising, ↓ falling, → steady, ↑↑ sharply rising, ↓↓
207
207
  For each module with high churn (top quartile in 1m window), check how contract-heavy and how covered it is:
208
208
 
209
209
  - Does its code own cross-cutting contract surfaces (schema/data access, wire handlers, auth/authz, event dispatch, env/config readers)? Skim the module's files to judge — contract-heavy churn is where silent breakage lives.
210
- - Is the module's `owns` doc up to date? (cross-reference with the maintenance agent's last drift check if available)
211
- - Does the module appear in `docs/routing.md`?
210
+ - Is the module's owning feature doc up to date? (cross-reference with the maintenance agent's last drift check if available)
211
+ - Do the module's code paths appear under any feature doc's `owns:` globs?
212
212
 
213
213
  Flag risk zones: high churn × contract-heavy × low doc coverage. These are where silent breakage is most likely.
214
214
 
@@ -231,7 +231,7 @@ Per module, list which authors made the most commits in the 3-month window. Surf
231
231
  - **Risk zones**: top 5 high-churn modules that own contract-heavy surfaces, with the specific contracts at risk named
232
232
  - **Stabilization signals**: modules where review overhead can decrease
233
233
  - **Concentration risks**: bus-factor and review-coverage flags
234
- - **Recommendations**: prioritized list — typically "run the `boundary` skill on changes touching X", "update routing.md to cover Y", "spread reviews of Z across more authors"
234
+ - **Recommendations**: prioritized list — typically "run the `boundary` skill on changes touching X", "add `owns:` coverage for Y to a feature doc", "spread reviews of Z across more authors"
235
235
 
236
236
  ### Update tracking
237
237