@naswerks/engineering-loop 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/.claude-plugin/marketplace.json +15 -0
  2. package/.claude-plugin/plugin.json +8 -0
  3. package/CHANGELOG.md +32 -0
  4. package/LICENSE +21 -0
  5. package/README.md +78 -0
  6. package/bin/verify-staged.mjs +247 -0
  7. package/package.json +35 -0
  8. package/references/docs-workflow.md +417 -0
  9. package/references/engineering-loop.md +298 -0
  10. package/skills/docs-audit-feature/SKILL.md +88 -0
  11. package/skills/docs-audit-full/SKILL.md +54 -0
  12. package/skills/docs-backlog/SKILL.md +41 -0
  13. package/skills/docs-process/SKILL.md +146 -0
  14. package/skills/docs-status/SKILL.md +47 -0
  15. package/skills/docs-write/SKILL.md +43 -0
  16. package/skills/init/SKILL.md +163 -0
  17. package/skills/init/scripts/doctor.mjs +176 -0
  18. package/skills/spec-child/SKILL.md +149 -0
  19. package/skills/spec-ignite/SKILL.md +277 -0
  20. package/skills/spec-parent/SKILL.md +634 -0
  21. package/skills/spec-pipeline/SKILL.md +453 -0
  22. package/skills/spec-retro/SKILL.md +398 -0
  23. package/skills/spec-review/SKILL.md +266 -0
  24. package/skills/spec-seat/SKILL.md +512 -0
  25. package/skills/spec-witness/SKILL.md +222 -0
  26. package/templates/claude-md-stanza.md +13 -0
  27. package/templates/docs/_meta/doc-index.md +90 -0
  28. package/templates/docs/infrastructure/background-work.md +53 -0
  29. package/templates/docs/infrastructure/realtime-events.md +54 -0
  30. package/templates/docs/patterns/backend-patterns.md +96 -0
  31. package/templates/docs/patterns/codegen.md +69 -0
  32. package/templates/docs/patterns/frontend-patterns.md +92 -0
  33. package/templates/docs/patterns/state-management.md +73 -0
  34. package/templates/docs/patterns/testing.md +103 -0
  35. package/templates/docs/patterns/ui-style-guide.md +76 -0
  36. package/templates/docs/patterns/vertical-slice-anatomy.md +61 -0
  37. package/templates/docs/readme-archive.md +9 -0
  38. package/templates/docs/readme-features.md +7 -0
  39. package/templates/docs/readme-guides.md +7 -0
  40. package/templates/docs/readme-infrastructure.md +7 -0
  41. package/templates/docs/readme-patterns.md +9 -0
  42. package/templates/docs/readme-research.md +9 -0
  43. package/templates/docs/readme-working.md +9 -0
  44. package/templates/settings-pin.json +10 -0
