@nurix/etna 0.18.15 → 0.18.17
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 +11 -16
- package/data/harness-index.json +1 -1
- package/data/harnesses/code/CLAUDE.md +71 -57
- package/data/harnesses/code/agents/{spec-mode.md → lld-mode.md} +12 -12
- package/data/harnesses/code/agents/maintenance.md +6 -31
- package/data/harnesses/code/harness.json +2 -2
- package/data/harnesses/code/hooks/hooks.json +0 -23
- package/data/harnesses/code/rules/testing.md +25 -0
- package/data/harnesses/code/skills/brainstorm/SKILL.md +1 -1
- package/data/harnesses/code/skills/brainstorm/exit-artifacts.md +2 -2
- package/data/harnesses/code/skills/documentation/SKILL.md +9 -5
- package/data/harnesses/code/skills/documentation/references/examples.md +1 -1
- package/data/harnesses/code/skills/documentation/references/style-guide.md +3 -1
- package/data/harnesses/code/skills/documentation/references/templates.md +99 -115
- package/data/harnesses/etna/CLAUDE.md +11 -12
- package/data/harnesses/etna/agents/{spec-mode.md → lld-mode.md} +12 -12
- package/data/harnesses/etna/agents/maintenance.md +6 -31
- package/data/harnesses/etna/harness.json +2 -2
- package/data/harnesses/etna/hooks/hooks.json +0 -23
- package/data/harnesses/etna/rules/testing.md +25 -0
- package/data/harnesses/etna/skills/brainstorm/SKILL.md +1 -1
- package/data/harnesses/etna/skills/brainstorm/exit-artifacts.md +2 -2
- package/data/harnesses/etna/skills/documentation/SKILL.md +9 -5
- package/data/harnesses/etna/skills/documentation/references/examples.md +1 -1
- package/data/harnesses/etna/skills/documentation/references/style-guide.md +3 -1
- package/data/harnesses/etna/skills/documentation/references/templates.md +99 -115
- package/data/harnesses/mobile/CLAUDE.md +78 -55
- package/data/harnesses/mobile/agents/{spec-mode.md → lld-mode.md} +12 -12
- package/data/harnesses/mobile/agents/maintenance.md +6 -31
- package/data/harnesses/mobile/harness.json +2 -2
- package/data/harnesses/mobile/hooks/hooks.json +0 -23
- package/data/harnesses/mobile/rules/testing.md +25 -0
- package/data/harnesses/mobile/skills/brainstorm/SKILL.md +1 -1
- package/data/harnesses/mobile/skills/brainstorm/exit-artifacts.md +2 -2
- package/data/harnesses/mobile/skills/documentation/SKILL.md +9 -5
- package/data/harnesses/mobile/skills/documentation/references/examples.md +1 -1
- package/data/harnesses/mobile/skills/documentation/references/style-guide.md +3 -1
- package/data/harnesses/mobile/skills/documentation/references/templates.md +99 -115
- package/package.json +1 -1
- package/data/harnesses/code/hooks/lib/redact.mjs +0 -35
- package/data/harnesses/code/hooks/prompt-recall.mjs +0 -155
- package/data/harnesses/code/hooks/session-reflect.mjs +0 -285
- package/data/harnesses/code/skills/distiller/SKILL.md +0 -90
- package/data/harnesses/code/skills/distiller/references/docs-mode.md +0 -299
- package/data/harnesses/code/skills/distiller/references/method.md +0 -94
- package/data/harnesses/etna/hooks/lib/redact.mjs +0 -35
- package/data/harnesses/etna/hooks/prompt-recall.mjs +0 -155
- package/data/harnesses/etna/hooks/session-reflect.mjs +0 -285
- package/data/harnesses/etna/skills/distiller/SKILL.md +0 -90
- package/data/harnesses/etna/skills/distiller/references/docs-mode.md +0 -299
- package/data/harnesses/etna/skills/distiller/references/method.md +0 -94
- package/data/harnesses/mobile/hooks/lib/redact.mjs +0 -35
- package/data/harnesses/mobile/hooks/prompt-recall.mjs +0 -155
- package/data/harnesses/mobile/hooks/session-reflect.mjs +0 -285
- package/data/harnesses/mobile/skills/distiller/SKILL.md +0 -90
- package/data/harnesses/mobile/skills/distiller/references/docs-mode.md +0 -299
- package/data/harnesses/mobile/skills/distiller/references/method.md +0 -94
|
@@ -105,7 +105,7 @@ Replaced change-tracking merge with version-based conflict resolution.
|
|
|
105
105
|
- Purpose: Single-pass merge with change detection
|
|
106
106
|
- Returns: `{ merged, changes }`
|
|
107
107
|
|
|
108
|
-
###
|
|
108
|
+
### Changed
|
|
109
109
|
|
|
110
110
|
- `useDataSync()` in `src/hooks/useDataSync.js`
|
|
111
111
|
- Changed: Now compares versions before merge
|
|
@@ -222,7 +222,7 @@ Use for structured info:
|
|
|
222
222
|
|
|
223
223
|
## Tense & History
|
|
224
224
|
|
|
225
|
-
**Active docs describe the present, not the past.** Everything outside `docs/history/` states what the system _is_ and how it works _today_. It must not narrate how it got there. The historical record — the journey, the dates, the migrations — lives **only** in `docs/history/` (changelog, plans
|
|
225
|
+
**Active docs describe the present, not the past.** Everything outside `docs/history/` states what the system _is_ and how it works _today_. It must not narrate how it got there. The historical record — the journey, the dates, the migrations — lives **only** in `docs/history/` (changelog, plans). Two sanctioned exceptions: `docs/memory/` is the agent's own dated log, and an ADR's **Decision Changelog** section carries that decision's dated revision history (the rest of the ADR body stays current-truth-only).
|
|
226
226
|
|
|
227
227
|
Strip this language from active docs:
|
|
228
228
|
|
|
@@ -257,6 +257,8 @@ Rules:
|
|
|
257
257
|
#### Detail (H4 - sparingly)
|
|
258
258
|
```
|
|
259
259
|
|
|
260
|
+
**Headings are retrieval keys.** Search and agents retrieve sections out of context, and a bare `## State` reads identically across every feature doc. In long docs, qualify generic headings with the feature name — `## State — invoice-pdf`, `### Merge rules — data sync` — so a section stands alone when retrieved. Short docs whose H1 disambiguates can keep bare headings.
|
|
261
|
+
|
|
260
262
|
### Standard Layout
|
|
261
263
|
|
|
262
264
|
```markdown
|
|
@@ -4,7 +4,7 @@ Templates for all documentation needs.
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## docs/README.md (Documentation Root)
|
|
8
8
|
|
|
9
9
|
Use for: the entry point for all documentation in a repo. Created during baseline audit.
|
|
10
10
|
|
|
@@ -72,7 +72,7 @@ See [CLAUDE.md](../CLAUDE.md) for documentation guidelines.
|
|
|
72
72
|
|
|
73
73
|
---
|
|
74
74
|
|
|
75
|
-
##
|
|
75
|
+
## docs/structure.md (Authority Map)
|
|
76
76
|
|
|
77
77
|
Use for: defining which folder owns which topic and how docs are maintained.
|
|
78
78
|
|
|
@@ -112,7 +112,7 @@ Plan (Status: Draft) → Implementation → Feature Doc or Architecture Update
|
|
|
112
112
|
|
|
113
113
|
## Folder Rules
|
|
114
114
|
|
|
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.
|
|
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.
|
|
116
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.
|
|
117
117
|
- `docs/operations/`: How-to procedures for setup, development, and deployment. Update when workflows change.
|
|
118
118
|
- `docs/history/plans/`: Historical. Must have `Status:` field. Never modify after completion.
|
|
@@ -131,24 +131,13 @@ Plan (Status: Draft) → Implementation → Feature Doc or Architecture Update
|
|
|
131
131
|
|
|
132
132
|
---
|
|
133
133
|
|
|
134
|
-
##
|
|
134
|
+
## Code-Path Ownership
|
|
135
135
|
|
|
136
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.
|
|
137
137
|
|
|
138
|
-
**Anchors (optional tooling key).** A doc may additionally carry an `anchors:` block — a qmd drift tripwire, orthogonal to ownership:
|
|
139
|
-
|
|
140
|
-
```yaml
|
|
141
|
-
---
|
|
142
|
-
anchors:
|
|
143
|
-
- "qmd query: feature-name persistence shape"
|
|
144
138
|
---
|
|
145
|
-
```
|
|
146
139
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
---
|
|
150
|
-
|
|
151
|
-
## 4. Scaffold Files (create if missing)
|
|
140
|
+
## Scaffold Files (create if missing)
|
|
152
141
|
|
|
153
142
|
These standard files must exist after every baseline. Create them with these scaffolds if the repo doesn't already have them.
|
|
154
143
|
|
|
@@ -241,14 +230,6 @@ description: Shared knowledge accumulated across agent sessions. All agents shou
|
|
|
241
230
|
- **Spec version:** v{harness-version}
|
|
242
231
|
<!-- 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. -->
|
|
243
232
|
|
|
244
|
-
## Knowledge Tiers
|
|
245
|
-
|
|
246
|
-
Memory is a gradient — volume falls, signal rises, one hop down each tier. Tiers describe themselves here even before they fill:
|
|
247
|
-
|
|
248
|
-
- **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.
|
|
249
|
-
- **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.
|
|
250
|
-
- **This index** — the curated read tier: the learnings list below, distilled from the colder tiers and hand-appended.
|
|
251
|
-
|
|
252
233
|
## Learnings
|
|
253
234
|
|
|
254
235
|
{Agents append learnings here as they discover gotchas, patterns, and architecture notes}
|
|
@@ -278,15 +259,15 @@ Append entries below, oldest at bottom. Format:
|
|
|
278
259
|
Memory file initialized during documentation baseline.
|
|
279
260
|
```
|
|
280
261
|
|
|
281
|
-
> 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.
|
|
282
|
-
|
|
283
262
|
---
|
|
284
263
|
|
|
285
|
-
##
|
|
264
|
+
## Feature Documentation — the LLD (docs/features/{feature}.md)
|
|
265
|
+
|
|
266
|
+
Use for: every feature in `docs/features/`. The feature doc is the feature's **LLD (low-level design)**: the same file persists from design (Status: Draft, written in LLD Mode) through implementation to live reference (Status: Active). Sections fill in as the feature matures — no template swap.
|
|
286
267
|
|
|
287
|
-
|
|
268
|
+
**Required vs optional.** Four things are required in every feature doc: the frontmatter, **Goal**, **Background**, and **Files** — plus **Current Behavior** once research or implementation exists (at Draft it's the pre-feature baseline; at Active it's how the feature works today). Every other section is optional: include it only when the feature has something real to put in it (no Redux → no Redux section; no risks worth naming → no Risks section). A **minimal form** is sanctioned for small features: frontmatter + Goal + a short how-it-works section + Files. A two-screen doc that is accurate beats a full-template doc with empty sections.
|
|
288
269
|
|
|
289
|
-
The four research-derived sections (**Affected Modules**, **Conventions to Follow**, **Current Behavior**, **Ownership Conflicts**) map 1:1 to
|
|
270
|
+
The four research-derived sections (**Affected Modules**, **Conventions to Follow**, **Current Behavior**, **Ownership Conflicts**) map 1:1 to the `lld-mode` agent's return shape. The orchestrator drops its findings into those slots without restructuring.
|
|
290
271
|
|
|
291
272
|
```yaml
|
|
292
273
|
---
|
|
@@ -294,8 +275,7 @@ owns: ["src/feature/**", "src/other/file.ts"] # required — code-path globs t
|
|
|
294
275
|
module: billing # optional — single bounded-context label; omit if cross-cutting
|
|
295
276
|
keywords: [invoice, pdf] # required — discovery terms
|
|
296
277
|
status: active # required — active | draft | deprecated
|
|
297
|
-
|
|
298
|
-
- "qmd query: wire envelope invariants"
|
|
278
|
+
last-reviewed: YYYY-MM-DD # optional tooling key — stamped on substantive review/update; the maintenance agent ranks audit priority by it (metadata, never narrated in the body)
|
|
299
279
|
---
|
|
300
280
|
```
|
|
301
281
|
|
|
@@ -332,22 +312,22 @@ High-level shape of the solution. ASCII diagram if it helps. Implementation spec
|
|
|
332
312
|
|
|
333
313
|
## Affected Modules
|
|
334
314
|
|
|
335
|
-
(From
|
|
315
|
+
(From lld-mode research) Files, routes, components, slices this feature involves. Group by module.
|
|
336
316
|
|
|
337
317
|
| Module | Path | Role in this feature |
|
|
338
318
|
|--------|------|----------------------|
|
|
339
319
|
|
|
340
320
|
## Conventions to Follow
|
|
341
321
|
|
|
342
|
-
(From
|
|
322
|
+
(From lld-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.
|
|
343
323
|
|
|
344
324
|
## Current Behavior
|
|
345
325
|
|
|
346
|
-
(From
|
|
326
|
+
(From lld-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.
|
|
347
327
|
|
|
348
328
|
## Ownership Conflicts
|
|
349
329
|
|
|
350
|
-
(From
|
|
330
|
+
(From lld-mode research) Existing feature docs whose `owns:` globs overlap with the projected scope. Resolve before the plan starts — leave nothing unresolved.
|
|
351
331
|
|
|
352
332
|
| Conflicting doc | Overlapping path(s) | Resolution |
|
|
353
333
|
|-----------------|---------------------|------------|
|
|
@@ -426,17 +406,19 @@ Sections fill in across the feature's lifecycle. No template swap — they accum
|
|
|
426
406
|
| When | Sections written | Source |
|
|
427
407
|
| --- | --- | --- |
|
|
428
408
|
| Status: Draft (design) | Goal, Goals & Non-Goals, Background, Approach, Open Questions, Risks | User interview |
|
|
429
|
-
| Status: Draft (research) | Affected Modules, Conventions to Follow, Current Behavior, Ownership Conflicts |
|
|
409
|
+
| Status: Draft (research) | Affected Modules, Conventions to Follow, Current Behavior, Ownership Conflicts | lld-mode agent |
|
|
430
410
|
| Status: Draft → Active (implementation lands) | Architecture, Key Functions, State, Redux, Files; `owns:` globs confirmed against real code | Main agent (from actual code) |
|
|
431
411
|
|
|
432
412
|
Resolved Open Questions can be summarized into Background; unresolved ones stay visible.
|
|
433
413
|
|
|
434
414
|
---
|
|
435
415
|
|
|
436
|
-
##
|
|
416
|
+
## Changelog
|
|
437
417
|
|
|
438
418
|
Use for: recording code changes with function-level detail.
|
|
439
419
|
|
|
420
|
+
Change categories follow the Keep a Changelog vocabulary — **Added / Changed / Deprecated / Removed / Fixed / Security** — the same six the master `CHANGELOG.md` scaffold instructs. Include only the categories that apply; all six share the same bullet shape (function/file, then detail lines).
|
|
421
|
+
|
|
440
422
|
```
|
|
441
423
|
# YYYY-MM-DD - [Title]
|
|
442
424
|
|
|
@@ -451,7 +433,7 @@ Brief description of what changed and why.
|
|
|
451
433
|
- Purpose: What it does
|
|
452
434
|
- Used by: Where it's called
|
|
453
435
|
|
|
454
|
-
###
|
|
436
|
+
### Changed
|
|
455
437
|
- `existingFunction()` in `path/to/file.js`
|
|
456
438
|
- Changed: What's different
|
|
457
439
|
- Reason: Why it changed
|
|
@@ -461,6 +443,13 @@ Brief description of what changed and why.
|
|
|
461
443
|
- `oldFunction()` from `path/to/file.js`
|
|
462
444
|
- Replaced by: `newFunction()`
|
|
463
445
|
|
|
446
|
+
### Fixed
|
|
447
|
+
- `buggyFunction()` in `path/to/file.js`
|
|
448
|
+
- Bug: What was wrong, when it manifested
|
|
449
|
+
- Fix: What changed
|
|
450
|
+
|
|
451
|
+
(Deprecated / Security follow the same shape.)
|
|
452
|
+
|
|
464
453
|
## Breaking Changes
|
|
465
454
|
|
|
466
455
|
⚠️ **[Change description]**
|
|
@@ -474,6 +463,11 @@ Brief description of what changed and why.
|
|
|
474
463
|
- [ ] Step 1
|
|
475
464
|
- [ ] Step 2
|
|
476
465
|
|
|
466
|
+
## Verified
|
|
467
|
+
|
|
468
|
+
- What was exercised end-to-end and the observed result — real runs, real fixtures, measured timings
|
|
469
|
+
- A future agent diagnosing a regression starts from this evidence
|
|
470
|
+
|
|
477
471
|
## Files Changed
|
|
478
472
|
|
|
479
473
|
- `src/path/file1.js` - Core changes
|
|
@@ -482,7 +476,7 @@ Brief description of what changed and why.
|
|
|
482
476
|
|
|
483
477
|
---
|
|
484
478
|
|
|
485
|
-
##
|
|
479
|
+
## Plan (docs/history/plans/YYYY-MM-DD-feature-name.md)
|
|
486
480
|
|
|
487
481
|
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.
|
|
488
482
|
|
|
@@ -549,10 +543,49 @@ Why this work is happening *now*. Link to the spec for *what* we're building; th
|
|
|
549
543
|
|
|
550
544
|
---
|
|
551
545
|
|
|
552
|
-
##
|
|
546
|
+
## Operations Procedure (docs/operations/{procedure}.md)
|
|
547
|
+
|
|
548
|
+
Use for: any doc in `docs/operations/` — setup, development, deployment, maintenance procedures. A procedure is consulted mid-task, not read: exact commands, copy-paste runnable, no narrative.
|
|
549
|
+
|
|
550
|
+
Required: **Goal**, **Steps**, **Verification**. Optional: Preconditions, Troubleshooting, Rollback — include only when they carry real content.
|
|
551
|
+
|
|
552
|
+
If a procedure is a deterministic command list run frequently, script it and have the doc point at the script — a doc should carry judgment (when, why, what to check), not replace automation.
|
|
553
|
+
|
|
554
|
+
```
|
|
555
|
+
# {Procedure Name}
|
|
556
|
+
|
|
557
|
+
**Goal:** What this procedure accomplishes, one line.
|
|
558
|
+
|
|
559
|
+
## Preconditions
|
|
560
|
+
|
|
561
|
+
- Access, tools, or state required before starting — exact versions, env vars, credentials location
|
|
562
|
+
|
|
563
|
+
## Steps
|
|
564
|
+
|
|
565
|
+
1. One action per step, exact command in a code block
|
|
566
|
+
2. Note expected output where it disambiguates success from failure
|
|
567
|
+
|
|
568
|
+
## Verification
|
|
569
|
+
|
|
570
|
+
- The observable end state that confirms it worked — exact check commands, not "it should work now"
|
|
571
|
+
|
|
572
|
+
## Troubleshooting
|
|
573
|
+
|
|
574
|
+
- Symptom → cause → fix (append entries as failures are root-caused)
|
|
575
|
+
|
|
576
|
+
## Rollback
|
|
577
|
+
|
|
578
|
+
- How to undo, and when undo stops being possible
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
---
|
|
582
|
+
|
|
583
|
+
## Protected Files
|
|
553
584
|
|
|
554
585
|
Use for: documenting critical files that need approval before modification.
|
|
555
586
|
|
|
587
|
+
This doc answers *what is protected and why breaking it hurts* — nothing more. Don't duplicate function-level detail here (signatures, inputs/outputs): it drifts from both the code and the owning feature doc. The owning feature doc is the canonical reference for how the code works; link to it.
|
|
588
|
+
|
|
556
589
|
```
|
|
557
590
|
# Protected Files
|
|
558
591
|
|
|
@@ -574,29 +607,22 @@ path/to/another/file.js
|
|
|
574
607
|
| Category 1 | Specific impact |
|
|
575
608
|
| Category 2 | Specific impact |
|
|
576
609
|
|
|
577
|
-
##
|
|
610
|
+
## Why Protected
|
|
578
611
|
|
|
579
612
|
### Category 1: [Name]
|
|
580
613
|
|
|
581
|
-
**Purpose:** What these files do
|
|
582
|
-
|
|
583
|
-
**
|
|
584
|
-
|
|
585
|
-
| Function | Input | Output | Purpose |
|
|
586
|
-
|------------|-------|--------|----------------|
|
|
587
|
-
| `func1()` | Type | Type | What it does |
|
|
588
|
-
| `func2()` | Type | Type | What it does |
|
|
589
|
-
|
|
590
|
-
**Critical Behavior:**
|
|
591
|
-
- Important point 1
|
|
614
|
+
**Purpose:** What these files do, one or two lines
|
|
615
|
+
**Owning doc:** [docs/features/{feature}.md] — canonical reference for how this code works
|
|
616
|
+
**Invariants:**
|
|
617
|
+
- The behavior that must not break, stated as a constraint (not a function tour)
|
|
592
618
|
- Important point 2
|
|
593
619
|
```
|
|
594
620
|
|
|
595
621
|
---
|
|
596
622
|
|
|
597
|
-
##
|
|
623
|
+
## Architecture Decision Record (ADR)
|
|
598
624
|
|
|
599
|
-
Use for: capturing a single
|
|
625
|
+
Use for: capturing a single architectural decision with its context, alternatives considered, and consequences. Lives in `docs/architecture/adr/` — co-located with the architecture it decides. An ADR is the **source of truth for its decision**: the body always states the current truth. When the decision is revisited, update the ADR in place — rewrite the affected sections to what is now true, bump `last-updated`, and record the revision in the **Decision Changelog**. Readers get the current decision from the body; the journey lives only in the changelog section.
|
|
600
626
|
|
|
601
627
|
### When to write an ADR
|
|
602
628
|
|
|
@@ -614,9 +640,9 @@ Don't write an ADR for:
|
|
|
614
640
|
|
|
615
641
|
### Lifecycle
|
|
616
642
|
|
|
617
|
-
`Proposed` → `Accepted` → `Deprecated`
|
|
643
|
+
`Proposed` → `Accepted` → `Deprecated`
|
|
618
644
|
|
|
619
|
-
|
|
645
|
+
An ADR stays `Accepted` for as long as its question is live — revisions update it in place. Set `Deprecated` only when the decision's question itself is retired (the component is gone, the contract no longer exists); state where the replacement lives, if any.
|
|
620
646
|
|
|
621
647
|
### Naming
|
|
622
648
|
|
|
@@ -624,18 +650,18 @@ ADRs are **immutable after acceptance**. If the decision changes, write a new AD
|
|
|
624
650
|
|
|
625
651
|
### Structure
|
|
626
652
|
|
|
627
|
-
Three sections are required: **Decision**, **Context**, **Consequences
|
|
653
|
+
Three sections are required: **Decision**, **Context**, **Consequences** — plus the **Decision Changelog** once the ADR has been revised at least once. Everything else is optional — include only when warranted. Decision-first: readers should see the answer in the first paragraph.
|
|
628
654
|
|
|
629
655
|
### Template
|
|
630
656
|
|
|
631
657
|
```markdown
|
|
632
658
|
---
|
|
633
659
|
title: "ADR-NNN: Short title in sentence case"
|
|
634
|
-
status: Accepted # Proposed | Accepted | Deprecated
|
|
635
|
-
|
|
660
|
+
status: Accepted # Proposed | Accepted | Deprecated
|
|
661
|
+
created: YYYY-MM-DD
|
|
662
|
+
last-updated: YYYY-MM-DD # bump on every revision
|
|
636
663
|
decision-owner: Name
|
|
637
664
|
reviewers: [] # optional
|
|
638
|
-
supersedes: # optional, e.g., ADR-005
|
|
639
665
|
tags: [adr]
|
|
640
666
|
---
|
|
641
667
|
|
|
@@ -682,13 +708,7 @@ tags: [adr]
|
|
|
682
708
|
|
|
683
709
|
## Architecture in Detail
|
|
684
710
|
|
|
685
|
-
[Diagrams, code shape, layer responsibilities. Include when the decision implies non-trivial structure that readers need to understand alongside the *why*.]
|
|
686
|
-
|
|
687
|
-
## Implementation Plan
|
|
688
|
-
|
|
689
|
-
| Phase | Scope | Duration |
|
|
690
|
-
| ----- | ----- | -------- |
|
|
691
|
-
| 1 | … | … |
|
|
711
|
+
[Diagrams, code shape, layer responsibilities. Include when the decision implies non-trivial structure that readers need to understand alongside the *why*. Execution belongs in a plan doc (`docs/history/plans/`) — link to it, don't embed an implementation plan here.]
|
|
692
712
|
|
|
693
713
|
## Open Questions
|
|
694
714
|
|
|
@@ -701,6 +721,13 @@ tags: [adr]
|
|
|
701
721
|
## References
|
|
702
722
|
|
|
703
723
|
- [External link or cross-reference]
|
|
724
|
+
|
|
725
|
+
## Decision Changelog
|
|
726
|
+
|
|
727
|
+
<!-- Append-only, newest first. One entry per revision: what changed in the decision, the trigger, and the previous choice. Added on the first revision; the initial acceptance is the first entry. -->
|
|
728
|
+
|
|
729
|
+
- YYYY-MM-DD — [What changed] because [trigger]. (Previously: [old choice].)
|
|
730
|
+
- YYYY-MM-DD — Initial decision accepted.
|
|
704
731
|
```
|
|
705
732
|
|
|
706
733
|
### Rules
|
|
@@ -709,14 +736,15 @@ tags: [adr]
|
|
|
709
736
|
- Decision-first. The first paragraph after the heading is the answer; readers should not need to scroll.
|
|
710
737
|
- No section numbering (`§5.1.1`). Use markdown headings only — inserting a section shouldn't renumber everything.
|
|
711
738
|
- Frontmatter `status` is the single source of truth for lifecycle. Don't also write "Status: Accepted" in the body.
|
|
712
|
-
-
|
|
713
|
-
- The
|
|
739
|
+
- **Revisions update the body in place.** Rewrite the affected sections to the current truth, bump `last-updated`, and append a Decision Changelog entry naming the old choice and the trigger. Never leave the superseded decision narrated in the body — the changelog carries the journey.
|
|
740
|
+
- The **Decision Changelog** is the one sanctioned dated-history section in an active doc: append-only, newest first. Typo and formatting fixes don't get entries.
|
|
741
|
+
- Execution detail lives in a plan doc, not the ADR — link, don't embed.
|
|
714
742
|
|
|
715
743
|
---
|
|
716
744
|
|
|
717
|
-
##
|
|
745
|
+
## Project Root README
|
|
718
746
|
|
|
719
|
-
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
|
|
747
|
+
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 **docs/README.md (Documentation Root)** above). The two coexist; don't merge them.
|
|
720
748
|
|
|
721
749
|
### Strategy
|
|
722
750
|
|
|
@@ -807,47 +835,3 @@ The full surface lives in [`{path/to/public-index}`]({path/to/public-index}).
|
|
|
807
835
|
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.
|
|
808
836
|
|
|
809
837
|
**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.
|
|
810
|
-
|
|
811
|
-
---
|
|
812
|
-
|
|
813
|
-
## 11. Memory inbox entry (docs/memory/inbox/{actor}.md)
|
|
814
|
-
|
|
815
|
-
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.
|
|
816
|
-
|
|
817
|
-
### File grain
|
|
818
|
-
|
|
819
|
-
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.
|
|
820
|
-
|
|
821
|
-
### File header
|
|
822
|
-
|
|
823
|
-
Written once, on the first entry:
|
|
824
|
-
|
|
825
|
-
```
|
|
826
|
-
# Memory inbox — {actor}
|
|
827
|
-
Session lessons awaiting distillation — appended by the session-reflect hook, consumed by `distiller facts`.
|
|
828
|
-
```
|
|
829
|
-
|
|
830
|
-
### Entry shape
|
|
831
|
-
|
|
832
|
-
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.
|
|
833
|
-
|
|
834
|
-
```
|
|
835
|
-
## YYYY-MM-DD HH:MM · session <id> · {repo}@{branch}
|
|
836
|
-
- [project] <one self-contained sentence, names and identifiers spelled out>
|
|
837
|
-
- [user] <one self-contained sentence>
|
|
838
|
-
```
|
|
839
|
-
|
|
840
|
-
### Examples
|
|
841
|
-
|
|
842
|
-
```
|
|
843
|
-
## 2026-06-08 22:26 · session bc06c4fc · etna@dev
|
|
844
|
-
- [project] The read_network_requests Chrome CDP tool only captures after its first call — arm it, trigger traffic, then read.
|
|
845
|
-
- [user] jane-doe prefers minimal fixes over defensive machinery; fail loudly instead of engineering around a problem.
|
|
846
|
-
```
|
|
847
|
-
|
|
848
|
-
### Rules
|
|
849
|
-
|
|
850
|
-
- **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.
|
|
851
|
-
- **Sessions are deduped by id.** The reflect hook skips a session whose id already appears in the file (SessionEnd re-fires on resume).
|
|
852
|
-
- **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.
|
|
853
|
-
- **Don't curate here.** Promotion to fact-cards and `docs/memory/main.md` happens at distillation; the inbox stays a transient queue.
|
|
@@ -20,20 +20,20 @@ This file defines how AI agents (Claude, GPT, etc.) should work on this project.
|
|
|
20
20
|
|
|
21
21
|
## Workflows
|
|
22
22
|
|
|
23
|
-
For new features or new systems, enter **
|
|
23
|
+
For new features or new systems, enter **LLD Mode** (low-level design) before Plan Mode.
|
|
24
24
|
|
|
25
|
-
###
|
|
25
|
+
### LLD Mode → Plan Mode → Completion
|
|
26
26
|
|
|
27
|
-
1. **
|
|
27
|
+
1. **LLD Mode**: Create or update the feature LLD in `docs/features/{feature}.md` using the **Feature Documentation template** (Status: Draft) in `.claude/skills/documentation/references/templates.md`. Use the **`lld-mode`** agent (`.claude/agents/lld-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 LLD for approval before proceeding.
|
|
28
28
|
|
|
29
|
-
2. **Plan Mode**: Once the
|
|
29
|
+
2. **Plan Mode**: Once the LLD is approved, create a plan in `docs/history/plans/YYYY-MM-DD-feature-name.md` using the **Plan template** (same file). Link back to the feature LLD 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
|
|
33
|
+
- **Flip the feature LLD** 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
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
|
-
For **Product-level** work (new systems, unclear scope), the
|
|
36
|
+
For **Product-level** work (new systems, unclear scope), the LLD should also include: problem statement, key hypotheses, and open questions.
|
|
37
37
|
|
|
38
38
|
`docs/features/` is _what_ we're building (lives on as documentation). `docs/history/plans/` is _how_ we built it (historical record).
|
|
39
39
|
|
|
@@ -42,9 +42,8 @@ For **Product-level** work (new systems, unclear scope), the spec should also in
|
|
|
42
42
|
Before modifying code in an unfamiliar area:
|
|
43
43
|
|
|
44
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
|
|
46
|
-
3. If
|
|
47
|
-
4. If a `docs/memory/` file exists for the domain you're working in, read it for domain knowledge and failure modes
|
|
45
|
+
2. 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.
|
|
46
|
+
3. If a `docs/memory/` file exists for the domain you're working in, read it for domain knowledge and failure modes
|
|
48
47
|
|
|
49
48
|
For the protocol on _writing_ to memory (which file, what belongs there, what doesn't), see **Project Memory** below.
|
|
50
49
|
|
|
@@ -72,9 +71,9 @@ When implementing a plan, if you discover work that is important but outside the
|
|
|
72
71
|
|
|
73
72
|
### Doc Ownership
|
|
74
73
|
|
|
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.
|
|
74
|
+
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.
|
|
76
75
|
|
|
77
|
-
The
|
|
76
|
+
The `lld-mode` agent checks for ownership conflicts during LLD research — feature docs whose `owns:` globs overlap at equal specificity. If conflicts are found, address them in the LLD before proceeding.
|
|
78
77
|
|
|
79
78
|
---
|
|
80
79
|
|
|
@@ -82,7 +81,7 @@ The spec-mode agent checks for ownership conflicts during research — feature d
|
|
|
82
81
|
|
|
83
82
|
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.
|
|
84
83
|
|
|
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/
|
|
84
|
+
**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/mechanisms.md` defines the failure mechanisms; technology packs under `references/packs/` carry stack specifics), 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.
|
|
86
85
|
|
|
87
86
|
> 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.
|
|
88
87
|
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description:
|
|
2
|
+
name: lld-mode
|
|
3
|
+
description: LLD researcher for Feature and Product workflows. Use to explore the codebase and gather the context needed for writing a feature LLD (low-level design — the feature doc in docs/features/). Returns research findings — does not write files.
|
|
4
4
|
tools: Read, Glob, Grep, WebSearch, WebFetch
|
|
5
5
|
model: inherit
|
|
6
6
|
skills:
|
|
7
7
|
- documentation
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
#
|
|
10
|
+
# LLD Mode Agent
|
|
11
11
|
|
|
12
|
-
You are
|
|
12
|
+
You are an LLD researcher. Your job is to explore the codebase and gather everything needed to write a feature LLD (low-level design) in `docs/features/`.
|
|
13
13
|
|
|
14
|
-
You do NOT write the
|
|
14
|
+
You do NOT write the LLD — you return structured research that the main agent uses to write it.
|
|
15
15
|
|
|
16
16
|
## Before Starting
|
|
17
17
|
|
|
18
18
|
First, understand the documentation landscape:
|
|
19
19
|
|
|
20
20
|
1. Read `./docs/structure.md` to understand the documentation structure
|
|
21
|
-
2. If `./docs/features/README.md` exists, read it to see existing feature
|
|
22
|
-
3. If `./docs/memory/
|
|
23
|
-
4. Read 1-2 existing
|
|
21
|
+
2. If `./docs/features/README.md` exists, read it to see existing feature LLDs and where the new one fits; otherwise glob the feature docs directly
|
|
22
|
+
3. If `./docs/memory/lld-mode.md` exists (or the legacy `./docs/memory/spec-mode.md`), read it for feature doc inventory, ownership conflict zones, and lessons from previous research
|
|
23
|
+
4. Read 1-2 existing feature LLDs in `./docs/features/` to calibrate format and depth
|
|
24
24
|
5. Consult the **injected ownership index** (the generated `glob → doc · module · keywords · status` map — the union of every feature doc's `owns:` frontmatter) to build the ownership map. This is the source of truth for what code paths are already owned. If the index isn't present in context, glob `docs/features/**/*.md` and read each doc's `owns:` frontmatter directly.
|
|
25
25
|
|
|
26
|
-
This tells you what already exists, what's adjacent, how detailed the
|
|
26
|
+
This tells you what already exists, what's adjacent, how detailed the LLD should be, and what code paths are already owned.
|
|
27
27
|
|
|
28
28
|
## What You Research
|
|
29
29
|
|
|
30
|
-
1. **Documentation fit** — Where does this
|
|
30
|
+
1. **Documentation fit** — Where does this LLD sit relative to existing feature docs? Does it extend an existing one or need a new doc?
|
|
31
31
|
2. **Existing patterns** — Find related features, similar implementations, and conventions in the codebase
|
|
32
32
|
3. **Affected modules** — Identify what files, routes, components, and data flows are relevant
|
|
33
33
|
4. **Current state** — Understand how the system works today in the area being specified
|
|
@@ -38,13 +38,13 @@ This tells you what already exists, what's adjacent, how detailed the spec shoul
|
|
|
38
38
|
|
|
39
39
|
Structure your findings as:
|
|
40
40
|
|
|
41
|
-
- **Documentation context**: Existing
|
|
41
|
+
- **Documentation context**: Existing feature LLDs that relate, whether to create new or update existing, suggested filename
|
|
42
42
|
- **Related patterns**: What similar things exist in the codebase and where
|
|
43
43
|
- **Affected modules**: Files, routes, components that will be involved
|
|
44
44
|
- **Current behavior**: How the relevant part of the system works today
|
|
45
45
|
- **Conventions**: Naming, structure, and patterns to follow based on existing code
|
|
46
46
|
- **Ownership conflicts**: Existing feature docs whose `owns:` globs overlap with the proposed feature. Include the conflicting paths and the owning doc name.
|
|
47
|
-
- **Risks or concerns**: Anything the
|
|
47
|
+
- **Risks or concerns**: Anything the LLD should address or call out
|
|
48
48
|
|
|
49
49
|
Use the documentation skill's style guide and conventions when structuring your findings — imperative voice, ASCII diagrams for flows, function signatures over implementations, concise.
|
|
50
50
|
|