@nurix/etna 0.18.1 → 0.18.3

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 (67) hide show
  1. package/data/harness-index.json +2 -6
  2. package/data/harnesses/code/CLAUDE.md +1 -1
  3. package/data/harnesses/code/harness.json +3 -3
  4. package/data/harnesses/code/rules/nomenclature.md +11 -0
  5. package/data/harnesses/code/skills/brainstorm/harvest.md +1 -1
  6. package/data/harnesses/code/skills/documentation/SKILL.md +2 -0
  7. package/data/harnesses/code/skills/documentation/references/style-guide.md +23 -0
  8. package/data/harnesses/code/skills/documentation/references/templates.md +1 -1
  9. package/data/harnesses/discover/CLAUDE.md +25 -10
  10. package/data/harnesses/discover/harness.json +2 -2
  11. package/data/harnesses/discover/rules/cartography-coverage.md +94 -0
  12. package/data/harnesses/discover/rules/cartography-flows.md +99 -0
  13. package/data/harnesses/discover/rules/cartography-ia.md +88 -0
  14. package/data/harnesses/discover/rules/cartography.md +109 -0
  15. package/data/harnesses/discover/rules/evaluation.md +3 -1
  16. package/data/harnesses/discover/rules/ingestion.md +1 -1
  17. package/data/harnesses/discover/rules/self-correction.md +35 -23
  18. package/data/harnesses/hr/harness.json +1 -1
  19. package/data/harnesses/kb-agi/harness.json +1 -1
  20. package/package.json +1 -1
  21. package/data/harnesses/code-fable/.prettierignore +0 -12
  22. package/data/harnesses/code-fable/.prettierrc.json +0 -3
  23. package/data/harnesses/code-fable/.vscode/settings.json +0 -10
  24. package/data/harnesses/code-fable/CLAUDE.md +0 -124
  25. package/data/harnesses/code-fable/agents/brainstorm.md +0 -35
  26. package/data/harnesses/code-fable/agents/change-review.md +0 -251
  27. package/data/harnesses/code-fable/agents/harness-manager.md +0 -181
  28. package/data/harnesses/code-fable/agents/maintenance.md +0 -122
  29. package/data/harnesses/code-fable/agents/performance-review.md +0 -223
  30. package/data/harnesses/code-fable/agents/spec-mode.md +0 -56
  31. package/data/harnesses/code-fable/harness.json +0 -12
  32. package/data/harnesses/code-fable/hooks/hooks.json +0 -27
  33. package/data/harnesses/code-fable/hooks/lib/redact.mjs +0 -35
  34. package/data/harnesses/code-fable/hooks/prompt-recall.mjs +0 -155
  35. package/data/harnesses/code-fable/hooks/session-reflect.mjs +0 -285
  36. package/data/harnesses/code-fable/rules/general.md +0 -83
  37. package/data/harnesses/code-fable/rules/nomenclature.md +0 -30
  38. package/data/harnesses/code-fable/rules/typescript.md +0 -19
  39. package/data/harnesses/code-fable/skills/boundary/SKILL.md +0 -49
  40. package/data/harnesses/code-fable/skills/boundary/references/boundary-taxonomy.md +0 -796
  41. package/data/harnesses/code-fable/skills/brainstorm/README.md +0 -136
  42. package/data/harnesses/code-fable/skills/brainstorm/SKILL.md +0 -135
  43. package/data/harnesses/code-fable/skills/brainstorm/harvest.md +0 -26
  44. package/data/harnesses/code-fable/skills/brainstorm/templates/backlog.md +0 -39
  45. package/data/harnesses/code-fable/skills/brainstorm/templates/build.md +0 -37
  46. package/data/harnesses/code-fable/skills/brainstorm/templates/decisions.md +0 -29
  47. package/data/harnesses/code-fable/skills/brainstorm/templates/doctrine.md +0 -31
  48. package/data/harnesses/code-fable/skills/brainstorm/templates/domain-model.md +0 -25
  49. package/data/harnesses/code-fable/skills/brainstorm/templates/glossary.md +0 -20
  50. package/data/harnesses/code-fable/skills/brainstorm/templates/milestones.md +0 -43
  51. package/data/harnesses/code-fable/skills/brainstorm/templates/non-goals.md +0 -17
  52. package/data/harnesses/code-fable/skills/brainstorm/templates/plan-doc.md +0 -61
  53. package/data/harnesses/code-fable/skills/brainstorm/templates/questions.md +0 -36
  54. package/data/harnesses/code-fable/skills/brainstorm/templates/references.md +0 -28
  55. package/data/harnesses/code-fable/skills/brainstorm/templates/rejected.md +0 -29
  56. package/data/harnesses/code-fable/skills/brainstorm/templates/state.md +0 -1
  57. package/data/harnesses/code-fable/skills/brainstorm/templates/tech.md +0 -23
  58. package/data/harnesses/code-fable/skills/brainstorm/templates/thesis.md +0 -21
  59. package/data/harnesses/code-fable/skills/distiller/SKILL.md +0 -90
  60. package/data/harnesses/code-fable/skills/distiller/references/docs-mode.md +0 -299
  61. package/data/harnesses/code-fable/skills/distiller/references/method.md +0 -94
  62. package/data/harnesses/code-fable/skills/documentation/SKILL.md +0 -128
  63. package/data/harnesses/code-fable/skills/documentation/references/examples.md +0 -162
  64. package/data/harnesses/code-fable/skills/documentation/references/style-guide.md +0 -285
  65. package/data/harnesses/code-fable/skills/documentation/references/templates.md +0 -857
  66. package/data/harnesses/code-fable/skills/workflow-mapper/SKILL.md +0 -451
  67. package/data/harnesses/code-fable/skills/workflow-mapper/references/patterns.md +0 -214
