@nurix/etna 0.18.10 → 0.18.12
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 +13 -13
- package/bin/etna.js +98 -2
- package/data/harness-index.json +9 -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 +11 -9
- package/data/harnesses/code/skills/brainstorm/SKILL.md +2 -2
- package/data/harnesses/code/skills/brainstorm/harvest.md +5 -6
- 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 +26 -64
- package/data/harnesses/etna/.prettierignore +12 -0
- package/data/harnesses/etna/.prettierrc.json +3 -0
- package/data/harnesses/etna/.vscode/settings.json +10 -0
- package/data/harnesses/etna/CLAUDE.md +151 -0
- package/data/harnesses/etna/agents/brainstorm.md +35 -0
- package/data/harnesses/etna/agents/change-review.md +251 -0
- package/data/harnesses/etna/agents/maintenance.md +240 -0
- package/data/harnesses/etna/agents/performance-review.md +223 -0
- package/data/harnesses/etna/agents/spec-mode.md +56 -0
- package/data/harnesses/etna/harness.json +11 -0
- package/data/harnesses/etna/hooks/generate-ownership-index.mjs +148 -0
- package/data/harnesses/etna/hooks/hooks.json +39 -0
- package/data/harnesses/etna/hooks/lib/redact.mjs +35 -0
- package/data/harnesses/etna/hooks/prompt-recall.mjs +155 -0
- package/data/harnesses/etna/hooks/session-reflect.mjs +285 -0
- package/data/harnesses/etna/rules/general.md +86 -0
- package/data/harnesses/etna/rules/kb.md +13 -0
- package/data/harnesses/etna/rules/nomenclature.md +41 -0
- package/data/harnesses/etna/rules/npm-cli.md +88 -0
- package/data/harnesses/etna/skills/boundary/SKILL.md +49 -0
- package/data/harnesses/etna/skills/boundary/references/boundary-taxonomy.md +796 -0
- package/data/harnesses/etna/skills/brainstorm/README.md +138 -0
- package/data/harnesses/etna/skills/brainstorm/SKILL.md +135 -0
- package/data/harnesses/etna/skills/brainstorm/harvest.md +25 -0
- package/data/harnesses/etna/skills/brainstorm/templates/backlog.md +39 -0
- package/data/harnesses/etna/skills/brainstorm/templates/build.md +37 -0
- package/data/harnesses/etna/skills/brainstorm/templates/decisions.md +29 -0
- package/data/harnesses/etna/skills/brainstorm/templates/doctrine.md +31 -0
- package/data/harnesses/etna/skills/brainstorm/templates/domain-model.md +25 -0
- package/data/harnesses/etna/skills/brainstorm/templates/glossary.md +20 -0
- package/data/harnesses/etna/skills/brainstorm/templates/milestones.md +43 -0
- package/data/harnesses/etna/skills/brainstorm/templates/non-goals.md +17 -0
- package/data/harnesses/etna/skills/brainstorm/templates/plan-doc.md +61 -0
- package/data/harnesses/etna/skills/brainstorm/templates/questions.md +36 -0
- package/data/harnesses/etna/skills/brainstorm/templates/references.md +28 -0
- package/data/harnesses/etna/skills/brainstorm/templates/rejected.md +29 -0
- package/data/harnesses/etna/skills/brainstorm/templates/state.md +1 -0
- package/data/harnesses/etna/skills/brainstorm/templates/tech.md +23 -0
- package/data/harnesses/etna/skills/brainstorm/templates/thesis.md +21 -0
- package/data/harnesses/etna/skills/distiller/SKILL.md +90 -0
- package/data/harnesses/etna/skills/distiller/references/docs-mode.md +299 -0
- package/data/harnesses/etna/skills/distiller/references/method.md +94 -0
- package/data/harnesses/etna/skills/documentation/SKILL.md +124 -0
- package/data/harnesses/etna/skills/documentation/references/examples.md +162 -0
- package/data/harnesses/etna/skills/documentation/references/style-guide.md +308 -0
- package/data/harnesses/etna/skills/documentation/references/templates.md +853 -0
- package/data/harnesses/etna/skills/workflow-mapper/SKILL.md +451 -0
- package/data/harnesses/etna/skills/workflow-mapper/references/patterns.md +214 -0
- package/data/harnesses/hr/harness.json +1 -1
- package/data/harnesses/hr/skills/evaluator/criteria/testing.md +4 -4
- package/data/harnesses/mobile/.prettierignore +12 -0
- package/data/harnesses/mobile/.prettierrc.json +3 -0
- package/data/harnesses/mobile/.vscode/settings.json +10 -0
- package/data/harnesses/mobile/CLAUDE.md +128 -0
- package/data/harnesses/mobile/agents/brainstorm.md +35 -0
- package/data/harnesses/mobile/agents/change-review.md +251 -0
- package/data/harnesses/mobile/agents/maintenance.md +240 -0
- package/data/harnesses/mobile/agents/performance-review.md +223 -0
- package/data/harnesses/mobile/agents/spec-mode.md +56 -0
- package/data/harnesses/mobile/harness.json +11 -0
- package/data/harnesses/mobile/hooks/generate-ownership-index.mjs +148 -0
- package/data/harnesses/mobile/hooks/hooks.json +39 -0
- package/data/harnesses/mobile/hooks/lib/redact.mjs +35 -0
- package/data/harnesses/mobile/hooks/prompt-recall.mjs +155 -0
- package/data/harnesses/mobile/hooks/session-reflect.mjs +285 -0
- package/data/harnesses/mobile/rules/general.md +86 -0
- package/data/harnesses/mobile/rules/nomenclature.md +41 -0
- package/data/harnesses/mobile/rules/react-native.md +132 -0
- package/data/harnesses/mobile/rules/typescript.md +40 -0
- package/data/harnesses/mobile/skills/boundary/SKILL.md +49 -0
- package/data/harnesses/mobile/skills/boundary/references/boundary-taxonomy.md +796 -0
- package/data/harnesses/mobile/skills/brainstorm/README.md +138 -0
- package/data/harnesses/mobile/skills/brainstorm/SKILL.md +135 -0
- package/data/harnesses/mobile/skills/brainstorm/harvest.md +25 -0
- package/data/harnesses/mobile/skills/brainstorm/templates/backlog.md +39 -0
- package/data/harnesses/mobile/skills/brainstorm/templates/build.md +37 -0
- package/data/harnesses/mobile/skills/brainstorm/templates/decisions.md +29 -0
- package/data/harnesses/mobile/skills/brainstorm/templates/doctrine.md +31 -0
- package/data/harnesses/mobile/skills/brainstorm/templates/domain-model.md +25 -0
- package/data/harnesses/mobile/skills/brainstorm/templates/glossary.md +20 -0
- package/data/harnesses/mobile/skills/brainstorm/templates/milestones.md +43 -0
- package/data/harnesses/mobile/skills/brainstorm/templates/non-goals.md +17 -0
- package/data/harnesses/mobile/skills/brainstorm/templates/plan-doc.md +61 -0
- package/data/harnesses/mobile/skills/brainstorm/templates/questions.md +36 -0
- package/data/harnesses/mobile/skills/brainstorm/templates/references.md +28 -0
- package/data/harnesses/mobile/skills/brainstorm/templates/rejected.md +29 -0
- package/data/harnesses/mobile/skills/brainstorm/templates/state.md +1 -0
- package/data/harnesses/mobile/skills/brainstorm/templates/tech.md +23 -0
- package/data/harnesses/mobile/skills/brainstorm/templates/thesis.md +21 -0
- package/data/harnesses/mobile/skills/distiller/SKILL.md +90 -0
- package/data/harnesses/mobile/skills/distiller/references/docs-mode.md +299 -0
- package/data/harnesses/mobile/skills/distiller/references/method.md +94 -0
- package/data/harnesses/mobile/skills/documentation/SKILL.md +124 -0
- package/data/harnesses/mobile/skills/documentation/references/examples.md +162 -0
- package/data/harnesses/mobile/skills/documentation/references/style-guide.md +308 -0
- package/data/harnesses/mobile/skills/documentation/references/templates.md +853 -0
- package/data/harnesses/mobile/skills/workflow-mapper/SKILL.md +451 -0
- package/data/harnesses/mobile/skills/workflow-mapper/references/patterns.md +214 -0
- package/package.json +1 -1
- package/data/harnesses/code/agents/harness-manager.md +0 -184
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A Claude Code skill that is a **thinking partner for designing software** — not a form to fill in. It runs one constant loop (distill → abstract → sync → record) over a conversation, files the thinking into a small set of substance-first pillars, and treats _coherence_ as a measurable target rather than a vibe.
|
|
4
4
|
|
|
5
|
-
The
|
|
5
|
+
The single principle: **the conversation is the work; the artifacts serve it.**
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -67,7 +67,7 @@ coherent ⇔ open_questions == 0 ∧ last sync ran after the last pillar write
|
|
|
67
67
|
|
|
68
68
|
## The sync agent
|
|
69
69
|
|
|
70
|
-
The background reconciler
|
|
70
|
+
The background reconciler. One sync in flight at a time; at most one queued behind it. It runs after substantive writes, mandatorily on entering converge and at `stop`, and on demand. It audits exactly four sources:
|
|
71
71
|
|
|
72
72
|
1. **Cross-pillar contradiction** — thesis vs domain model vs decisions vs doctrine vs build.
|
|
73
73
|
2. **Aspect coverage** — any mapped aspect with no content → a question.
|
|
@@ -96,9 +96,9 @@ The complexity dial sets _defaults_, not a cage — any lazy pillar materializes
|
|
|
96
96
|
|
|
97
97
|
---
|
|
98
98
|
|
|
99
|
-
## Build modes
|
|
99
|
+
## Build modes
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
The writing posture is a **mode** chosen at intake, folded into `build.md`:
|
|
102
102
|
|
|
103
103
|
- **greenfield** (default) — present-tense everywhere, no phantom history. Execution sections closed.
|
|
104
104
|
- **brownfield** — migration vocabulary is legitimate in `build.md`; other pillars still describe the target.
|
|
@@ -108,9 +108,9 @@ v1 applied a present-tense "greenfield" writing doctrine unconditionally — whi
|
|
|
108
108
|
|
|
109
109
|
---
|
|
110
110
|
|
|
111
|
-
## Harvest
|
|
111
|
+
## Harvest
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
The session writes a **kept** design record at `docs/brainstorm/{topic}/` (one subfolder per topic). At `stop` the skill _offers_ the harvest adapter, which distils the pillars' conclusions into the doc tree (ADRs, module pillars, plans, the `boundary` skill reads contracts from source). The `docs/brainstorm/{topic}/` record is **kept** as the provenance — never deleted. See `harvest.md`.
|
|
114
114
|
|
|
115
115
|
---
|
|
116
116
|
|
|
@@ -128,9 +128,11 @@ By default the session folder _is_ the product — self-contained, resumed by th
|
|
|
128
128
|
## Files
|
|
129
129
|
|
|
130
130
|
```
|
|
131
|
-
brainstorm/
|
|
131
|
+
brainstorm/ # the skill (in .claude/skills/)
|
|
132
132
|
├── SKILL.md # the skill definition Claude Code loads (~1.8k words)
|
|
133
133
|
├── README.md # this file
|
|
134
|
-
├── harvest.md #
|
|
135
|
-
└── templates/ # pillar templates copied into the session
|
|
134
|
+
├── harvest.md # doc-tree harvest adapter (record kept at docs/brainstorm/{topic}/)
|
|
135
|
+
└── templates/ # pillar templates copied into the session record on first use
|
|
136
136
|
```
|
|
137
|
+
|
|
138
|
+
The session itself is written to `docs/brainstorm/{topic}/` (kept, committed) — not here.
|
|
@@ -50,7 +50,7 @@ Then propose the **aspect map**: the thinking dimensions for _this specific idea
|
|
|
50
50
|
|
|
51
51
|
### 3. Bootstrap
|
|
52
52
|
|
|
53
|
-
Session folder:
|
|
53
|
+
Session folder: `docs/brainstorm/{topic}/` — a **committed, kept** design record, one subfolder per design topic (slug the topic; confirm it in one line). Resume an existing topic by reusing its folder if it already holds a `state.md`. The record stays in the repo after harvest (it is the provenance the steering pillars distil from — see `harvest.md`), so it lives under `docs/` like any other durable project knowledge, not at the repo root. Create only the pillars the complexity calls for, from `templates/` (never overwrite existing files; if a template is missing, create the file from the field lists in **Pillars**). Write top-level `state.md`:
|
|
54
54
|
|
|
55
55
|
```
|
|
56
56
|
STATE: open
|
|
@@ -121,7 +121,7 @@ Zero means _"audited against the four sources and clean"_ — never _"nothing ca
|
|
|
121
121
|
|
|
122
122
|
1. Run a final sync (wait for any in-flight sync first).
|
|
123
123
|
2. **Coherent** → say so and proceed. **Questions open** → list them plainly (English first, codes in parentheses) and offer per question: resolve now (mini-converge) / park explicitly (backlog or non-goals, with reason) / leave open and stop anyway — the folder keeps full state and resumes exactly where it left off.
|
|
124
|
-
3. **Harvest** — see `harvest.md`.
|
|
124
|
+
3. **Harvest** — see `harvest.md`. The harvest distils the pillars' conclusions into the live steering docs by scope (`docs/architecture/`, `docs/architecture/adr/`, `docs/history/backlog.md`); the `docs/brainstorm/{topic}/` record itself is **kept** (committed), never deleted — it is the provenance the harvested headlines trace back to and the seed the next session resumes from.
|
|
125
125
|
4. Write `STATE: closed` + one-line reason. Print: _"Run `/brainstorm start` to resume."_
|
|
126
126
|
|
|
127
127
|
## Conduct — holds for the whole session
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
# Harvest adapter
|
|
2
2
|
|
|
3
|
-
Harvest
|
|
3
|
+
Harvest distils a closed session's **conclusions** into the live steering docs. It is **offered at `stop`, never forced** — but the `docs/brainstorm/{topic}/` record is **kept either way**: it is a committed design record, not a scratchpad, so harvest copies its conclusions outward and leaves the record in place as their provenance. (In a code-harnessed repo `docs/architecture/` and its `adr/` already exist, so the routing below always applies.)
|
|
4
4
|
|
|
5
5
|
## Routing
|
|
6
6
|
|
|
7
|
-
The harvest is a structured diff between the session pillars and the live docs, routed by scope:
|
|
7
|
+
The harvest is a structured diff between the session pillars and the live docs, routed by scope: doctrine / glossary / non-goals / IA / contract changes → `docs/architecture/`, decisions → `docs/architecture/adr/`, backlog → `docs/history/backlog.md`. Modules are labels, not folders — a finding scoped to one module's context still lands in `docs/architecture/` and names the module in prose; there is no module-local doc home.
|
|
8
8
|
|
|
9
9
|
| Session source | Destination |
|
|
10
10
|
| --- | --- |
|
|
11
11
|
| `thesis.md` narrative | `docs/history/plans/YYYY-MM-DD-{slug}.md` (Status: Draft, `documentation` skill §8 Plan template) |
|
|
12
12
|
| `domain-model.md` | `docs/architecture/domain-model.md`; if it changes the IA or a cross-cutting contract, note the contract change there — the `boundary` skill will pick it up from source at the next plan check |
|
|
13
|
-
| Decisions
|
|
14
|
-
|
|
|
15
|
-
| Cross-module doctrine / glossary | `docs/architecture/domain-model.md` / `docs/architecture/glossary.md` |
|
|
13
|
+
| Decisions (any scope) | one ADR per cohesive theme → `docs/architecture/adr/NNN-{slug}.md`, authored to the **`documentation` skill ADR template** (frontmatter `status:` is the lifecycle source of truth — no body Status line; required sections Decision/Context/Consequences); rejected alternatives → the ADR's **Options Considered** table |
|
|
14
|
+
| Doctrine / glossary / rejected | `docs/architecture/domain-model.md` / `docs/architecture/glossary.md`, or the relevant ADR |
|
|
16
15
|
| `tech.md` deviations | `docs/architecture/references.md` or the relevant ADR |
|
|
17
16
|
| `non-goals.md` / `references.md` | `docs/architecture/{non-goals,references}.md` |
|
|
18
17
|
| `backlog.md` | `docs/history/backlog.md` (P0–P3) |
|
|
@@ -23,4 +22,4 @@ Append a changelog entry at `docs/history/changelog/YYYY-MM-DD-brainstorm-harves
|
|
|
23
22
|
|
|
24
23
|
## After harvest
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
**Keep the `docs/brainstorm/{topic}/` record — never delete it.** The dispersed homes now carry the distilled conclusions, but the record stays committed as their provenance: a traceable source for every harvested headline, the seed the next `/brainstorm start` on this topic resumes from, and a high-surprisal input the `distiller` ingests. Retire a topic's folder by hand only when the design line is truly dead.
|
|
@@ -38,13 +38,13 @@ Distill the inbox's undigested entries into fact-cards. The algorithm is in [`re
|
|
|
38
38
|
|
|
39
39
|
**Thin or empty inbox ⇒ not a NOOP — distill the decision record.** A project whose sessions produced no reflected lessons is **not** a project with nothing to distill. Architecture decisions and reversals are high-surprisal by nature — they exist precisely because they were _not_ predictable. So when the inbox is thin/empty, also ingest, as surprisal sources for steps 2–5:
|
|
40
40
|
- `docs/architecture/adr/**` — each accepted ADR is a surprising decision (its `Decision` + **Options Considered** — the rejected-alternatives section in the `documentation` §10 ADR template — carry the prediction error).
|
|
41
|
-
- `docs/
|
|
41
|
+
- `docs/brainstorm/{topic}/` — the kept Brainstorming-Mode design records (`pillars/decisions.md`, `rejected.md`, etc.): the reasoning, reversals, and roads-not-taken behind each design call, retained as committed provenance. The richest surprisal source the harness produces. (Where a repo keeps no brainstorm record in `docs/` — e.g. an older transient-workspace harness — fall back to `docs/memory/brainstorm.md`, the owner pronouncements recorded outside the inbox.) Provenance points at the ADR file / brainstorm pillar, not a session id. These sources are **never consumed** — reconciliation (step 4) is what keeps a re-run over them idempotent.
|
|
42
42
|
|
|
43
43
|
2. **Surprisal filter → survivors** (method §1). Present the LLM with (a) a summary of the _current_ fact-set, (b) the undigested entries. Keep only what is **surprising** relative to (a). Predictable ⇒ dropped — no importance scores, no templates, prediction error is the only retention signal. Inbox entries arrive semi-distilled (the reflection hook already dropped routine work), so the filter's job here is narrower: drop what the existing fact-set already predicts. (First run, empty fact-set: keep decisions, reversals, discovered constraints, and failures with a cause worth remembering.)
|
|
44
44
|
|
|
45
45
|
3. **Decompose survivors → EDU candidates** (method §2). Each survivor becomes **one** atomic, self-contained statement — entity names normalized, minimal context baked into the sentence — with `provenance` pointing at the session ids and commits its inbox entry names. Decomposition, **not** summarization: one survivor may yield several cards; no information is destroyed; everything stays auditable back to its session and commits.
|
|
46
46
|
|
|
47
|
-
4. **Reconcile each candidate against existing cards** (method §3). Query the existing facts for semantic neighbors, then decide **ADD / UPDATE / SUPERSEDE / NOOP** for each. Gate on the **facts collection holding cards**, not on the binary and not on the collection merely being registered — a present qmd whose `{repo}-facts` collection is _registered but empty_ (the common first run:
|
|
47
|
+
4. **Reconcile each candidate against existing cards** (method §3). Query the existing facts for semantic neighbors, then decide **ADD / UPDATE / SUPERSEDE / NOOP** for each. Gate on the **facts collection holding cards**, not on the binary and not on the collection merely being registered — a present qmd whose `{repo}-facts` collection is _registered but empty_ (the common first run: the `maintenance` agent's baseline mode registers + embeds `{repo}-facts` over a freshly-scaffolded `docs/memory/facts/` that has zero cards) returns nothing useful, exactly like an unregistered collection.
|
|
48
48
|
- **Cards present** — `command -v qmd` succeeds **and** `docs/memory/facts/` holds at least one card (`docs/memory/facts/*.md` is non-empty): query scoped to the collection — `qmd query --format json -c {repo}-facts "<the candidate statement>"`. `{repo}` = the repo's directory name. Scope with `-c` always. (If the query returns nothing on a non-empty card set, the collection is registered-but- unbuilt — treat that as the fallback trigger below, not as "no neighbors.")
|
|
49
49
|
- **No cards to query** (qmd absent, **or** `docs/memory/facts/*.md` empty — the common first-run case where the facts dir was scaffolded but never distilled into): fall back to filename/grep similarity over `docs/memory/facts/*.md` (slug overlap + entity-name grep), and **note in the report** that reconciliation ran without semantic retrieval. Step 7 builds/refreshes the collection at the end of the run, so the _next_ run — with cards now present — reconciles semantically.
|
|
50
50
|
|
|
@@ -82,7 +82,7 @@ Distill fact-cards into proposed edits to `docs/` (the cold, human-owned SSoT)
|
|
|
82
82
|
- **Supersede ≠ delete.** Bi-temporal only: set `invalid_from:` + `superseded_by:` on the old card and leave the file in place. Nothing is ever removed from `docs/memory/facts/`.
|
|
83
83
|
- **Findings are questions, not verdicts.** When a candidate appears to contradict an existing card, phrase it as a question (is X now superseded by Y?) — never assert staleness or falsity.
|
|
84
84
|
- **Never auto-runs.** Invoked by the user, by the Completion flow (kit `CLAUDE.md`), or by accepting the maintenance proposal. No cron, no daemon, no hook self-trigger — a workflow step the agent runs is not a self-trigger.
|
|
85
|
-
- **qmd is strictly optional.** Guard every qmd call on `command -v qmd`; absent ⇒ silent skip. Reconciliation additionally needs the `{repo}-facts` collection to hold **cards** — not merely to be registered. "Unbuilt" here means **no cards** (`docs/memory/facts/*.md` empty), not "unregistered":
|
|
85
|
+
- **qmd is strictly optional.** Guard every qmd call on `command -v qmd`; absent ⇒ silent skip. Reconciliation additionally needs the `{repo}-facts` collection to hold **cards** — not merely to be registered. "Unbuilt" here means **no cards** (`docs/memory/facts/*.md` empty), not "unregistered": the `maintenance` agent's baseline mode registers + embeds `{repo}-facts` over an empty scaffolded facts dir, so on a qmd-equipped, freshly-baselined repo the collection _appears in_ `qmd collection list` yet indexes zero cards. Binary present but collection cardless (first run) falls back to filename/grep too, same as qmd being absent.
|
|
86
86
|
|
|
87
87
|
## Output locations
|
|
88
88
|
|
|
@@ -66,16 +66,16 @@ Read [`method.md`](method.md) (surprisal / EDU / reconciliation / bi-temporal vo
|
|
|
66
66
|
### 1. Resolve the target doc, read the three roots in order
|
|
67
67
|
|
|
68
68
|
1. `method.md` (algorithm vocabulary).
|
|
69
|
-
2. The **target doc** — full current prose + the `
|
|
69
|
+
2. The **target doc** — full current prose + the doc's `owns:` globs (the paths it owns). This is the SSoT you are proposing to revise; you read it before you draft so conflicts surface as questions, not silent overwrites.
|
|
70
70
|
- `--doc <path>` → that doc.
|
|
71
|
-
- `--feature <slug>` / bare → the spec that just flipped to `Active` (Completion names it), or the feature doc whose `
|
|
71
|
+
- `--feature <slug>` / bare → the spec that just flipped to `Active` (Completion names it), or the feature doc whose `owns:` glob covers the plan's Proposed-Changes paths. Match the `owns:` globs against changed paths. Architecture/operations docs declare no `owns:` — for those, fall to entity/semantic match.
|
|
72
72
|
- No doc resolves → Edge Case A.
|
|
73
73
|
3. The **pillar headlines** — the doctrine pillar (`## Pn —` headlines) and the decisions pillar (`## Dn —` headlines) plus each one's one-line Principle/Decision statement. Read **every** decision headline except those marked superseded: a decision carrying a `Reversed by D-M` marker (or a legacy `Status: tentative`) is NOT a binding pillar headline and is skipped; absence of any status marker means the decision is live (the new append-only model has no `Status: committed` field — a live decision is simply one nothing has reversed). Headlines only, never the bodies — this is the conservative contradiction-check substrate (Resolution 4).
|
|
74
74
|
|
|
75
75
|
### 2. INPUT SELECTION — gather the cards "touching" the target (Resolution 1) — _closes F2, F3, F5_
|
|
76
76
|
|
|
77
|
-
1. **Structural retriever (always runs, qmd-independent).** Read every card in `docs/memory/facts/*.md`. A card _structurally touches_ the target when its `provenance` paths or `entities` intersect the target's `
|
|
78
|
-
2. **Semantic retriever (qmd, optional).** If `command -v qmd` succeeds, for the target's identity (title + each
|
|
77
|
+
1. **Structural retriever (always runs, qmd-independent).** Read every card in `docs/memory/facts/*.md`. A card _structurally touches_ the target when its `provenance` paths or `entities` intersect the target's `owns:` globs — match defined precisely in Resolution 1.
|
|
78
|
+
2. **Semantic retriever (qmd, optional).** If `command -v qmd` succeeds, for the target's identity (title + each `owns:`-glob stem + any `anchors:` query) run `qmd query --format json -c {repo}-facts "<the doc's subject>"`. `{repo}` = repo dir name; scope with `-c` always; repeat `-c` per relevant `{repo}-*` facts collection (the set `qmd collection list` names). qmd absent ⇒ skip silently, note in the report that selection ran structural-only (changes recall, not correctness).
|
|
79
79
|
3. **Bi-temporal + digestion gate (F2, F3).** From the union, drop:
|
|
80
80
|
- any card with `invalid_from` ≠ `null` (superseded — list as "skipped: superseded");
|
|
81
81
|
- any card whose `digested_into:` already lists the target doc path (already consumed here);
|
|
@@ -169,8 +169,8 @@ A card **touches** the target doc iff it satisfies **either** retriever, and is
|
|
|
169
169
|
|
|
170
170
|
**(a) Structural intersection (exact, always evaluated).** True when ANY of:
|
|
171
171
|
|
|
172
|
-
1. **Provenance match (STRONG signal).** A `commit <sha>` entry in the card's `provenance` resolves to changed files (`git show --name-only <sha>` when the commit is local); a changed file under the target's `
|
|
173
|
-
2. **Entity match (SUPPORTING signal).** A normalized name in the card's `entities` equals (case-insensitively, after kebab/camel normalization) a module/feature stem in one of the target's `
|
|
172
|
+
1. **Provenance match (STRONG signal).** A `commit <sha>` entry in the card's `provenance` resolves to changed files (`git show --name-only <sha>` when the commit is local); a changed file under the target's `owns:` globs is a match. (`session <id>` entries carry no paths and do not participate; an ADR/brainstorm path matches the globs directly.) This is strong because the card derives from a commit that edited code the doc owns.
|
|
173
|
+
2. **Entity match (SUPPORTING signal).** A normalized name in the card's `entities` equals (case-insensitively, after kebab/camel normalization) a module/feature stem in one of the target's `owns:` globs, the doc title, or a symbol the doc explicitly names. **Bare prose mentions do NOT count** — only declared ownership (its `owns:` globs), so "touching" can't be triggered by a doc that merely discusses an entity it doesn't own.
|
|
174
174
|
|
|
175
175
|
**(b) Semantic neighborhood (qmd, optional, recall-only).** A card returned by `qmd query -c {repo}-facts "<doc subject>"` within qmd's default result window. Semantic hits with **no** structural intersection are still candidates but flagged `[semantic-only]` in the delta — the link is associative, not provenance-grounded, so the reviewer treats it as lower-trust and may reject on link-strength alone.
|
|
176
176
|
|
|
@@ -189,7 +189,7 @@ A card may touch **several** docs (its entities span modules) — expected, hand
|
|
|
189
189
|
| **`## Architecture` / `## Key Functions`** (feature doc) | Additive correction only when a card names a concrete, code-anchored fact (a new function, a moved file). Prefer Current Behavior unless the card is structural. | Code-anchored structure, not prose. |
|
|
190
190
|
| **A new changelog entry** in `docs/history/changelog/` (via `documentation` skill's Changelog template, `### Added`/`### Modified`/`### Removed`) | Draft a changelog line for a code change a card witnesses, when a plan just completed. | Append-only history; a _new_ file, never an edit. |
|
|
191
191
|
|
|
192
|
-
**Never writable by distill②** (hard stops): `## Goal`, `## Goals & Non-Goals`, `## Approach`, `## Open Questions`, `## State`, the optional `anchors:`
|
|
192
|
+
**Never writable by distill②** (hard stops): `## Goal`, `## Goals & Non-Goals`, `## Approach`, `## Open Questions`, `## State`, the focal frontmatter (`owns`/`module`/`keywords`/`status`) and the optional `anchors:` block (ownership and discovery live there, on the spec/maintenance axis, not the distiller's — P19), any **pillar** file, any **plan** (frozen), any **existing** changelog entry (frozen history), any **boundary** file. A card implying one of these needs a change becomes a **question** (below) or, for pillars, an **escape item** (Resolution 4).
|
|
193
193
|
|
|
194
194
|
**Per-line provenance (the invariant, mechanized).** Every drafted line carries `[from: fact-<slug>]` for each contributing card. A line with no such tag is a **defect** — not presented (Acceptance A2). On accept the tag is stripped from the final doc prose (it was review scaffolding); the durable forward-link survives as `digested_into:` (Resolution 3) — so traceability is preserved without polluting human-owned prose.
|
|
195
195
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: documentation
|
|
3
|
-
description: Template & generator library for technical docs — the skill agents call to produce a doc from a template. Use to (1) document a feature or module, (2) create or update a changelog entry, (3) document data flows or Redux state, (4) add to protected files, (5) record an architecture decision (ADR), (6) create or update the project root README, (7) create or update a plan, (8) derive
|
|
3
|
+
description: Template & generator library for technical docs — the skill agents call to produce a doc from a template. Use to (1) document a feature or module, (2) create or update a changelog entry, (3) document data flows or Redux state, (4) add to protected files, (5) record an architecture decision (ADR), (6) create or update the project root README, (7) create or update a plan, (8) derive a feature doc's `owns:` frontmatter (the code-path globs it owns) from code, (9) scaffold a standard doc (README, structure.md, CHANGELOG, backlog, memory) from its template, or (10) co-author any technical doc. Baselining / reconciling a repo's docs to the installed harness version is the **`maintenance` agent (baseline mode)** (which calls this skill for each template) — this skill does not orchestrate baseline. Triggers on "document this", "create docs", "update changelog", "add to protected files", "ADR", "architecture decision", "root README", "plan", "feature doc".
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Technical Documentation Skill
|
|
7
7
|
|
|
8
|
-
**This skill is a template & generator library, not an orchestrator.** It supplies the templates, the
|
|
8
|
+
**This skill is a template & generator library, not an orchestrator.** It supplies the templates, the frontmatter-derivation generator, and the co-authoring workflow that _agents_ call to produce individual docs. It does **not** baseline, audit, or reconcile a repo's doc tree — that is the **`maintenance` agent (baseline mode)**, which calls this skill for each template it scaffolds. Reach here to generate _one_ doc from a template; reach for the `maintenance` agent (baseline mode) to bring a whole repo into shape.
|
|
9
9
|
|
|
10
10
|
Document contracts and architecture, not implementation details. Show function signatures and API shapes — never paste full implementations (they rot fast). Use ASCII diagrams over prose for flows. Only document state at persistence boundaries (Redux persistence, DB schemas, API shapes), not component-level or transient state. Mark deprecated fields with `// UNUSED:` comments. Breaking changes belong in changelogs only, not module docs.
|
|
11
11
|
|
|
12
|
-
**No redirect docs.** When moving a doc to a new location, delete the old file entirely. Update all references (
|
|
12
|
+
**No redirect docs.** When moving a doc to a new location, delete the old file entirely. Update all references (cross-doc links, memory files) to point to the new path. Never leave a stub file that says "Moved to X" — redirect docs rot, clutter the repo, and create false search hits.
|
|
13
13
|
|
|
14
14
|
**Present tense, current state only.** Active docs (everything outside `docs/history/`) describe the system _as it is now_ — what exists and how it works today. They never narrate how it got there: no migration/fold history, no dated "shipped/verified/built on YYYY-MM-DD" markers, no "ex-`@nurix/X`, folded 2026-06-12" provenance, no "was X → now Y" change journeys, no "removed/deleted in the <date> fold". The historical record — when and how things changed — lives **only** in `docs/history/` (changelog, plans, ADRs); `docs/memory/` is the agent's dated log and is likewise exempt. A doc may cite an ADR for the _why_ (the decision rationale), but must not narrate the _when/how it changed_. Routing/index docs point only to current authority docs — never to a historical plan or changelog as the "read first" source. When you find historical narration in an active doc, rewrite it to the present-tense fact and let `docs/history/` carry the story.
|
|
15
15
|
|
|
@@ -20,7 +20,7 @@ Document contracts and architecture, not implementation details. Show function s
|
|
|
20
20
|
```
|
|
21
21
|
User request
|
|
22
22
|
│
|
|
23
|
-
├─ "Baseline/reconcile docs" ──────▶
|
|
23
|
+
├─ "Baseline/reconcile docs" ──────▶ maintenance agent (baseline mode) (it calls this skill per template)
|
|
24
24
|
│
|
|
25
25
|
├─ "Document feature/module" ──────▶ Module Template
|
|
26
26
|
│
|
|
@@ -54,25 +54,25 @@ User request
|
|
|
54
54
|
|
|
55
55
|
---
|
|
56
56
|
|
|
57
|
-
##
|
|
57
|
+
## Frontmatter Derivation
|
|
58
58
|
|
|
59
|
-
When creating or updating a feature doc, derive its **`
|
|
59
|
+
When creating or updating a feature doc, derive its **`owns:` frontmatter** — the code-path globs it is canonical for — from the source the doc describes. Code ownership lives in each feature doc's `owns:` frontmatter (the SessionStart hook unions them into the injected ownership index); there is no hand-maintained ownership map.
|
|
60
60
|
|
|
61
61
|
### When to run
|
|
62
62
|
|
|
63
|
-
- **Baseline / reconcile** — for every feature doc whose code paths aren't yet
|
|
64
|
-
- **New feature doc** — when creating a doc via the Feature/Module template,
|
|
65
|
-
- **Doc update** — when the documented scope changes, update the doc's
|
|
63
|
+
- **Baseline / reconcile** — for every feature doc whose code paths aren't yet declared in its `owns:` frontmatter (the `maintenance` agent (baseline mode) calls this)
|
|
64
|
+
- **New feature doc** — when creating a doc via the Feature/Module template, project its `owns:` globs
|
|
65
|
+
- **Doc update** — when the documented scope changes, update the doc's `owns:` globs
|
|
66
66
|
|
|
67
|
-
### How to derive
|
|
67
|
+
### How to derive the frontmatter
|
|
68
68
|
|
|
69
|
-
A
|
|
69
|
+
A feature doc's launch-map frontmatter is `owns:` (required), `module:` (optional), `keywords:` (required), and `status:` (required).
|
|
70
70
|
|
|
71
|
-
**1.
|
|
71
|
+
**1. `owns:`** (the path scope)
|
|
72
72
|
|
|
73
|
-
Read the doc's content. Extract every source file path it references (file listings, function locations, component paths). Group them into the narrowest glob patterns that cover all referenced files without overlapping another doc's
|
|
73
|
+
Read the doc's content. Extract every source file path it references (file listings, function locations, component paths). Group them into the narrowest glob patterns that cover all referenced files without overlapping another doc's `owns:` globs at equal specificity. A doc may own several globs.
|
|
74
74
|
|
|
75
|
-
| Doc references |
|
|
75
|
+
| Doc references | Glob |
|
|
76
76
|
| ------------------------------------ | ------------------------- |
|
|
77
77
|
| Multiple files under one directory | `src/feature/**` |
|
|
78
78
|
| Specific files in a shared directory | List each file explicitly |
|
|
@@ -80,22 +80,22 @@ Read the doc's content. Extract every source file path it references (file listi
|
|
|
80
80
|
|
|
81
81
|
Glob each pattern against the codebase; drop any that match nothing.
|
|
82
82
|
|
|
83
|
-
**2.
|
|
83
|
+
**2. `module:`**
|
|
84
84
|
|
|
85
|
-
The
|
|
85
|
+
The single bounded-context label this feature belongs to, or omit it for a cross-cutting feature that belongs to no single context. A module is a label, not a folder — features sharing a `module:` value are what ties that module to code (a filter over the generated ownership index).
|
|
86
86
|
|
|
87
|
-
**3.
|
|
87
|
+
**3. `keywords:` & `status:`**
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
`keywords:` are the discovery terms topic→doc lookup rides. `status:` is `active`, `draft`, or `deprecated` — it steers the model toward live docs and away from draft/deprecated ones.
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
A doc's dependencies on other docs are expressed inline in its prose (links); cross-cutting contracts are diagnosed by the `boundary` skill from source, not persisted.
|
|
92
92
|
|
|
93
93
|
### Rules
|
|
94
94
|
|
|
95
|
-
- One canonical doc per path. A
|
|
95
|
+
- One canonical doc per path. A doc's `owns:` globs must not overlap another doc's at equal specificity — the narrower glob wins; equal-specificity overlap is an ownership conflict to resolve.
|
|
96
96
|
- Use glob patterns for directories, explicit paths for individual files. Don't list paths that don't exist in the codebase.
|
|
97
|
-
- When a doc covers a deep feature with sub-specs (e.g., `editor/`), each sub-spec
|
|
98
|
-
- For baseline/reconcile with many docs, use parallel sub-agents to read source and propose
|
|
97
|
+
- When a doc covers a deep feature with sub-specs (e.g., `editor/`), each sub-spec owns its own globs — don't duplicate a path across siblings.
|
|
98
|
+
- For baseline/reconcile with many docs, use parallel sub-agents to read source and propose `owns:` globs.
|
|
99
99
|
|
|
100
100
|
---
|
|
101
101
|
|
|
@@ -119,6 +119,6 @@ For docs that don't match templates:
|
|
|
119
119
|
|
|
120
120
|
| File | Use For |
|
|
121
121
|
| --- | --- |
|
|
122
|
-
| `references/templates.md` | docs/README.md, structure.md,
|
|
122
|
+
| `references/templates.md` | docs/README.md, structure.md, the feature-frontmatter contract, scaffolds (CHANGELOG, backlog, memory), feature, changelog, plan, protected files, ADR, project root README templates |
|
|
123
123
|
| `references/style-guide.md` | Writing rules, formatting conventions |
|
|
124
124
|
| `references/examples.md` | Good vs bad documentation examples |
|
|
@@ -60,6 +60,7 @@ Everything frozen or append-only.
|
|
|
60
60
|
- [CHANGELOG.md](history/CHANGELOG.md) - Master changelog index
|
|
61
61
|
- [changelog/](history/changelog/) - Individual changelog entries
|
|
62
62
|
- [plans/](history/plans/) - Historical implementation plans
|
|
63
|
+
- [research/](history/research/) - Deep-research artifacts (one folder per topic)
|
|
63
64
|
- [backlog.md](history/backlog.md) - Tracked work items and technical debt
|
|
64
65
|
|
|
65
66
|
---
|
|
@@ -83,7 +84,7 @@ harness-version: 1.0.0
|
|
|
83
84
|
# Documentation Structure
|
|
84
85
|
|
|
85
86
|
> This file is the entry point for understanding the docs folder.
|
|
86
|
-
> `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.
|
|
87
88
|
|
|
88
89
|
## Authority Map
|
|
89
90
|
|
|
@@ -91,13 +92,14 @@ Each topic has one canonical location. Read from here, not from plans or changel
|
|
|
91
92
|
|
|
92
93
|
| Topic | Authority | Key Files |
|
|
93
94
|
| ----- | --------- | --------- |
|
|
94
|
-
| Code-path ownership (path → doc + module) | `
|
|
95
|
+
| Code-path ownership (path → doc + module) | feature `owns:` frontmatter | the generated ownership index |
|
|
95
96
|
| System architecture + steering | `docs/architecture/` | domain-model, glossary, non-goals, references, adr/ |
|
|
96
|
-
| Feature behavior | `docs/features/`
|
|
97
|
-
| Declared modules (bounded contexts) | `docs/modules/{m}/` | `features/` + `pillars/` |
|
|
97
|
+
| Feature behavior | `docs/features/` | {key files} |
|
|
98
98
|
| Setup & development | `docs/operations/` | {key files} |
|
|
99
99
|
| Historical plans | `docs/history/plans/` | YYYY-MM-DD-name.md |
|
|
100
100
|
| Change records | `docs/history/changelog/` | Individual entries |
|
|
101
|
+
| Deep-research artifacts | `docs/history/research/{topic}/` | README.md + findings.md + sources.md |
|
|
102
|
+
| Brainstorm design records | `docs/brainstorm/{topic}/` | state.md + pillars/ |
|
|
101
103
|
| Backlog | `docs/history/` | backlog.md |
|
|
102
104
|
|
|
103
105
|
## Document Lifecycle
|
|
@@ -110,13 +112,13 @@ Plan (Status: Draft) → Implementation → Feature Doc or Architecture Update
|
|
|
110
112
|
|
|
111
113
|
## Folder Rules
|
|
112
114
|
|
|
113
|
-
- `docs/
|
|
114
|
-
- `docs/
|
|
115
|
-
- `docs/architecture/`: System-wide patterns and the cross-module steering layer (domain model, glossary, non-goals, references, ADRs). Update when cross-cutting concerns change.
|
|
116
|
-
- `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.
|
|
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.
|
|
119
119
|
- `docs/history/changelog/`: Historical. Append-only.
|
|
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.
|
|
120
122
|
- `docs/history/backlog.md`: Tracked work items. Append new items under appropriate priority.
|
|
121
123
|
|
|
122
124
|
## Health Log
|
|
@@ -129,55 +131,11 @@ Plan (Status: Draft) → Implementation → Feature Doc or Architecture Update
|
|
|
129
131
|
|
|
130
132
|
---
|
|
131
133
|
|
|
132
|
-
## 2.5 docs/routing.md (Code-Path Ownership Map)
|
|
133
|
-
|
|
134
|
-
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.
|
|
135
|
-
|
|
136
|
-
```
|
|
137
|
-
# Routing
|
|
138
|
-
|
|
139
|
-
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.
|
|
140
|
-
|
|
141
|
-
> **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.
|
|
142
|
-
|
|
143
|
-
## File-Pattern Routes
|
|
144
|
-
|
|
145
|
-
| Pattern | Module | Canonical Doc | Memory |
|
|
146
|
-
| ------- | ------ | ------------- | ------ |
|
|
147
|
-
| `src/auth/**` | auth | features/login.md | memory/main.md |
|
|
148
|
-
| `src/billing/**` | billing | modules/billing/features/invoicing.md | — |
|
|
149
|
-
|
|
150
|
-
- **Pattern** — the narrowest glob covering the files the doc is canonical for. A doc may have several rows.
|
|
151
|
-
- **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.
|
|
152
|
-
- **Canonical Doc** — the one doc to read before changing matching files (`features/…` when flat, `modules/{m}/features/…` when the module is declared).
|
|
153
|
-
- **Memory** — the `docs/memory/` file with domain knowledge for this area, or `—`.
|
|
154
|
-
|
|
155
|
-
## Keyword Routes
|
|
156
|
-
|
|
157
|
-
| Keyword / topic | Canonical Doc |
|
|
158
|
-
| --------------- | ------------- |
|
|
159
|
-
| auth, login, SSO, refresh | features/login.md |
|
|
160
|
-
|
|
161
|
-
## Top-Level Folders
|
|
162
|
-
|
|
163
|
-
| Folder | Purpose | Doc |
|
|
164
|
-
| ------ | ------- | --- |
|
|
165
|
-
| `src/` | {what lives here} | {doc} |
|
|
166
|
-
|
|
167
|
-
## How to Add a Route
|
|
168
|
-
|
|
169
|
-
1. Add/extend a **File-Pattern Routes** row — narrowest pattern that doesn't overlap an existing row at equal specificity; set its Module (or `—`).
|
|
170
|
-
2. Add keyword row(s) for discoverability.
|
|
171
|
-
3. When you move/rename owned source, update the matching pattern(s) here — this map is hand-maintained.
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
134
|
## 3. Code-Path Ownership & Anchors
|
|
177
135
|
|
|
178
|
-
**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.
|
|
179
137
|
|
|
180
|
-
**Anchors (optional
|
|
138
|
+
**Anchors (optional tooling key).** A doc may additionally carry an `anchors:` block — a qmd drift tripwire, orthogonal to ownership:
|
|
181
139
|
|
|
182
140
|
```yaml
|
|
183
141
|
---
|
|
@@ -186,7 +144,7 @@ anchors:
|
|
|
186
144
|
---
|
|
187
145
|
```
|
|
188
146
|
|
|
189
|
-
`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.
|
|
190
148
|
|
|
191
149
|
---
|
|
192
150
|
|
|
@@ -279,7 +237,7 @@ description: Shared knowledge accumulated across agent sessions. All agents shou
|
|
|
279
237
|
## Documentation Baseline
|
|
280
238
|
|
|
281
239
|
- **Baselined:** {today}
|
|
282
|
-
- **Structure:** v{harness-version} (architecture, features, operations, history, memory; +
|
|
240
|
+
- **Structure:** v{harness-version} (architecture, features, operations, history, memory; + tests/ when present)
|
|
283
241
|
- **Spec version:** v{harness-version}
|
|
284
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. -->
|
|
285
243
|
|
|
@@ -332,17 +290,21 @@ The four research-derived sections (**Affected Modules**, **Conventions to Follo
|
|
|
332
290
|
|
|
333
291
|
```yaml
|
|
334
292
|
---
|
|
335
|
-
|
|
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
|
|
336
298
|
- "qmd query: wire envelope invariants"
|
|
337
299
|
---
|
|
338
300
|
```
|
|
339
301
|
|
|
340
|
-
>
|
|
302
|
+
> Declare the code paths it owns in its `owns:` frontmatter — projected at Draft, confirmed against real code at Active.
|
|
341
303
|
|
|
342
304
|
```
|
|
343
305
|
# {Feature Name}
|
|
344
306
|
|
|
345
|
-
|
|
307
|
+
<!-- Lifecycle lives in the frontmatter `status:` key (active | draft | deprecated) — the single source of truth. Don't restate it in the body. -->
|
|
346
308
|
**Plan:** [history/plans/YYYY-MM-DD-feature-name.md](../history/plans/YYYY-MM-DD-feature-name.md) <!-- added once a plan exists -->
|
|
347
309
|
|
|
348
310
|
## Goal
|
|
@@ -385,7 +347,7 @@ High-level shape of the solution. ASCII diagram if it helps. Implementation spec
|
|
|
385
347
|
|
|
386
348
|
## Ownership Conflicts
|
|
387
349
|
|
|
388
|
-
(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.
|
|
389
351
|
|
|
390
352
|
| Conflicting doc | Overlapping path(s) | Resolution |
|
|
391
353
|
|-----------------|---------------------|------------|
|
|
@@ -465,7 +427,7 @@ Sections fill in across the feature's lifecycle. No template swap — they accum
|
|
|
465
427
|
| --- | --- | --- |
|
|
466
428
|
| Status: Draft (design) | Goal, Goals & Non-Goals, Background, Approach, Open Questions, Risks | User interview |
|
|
467
429
|
| Status: Draft (research) | Affected Modules, Conventions to Follow, Current Behavior, Ownership Conflicts | spec-mode agent |
|
|
468
|
-
| 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) |
|
|
469
431
|
|
|
470
432
|
Resolved Open Questions can be summarized into Background; unresolved ones stay visible.
|
|
471
433
|
|
|
@@ -560,7 +522,7 @@ Why this work is happening *now*. Link to the spec for *what* we're building; th
|
|
|
560
522
|
|
|
561
523
|
### Cross-Module Contracts Affected
|
|
562
524
|
|
|
563
|
-
- List which cross-cutting contracts this plan
|
|
525
|
+
- List which cross-cutting contracts this plan affects (db schema, wire envelope, auth, events, env/config, …)
|
|
564
526
|
- "None" is a valid answer and means the `boundary` check will pass cleanly
|
|
565
527
|
|
|
566
528
|
## Implementation Steps
|
|
@@ -572,7 +534,7 @@ Why this work is happening *now*. Link to the spec for *what* we're building; th
|
|
|
572
534
|
## Done Criteria
|
|
573
535
|
|
|
574
536
|
- [ ] Implementation complete and verified
|
|
575
|
-
- [ ] Affected docs updated (use
|
|
537
|
+
- [ ] Affected docs updated (use the injected ownership index to find them)
|
|
576
538
|
- [ ] Changelog entry created in `docs/history/changelog/`
|
|
577
539
|
- [ ] Plan marked `Status: Complete`, **Completed:** date filled
|
|
578
540
|
|
|
@@ -634,7 +596,7 @@ path/to/another/file.js
|
|
|
634
596
|
|
|
635
597
|
## 9. Architecture Decision Record (ADR)
|
|
636
598
|
|
|
637
|
-
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.
|
|
638
600
|
|
|
639
601
|
### When to write an ADR
|
|
640
602
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Markdown: Prettier unwraps prose to one logical line per paragraph
|
|
3
|
+
// (see .prettierrc → proseWrap:never) on save; the editor soft-wraps for
|
|
4
|
+
// reading, so no hard line breaks get baked into the source.
|
|
5
|
+
"[markdown]": {
|
|
6
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
7
|
+
"editor.formatOnSave": true,
|
|
8
|
+
"editor.wordWrap": "on"
|
|
9
|
+
}
|
|
10
|
+
}
|