@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.
- package/README.md +8 -9
- package/bin/etna.js +63 -2
- package/data/harness-index.json +1 -1
- package/data/harnesses/code/CLAUDE.md +9 -10
- package/data/harnesses/code/agents/brainstorm.md +3 -3
- package/data/harnesses/code/agents/change-review.md +4 -4
- package/data/harnesses/code/agents/maintenance.md +177 -59
- package/data/harnesses/code/agents/spec-mode.md +3 -3
- package/data/harnesses/code/harness.json +2 -2
- package/data/harnesses/code/hooks/generate-ownership-index.mjs +148 -0
- package/data/harnesses/code/hooks/hooks.json +12 -0
- package/data/harnesses/code/skills/boundary/references/boundary-taxonomy.md +3 -3
- package/data/harnesses/code/skills/brainstorm/README.md +20 -12
- package/data/harnesses/code/skills/brainstorm/SKILL.md +4 -4
- package/data/harnesses/code/skills/brainstorm/exit-artifacts.md +62 -0
- package/data/harnesses/code/skills/brainstorm/templates/source-of-truth.md +49 -0
- package/data/harnesses/code/skills/distiller/SKILL.md +3 -3
- package/data/harnesses/code/skills/distiller/references/docs-mode.md +7 -7
- package/data/harnesses/code/skills/documentation/SKILL.md +23 -23
- package/data/harnesses/code/skills/documentation/references/templates.md +24 -65
- package/data/harnesses/etna/CLAUDE.md +18 -27
- package/data/harnesses/etna/agents/brainstorm.md +3 -3
- package/data/harnesses/etna/agents/change-review.md +4 -4
- package/data/harnesses/etna/agents/maintenance.md +177 -59
- package/data/harnesses/etna/agents/spec-mode.md +3 -3
- package/data/harnesses/etna/harness.json +2 -2
- package/data/harnesses/etna/hooks/generate-ownership-index.mjs +148 -0
- package/data/harnesses/etna/hooks/hooks.json +12 -0
- package/data/harnesses/etna/rules/npm-cli.md +88 -0
- package/data/harnesses/etna/skills/boundary/references/boundary-taxonomy.md +3 -3
- package/data/harnesses/etna/skills/brainstorm/README.md +20 -12
- package/data/harnesses/etna/skills/brainstorm/SKILL.md +4 -4
- package/data/harnesses/etna/skills/brainstorm/exit-artifacts.md +62 -0
- package/data/harnesses/etna/skills/brainstorm/templates/source-of-truth.md +49 -0
- package/data/harnesses/etna/skills/distiller/SKILL.md +3 -3
- package/data/harnesses/etna/skills/distiller/references/docs-mode.md +7 -7
- package/data/harnesses/etna/skills/documentation/SKILL.md +23 -23
- package/data/harnesses/etna/skills/documentation/references/templates.md +24 -65
- package/data/harnesses/hr/harness.json +2 -2
- package/data/harnesses/hr/skills/evaluator/criteria/testing.md +4 -4
- package/data/harnesses/mobile/CLAUDE.md +9 -10
- package/data/harnesses/mobile/agents/brainstorm.md +3 -3
- package/data/harnesses/mobile/agents/change-review.md +4 -4
- package/data/harnesses/mobile/agents/maintenance.md +177 -59
- package/data/harnesses/mobile/agents/spec-mode.md +3 -3
- package/data/harnesses/mobile/harness.json +2 -2
- package/data/harnesses/mobile/hooks/generate-ownership-index.mjs +148 -0
- package/data/harnesses/mobile/hooks/hooks.json +12 -0
- package/data/harnesses/mobile/skills/boundary/references/boundary-taxonomy.md +3 -3
- package/data/harnesses/mobile/skills/brainstorm/README.md +20 -12
- package/data/harnesses/mobile/skills/brainstorm/SKILL.md +4 -4
- package/data/harnesses/mobile/skills/brainstorm/exit-artifacts.md +62 -0
- package/data/harnesses/mobile/skills/brainstorm/templates/source-of-truth.md +49 -0
- package/data/harnesses/mobile/skills/distiller/SKILL.md +3 -3
- package/data/harnesses/mobile/skills/distiller/references/docs-mode.md +7 -7
- package/data/harnesses/mobile/skills/documentation/SKILL.md +23 -23
- package/data/harnesses/mobile/skills/documentation/references/templates.md +24 -65
- package/package.json +1 -1
- package/data/harnesses/code/agents/harness-manager.md +0 -184
- package/data/harnesses/code/skills/brainstorm/harvest.md +0 -26
- package/data/harnesses/etna/agents/harness-manager.md +0 -184
- package/data/harnesses/etna/skills/brainstorm/harvest.md +0 -26
- package/data/harnesses/mobile/agents/harness-manager.md +0 -184
- 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 `
|
|
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) | `
|
|
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/`
|
|
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/
|
|
116
|
-
- `docs/
|
|
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 `
|
|
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
|
|
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
|
|
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
|
|
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; +
|
|
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
|
-
|
|
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
|
-
>
|
|
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
|
-
|
|
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 `
|
|
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; `
|
|
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
|
|
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
|
|
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/
|
|
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
|
|
|
@@ -132,13 +132,13 @@ jq '[.results[] | select(
|
|
|
132
132
|
)]' /tmp/semgrep.json
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
-
**What
|
|
135
|
+
**What the pattern deliberately excludes, and why:**
|
|
136
136
|
|
|
137
137
|
- `error|exception` — matched every rule name containing those words (most security rules do), inflating findings ~10×.
|
|
138
138
|
- `injection|deserial|unsafe` — security territory; belongs in 1.4 Maintainability / SECURITY gate to avoid double-counting.
|
|
139
|
-
- `await|promise` (bare) —
|
|
139
|
+
- `await|promise` (bare) — scoped to `unchecked-await` / `unhandled-promise` so async-correctness rules aren't indiscriminately matched.
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
`p/security-audit` config is excluded — it produces security-skewed noise. Language packs alone carry the resilience rules we want.
|
|
142
142
|
|
|
143
143
|
Capture:
|
|
144
144
|
|
|
@@ -390,7 +390,7 @@ signals_used: [filesystem, gha, semgrep, llm, coderabbit_empty]
|
|
|
390
390
|
|
|
391
391
|
## Caveats
|
|
392
392
|
|
|
393
|
-
- Semgrep pre-built packs skew toward security.
|
|
393
|
+
- Semgrep pre-built packs skew toward security. A tight regex keeps resilience focus; worth 3–5 custom rules if scoring reveals gaps.
|
|
394
394
|
- CodeRabbit reuse is a calibrating modifier, not a primary axis; `null` on Free-plan walkthrough-only repos means no-op. Full rationale + plan-upgrade escape hatch in [`SKILL.md → CodeRabbit — calibrating modifier with null-data semantics`](../SKILL.md#coderabbit--calibrating-modifier-with-null-data-semantics).
|
|
395
395
|
- `AI_AUTHORED_SUSPECTED` flag (from 1.1) remains informational — LLM reviewer should note AI-generated resilience patterns (e.g. copy-pasted try/except blocks with identical logging).
|
|
396
396
|
- LLM sample size is 3. Diverse codebases may score unevenly. Evidence must name the files.
|
|
@@ -6,9 +6,9 @@ This file defines how AI agents (Claude, GPT, etc.) should work on this project.
|
|
|
6
6
|
|
|
7
7
|
## Bootstrap
|
|
8
8
|
|
|
9
|
-
> A missing `docs/structure.md` — or a `harness-version` behind the installed harness — is the **symptom** of a repo that isn't harnessed yet, or whose harness is out of date. Don't reconcile it by hand. Drive the **reconcile chain** — you (the main session) own it, because `
|
|
9
|
+
> A missing `docs/structure.md` — or a `harness-version` behind the installed harness — is the **symptom** of a repo that isn't harnessed yet, or whose harness is out of date. Don't reconcile it by hand. Drive the **reconcile chain** — you (the main session) own it, because `maintenance` is a sub-agent that can't run skills or spawn sub-agents:
|
|
10
10
|
>
|
|
11
|
-
> 1. Invoke **`
|
|
11
|
+
> 1. Invoke **`maintenance`** (`"baseline this repo"` / `"reconcile the harness"`). It auto-selects **baseline mode** from the missing/behind `harness-version`, reconciles `docs/`, stamps the version, then hands back.
|
|
12
12
|
> 2. If it hands back with a follow-up (typically the module proposal), re-invoke it to finish.
|
|
13
13
|
>
|
|
14
14
|
> Then continue. Each component's internals live in the component, not here.
|
|
@@ -42,7 +42,7 @@ Three peer modes plus a Completion step — enter wherever the user's thinking a
|
|
|
42
42
|
| **Spec** | new feature work | `spec-mode` agent + `documentation` skill | Plan |
|
|
43
43
|
| **Plan** | a spec is approved | `documentation` skill → `docs/history/plans/YYYY-MM-DD-{slug}.md` | Completion |
|
|
44
44
|
|
|
45
|
-
On **Completion**: freeze the plan (`Status: Complete`) and flip the feature spec to `
|
|
45
|
+
On **Completion**: freeze the plan (`Status: Complete`) and flip the feature spec to `status: active`, extending it with how-it-works sections and confirming its `owns:` globs against the actual code; then distil the plan's trail — if the memory inbox (`docs/memory/inbox/`) holds entries, run `distiller facts` (inbox→fact-cards), then `distiller docs` for the just-completed feature's doc drafts any pending deltas for approval (presented, never auto-written). The `boundary` skill gates every approved plan before coding — it reads the source the plan touches and reports what would break (see **Boundaries** below); a brainstorm session is written to a **kept** record at `docs/brainstorm/{topic}/` (committed, one subfolder per topic), and on close harvest distils its conclusions by scope — doctrine, glossary, non-goals, and information-architecture changes → `docs/architecture/`, decisions → `docs/architecture/adr/`, backlog → `docs/history/backlog.md` — leaving the `docs/brainstorm/{topic}/` record in place as the provenance. Open questions block close.
|
|
46
46
|
|
|
47
47
|
---
|
|
48
48
|
|
|
@@ -50,11 +50,10 @@ On **Completion**: freeze the plan (`Status: Complete`) and flip the feature spe
|
|
|
50
50
|
|
|
51
51
|
Before modifying code in an unfamiliar area:
|
|
52
52
|
|
|
53
|
-
1.
|
|
54
|
-
2. If `qmd` is installed, `qmd query --format json -c <collection> "<topic>"` (repeat `-c` to span this repo's collections; `qmd collection list` names them)
|
|
53
|
+
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 feature doc and read it before changes. (If no ownership index appears in context, the repo isn't reconciled — see Bootstrap.)
|
|
54
|
+
2. If `qmd` is installed, run `qmd query --format json -c <collection> "<topic>"` (repeat `-c` to span this repo's collections; `qmd collection list` names them) for semantic recall over the indexed docs — prefer it when entering an unfamiliar area; absent ⇒ skip.
|
|
55
55
|
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.
|
|
56
|
-
4. If a `docs/memory/` file exists for the domain you're working in, read it for domain knowledge and failure modes
|
|
57
|
-
5. When you author a declared module's docs, its `docs/modules/{m}/CLAUDE.md` auto-loads (the pillar bootstrap) — follow it. For code work it's surfaced via step 1.
|
|
56
|
+
4. If a `docs/memory/` file exists for the domain you're working in, read it for domain knowledge and failure modes.
|
|
58
57
|
|
|
59
58
|
For the protocol on _writing_ to memory (which file, what belongs there, what doesn't), see **Project Memory** below.
|
|
60
59
|
|
|
@@ -88,9 +87,9 @@ When implementing a plan, if you discover work that is important but outside the
|
|
|
88
87
|
|
|
89
88
|
## Doc Ownership
|
|
90
89
|
|
|
91
|
-
Which doc is canonical for which code paths
|
|
90
|
+
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. A module is tied to code by the `owns:` globs of the docs carrying its `module:` label — not a folder, not a separate map. 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).
|
|
92
91
|
|
|
93
|
-
The spec-mode agent checks
|
|
92
|
+
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.
|
|
94
93
|
|
|
95
94
|
---
|
|
96
95
|
|
|
@@ -126,4 +125,4 @@ Unless explicitly requested:
|
|
|
126
125
|
Maintenance triggers (act on these without re-reading `structure.md`):
|
|
127
126
|
|
|
128
127
|
- After plan completion: add a `docs/history/changelog/` entry + update `docs/history/CHANGELOG.md` (no confirmation; include `Commits:` if multi-commit). Non-plan changes (refactors, fixes, API changes): prompt first.
|
|
129
|
-
- When you
|
|
128
|
+
- When you move or rename source files: update the `owns:` globs of the feature doc that owns them so the generated ownership index stays accurate. A new doc that owns code declares its paths in its own `owns:` frontmatter — there is no separate map to update.
|
|
@@ -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
|
|
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
|
|
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
|
|
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.
|
|
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
|
|
211
|
-
-
|
|
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", "
|
|
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
|
|