@@ -1,857 +0,0 @@
1
- # Documentation Templates
2
-
3
- Templates for all documentation needs.
4
-
5
- ---
6
-
7
- ## 1. docs/README.md (Documentation Root)
8
-
9
- Use for: the entry point for all documentation in a repo. Created during baseline audit.
10
-
11
- ```
12
- # {Project Name} Documentation
13
-
14
- Technical documentation for {project description}.
15
-
16
- > For documentation organization, authority map, and folder rules, see **[structure.md](structure.md)**.
17
-
18
- ---
19
-
20
- ## Quick Links
21
-
22
- | Document | Description |
23
- | --------------------------------- | ------------------------------------ |
24
- | [Structure](structure.md) | Documentation entry point and rules |
25
- | [Setup](operations/setup.md) | Installation and configuration guide |
26
-
27
- ---
28
-
29
- ## Architecture
30
-
31
- System design, patterns, and technical decisions.
32
-
33
- - [system-design.md](architecture/system-design.md) - High-level system architecture
34
- {list all architecture docs}
35
-
36
- ---
37
-
38
- ## Features
39
-
40
- Living reference docs for implemented features (how things currently work).
41
-
42
- - [feature-name.md](features/feature-name.md) - Feature description
43
- {list all feature docs}
44
-
45
- ---
46
-
47
- ## Operations
48
-
49
- How to run, develop, and deploy.
50
-
51
- - [setup.md](operations/setup.md) - Installation and configuration guide
52
- {list all operations docs}
53
-
54
- ---
55
-
56
- ## History
57
-
58
- Everything frozen or append-only.
59
-
60
- - [CHANGELOG.md](history/CHANGELOG.md) - Master changelog index
61
- - [changelog/](history/changelog/) - Individual changelog entries
62
- - [plans/](history/plans/) - Historical implementation plans
63
- - [backlog.md](history/backlog.md) - Tracked work items and technical debt
64
-
65
- ---
66
-
67
- ## Contributing
68
-
69
- See [CLAUDE.md](../CLAUDE.md) for documentation guidelines.
70
- ```
71
-
72
- ---
73
-
74
- ## 2. docs/structure.md (Authority Map)
75
-
76
- Use for: defining which folder owns which topic and how docs are maintained.
77
-
78
- ```
79
- ---
80
- harness-version: 12
81
- ---
82
-
83
- # Documentation Structure
84
-
85
- > This file is the entry point for understanding the docs folder.
86
- > `harness-version` above is the repo's single baseline/version sentinel — the `harness-manager` agent owns it and stamps the installed design epoch on every reconcile.
87
-
88
- ## Authority Map
89
-
90
- Each topic has one canonical location. Read from here, not from plans or changelogs.
91
-
92
- | Topic | Authority | Key Files |
93
- | ----- | --------- | --------- |
94
- | System architecture + steering | `docs/architecture/` | domain-model, glossary, non-goals, references, adr/ |
95
- | Feature behavior | `docs/features/` (or `docs/modules/{m}/features/`) | {key files} |
96
- | Declared modules (bounded contexts) | `docs/modules/{m}/` | `features/` + `pillars/` |
97
- | Setup & development | `docs/operations/` | {key files} |
98
- | Historical plans | `docs/history/plans/` | YYYY-MM-DD-name.md |
99
- | Change records | `docs/history/changelog/` | Individual entries |
100
- | Backlog | `docs/history/` | backlog.md |
101
-
102
- ## Document Lifecycle
103
-
104
- Plan (Status: Draft) → Implementation → Feature Doc or Architecture Update → Changelog Entry
105
-
106
- - Plans freeze at completion — never updated to reflect current code
107
- - Changelogs summarize + link to feature docs — no duplicated schemas
108
- - Feature docs are the living reference — updated when code changes
109
-
110
- ## Folder Rules
111
-
112
- - `docs/features/`: Living reference for implemented features. Each spec includes YAML frontmatter with `owns`, `touches`, `depends_on` fields declaring code ownership.
113
- - `docs/architecture/`: System-wide patterns and the cross-module steering layer (domain model, glossary, non-goals, references, ADRs). Update when cross-cutting concerns change.
114
- - `docs/modules/{m}/`: Vertical bounded contexts, **declared** (not inferred from layout) and tied to code by their `owns` globs. 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/operations/`: How-to procedures for setup, development, and deployment. Update when workflows change.
116
- - `docs/history/plans/`: Historical. Must have `Status:` field. Never modify after completion.
117
- - `docs/history/changelog/`: Historical. Append-only.
118
- - `docs/history/backlog.md`: Tracked work items. Append new items under appropriate priority.
119
-
120
- ## Health Log
121
-
122
- <!-- Updated by maintenance agent -->
123
- | Date | Review Summary |
124
- | ---- | -------------- |
125
- | {today} | Initial baseline — v{harness-version} structure established |
126
- ```
127
-
128
- ---
129
-
130
- ## 3. Feature Ownership Frontmatter
131
-
132
- Use for: every feature doc in `docs/features/`. Declares which source files this doc is authoritative for.
133
-
134
- ```yaml
135
- ---
136
- owns:
137
- - src/feature-name/**
138
- - app/feature-name/**
139
- touches:
140
- - src/shared/utils/feature-helper.js
141
- depends_on:
142
- - docs/architecture/system-design.md
143
- anchors:
144
- - "qmd query: feature-name persistence shape"
145
- ---
146
- ```
147
-
148
- - `owns`: Glob patterns for files this feature doc is the canonical reference for
149
- - `touches`: Files this feature interacts with but doesn't own
150
- - `depends_on`: Other docs that must be read for full context
151
- - `anchors` (optional): 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. The feature template ships the exemplar, but `anchors:` may appear on any living doc the maintenance anchor-drift check globs — `docs/features/`, `docs/architecture/`, and `docs/operations/` — so the convention and the check stay one mental model.
152
-
153
- ---
154
-
155
- ## 4. Scaffold Files (create if missing)
156
-
157
- These standard files must exist after every baseline. Create them with these scaffolds if the repo doesn't already have them.
158
-
159
- ### docs/history/CHANGELOG.md
160
-
161
- ```
162
- # Changelog
163
-
164
- All notable changes to {Project Name} will be documented in this file.
165
-
166
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
167
-
168
- ---
169
-
170
- ## [Unreleased]
171
-
172
- {entries added here as work proceeds}
173
-
174
- ---
175
-
176
- ## Links
177
-
178
- - [Setup Guide](../operations/setup.md)
179
- - [Architecture](../architecture/)
180
-
181
- ---
182
-
183
- ## How to Update This Changelog
184
-
185
- 1. Create a dated change file in `docs/history/changelog/`:
186
- `docs/history/changelog/YYYY-MM-DD-feature-name.md`
187
-
188
- 2. Update this CHANGELOG.md with a high-level summary linking to the detail file
189
-
190
- 3. Follow Keep a Changelog categories:
191
- - **Added** for new features
192
- - **Changed** for changes in existing functionality
193
- - **Deprecated** for soon-to-be removed features
194
- - **Removed** for now removed features
195
- - **Fixed** for bug fixes
196
- - **Security** for security improvements
197
- ```
198
-
199
- ### docs/history/backlog.md
200
-
201
- ```
202
- # Backlog
203
-
204
- Tracked work items, technical debt, and planned improvements. Append new items under the appropriate priority.
205
-
206
- ---
207
-
208
- ## Format
209
-
210
- - **[P0]** Description — discovered by [plan-name or agent-name]
211
-
212
- ---
213
-
214
- ## P0 — Critical
215
-
216
- {items here}
217
-
218
- ## P1 — High
219
-
220
- {items here}
221
-
222
- ## P2 — Medium
223
-
224
- {items here}
225
-
226
- ## P3 — Low
227
-
228
- {items here}
229
- ```
230
-
231
- ### docs/memory/index.md
232
-
233
- ```
234
- ---
235
- type: cross-session-learnings
236
- description: Shared knowledge accumulated across agent sessions. All agents should consult and update this file.
237
- ---
238
-
239
- # Cross-Session Learnings
240
-
241
- ## Documentation Baseline
242
-
243
- - **Baselined:** {today}
244
- - **Structure:** v{harness-version} (architecture, features, operations, history, memory; + modules/, tests/ when present)
245
- - **Spec version:** v{harness-version}
246
- <!-- v{harness-version} resolves to the installed design epoch — read it from `.claude/harness.json` (`epoch`) / `docs/structure.md` frontmatter (`harness-version`); never hardcode a literal version here. -->
247
-
248
- ## Knowledge Tiers
249
-
250
- Memory is a gradient — volume falls, signal rises, one hop down each tier. Tiers describe themselves here even before they fill:
251
-
252
- - **Inbox** (`docs/memory/inbox/`) — per-actor queue of session lessons, written by the `session-reflect` hook at session end and consumed by the distiller on digestion. Transient by design, rarely read directly.
253
- - **Fact-cards** (`docs/memory/facts/`) — distilled, provenance-linked atomic facts, written by the distiller (`facts` mode) from inbox entries and resurfaced at prompt time by the `prompt-recall` hook.
254
- - **This index** — the curated read tier: the learnings list below, distilled from the colder tiers and hand-appended.
255
-
256
- ## Learnings
257
-
258
- {Agents append learnings here as they discover gotchas, patterns, and architecture notes}
259
- ```
260
-
261
- ### docs/memory/main.md
262
-
263
- ```
264
- ---
265
- type: project-memory
266
- owner: main-agent
267
- description: Project-wide patterns and conventions confirmed in this codebase. Project facts only — user-centric facts go in ~/.claude/.
268
- ---
269
-
270
- # Main Agent — Project Memory
271
-
272
- Append entries below, oldest at bottom. Format:
273
-
274
- ## YYYY-MM-DD — {topic}
275
-
276
- {1-3 line fact, with file paths or references where relevant}
277
-
278
- ---
279
-
280
- ## {today} — Baseline
281
-
282
- Memory file initialized during documentation baseline.
283
- ```
284
-
285
- > The per-actor memory **inbox** (`docs/memory/inbox/`) is _not_ a baseline scaffold — the `session-reflect` hook creates it mechanically on the first reflected session. See **§11 Memory inbox entry** for its format.
286
-
287
- ---
288
-
289
- ## 5. Feature Documentation (docs/features/{feature}.md)
290
-
291
- Use for: every feature in `docs/features/`. The same file persists from design (Status: Draft) through implementation to live reference (Status: Active). Sections fill in as the feature matures — no template swap.
292
-
293
- The four research-derived sections (**Affected Modules**, **Conventions to Follow**, **Current Behavior**, **Ownership Conflicts**) map 1:1 to spec-mode's return shape. The orchestrator drops spec-mode's findings into those slots without restructuring.
294
-
295
- ```yaml
296
- ---
297
- owns:
298
- - src/feature-name/** # projected at Draft, confirmed at Active
299
- touches:
300
- - src/shared/state/feature.js
301
- depends_on:
302
- - docs/features/related-feature.md
303
- anchors: # optional — see §3 frontmatter reference
304
- - "qmd query: wire envelope invariants"
305
- ---
306
- ```
307
-
308
- ```
309
- # {Feature Name}
310
-
311
- **Status:** Draft | Active <!-- Draft: in design or in flight. Active: implemented and maintained. -->
312
- **Plan:** [history/plans/YYYY-MM-DD-feature-name.md](../history/plans/YYYY-MM-DD-feature-name.md) <!-- added once a plan exists -->
313
-
314
- ## Goal
315
-
316
- One sentence. What this feature accomplishes, in user-facing terms.
317
-
318
- ## Goals & Non-Goals
319
-
320
- **In scope**
321
- - Bullet 1
322
- - Bullet 2
323
-
324
- **Out of scope**
325
- - Bullet 1
326
-
327
- ## Background
328
-
329
- Why this feature exists. The user need, the business trigger, the constraint that pushed it above the line. One paragraph.
330
-
331
- (For Product-level work, also include: problem statement, key hypotheses, open questions.)
332
-
333
- ## Approach
334
-
335
- High-level shape of the solution. ASCII diagram if it helps. Implementation specifics belong in the plan.
336
-
337
- ## Affected Modules
338
-
339
- (From spec-mode research) Files, routes, components, slices this feature involves. Group by module.
340
-
341
- | Module | Path | Role in this feature |
342
- |--------|------|----------------------|
343
-
344
- ## Conventions to Follow
345
-
346
- (From spec-mode research) Naming patterns, structural patterns, doc-fit heuristics confirmed for the area being touched. Cite the source file(s) where the convention is established.
347
-
348
- ## Current Behavior
349
-
350
- (From spec-mode research) How the relevant part of the system works *today*, before this feature lands. Without this baseline the design intent is hard to evaluate.
351
-
352
- ## Ownership Conflicts
353
-
354
- (From spec-mode research) Existing feature docs whose `owns` or `touches` overlap with the projected scope. Resolve per row before the plan starts — leave nothing unresolved.
355
-
356
- | Conflicting doc | Overlapping path(s) | Resolution |
357
- |-----------------|---------------------|------------|
358
-
359
- ## Architecture
360
-
361
- [ASCII diagram. Fill once implementation lands. See style-guide.md for box-drawing patterns.]
362
-
363
- ## Key Functions
364
-
365
- ### `functionName(param1, param2)`
366
- **Goal:** What it accomplishes
367
- **Input:**
368
- - `param1` (type) - Description
369
- - `param2` (type) - Description
370
- **Output:** Return type and shape
371
- **Side Effects:** DB writes, API calls, state updates
372
-
373
- ### `hookName(config)`
374
- **Goal:** What it provides
375
- **Returns:** `{ data, loading, error }`
376
- **Triggers:** On mount, on change, manual
377
-
378
- ## State
379
-
380
- **Frontend (at persistence):**
381
- {
382
- "data": [],
383
- "changes": { "added": [], "updated": [], "removed": [] }
384
- // "cache": {} // UNUSED: Deprecated
385
- }
386
-
387
- **Storage:** localStorage `app_state`
388
-
389
- **Backend:**
390
- model Resource {
391
- id String @id
392
- data Json
393
- // oldField String? // UNUSED: Legacy
394
- }
395
-
396
- **API Shape:**
397
- { "status": 1, "data": {...} }
398
-
399
- ## Redux (if applicable)
400
-
401
- **Slice:** `sliceName`
402
-
403
- **Actions:**
404
- - `setData(payload)` - Replace all data
405
- - `upsertItem(item)` - Add or update single item
406
-
407
- **Selectors:**
408
- - `selectAll(state)` → `Array<Item>`
409
- - `selectById(state, id)` → `Item | undefined`
410
-
411
- ## Files
412
-
413
- - `src/path/to/main.js` - Core logic
414
- - `src/path/to/hooks.js` - React hooks
415
-
416
- ## Open Questions
417
-
418
- - Question — who decides, by when
419
- - (Resolved questions: fold the resolution into Background.)
420
-
421
- ## Risks
422
-
423
- - Risk — likelihood / impact / mitigation
424
- ```
425
-
426
- ### Section evolution
427
-
428
- Sections fill in across the feature's lifecycle. No template swap — they accumulate in place.
429
-
430
- | When | Sections written | Source |
431
- | --- | --- | --- |
432
- | Status: Draft (design) | Goal, Goals & Non-Goals, Background, Approach, Open Questions, Risks | User interview |
433
- | Status: Draft (research) | Affected Modules, Conventions to Follow, Current Behavior, Ownership Conflicts | spec-mode agent |
434
- | Status: Draft → Active (implementation lands) | Architecture, Key Functions, State, Redux, Files; frontmatter `owns`/`touches` confirmed against real code | Main agent (from actual code) |
435
-
436
- Resolved Open Questions can be summarized into Background; unresolved ones stay visible.
437
-
438
- ---
439
-
440
- ## 6. Changelog
441
-
442
- Use for: recording code changes with function-level detail.
443
-
444
- ```
445
- # YYYY-MM-DD - [Title]
446
-
447
- ## Summary
448
-
449
- Brief description of what changed and why.
450
-
451
- ## Changes
452
-
453
- ### Added
454
- - `newFunction(params)` in `path/to/file.js`
455
- - Purpose: What it does
456
- - Used by: Where it's called
457
-
458
- ### Modified
459
- - `existingFunction()` in `path/to/file.js`
460
- - Changed: What's different
461
- - Reason: Why it changed
462
- - Migration: What callers must do
463
-
464
- ### Removed
465
- - `oldFunction()` from `path/to/file.js`
466
- - Replaced by: `newFunction()`
467
-
468
- ## Breaking Changes
469
-
470
- ⚠️ **[Change description]**
471
- - Old: Previous behavior
472
- - New: Current behavior
473
- - Impact: What breaks
474
- - Migration: How to fix
475
-
476
- ## Migration Steps
477
-
478
- - [ ] Step 1
479
- - [ ] Step 2
480
-
481
- ## Files Changed
482
-
483
- - `src/path/file1.js` - Core changes
484
- - `src/path/file2.js` - Supporting updates
485
- ```
486
-
487
- ---
488
-
489
- ## 7. Plan (docs/history/plans/YYYY-MM-DD-feature-name.md)
490
-
491
- Use for: every implementation plan. Plans are created here directly with `Status: Draft`, flip to `Status: In Progress` when work starts, and freeze at `Status: Complete` or `Status: Abandoned`. Once frozen, never edit — write a new dated plan if scope changes.
492
-
493
- The `boundary` skill parses the **Proposed Changes** sections to check boundary impact before execution. Keep that structure stable — section headings and bullet shape are load-bearing for the parser.
494
-
495
- ```
496
- # {Feature Name}
497
-
498
- **Status:** Draft | In Progress | Complete | Abandoned
499
- **Spec:** [docs/features/{feature}.md](../../features/{feature}.md)
500
- **Started:** YYYY-MM-DD
501
- **Completed:** YYYY-MM-DD <!-- fill when status flips to Complete -->
502
-
503
- ## Background
504
-
505
- Why this work is happening *now*. Link to the spec for *what* we're building; this section is the motivation and the trigger. One paragraph.
506
-
507
- ## Proposed Changes
508
-
509
- ### New Files
510
-
511
- - `src/path/new-file.js` — purpose
512
-
513
- ### Modified Files
514
-
515
- - `src/path/existing.js` — what changes and why
516
-
517
- ### New Entities / State
518
-
519
- - `entities.foo` — new Redux slice / DB table / persisted shape
520
- - Persisted state addition: `state.bar.baz` (default `null` for existing users on rehydrate)
521
-
522
- ### API Changes
523
-
524
- - `POST /api/foo` — new route, request `{...}`, response `{status, data}`
525
- - `PUT /api/bar` — request shape changes; see Migration
526
-
527
- ### Cross-Module Contracts Affected
528
-
529
- - List which cross-cutting contracts this plan touches (db schema, wire envelope, auth, events, env/config, …)
530
- - "None" is a valid answer and means the `boundary` check will pass cleanly
531
-
532
- ## Implementation Steps
533
-
534
- 1. Concrete, ordered, testable
535
- 2. Each step ends with something verifiable
536
- 3. ...
537
-
538
- ## Done Criteria
539
-
540
- - [ ] Implementation complete and verified
541
- - [ ] Affected docs updated (use `docs/routing.md` to find them)
542
- - [ ] Changelog entry created in `docs/history/changelog/`
543
- - [ ] Plan marked `Status: Complete`, **Completed:** date filled
544
-
545
- ## Open Questions
546
-
547
- - Question — who decides, by when
548
-
549
- ## Risks
550
-
551
- - Risk — likelihood / impact / mitigation
552
- ```
553
-
554
- ---
555
-
556
- ## 8. Protected Files
557
-
558
- Use for: documenting critical files that need approval before modification.
559
-
560
- ```
561
- # Protected Files
562
-
563
- Critical files requiring approval before modification.
564
-
565
- ## File List
566
-
567
- # Category 1 - Description
568
- path/to/critical/file1.js
569
- path/to/critical/file2.js
570
-
571
- # Category 2 - Description
572
- path/to/another/file.js
573
-
574
- ## Risk Summary
575
-
576
- | Category | Risk if Broken |
577
- |------------|-----------------|
578
- | Category 1 | Specific impact |
579
- | Category 2 | Specific impact |
580
-
581
- ## Critical Logic
582
-
583
- ### Category 1: [Name]
584
-
585
- **Purpose:** What these files do
586
-
587
- **Key Functions:**
588
-
589
- | Function | Input | Output | Purpose |
590
- |------------|-------|--------|----------------|
591
- | `func1()` | Type | Type | What it does |
592
- | `func2()` | Type | Type | What it does |
593
-
594
- **Critical Behavior:**
595
- - Important point 1
596
- - Important point 2
597
- ```
598
-
599
- ---
600
-
601
- ## 9. Architecture Decision Record (ADR)
602
-
603
- Use for: capturing a single, point-in-time architectural decision with its context, alternatives considered, and consequences. Lives in `docs/architecture/adr/`.
604
-
605
- ### When to write an ADR
606
-
607
- Write an ADR when **all three** apply:
608
-
609
- 1. The decision is architectural — affects system shape, contracts, or substrate choice, not internal implementation
610
- 2. Alternatives were genuinely considered and rejected
611
- 3. Future maintainers will ask "why did we do it this way?"
612
-
613
- Don't write an ADR for:
614
-
615
- - Standing principles or style preferences (those are stances, not decisions — put them in `docs/architecture/`)
616
- - Routine implementation choices with no rejected alternatives
617
- - Anything you'd be happy reversing without ceremony
618
-
619
- ### Lifecycle
620
-
621
- `Proposed` → `Accepted` → `Deprecated` → `Superseded by ADR-NNN`
622
-
623
- ADRs are **immutable after acceptance**. If the decision changes, write a new ADR that supersedes it. Update only the old ADR's `status` frontmatter field — never its body.
624
-
625
- ### Naming
626
-
627
- `ADR-NNN-short-title.md` — three-digit zero-padded number, kebab-case title. Numbers are assigned sequentially across the project and never reused.
628
-
629
- ### Structure
630
-
631
- Three sections are required: **Decision**, **Context**, **Consequences**. Everything else is optional — include only when warranted. Decision-first: readers should see the answer in the first paragraph.
632
-
633
- ### Template
634
-
635
- ```markdown
636
- ---
637
- title: "ADR-NNN: Short title in sentence case"
638
- status: Accepted # Proposed | Accepted | Deprecated | Superseded by ADR-NNN
639
- date: YYYY-MM-DD
640
- decision-owner: Name
641
- reviewers: [] # optional
642
- supersedes: # optional, e.g., ADR-005
643
- tags: [adr]
644
- ---
645
-
646
- # ADR-NNN: Short Title
647
-
648
- ## Decision
649
-
650
- [One paragraph, active voice. "We will…" Lead with the answer.]
651
-
652
- ## Context
653
-
654
- [The forces in play. What is the problem? Why does it need a decision now? Technical, political, social, and project-local pressures.]
655
-
656
- ## Consequences
657
-
658
- **Positive:**
659
-
660
- - [What becomes easier]
661
-
662
- **Negative:**
663
-
664
- - [What becomes harder, what we accept reluctantly]
665
-
666
- **Risks:**
667
-
668
- - [Second-order effects you can already see, with mitigations if known]
669
-
670
- <!-- Optional sections below. Include only when warranted by the decision's weight. -->
671
-
672
- ## Decision Drivers
673
-
674
- [Hard non-negotiables vs. strong levers. Include when alternatives exist and the criteria aren't self-evident from Context.]
675
-
676
- ## Options Considered
677
-
678
- | Option | Pros | Cons | Outcome |
679
- | ------------ | ---- | ---- | --------------------- |
680
- | **Option A** | … | … | **CHOSEN** |
681
- | Option B | … | … | Eliminated — [reason] |
682
-
683
- ## Deep Comparison
684
-
685
- [Honest framing of the strongest alternative(s). Include when the table doesn't make the reasoning obvious. State the *real* reason each was rejected — not a strawman.]
686
-
687
- ## Architecture in Detail
688
-
689
- [Diagrams, code shape, layer responsibilities. Include when the decision implies non-trivial structure that readers need to understand alongside the *why*.]
690
-
691
- ## Implementation Plan
692
-
693
- | Phase | Scope | Duration |
694
- | ----- | ----- | -------- |
695
- | 1 | … | … |
696
-
697
- ## Open Questions
698
-
699
- 1. **[Question]** — _Default_: [stated default until resolved].
700
-
701
- ## Acknowledgements
702
-
703
- [Credit reviewers; name what they corrected. Include when reviewers materially shaped the doc.]
704
-
705
- ## References
706
-
707
- - [External link or cross-reference]
708
- ```
709
-
710
- ### Rules
711
-
712
- - One decision per ADR. If you find yourself describing two decisions, split into two ADRs.
713
- - Decision-first. The first paragraph after the heading is the answer; readers should not need to scroll.
714
- - No section numbering (`§5.1.1`). Use markdown headings only — inserting a section shouldn't renumber everything.
715
- - Frontmatter `status` is the single source of truth for lifecycle. Don't also write "Status: Accepted" in the body.
716
- - When superseding, set the old ADR's `status: "Superseded by ADR-NNN"` and the new ADR's `supersedes: ADR-OLD`.
717
- - The body is frozen at `Accepted`. Corrections to facts that were wrong at the time get a new ADR; typos and formatting fixes are fine.
718
-
719
- ---
720
-
721
- ## 10. Project Root README
722
-
723
- Use for: the human-facing entry point at the repository root (`/README.md`) — what visitors and new contributors land on. Distinct from `docs/README.md` (the agent/doc index — see §1). The two coexist; don't merge them.
724
-
725
- ### Strategy
726
-
727
- The root README answers, in order:
728
-
729
- 1. **What is this?** — one to two sentences, no marketing claims
730
- 2. **What do I get if I install it?** — capability families
731
- 3. **What's it built on?** — terse stack list with versions
732
- 4. **How do I run it?** — the three or four scripts that matter
733
- 5. **How is it laid out?** — directory tree, one-liner per significant folder
734
- 6. **How do I extend it?** — numbered contribution checklist
735
- 7. **What state is it in?** — pre-publish, beta, stable, internal
736
-
737
- Skip any section that doesn't apply. Don't pad to fill the template.
738
-
739
- ### Writing rules
740
-
741
- - **Sentence-case headings.** "Getting started", not "Getting Started".
742
- - **Concrete over abstract.** Real versions, real paths, real commands. No "leverages cutting-edge…".
743
- - **The tagline answers "what is this?"** — not "why is it great?". Two sentences max.
744
- - **Tables for enumeration** (routes, commands, endpoints). **Bullets for families and categories.**
745
- - **Directory tree as a code block**, not a nested markdown list.
746
- - **Numbered checklist** for "how to add a thing" — readers should be able to follow it top-to-bottom without re-reading.
747
- - **Point to `docs/` for depth.** The root README links into deep docs; it doesn't host them.
748
- - **Detect the package manager from the lockfile** (`pnpm-lock.yaml` → pnpm, `yarn.lock` → yarn, otherwise npm) and write commands accordingly. Don't hardcode `npm` if the repo uses pnpm.
749
-
750
- ### Template
751
-
752
- ```markdown
753
- # {package-name}
754
-
755
- {One- to two-sentence positioning. What it is and what scope it covers. No superlatives, no value claims.}
756
-
757
- ## What's in the box
758
-
759
- - **{Family 1}** — {what's in it; a few specific items, comma-listed.}
760
- - **{Family 2}** — {what's in it.}
761
- - **{Family 3}** — {what's in it.}
762
-
763
- The full surface lives in [`{path/to/public-index}`]({path/to/public-index}). ← optional pointer for libraries
764
-
765
- ## Stack
766
-
767
- - {Framework} {version} · {Language} {version}
768
- - {Build tool} {version}
769
- - {Other load-bearing deps}
770
-
771
- ## Getting started
772
-
773
- \`\`\`bash {pm} install {pm} run dev # what it does (port, URL) {pm} run build # what it does {pm} run preview # what it does (omit if not applicable) \`\`\`
774
-
775
- {Optional one-liner about first-run behavior — e.g., "Dev server lands on /playground."}
776
-
777
- ## {Runtime entry point} ← optional; e.g., "The playground", "CLI", "API endpoints"
778
-
779
- {Brief description of the dev/runtime surface.}
780
-
781
- | {Thing} | {What it shows / does} |
782
- | -------------------- | ---------------------- |
783
- | `{route or command}` | {description} |
784
-
785
- ## Layout
786
-
787
- \`\`\` src/ ├── {entry-file} # {purpose} ├── {folder}/ # {purpose} │ └── ... └── {folder}/ # {purpose} \`\`\`
788
-
789
- ## Adding a {primary unit}
790
-
791
- 1. {Drop the source under the right family/folder.}
792
- 2. {Re-export from the public surface.}
793
- 3. {Wire into the playground / example app / test harness so reviewers can see it render.}
794
- 4. {Document any divergence from upstream in `docs/{...}`.}
795
-
796
- ## Styling ← optional; replace with whichever cross-cutting concern matters most
797
-
798
- {Configuration notes that affect every consumer — design tokens, conventions, opt-outs.}
799
-
800
- ## Status
801
-
802
- {Pre-publish, beta, stable, internal-only. State what's stable and what's still moving — readers should know whether the API can be relied on.}
803
-
804
- ## License
805
-
806
- {License name — scope. e.g., "UNLICENSED — internal use only", "MIT".}
807
- ```
808
-
809
- ### Baseline scaffolding behavior
810
-
811
- The baseline audit **does** scaffold the project root README when missing. The risk this template guards against — template-shaped placeholders that look abandoned — is mitigated by the writing rules above: fill every section with concrete details from the repo (real package manager from the lockfile, real scripts, real layout, real status). Skip sections that genuinely don't apply rather than leaving stubs.
812
-
813
- **Never overwrite an existing root README** during a baseline. If one is present — even sparse or outdated — leave it untouched. Treat updates to a pre-existing root README as a separate, explicit request.
814
-
815
- ---
816
-
817
- ## 11. Memory inbox entry (docs/memory/inbox/{actor}.md)
818
-
819
- Use for: the capture tier of the knowledge gradient — the durable lessons of each session (corrections, root-caused failures, decisions with rationale, discovered constraints), reflected by the `session-reflect` hook at session end. It is the raw input to distillation: `distiller facts` digests entries into fact-cards and **consumes** them, so the file holds exactly what is undigested.
820
-
821
- ### File grain
822
-
823
- One file **per actor**: `docs/memory/inbox/{actor}.md`. `actor` is `git config user.name` lowercased and kebab-slugged; fall back to `$USER`, then `agent`. Two actors write to different files, so the inbox is **append-only without merge conflicts** — no shared file to contend over, no lock, no last-writer-wins.
824
-
825
- ### File header
826
-
827
- Written once, on the first entry:
828
-
829
- ```
830
- # Memory inbox — {actor}
831
- Session lessons awaiting distillation — appended by the session-reflect hook, consumed by `distiller facts`.
832
- ```
833
-
834
- ### Entry shape
835
-
836
- One block per reflected session, at most 6 bullets. Each bullet is one complete, self-contained sentence tagged `[project]` (true of the repo or its tooling) or `[user]` (true of the user) — the tag routes it at distillation: project facts → `docs/memory/facts/`, user facts → user-level memory.
837
-
838
- ```
839
- ## YYYY-MM-DD HH:MM · session <id> · {repo}@{branch}
840
- - [project] <one self-contained sentence, names and identifiers spelled out>
841
- - [user] <one self-contained sentence>
842
- ```
843
-
844
- ### Examples
845
-
846
- ```
847
- ## 2026-06-08 22:26 · session bc06c4fc · etna@dev
848
- - [project] The read_network_requests Chrome CDP tool only captures after its first call — arm it, trigger traffic, then read.
849
- - [user] jane-doe prefers minimal fixes over defensive machinery; fail loudly instead of engineering around a problem.
850
- ```
851
-
852
- ### Rules
853
-
854
- - **Hooks append, the distiller consumes.** A digested entry block is deleted by `distiller facts`; nothing else edits or reorders the file. A human may hand-append a lesson in the same shape — it rides the same queue.
855
- - **Sessions are deduped by id.** The reflect hook skips a session whose id already appears in the file (SessionEnd re-fires on resume).
856
- - **Secrets are redacted on write.** The privacy filter replaces secret shapes with `[redacted:{kind}]` (e.g. `[redacted:api-key]`, `[redacted:bearer]`, `[redacted:pem]`) before any line is appended — never paste a raw token in by hand either.
857
- - **Don't curate here.** Promotion to fact-cards and `docs/memory/main.md` happens at distillation; the inbox stays a transient queue.