@@ -0,0 +1,417 @@
1
+ <!-- naswerks-loop: version=0.1.0 -->
2
+ # Docs Workflow
3
+
4
+ > How knowledge flows through `docs/`: the loop, the folder rules, the templates, and the `docs-*` skills.
5
+ > For the menu of what to read, see [doc-index.md](doc-index.md).
6
+
7
+ ---
8
+
9
+ ## The Loop
10
+
11
+ ```
12
+ research/ the running tab of ideas to do — search a topic, file it (docs-backlog)
13
+ | pick one up: plan + implement
14
+ working/ per-session handoff doc(s). A multi-session effort chains several —
15
+ each `Builds on` the last, all tagged `Source:` the research doc
16
+ | docs-write at each session's end — doc(s) STAY in working/ (the queue)
17
+ docs-process finalizer (effort done): patch living docs, then archive the
18
+ research doc + ALL its working docs together into archive/{topic}/
19
+ |
20
+ living docs guides/ · patterns/ · infrastructure/ · features/ (current state)
21
+ ```
22
+
23
+ A research doc is the *running tab*: it stays in `research/` through the build — which may take several
24
+ sessions and several chained working docs — and is archived **with** its working docs when the effort
25
+ finishes, so the idea and the work that delivered it land in the same `archive/{topic}/` folder.
26
+
27
+ `docs-write` runs at each session's end while context is fresh; it records the archive target (an
28
+ `## Archive` line) but **moves nothing** — that keeps `working/` an honest queue. `docs-process` is the
29
+ **finalizer**, run once the effort is done: it patches the living docs (the working docs' **Living Docs
30
+ to Update** checklists are the bridge), then files the research doc + the whole working-doc chain into
31
+ `archive/`. Releases/changelogs are **not** tracked here — git history covers that.
32
+
33
+ Splitting `write` from `process` is deliberate (the two-session boundary): `process` runs later, with
34
+ **fresh eyes**, and verifies every claim against the actual code rather than trusting the just-written
35
+ narrative. That's also why it's a separate session, not the tail of the implementation one.
36
+
37
+ ---
38
+
39
+ ## Folders
40
+
41
+ | Folder | What it holds | Lifecycle |
42
+ |--------|---------------|-----------|
43
+ | `_meta/` | This system — `doc-index` (the menu) + `docs-workflow` (this file) | Maintained as the system evolves |
44
+ | `research/` | The running tab of ideas to do, not yet built. The folder is the queue. | Created by `docs-backlog`; stays through the build, then **archived with its working doc(s)** by `docs-process` |
45
+ | `working/` | Active + finished-but-unprocessed session docs (one effort may chain several). The folder is the queue. | **Leaves via `docs-process`** — research + the whole chain archived together once the living docs are patched |
46
+ | `archive/` | Completed/abandoned session docs, grouped into **topic** folders | Write-once. Frozen history — never edit archived docs |
47
+ | `guides/` | How to ADD a new thing — step-by-step walkthroughs | Living — patched by `docs-process` |
48
+ | `patterns/` | Conventions to FOLLOW when writing code | Living — patched by `docs-process` |
49
+ | `infrastructure/` | What runs under the hood (technologies/plumbing) | Living — patched by `docs-process` |
50
+ | `features/` | What exists — one doc per feature | Living — patched by `docs-process`, audited vs code |
51
+
52
+ **Living docs vs session docs:** living docs describe what exists NOW (overwritten with current
53
+ state). Session docs describe how we got there (written once, then frozen in `archive/`).
54
+
55
+ **Two kinds of living doc — opposite truth sources.** Prescriptive docs (`patterns/`, `guides/`)
56
+ answer *"how should I?"* — they're rules you decided, so **truth is by decision** and code should
57
+ *conform* to them; they can exist before the code does. Descriptive docs (`infrastructure/`,
58
+ `features/`) answer *"how did we?"* — born from `docs-process` after code ships, so **code is truth**
59
+ and they're verified against source. This flips the audit direction: for a descriptive doc you fix the
60
+ doc to match code; for a prescriptive doc you check whether the *code* matches the doc — and a mismatch
61
+ is usually a code problem to flag, not a doc to rewrite (unless the rule itself deliberately changed).
62
+
63
+ ---
64
+
65
+ ## The archive convention
66
+
67
+ A multi-session effort becomes a **topic folder** under `archive/` (e.g. `archive/{topic}/`).
68
+ Docs are **not numbered** — they use descriptive names and chain via a header link:
69
+
70
+ ```markdown
71
+ # GraphRAG Hardening — Part 2
72
+
73
+ > {One-line summary}. Builds on [{prior}]({prior}.md).
74
+ > Completed {date} on branch `{branch}`.
75
+ ```
76
+
77
+ Each archived doc carries the full narrative: Research & Decisions (the plan), Implementation,
78
+ Change shape, Verification, Watch-Outs. The chain (`Builds on …`) is how a reader replays the
79
+ effort across sessions.
80
+
81
+ If the effort began as a research idea, its **research doc is filed into the same topic folder** by
82
+ `docs-process` — so the topic folder holds the original idea plus the working-doc chain that delivered
83
+ it, the complete arc from "thing we'd like to do" to "done."
84
+
85
+ ### Two topic-folder shapes (flat vs. spec-driven split)
86
+
87
+ **There is always a working doc; a spec pipeline is added only when the work is large enough to plan as
88
+ one** (via `spec-pipeline`). The trigger for the layout is simply *"does this effort have a spec pipeline?"*:
89
+
90
+ - **Flat (no specs)** — the default. A small/single-session effort is just its working doc(s) (plus
91
+ any `Source:` research doc) at the topic-folder root, chained by `Builds on`. This is how the legacy
92
+ topic folders look.
93
+ - **Split (has specs)** — when the effort used `spec-pipeline`, separate the two halves so the folder stays
94
+ navigable as it grows:
95
+
96
+ ```
97
+ archive/{topic}/
98
+ project-status.md <- the tracker/index — root, "read me first" (spans both halves)
99
+ live-checks.md <- the human's verification rows, accumulated as the pipeline ran
100
+ specs/ <- the spec pipeline: 00-ignition-brief · 01 umbrella · 02..NN slices
101
+ implementation/ <- the per-session working docs that built it
102
+ sessions/ <- THE PIPELINE'S CONVERSATION, archived intact:
103
+ {spec-slug}/plan.md + {spec-slug}/tldr.md per build session
104
+ (TWO files — questions ride the PLAN TLDR, and there are no
105
+ status snapshots, because the tracker is committed live and
106
+ its git history carries every revision)
107
+ code-review.md the review seat's outside look, if
108
+ the pipeline had a review row
109
+ parent-retrospective.md the parent's inside look
110
+ These are TESTIMONY: an archive pass repairs links elsewhere and
111
+ leaves sessions/** byte-untouched. Older archived sessions may
112
+ still hold questions.md / status-after-*.md; that is historical
113
+ record, not the convention.
114
+ ```
115
+
116
+ **Follow-on pipelines (multi-round families).** *(Renamed at the v2 cutover — this section was
117
+ `Follow-on chains`; skills citing the old heading mean this one.)* A second (third, …) spec pipeline that continues an
118
+ already-archived effort gets its **own sibling topic folder**, never filed inside the frozen one.
119
+ Rules: (a) name the new topic `{family-prefix}-{subtopic}` so the family groups
120
+ alphabetically; (b) each folder keeps the full split shape (own `project-status.md` at root); (c) the
121
+ **family index is the living feature doc's `## Lineage`** — it accumulates Idea/Spec/Built rows from
122
+ every round; (d) the new pipeline's umbrella/tracker back-link to the prior round's archive (allowed —
123
+ cross-effort links into archives are historical record). Never reopen a frozen topic folder to add
124
+ a round.
125
+
126
+ **Fix the intra-effort links the move breaks.** Moving files changes relative depths, so on archive
127
+ `docs-process` repairs the links *within* the effort (and the live feature doc that points at it):
128
+ working docs' `Source:` to the spec's new path (`../specs/NN-*.md`), the spec / `project-status` links, the
129
+ index's links into `specs/`, and the feature doc's `## Lineage` rows (`Spec` to `specs/…`,
130
+ `Built` to `implementation/…`). **Pre-existing cross-effort links** in archived docs (to *other* topic
131
+ folders / research chains) are **left as historical record** — don't chase those.
132
+
133
+ **`archive/audit/` is the one exception to topic-folder grouping.** Audit reports mirror the *living-doc
134
+ groups* instead — `archive/audit/{guides,patterns,infrastructure,features}/{doc}-audit.md` — so each
135
+ report sits beside the docs it audits. The cross-cutting `health-report-{date}.md` (from
136
+ `docs-audit-full`) stays at the `audit/` root.
137
+
138
+ ---
139
+
140
+ ## Doc metadata (header + lineage)
141
+
142
+ Two additive machine layers wrap a doc's unchanged human content: an invisible **header meta-comment**
143
+ (greppable status/identity) and a visible **`## Lineage` footer** (the clickable provenance breadcrumb).
144
+ Both render cleanly in any markdown viewer, and both have an Obsidian (frontmatter + `[[wikilink]]`)
145
+ equivalent so imported vaults work too.
146
+
147
+ ### The header meta-comment
148
+
149
+ One line, directly **below** the blockquote (which stays exactly as-is), the comment opening at column 0:
150
+
151
+ ```markdown
152
+ # Knowledge Ingestion Feature
153
+
154
+ > Multi-format content ingestion… Last verified {date}.
155
+ <!-- meta: type=feature; status=current; verified={date}; lineage=3 -->
156
+ ```
157
+
158
+ **Grammar:** `<!-- meta: key=value; key=value; … -->` — one line, `;`-separated, `key=value`. Invisible in
159
+ render; `rg -o '<!-- meta:.*-->' docs/` yields one line per doc (the condensed status report); a parser splits
160
+ on `;` then `=`. Keep it **one line** — multi-line comments grep badly.
161
+
162
+ | Key | Values | Notes |
163
+ |-----|--------|-------|
164
+ | `type` | `feature` \| `infrastructure` \| `pattern` \| `guide` \| `research` \| `spec` \| `working` | mirrors the folder |
165
+ | `status` | `current` \| `wip` \| `draft` \| `stale` \| `shipped` | descriptive docs are `current`; specs go `draft` then `shipped` |
166
+ | `verified` | `YYYY-MM-DD` | **equals** the blockquote's `Last verified` date — the two move together |
167
+ | `lineage` | integer | count of `## Lineage` links — a quick "how grounded is this doc" signal |
168
+
169
+ The blockquote header is **untouched** — the meta line is additive, so the legacy `Last verified` grep keeps
170
+ working through any transition. `type`/`status`/`verified` map 1:1 to Obsidian frontmatter keys (see interop).
171
+
172
+ ### The `## Lineage` footer
173
+
174
+ The visible `Idea / Spec / Built / Related` breadcrumb. It **supersedes `## Related Docs`** — the old peer
175
+ links become the `Related` row:
176
+
177
+ ```markdown
178
+ ## Lineage
179
+ - **Idea** — [{research doc}](../archive/{topic}/{research-doc}.md)
180
+ - **Spec** — [{NN-slice}](../archive/{topic}/specs/{NN-slice}.md)
181
+ - **Built** — [{working doc}](../archive/{topic}/{working-doc}.md)
182
+ - **Related** — [{peer}]({peer}.md) · [{peer}]({peer}.md)
183
+ ```
184
+
185
+ | Row | Points at | Edge type (for a doc-graph tool, if the repo has one) |
186
+ |-----|-----------|------------------------------|
187
+ | `Idea` | the `research/` (or archived research) doc the idea came from | `SOURCE_OF` |
188
+ | `Spec` | the spec doc(s) it was built from (if the effort used the spec stage) | `SPEC_OF` |
189
+ | `Built` | the working/archived implementation doc(s) — the real WHY | `BUILT_BY` |
190
+ | `Related` | peer living docs (the old `## Related Docs` content) | `RELATED` |
191
+
192
+ **Rules:**
193
+ - All rows optional — omit a row that doesn't apply. Native links are **relative markdown links**;
194
+ `[[wikilinks]]` are also accepted (interop).
195
+ - **Real lineage only.** Wire a row only where the idea/implementation origin is *genuine* — never on
196
+ coincidental topic overlap (junk links would pollute the graph's communities).
197
+ - Most `patterns/`/`guides/` docs carry only `Related` (maybe `Built`); `features/` carry the full chain.
198
+ - **`Spec` mirrors `Built`; the vision goes to `Idea`.** For a spec-driven effort: put the umbrella +
199
+ any `00-operating-frame` (the *why/what*) in `Idea`, and list in `Spec` **every per-slice spec that a
200
+ listed `Built` session implemented** — the two rows stay symmetric. A session in `Built` whose spec is
201
+ missing from `Spec` (or vice-versa) is the smell. Don't silently drop chain members because they feel
202
+ "adjacent" — the chain that built the doc *is* its lineage.
203
+
204
+ ### `related_files` — the doc-to-code bridge (derived, no authoring)
205
+
206
+ Most feature/infra docs already list code paths in their `## Key Files` table (plus inline `path/File.cs:line`
207
+ mentions). A doc-graph tool can reverse-index those into a `related_files` set per doc — a `COVERS` edge
208
+ from the doc to the matching code file. **No new field, no new authoring** — just keep `## Key Files` accurate.
209
+
210
+ ### Obsidian interop (two encodings of the same fields)
211
+
212
+ The format is two encodings of one set of fields, which a doc-graph parser treats as equivalent:
213
+ - **Native:** `<!-- meta -->` (status/identity) + `## Lineage` relative links (edges).
214
+ - **Imported (Obsidian):** YAML frontmatter keys `type/status/verified` + `[[wikilinks]]` anywhere.
215
+
216
+ Native is the default because a plain markdown renderer shows the HTML comment invisibly and relative links
217
+ cleanly, whereas frontmatter shows as a stray paragraph + `<hr>` and `[[ ]]` as literal text. Embrace-and-extend
218
+ Obsidian; don't imitate it.
219
+
220
+ ---
221
+
222
+ ## Templates
223
+
224
+ ### Session / working doc (created during a session, archived by `docs-write`)
225
+
226
+ ```markdown
227
+ # {Feature/Topic} — {Subtitle}
228
+
229
+ > {One-line summary}. Builds on [{prior}]({path}) (if continuing prior work).
230
+ > Source: [{research-doc}](../research/{x}.md) (if idea-driven).
231
+ > Completed {date} on branch `{branch}`.
232
+ <!-- meta: type=working; status={wip|shipped}; verified={date}; lineage=N -->
233
+ <!-- session: claude-session-id={the harness's session id}; name={window name, only if one exists} -->
234
+
235
+ ## The Problem
236
+ {what was wrong or missing}
237
+
238
+ ## The Target
239
+ {desired end state}
240
+
241
+ ## Research & Decisions
242
+ | Option | Verdict | Why |
243
+ |--------|---------|-----|
244
+
245
+ ## Implementation
246
+ {what changed, before/after where useful}
247
+
248
+ ## Change shape
249
+ {orientation only — the new/moved pieces and the structural facts a later session needs. The commit
250
+ is the file-by-file inventory; don't duplicate it (a full dump makes the doc read like a review).}
251
+
252
+ ## Verification
253
+ - [ ] build / tests
254
+ - [ ] manual check
255
+
256
+ ## Watch-Outs
257
+ {edge cases, gotchas}
258
+
259
+ ## Living Docs to Update
260
+ | Doc | What to change |
261
+ |-----|----------------|
262
+ > The bridge to docs-process. Be specific about form, not just topic.
263
+
264
+ ## Archive
265
+ Topic folder: `archive/{topic}/`
266
+ ```
267
+
268
+ ### Living doc (guides / patterns / infrastructure / features)
269
+
270
+ ```markdown
271
+ # {Topic}
272
+
273
+ > {One-line description}. Last verified {date}.
274
+ <!-- meta: type={feature|infrastructure|pattern|guide}; status=current; verified={date}; lineage=N -->
275
+
276
+ ## Overview
277
+ {what it is, why it exists, how it fits}
278
+
279
+ ## {Sections per concept}
280
+ {rules, patterns, code examples — real relative file links}
281
+
282
+ ## Key Files
283
+ | File | Purpose |
284
+ |------|---------|
285
+
286
+ ## Open Issues _(optional — omit the section entirely if none)_
287
+ - {YYYY-MM-DD} {one-line, code-verified risk / bug / tech-debt not yet fixed} — `path/File.cs:line`
288
+
289
+ ## Lineage _(supersedes `## Related Docs`; omit any row that doesn't apply — see "Doc metadata" above)_
290
+ - **Idea** — [{research doc}]({relative-path})
291
+ - **Spec** — [{spec doc(s)}]({relative-path})
292
+ - **Built** — [{working/archived doc(s)}]({relative-path})
293
+ - **Related** — [{peer doc}]({relative-path}) · [{peer doc}]({relative-path})
294
+ ```
295
+
296
+ `## Open Issues` is the one place a living doc records "this is currently *wrong/risky*" (the rest of the
297
+ doc describes what works). `docs-process` and `docs-audit-feature` add to it when they spot a real,
298
+ code-verified problem while reading; `docs-status` surfaces docs that carry one; the bullet is removed
299
+ once the code is fixed. Keep entries one line, dated, and pointing at a `file:line` — never speculation.
300
+
301
+ ### Research doc (future-state, pre-implementation)
302
+
303
+ ```markdown
304
+ # {Topic} — Future-State Design
305
+
306
+ > {One-line summary of what this explores}.
307
+
308
+ ## Current State
309
+ {what exists today, verified vs code}
310
+
311
+ ## Desired End State
312
+ {what we want to build}
313
+
314
+ ## Design Options / Recommendation
315
+ {options with trade-offs; the recommended approach}
316
+
317
+ ## Open Questions
318
+ {unresolved decisions}
319
+ ```
320
+
321
+ ### Spec doc (a numbered pipeline — `spec-pipeline`)
322
+
323
+ When a research idea graduates into a real plan, `spec-pipeline` explodes it into a numbered pipeline in
324
+ `docs/research/{topic}/`: `00-ignition-brief.md` (the parent seat's standing orders for the run — two
325
+ sections completed at ignition) · `01-{topic}.md` (the umbrella) · `02..NN-{slice}.md` (**one
326
+ self-contained spec per planned session**) · `project-status.md` (the tracker, which carries its own
327
+ section notes) · `live-checks.md` (the human's verification rows).
328
+ Each per-session spec uses this template (carries `Builds on`/`Source:` so the chain stays navigable):
329
+
330
+ ```markdown
331
+ # Spec NN — {Slice title}
332
+
333
+ > {what this slice builds} — {why / the gap it closes}. {what it builds on / supersedes / defers}.
334
+ > Builds on [{prior}]({prior}.md). Source: [{umbrella / research}](...). Written {date}.
335
+ <!-- meta: type=spec; status=draft; verified={date}; lineage=N -->
336
+
337
+ ## The Problem / The Target
338
+ ## Design & Decisions (table: Option | Verdict | Why)
339
+ ## Implementation (concrete, file-level, with verified `path:line` where known)
340
+ ## Verification
341
+ ## Watch-Outs
342
+ ## Deferred to other specs
343
+ ```
344
+
345
+ Specs stay physically in `research/{topic}/` through the build; when the effort ships, `docs-process` archives
346
+ the umbrella + specs + working docs together into `archive/{topic}/` — a spec-driven effort splits into
347
+ `specs/` + `implementation/` with `project-status.md` at the root (see "Two topic-folder shapes" above). The
348
+ spec set *is* the design history.
349
+
350
+ ---
351
+
352
+ ## The skills — two loops, two prefixes
353
+
354
+ **`docs-*` = the knowledge loop** (what the repo knows: capture, compile, audit).
355
+ **`spec-*` = the execution loop** (how big work gets built: graduate a plan, a coordinator seat,
356
+ build seats). They hand off at both ends: research docs feed `spec-pipeline`; every build session
357
+ closes with `docs-write`; `docs-process` compiles the results back into living docs. A seat prompt
358
+ never restates a rule a skill holds — the prompt points, the skill holds it.
359
+
360
+ | Skill | When | What it does |
361
+ |-------|------|-------------|
362
+ | `docs-backlog` | Have an idea | Capture it as a research doc in `research/` |
363
+ | `spec-pipeline` | A research idea is graduating into a real plan | Explode the plan into a numbered spec pipeline (umbrella + one self-contained spec per session + `project-status`) in `research/{topic}/`; the plan becomes ephemeral |
364
+ | `spec-parent` | Right after `spec-pipeline` (same session, context-loaded) or to resume an effort fresh | Assume the coordinator seat: cut seat prompts (one per spec), review/verify TLDRs, give commit calls, own `project-status.md` — the same loop hand-cranked or hosted |
365
+ | `spec-seat` | **Every** seat a coordinator arms — invoked FIRST, before the job skill | The CONTRACT, not a seat: the shared half of every seat's procedure — beliefs, plain-text PLAN TLDR, numbered questions w/ recommendations, six-section FINAL TLDR, commit only on the relayed call |
366
+ | `spec-child` | Igniting a build or fixit seat — manually or platform-spawned, after `spec-seat` | The BUILD JOB only: one spec, the role's reading list, the pin taxonomy, the suite protocol; `fixit` variant for no-spec defect sessions. Its ceremony comes from `spec-seat` |
367
+ | `spec-witness` | A pipeline looks wedged, actors' claims conflict, or you want a substrate-verified state report | The read-only fourth seat: the control plane's read lanes, transcripts, git; zero writes, zero rulings — the seats act, the human judges, the witness testifies |
368
+ | `spec-ignite` | Right after `spec-pipeline` when the pipeline runs HOSTED (vs `spec-parent` for hand-cranked) | The ignition copilot: verify the committed brief, derive the stage card (the human clicks Create), "kick it", a hosted coordinator runs the pipeline; two verbal gates, everything announced, every UI gap a named finding |
369
+ | `spec-review` | A pipeline's builds are done and it has a review row | The outside look, before the retro and before the PR: code + patterns + composition across session seams + the loop's own comms, in two independent passes. Files `sessions/code-review.md` and classifies which findings earn a fixit. **Its value is having none of the pipeline's context** |
370
+ | `spec-retro` | The parent's LAST act, after any review and any fixit | The inside look: a substrate-verified grade, the ceremony audit (did the acts the seat believes it performed actually write rows?), the ledger reconciliation, the true economics, the blindnesses, and the ranked fixit backlog |
371
+ | `docs-status` | Session start | Report what's recently archived, what's in `working/`, what's in `research/`; sweep the meta-comments for the condensed status table |
372
+ | `docs-write` | End of a session | Finalize the working doc; it stays in `working/` (records its `## Archive` target) |
373
+ | `docs-process` | Start of a session, `working/` has docs | Patch living docs from the working doc's checklist (verified vs code), then file the doc into `archive/` |
374
+ | `docs-audit-feature` | Touched/suspect a doc, or periodic | Deep-audit one or more living docs (features / infrastructure / patterns) against code — audit report + corrected doc. Takes a single doc, a list, or a whole folder (folder mode also flags code with no doc) |
375
+ | `docs-audit-full` | Monthly / after absence | Scan all docs for staleness/age, produce a prioritized re-verify plan |
376
+
377
+ ---
378
+
379
+ ## Conventions
380
+
381
+ - **kebab-case** filenames. No date prefixes — dates go in the header.
382
+ - **Relative links** between docs (clickable, survive moves within a group).
383
+ - **One *authority* per fact** — not one mention. *Orientation* docs (e.g. `frontend-patterns`, the build-from-this
384
+ snapshots) may carry a **condensed snapshot** of an adjacent topic — just enough to act — and back-link to its
385
+ authority for the rest. That overlap is *fortifying*, not redundant: it keeps the doc self-contained so a reader
386
+ can build without opening every deep-dive, and escalates only when stuck. The line that keeps it healthy:
387
+ **exhaustive or drift-prone detail** (exact commands, config keys, audit tables, full mechanics, edge-case lists)
388
+ lives **only** in the authority — a snapshot reinforces the *shape* and points forward, it never holds the
389
+ authoritative detail in two places. Mark snapshots as such and link the authority (e.g. "Snapshot — see X").
390
+ - **Write the capability and the situation that calls for it — never its history.** This applies to living
391
+ docs, skills, and the system prompts alike. Say *"when you need a decision mid-build, append a
392
+ `## MID-BUILD QUESTION` and end your turn"* — never *"X was removed, use Y instead."* A reader who has to
393
+ learn the retired lane in order to understand the live one is paying for history they will never need, and
394
+ a rule stated as a correction invites re-litigation instead of action.
395
+ - If a mechanism **no longer exists**, don't mention it. Its absence is not a fact a seat can act on.
396
+ - If a tool **exists but is wrong for this job**, say what it *is* for and move on — that answers the
397
+ reader's real question ("then when do I use it?") instead of leaving a warning they must remember.
398
+ - **Contrasting two LIVE choices is different, and it stays** — *"a property, not a mechanical result"*,
399
+ *"a journal entry, not a status cell"*, *"the floor, not the ceiling"*. These steer away from a tempting
400
+ wrong answer a reader might otherwise pick. The test: would the reader plausibly choose the other side
401
+ today? If yes it is clarification; if the other side is gone, it is archaeology.
402
+ - Incident receipts belong in `archive/` — the retro, the session doc, the git history. A living
403
+ instruction cites a rule; the effort that earned it keeps the story.
404
+ - **Cite an artifact from `sessions/…` down, never from the effort root.** A receipt path belongs in the
405
+ doc that reads it, but effort folder names carry ceremony words (`spec`, `chain`, `park`, `verdict`) and
406
+ some shipped packages fail their own build when one appears in source. Writing
407
+ `sessions/10-packaging/artifacts/coverage-baseline.txt` keeps the citation usable from inside a
408
+ script header or a test comment; the effort-root prefix belongs only in prose that will never be
409
+ vendored.
410
+ - **Code is truth — for descriptive docs** (`infrastructure/`, `features/`): verify every update against
411
+ the actual source. For prescriptive docs (`patterns/`, `guides/`) the doc is the decided rule — check
412
+ that code conforms to it instead (see "Two kinds of living doc" above).
413
+ - **Every living / spec / working doc carries the machine layer** — a one-line `<!-- meta: … -->` header
414
+ below the blockquote + a `## Lineage` footer (see "Doc metadata (header + lineage)" above). The meta
415
+ `verified` date moves with the blockquote's `Last verified` and obeys the same anti-fabrication rule:
416
+ only stamp it for a doc actually checked against code this run.
417
+ - **Don't edit archived docs** — stale references there are historical record.