@adia-ai/adia-ui-forge 0.1.3 → 0.8.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 (259) hide show
  1. package/.claude-plugin/plugin.json +3 -6
  2. package/CHANGELOG.md +27 -34
  3. package/README.md +35 -40
  4. package/agents/a2ui-engineer.md +22 -53
  5. package/agents/component-author.md +29 -0
  6. package/agents/framework-verifier.md +26 -0
  7. package/agents/release-engineer.md +21 -81
  8. package/agents/routing-corpus.json +293 -64
  9. package/bin/demo-postwrite-pattern-gate +94 -0
  10. package/bin/forge-lint +17 -2
  11. package/bin/sidecar-prewrite-guard +104 -0
  12. package/commands/deploy.md +9 -0
  13. package/commands/dogfood.md +10 -0
  14. package/commands/gen-review.md +9 -0
  15. package/commands/release.md +10 -0
  16. package/hooks/hooks.json +15 -0
  17. package/package.json +3 -6
  18. package/references/contracts/a2ui-mcp-surface.md +35 -0
  19. package/references/contracts/migration-guide-format.md +34 -0
  20. package/references/shared/content-trust.md +19 -74
  21. package/skills/adia-a2ui/SKILL.md +99 -0
  22. package/skills/{adia-ui-a2ui → adia-a2ui}/evals/routing-corpus.json +10 -10
  23. package/skills/adia-a2ui/references/anti-patterns.md +27 -0
  24. package/skills/adia-a2ui/references/chunk-authoring.md +71 -0
  25. package/skills/adia-a2ui/references/corpus-discipline.md +68 -0
  26. package/skills/adia-a2ui/references/eval-diagnostics.md +86 -0
  27. package/skills/adia-a2ui/references/format-extension-decisions.md +66 -0
  28. package/skills/adia-a2ui/references/leverage-rules.md +52 -0
  29. package/skills/adia-a2ui/references/mcp-pipeline-ops.md +83 -0
  30. package/skills/adia-a2ui/references/mcp-tool-reference.md +59 -0
  31. package/skills/adia-a2ui/references/pipeline-overview.md +115 -0
  32. package/skills/adia-a2ui/references/semantic-fail-lifting.md +74 -0
  33. package/skills/adia-a2ui/references/strategy-engines.md +109 -0
  34. package/skills/adia-a2ui/references/zettel-calibration.md +104 -0
  35. package/skills/adia-author/SKILL.md +112 -0
  36. package/skills/adia-author/evals/routing-corpus.json +222 -0
  37. package/skills/{adia-ui-authoring → adia-author}/references/anti-patterns.md +33 -4
  38. package/skills/{adia-ui-authoring → adia-author}/references/authoring-cycle.md +9 -11
  39. package/skills/adia-author/references/canonical-pattern-index.md +243 -0
  40. package/skills/{adia-ui-authoring → adia-author}/references/code-style.md +19 -21
  41. package/skills/adia-author/references/common-gotchas.md +129 -0
  42. package/skills/adia-author/references/composite-demo-protocol.md +271 -0
  43. package/skills/{adia-ui-authoring → adia-author}/references/css-patterns.md +19 -6
  44. package/skills/{adia-ui-authoring → adia-author}/references/lifecycle-patterns.md +1 -0
  45. package/skills/{adia-ui-authoring → adia-author}/references/llm-bridge.md +3 -5
  46. package/skills/{adia-ui-authoring → adia-author}/references/module-promotion.md +20 -38
  47. package/skills/{adia-ui-authoring → adia-author}/references/primitive-audit.md +2 -4
  48. package/skills/{adia-ui-authoring → adia-author}/references/shell-patterns.md +12 -18
  49. package/skills/{adia-ui-authoring → adia-author}/references/token-contract.md +5 -7
  50. package/skills/{adia-ui-authoring → adia-author}/references/worked-example.md +3 -3
  51. package/skills/{adia-ui-authoring → adia-author}/references/yaml-contract.md +3 -3
  52. package/skills/{adia-ui-authoring → adia-author}/scripts/build-canonical-pattern-index.mjs +3 -3
  53. package/skills/adia-deploy/SKILL.md +128 -0
  54. package/skills/{adia-ui-ops → adia-deploy}/references/deploy-playbooks.md +47 -30
  55. package/skills/adia-dogfood/SKILL.md +124 -0
  56. package/skills/adia-dogfood/references/admin-shell-anatomy.md +77 -0
  57. package/skills/adia-dogfood/references/app-shell-pitfalls.md +66 -0
  58. package/skills/adia-dogfood/references/card-anatomy-sweep.md +66 -0
  59. package/skills/adia-dogfood/references/html-attr-sweep.md +63 -0
  60. package/skills/adia-dogfood/references/native-leak-annotations.md +73 -0
  61. package/skills/adia-dogfood/references/visual-probe-triage.md +80 -0
  62. package/skills/{adia-ui-dogfood → adia-dogfood}/scripts/analyze.mjs +30 -14
  63. package/skills/adia-gen-review/SKILL.md +127 -0
  64. package/skills/adia-gen-review/references/corpus-html-patterns.md +279 -0
  65. package/skills/adia-gen-review/references/loop-protocol.md +216 -0
  66. package/skills/adia-gen-review/references/rubric-cosmetic.md +100 -0
  67. package/skills/adia-gen-review/references/rubric-decompose.md +101 -0
  68. package/skills/adia-gen-review/references/rubric-score.md +214 -0
  69. package/skills/{adia-ui-gen-review → adia-gen-review}/references/scores.schema.json +2 -2
  70. package/skills/{adia-ui-gen-review → adia-gen-review}/scripts/gen-review-coverage-audit.mjs +4 -4
  71. package/skills/{adia-ui-gen-review → adia-gen-review}/scripts/gen-review-decompose.mjs +10 -6
  72. package/skills/{adia-ui-gen-review → adia-gen-review}/scripts/gen-review-status.mjs +5 -5
  73. package/skills/{adia-ui-gen-review → adia-gen-review}/scripts/validate-cycle-scores.mjs +5 -5
  74. package/skills/adia-llm-internals/SKILL.md +77 -0
  75. package/skills/{adia-ui-llm → adia-llm-internals}/references/adapter-contract.md +4 -2
  76. package/skills/{adia-ui-llm → adia-llm-internals}/references/add-a-provider.md +4 -5
  77. package/skills/{adia-ui-llm → adia-llm-internals}/references/bridge-facade.md +10 -3
  78. package/skills/{adia-ui-llm → adia-llm-internals}/references/browser-proxy-boundary.md +1 -1
  79. package/skills/{adia-ui-llm → adia-llm-internals}/references/model-registry.md +5 -3
  80. package/skills/{adia-ui-llm → adia-llm-internals}/references/streaming-sse.md +2 -2
  81. package/skills/adia-release/SKILL.md +72 -0
  82. package/skills/adia-release/references/changelog-discipline.md +119 -0
  83. package/skills/adia-release/references/cut-procedure.md +247 -0
  84. package/skills/adia-release/references/gates-catalog.md +222 -0
  85. package/skills/adia-release/references/independent-package-release.md +52 -0
  86. package/skills/adia-release/references/migration-guide-authoring.md +86 -0
  87. package/skills/adia-release/references/notes-authoring.md +90 -0
  88. package/skills/adia-release/references/recovery-paths.md +106 -0
  89. package/skills/{adia-ui-release → adia-release}/scripts/bump.mjs +27 -2
  90. package/skills/{adia-ui-release → adia-release}/scripts/dispatch-publish.mjs +4 -1
  91. package/skills/{adia-ui-release → adia-release}/scripts/insert-stub.mjs +1 -1
  92. package/skills/{adia-ui-release → adia-release}/scripts/package-paths.mjs +6 -0
  93. package/skills/{adia-ui-release → adia-release}/scripts/promote-unreleased.mjs +1 -1
  94. package/skills/{adia-ui-release → adia-release}/scripts/release-pack.mjs +13 -21
  95. package/skills/{adia-ui-release → adia-release}/scripts/tag-lockstep.mjs +5 -1
  96. package/skills/adia-site-docs/SKILL.md +68 -0
  97. package/skills/adia-site-docs/evals/audit-report.md +30 -0
  98. package/skills/adia-site-docs/evals/routing-corpus.json +176 -0
  99. package/skills/adia-site-docs/intent.md +72 -0
  100. package/agents/README.md +0 -209
  101. package/agents/author.md +0 -56
  102. package/agents/repo-steward.md +0 -56
  103. package/agents/spec-architect.md +0 -53
  104. package/agents/tech-lead.md +0 -57
  105. package/agents/verifier.md +0 -55
  106. package/bin/lib/audit-axes.mjs +0 -555
  107. package/bin/lib/dry-run-irreversible.mjs +0 -236
  108. package/bin/lib/run-skill-evals.mjs +0 -487
  109. package/bin/lib/teach-router.mjs +0 -250
  110. package/commands/adia-forge-a2ui.md +0 -10
  111. package/commands/adia-forge-author.md +0 -10
  112. package/commands/adia-forge-dogfood.md +0 -8
  113. package/commands/adia-forge-llm.md +0 -8
  114. package/commands/adia-forge-orient.md +0 -10
  115. package/commands/adia-forge-release.md +0 -8
  116. package/commands/adia-forge-review.md +0 -10
  117. package/references/shared/pev-rationale.md +0 -64
  118. package/references/shared/skill-conventions.md +0 -133
  119. package/skills/adia-ui-a2ui/CHANGELOG.md +0 -32
  120. package/skills/adia-ui-a2ui/SKILL.md +0 -243
  121. package/skills/adia-ui-a2ui/evals/adversarial-corpus.json +0 -75
  122. package/skills/adia-ui-a2ui/evals/teach-routing-cases.json +0 -100
  123. package/skills/adia-ui-a2ui/references/anti-patterns.md +0 -24
  124. package/skills/adia-ui-a2ui/references/chunk-authoring.md +0 -88
  125. package/skills/adia-ui-a2ui/references/corpus-discipline.md +0 -56
  126. package/skills/adia-ui-a2ui/references/eval-diagnostics.md +0 -127
  127. package/skills/adia-ui-a2ui/references/fragment-graph.md +0 -91
  128. package/skills/adia-ui-a2ui/references/mcp-pipeline-ops.md +0 -106
  129. package/skills/adia-ui-a2ui/references/mcp-tool-reference.md +0 -398
  130. package/skills/adia-ui-a2ui/references/pipeline-overview.md +0 -175
  131. package/skills/adia-ui-a2ui/references/semantic-fail-lifting.md +0 -120
  132. package/skills/adia-ui-a2ui/references/strategy-engines.md +0 -111
  133. package/skills/adia-ui-a2ui/references/teach-protocol.md +0 -220
  134. package/skills/adia-ui-a2ui/references/zettel-calibration.md +0 -93
  135. package/skills/adia-ui-a2ui/scripts/audit-a2ui-roster.mjs +0 -96
  136. package/skills/adia-ui-a2ui/scripts/teach-route.mjs +0 -157
  137. package/skills/adia-ui-a2ui/skill.json +0 -38
  138. package/skills/adia-ui-authoring/CHANGELOG.md +0 -32
  139. package/skills/adia-ui-authoring/SKILL.md +0 -256
  140. package/skills/adia-ui-authoring/assets/case-studies/admin-shell-decomposition.md +0 -101
  141. package/skills/adia-ui-authoring/assets/case-studies/maxtokens-32768-discovery.md +0 -109
  142. package/skills/adia-ui-authoring/assets/case-studies/theme-panel-promotion.md +0 -113
  143. package/skills/adia-ui-authoring/evals/adversarial-design-plan-gates.json +0 -138
  144. package/skills/adia-ui-authoring/evals/routing-corpus.json +0 -245
  145. package/skills/adia-ui-authoring/references/canonical-pattern-index.md +0 -179
  146. package/skills/adia-ui-authoring/references/common-gotchas.md +0 -93
  147. package/skills/adia-ui-authoring/references/composite-demo-protocol.md +0 -1084
  148. package/skills/adia-ui-authoring/references/teach-protocol.md +0 -428
  149. package/skills/adia-ui-authoring/scripts/audit-authoring-roster.mjs +0 -148
  150. package/skills/adia-ui-authoring/skill.json +0 -45
  151. package/skills/adia-ui-dogfood/CHANGELOG.md +0 -17
  152. package/skills/adia-ui-dogfood/README.md +0 -62
  153. package/skills/adia-ui-dogfood/SKILL.md +0 -866
  154. package/skills/adia-ui-dogfood/skill.json +0 -40
  155. package/skills/adia-ui-forge/SKILL.md +0 -88
  156. package/skills/adia-ui-forge/evals/routing-corpus.json +0 -30
  157. package/skills/adia-ui-gen-review/CHANGELOG.md +0 -108
  158. package/skills/adia-ui-gen-review/SKILL.md +0 -266
  159. package/skills/adia-ui-gen-review/references/loop-protocol.md +0 -712
  160. package/skills/adia-ui-gen-review/references/rubric-cosmetic.md +0 -144
  161. package/skills/adia-ui-gen-review/references/rubric-decompose.md +0 -117
  162. package/skills/adia-ui-gen-review/references/rubric-score.md +0 -249
  163. package/skills/adia-ui-gen-review/references/teach-protocol.md +0 -214
  164. package/skills/adia-ui-gen-review/skill.json +0 -23
  165. package/skills/adia-ui-llm/CHANGELOG.md +0 -25
  166. package/skills/adia-ui-llm/SKILL.md +0 -165
  167. package/skills/adia-ui-llm/evals/adversarial-corpus.json +0 -75
  168. package/skills/adia-ui-llm/evals/routing-corpus.json +0 -30
  169. package/skills/adia-ui-llm/evals/teach-routing-cases.json +0 -73
  170. package/skills/adia-ui-llm/references/teach-protocol.md +0 -78
  171. package/skills/adia-ui-llm/scripts/audit-llm-roster.mjs +0 -93
  172. package/skills/adia-ui-llm/scripts/teach-route.mjs +0 -119
  173. package/skills/adia-ui-llm/skill.json +0 -33
  174. package/skills/adia-ui-ops/CHANGELOG.md +0 -291
  175. package/skills/adia-ui-ops/SKILL.md +0 -401
  176. package/skills/adia-ui-ops/references/INDEX.md +0 -158
  177. package/skills/adia-ui-ops/references/audit-cadence.md +0 -263
  178. package/skills/adia-ui-ops/references/audit-patterns/archive-link-sweep.md +0 -96
  179. package/skills/adia-ui-ops/references/audit-patterns/audit-history-ledger.md +0 -162
  180. package/skills/adia-ui-ops/references/audit-patterns/browser-bundle-node-imports.md +0 -154
  181. package/skills/adia-ui-ops/references/audit-patterns/changelog-unreleased-bloat.md +0 -75
  182. package/skills/adia-ui-ops/references/audit-patterns/coverage-gaps.md +0 -187
  183. package/skills/adia-ui-ops/references/audit-patterns/entry-file-coverage.md +0 -122
  184. package/skills/adia-ui-ops/references/audit-patterns/format-hygiene.md +0 -217
  185. package/skills/adia-ui-ops/references/audit-patterns/lockstep-versioning.md +0 -113
  186. package/skills/adia-ui-ops/references/audit-patterns/memory-fragmentation.md +0 -180
  187. package/skills/adia-ui-ops/references/audit-patterns/orphan-detection.md +0 -202
  188. package/skills/adia-ui-ops/references/audit-patterns/pointer-validation.md +0 -180
  189. package/skills/adia-ui-ops/references/audit-patterns/redundancy-detection.md +0 -210
  190. package/skills/adia-ui-ops/references/audit-patterns/spec-dating-sweep.md +0 -91
  191. package/skills/adia-ui-ops/references/audit-patterns/stale-content.md +0 -182
  192. package/skills/adia-ui-ops/references/audit-patterns/staleness-tooling.md +0 -156
  193. package/skills/adia-ui-ops/references/audit-patterns/token-waste-detection.md +0 -196
  194. package/skills/adia-ui-ops/references/doc-types/adr-pattern.md +0 -210
  195. package/skills/adia-ui-ops/references/doc-types/architecture-md.md +0 -190
  196. package/skills/adia-ui-ops/references/doc-types/changelog.md +0 -183
  197. package/skills/adia-ui-ops/references/doc-types/decisions-log.md +0 -146
  198. package/skills/adia-ui-ops/references/doc-types/plan-roadmap.md +0 -182
  199. package/skills/adia-ui-ops/references/doc-types/postmortem-pattern.md +0 -206
  200. package/skills/adia-ui-ops/references/genres/prose-and-writing.md +0 -149
  201. package/skills/adia-ui-ops/references/guidance/context-budget.md +0 -137
  202. package/skills/adia-ui-ops/references/guidance/llm-doc-writing.md +0 -116
  203. package/skills/adia-ui-ops/references/guidance/reliability-dial.md +0 -186
  204. package/skills/adia-ui-ops/references/recipes/adr-introduction.md +0 -211
  205. package/skills/adia-ui-ops/references/recipes/audit-existing-repo.md +0 -234
  206. package/skills/adia-ui-ops/references/recipes/cold-start-harvest.md +0 -263
  207. package/skills/adia-ui-ops/references/recipes/concurrent-learnings-merge.md +0 -158
  208. package/skills/adia-ui-ops/references/recipes/continuous-learning-loop.md +0 -169
  209. package/skills/adia-ui-ops/references/recipes/external-reference-verification.md +0 -158
  210. package/skills/adia-ui-ops/references/recipes/findings-index-readout.md +0 -126
  211. package/skills/adia-ui-ops/references/recipes/greenfield-setup.md +0 -252
  212. package/skills/adia-ui-ops/references/recipes/harvest-repo-brain.md +0 -169
  213. package/skills/adia-ui-ops/references/recipes/import-repo-brain-harvest.md +0 -153
  214. package/skills/adia-ui-ops/references/recipes/memory-organization.md +0 -182
  215. package/skills/adia-ui-ops/references/recipes/recommend-then-validate.md +0 -199
  216. package/skills/adia-ui-ops/references/recipes/self-healing-hooks.md +0 -366
  217. package/skills/adia-ui-ops/references/recipes/skill-stewardship-loop.md +0 -113
  218. package/skills/adia-ui-ops/references/standards/agents-md-spec.md +0 -138
  219. package/skills/adia-ui-ops/references/standards/claude-md-convention.md +0 -123
  220. package/skills/adia-ui-ops/references/standards/cross-tool-matrix.md +0 -85
  221. package/skills/adia-ui-ops/references/standards/readme-conventions.md +0 -232
  222. package/skills/adia-ui-ops/references/teach-protocol.md +0 -215
  223. package/skills/adia-ui-ops/scripts/audit-ops-roster.mjs +0 -104
  224. package/skills/adia-ui-ops/skill.json +0 -65
  225. package/skills/adia-ui-release/CHANGELOG.md +0 -66
  226. package/skills/adia-ui-release/SKILL.md +0 -323
  227. package/skills/adia-ui-release/assets/case-studies/2026-05-20-batch-push-v0.6.14-v0.6.15.md +0 -144
  228. package/skills/adia-ui-release/assets/case-studies/2026-05-20-corpus-drift-remediation-v0.6.15.md +0 -155
  229. package/skills/adia-ui-release/assets/case-studies/2026-05-20-version-skip-correction-v0.6.12.md +0 -114
  230. package/skills/adia-ui-release/assets/case-studies/2026-05-21-author-from-scratch-v0.6.18.md +0 -139
  231. package/skills/adia-ui-release/assets/case-studies/2026-05-21-feedback37-retraction-v0.6.21.md +0 -124
  232. package/skills/adia-ui-release/assets/case-studies/2026-05-21-fn1-enrichment-pass-v0.6.19.md +0 -125
  233. package/skills/adia-ui-release/assets/case-studies/2026-05-21-stale-test-detection-v0.6.20.md +0 -142
  234. package/skills/adia-ui-release/assets/case-studies/2026-05-23-freshness-gate-recovery-v0.6.32.md +0 -97
  235. package/skills/adia-ui-release/assets/case-studies/2026-05-26-catalog-drift-recurring-v0.6.40.md +0 -147
  236. package/skills/adia-ui-release/assets/templates/stub-changelog.template.md +0 -22
  237. package/skills/adia-ui-release/evals/evals.json +0 -164
  238. package/skills/adia-ui-release/references/changelog-discipline.md +0 -250
  239. package/skills/adia-ui-release/references/cycle-happy-path.md +0 -520
  240. package/skills/adia-ui-release/references/exe-deploy.md +0 -149
  241. package/skills/adia-ui-release/references/gates-catalog.md +0 -778
  242. package/skills/adia-ui-release/references/independent-package-release.md +0 -129
  243. package/skills/adia-ui-release/references/ledger-discipline.md +0 -232
  244. package/skills/adia-ui-release/references/migration-guide-authoring.md +0 -174
  245. package/skills/adia-ui-release/references/multi-agent-baseline.md +0 -207
  246. package/skills/adia-ui-release/references/notes-authoring.md +0 -212
  247. package/skills/adia-ui-release/references/recovery-paths.md +0 -262
  248. package/skills/adia-ui-release/references/rollup-notes.md +0 -208
  249. package/skills/adia-ui-release/references/teach-protocol.md +0 -468
  250. package/skills/adia-ui-release/scripts/audit-gate-roster.mjs +0 -196
  251. package/skills/adia-ui-release/scripts/make-ledger.mjs +0 -200
  252. package/skills/adia-ui-release/skill.json +0 -77
  253. package/skills/dogfood-sweep/CHANGELOG.md +0 -37
  254. package/skills/dogfood-sweep/README.md +0 -105
  255. package/skills/dogfood-sweep/SKILL.md +0 -1000
  256. package/skills/dogfood-sweep/analyze.mjs +0 -600
  257. package/skills/dogfood-sweep/skill.json +0 -31
  258. /package/skills/{adia-ui-authoring → adia-author}/references/api-contract.md +0 -0
  259. /package/skills/{adia-ui-release → adia-release}/scripts/assert-monorepo-root.mjs +0 -0
@@ -1,169 +0,0 @@
1
- ---
2
- date: 2026-04-29
3
- coverage: canonical
4
- peers:
5
- - import-repo-brain-harvest.md
6
- - cold-start-harvest.md
7
- - continuous-learning-loop.md
8
- - ../audit-patterns/audit-history-ledger.md
9
- status: research-verified
10
- ---
11
-
12
- # Harvest ops-repo (export findings + sync to agent memory + update harness)
13
-
14
- > **The premise.** The `.brain/` tree is the repo's long-term memory; agent memory at `~/.claude/projects/<repo>/memory/` is the per-conversation working memory; `AGENTS.md` / `.claude/settings.json` is the harness that decides what gets loaded when. **`harvest ops-repo`** runs all three in one pass: ingests every finding the brain has accumulated, lifts the durable ones into agent memory, and (optionally) updates the harness so the next session loads them.
15
-
16
- This recipe is invoked by phrases like:
17
- - "harvest ops-repo"
18
- - "use ops-repo to harvest"
19
- - "sync brain to agent memory"
20
- - "promote findings to memory"
21
- - "harvest brain matter"
22
-
23
- It has two output paths the user picks between (or runs both):
24
-
25
- - **Local sync** — write to `~/.claude/projects/<repo>/memory/`. The next session in *this* repo starts richer. Default.
26
- - **Portable export** — write a bundle to `/tmp/brain-export-<repo>-<date>/`. Another repo's `ops-repo` can `import` it. Opt-in.
27
-
28
- ## What gets harvested
29
-
30
- Source-of-truth inventory:
31
-
32
- | Source | Memory destination | Disposition rule |
33
- |---|---|---|
34
- | `.brain/adrs/*.md` (status: `accepted` or `superseded`) | `project_<topic>.md` | One memory per ADR. The decision + rationale → body. Skip `proposed` / `rejected`. |
35
- | `.brain/postmortems/*.md` (the lessons section) | `feedback_<lesson_slug>.md` | One memory per *lesson bullet*, not per postmortem. Each lesson gets `**Why:**` + `**How to apply:**`. |
36
- | `docs/conventions/*.md` (rule paragraphs) | `feedback_<rule_slug>.md` | Extract individual rules; body points back at the convention file for full text. |
37
- | `.brain/findings/INDEX.md` (OPEN entries with severity ≥ medium) | (audit-input only — not promoted) | Findings are working state, not durable canon. They feed the harness-update step instead. |
38
- | `.brain/audit-history/*.json` (recent trip-wire results) | (audit-input only) | Used to detect harness gaps, not promoted as memories. |
39
- | External URLs cited 2+ times across the brain | `reference_<topic>.md` | One-liner + URL. |
40
- | Journal sections cited 3+ times from ADRs/postmortems/conventions | `feedback_<topic>.md` | Citation count is the promotion gate; below threshold stays in the journal. |
41
- | Operator-profile facts in `AGENTS.md` (role, expertise, tooling) | `user_<aspect>.md` | Only if AGENTS.md states them explicitly. |
42
-
43
- ## What does NOT get harvested
44
-
45
- - Per-day journal entries (high-volume, mostly already distilled into ADRs / postmortems / conventions).
46
- - ADRs with status `proposed` / `rejected` (working memory, not durable).
47
- - Boilerplate convention prose (rules > 30 lines stay in the convention file; the memory is a *pointer*).
48
- - Anything matching the secret-pattern redactor (same list as `audit-history-ledger.md` privacy section).
49
-
50
- ## Procedure
51
-
52
- The agent runs through these steps. User-confirmation gates are marked **[gate]**.
53
-
54
- 1. **Resolve the agent-memory directory.** It's `~/.claude/projects/<encoded-repo-path>/memory/`. The encoding replaces `/` with `-` and prefixes `-`. Confirm by inspecting an existing file there if uncertain.
55
-
56
- 2. **Inventory existing memory.** Read `MEMORY.md` and list the directory. Build a map of `existing_name → file` so the harvest can update in place rather than create duplicates.
57
-
58
- 3. **Walk ADRs.** For each `.brain/adrs/NNNN-*.md` with `status: accepted` or `superseded`:
59
- - Title → `name` field
60
- - Frontmatter summary or first paragraph → `description` field (one-liner)
61
- - Decision + rationale → body, structured as `**Why:** … **How to apply:** …`
62
- - If a matching memory exists → diff and update; else → create
63
-
64
- 4. **Walk postmortems.** For each `.brain/postmortems/YYYY-MM-DD-*.md`:
65
- - Find the *Lessons* / *Memory* / *Memories captured* section
66
- - Each bulleted lesson → its own `feedback_*.md` (don't bundle)
67
- - Postmortem title → `description` hook
68
- - Lesson rule → body lead, then `**Why:**` (the incident), `**How to apply:**` (when to invoke)
69
-
70
- 5. **Walk conventions.** For each `docs/conventions/*.md`:
71
- - Extract individual rules (`## ` headings or numbered list items)
72
- - One `feedback_*` per rule
73
- - Body: rule + `**Why:** ... **How to apply:** see docs/conventions/<file>.md` for full text
74
-
75
- 6. **Walk external references.** Grep for `https://` URLs that recur 2+ times in `.brain/`:
76
- ```bash
77
- grep -rhoE 'https?://[^ )"]+' .brain/adrs .brain/postmortems docs/conventions | \
78
- sort | uniq -c | sort -rn | awk '$1 >= 2'
79
- ```
80
- - Each → one `reference_*.md` (one-liner + URL)
81
-
82
- 7. **Promote frequent journal sections.** Citation count:
83
- ```bash
84
- grep -rhoE 'journal/.*§\s*[0-9]+' .brain/ docs/conventions/ | \
85
- sort | uniq -c | sort -rn | awk '$1 >= 3'
86
- ```
87
- - For each, read the journal section, distill to a rule, write `feedback_*`
88
-
89
- 8. **Audit the harness.** Read `.claude/settings.json` (project) and `~/.claude/settings.json` (user). Check for:
90
- - **Hooks gap:** if a finding mentions "should run X before commit" 3+ times in `.brain/audit-history/`, propose a `pre-commit` hook
91
- - **Permission gap:** if commands in `.brain/runbooks/` aren't in `permissions.allow`, propose adding them
92
- - **Memory ceiling:** if `MEMORY.md` after harvest exceeds 200 lines, propose pruning the lowest-value entries (lowest description quality, oldest by file mtime)
93
-
94
- 9. **[gate] Diff-and-confirm.** Show the user a 5-line preview per memory candidate (name, description, type, body lead, action: create/update/skip). For harness changes, show the proposed `settings.json` diff. Default interactive; allow `--yes` for bulk seeding.
95
-
96
- 10. **Apply approved changes.** Write memory files; update `MEMORY.md` index; apply settings.json diff if approved.
97
-
98
- 11. **Optional portable export.** If the user requested a portable bundle (or invoked `harvest ops-repo --export`):
99
- - Build `/tmp/brain-export-<repo>-<date>/` with manifest.json + adrs/ + postmortems/ + conventions-portable/ + findings-schema.json + audit-history-schema.json + config.toml.example + agents-template.md
100
- - Manifest schema, sanity gates (no absolute paths, no secrets, ≤5MB), and bundle README — see [`import-repo-brain-harvest.md`](./import-repo-brain-harvest.md) for the receiving-side contract
101
-
102
- 12. **Report.** Print a summary:
103
- ```
104
- Harvested 14 memory files from .brain/ + docs/conventions/:
105
- ✓ 8 project_ (from 10 ADRs — 2 already in memory, updated in place)
106
- ✓ 4 feedback_ (from 1 postmortem + 3 conventions)
107
- ✓ 2 reference_ (from external URLs cited 2+ times)
108
- ✓ 0 user_ (AGENTS.md doesn't state operator profile)
109
-
110
- Harness updates applied:
111
- ✓ pre-commit hook for "verify journal-date" (cited 3× in audit-history)
112
- ✓ permissions.allow += ["Bash(npm run verify:*)"]
113
- MEMORY.md: 18 → 32 lines (well under 200 ceiling).
114
-
115
- Portable bundle: not requested. Re-run with --export to produce one.
116
- ```
117
-
118
- ## Memory-file format reminder
119
-
120
- Each memory file is its own markdown with frontmatter:
121
-
122
- ```markdown
123
- ---
124
- name: {{short title}}
125
- description: {{one-line description used to decide relevance in future conversations}}
126
- type: {{user | feedback | project | reference}}
127
- ---
128
-
129
- {{body — for feedback/project, structure as: rule/fact, then **Why:** and **How to apply:** lines}}
130
- ```
131
-
132
- `MEMORY.md` index is a flat list, one line per entry, < 200 lines:
133
-
134
- ```markdown
135
- - [Title](file.md) — one-line hook
136
- ```
137
-
138
- ## Sanity checks
139
-
140
- Before write, every candidate must pass:
141
-
142
- - [ ] Body ≤ 30 lines (long content stays in `.brain/` / `docs/`; memory points to it)
143
- - [ ] `description` is meaningful (no "TODO", no placeholder)
144
- - [ ] `type` is one of `user` / `feedback` / `project` / `reference` (no inventions)
145
- - [ ] No file path under `/Users/`, `/home/`, `C:\`
146
- - [ ] No content matching `sk_live_`, `ghp_`, `aws_secret_access_key`, `BEGIN PRIVATE KEY`, `Authorization: Bearer`
147
- - [ ] No filename collision (existing entries get *updated*, not duplicated)
148
-
149
- If the portable bundle path is selected, the bundle ALSO must pass:
150
-
151
- - [ ] Manifest.json parses + every disposition claim has a matching file
152
- - [ ] No absolute user paths
153
- - [ ] Bundle size < 5 MB
154
- - [ ] No file references hostnames matching `*.internal`, `*.corp`, IPv4 addresses, or `localhost`-anchored URLs
155
-
156
- ## Cadence
157
-
158
- - **At repo onboarding** — first run seeds the agent's memory with the existing canon. Most-impactful single invocation.
159
- - **Per quarter** — sweep recent ADRs / postmortems / conventions for promotions.
160
- - **On-demand after a postmortem lands** — promote the lesson immediately so the next session catches it.
161
- - **NOT weekly cron** — memory churn confuses the agent more than it helps.
162
-
163
- ## See also
164
-
165
- - [`import-repo-brain-harvest.md`](./import-repo-brain-harvest.md) — the receiving-side recipe (consumes a portable bundle, syncs to agent memory)
166
- - [`continuous-learning-loop.md`](./continuous-learning-loop.md) — the broader Anthropic-iterate pattern this skill instantiates
167
- - [`cold-start-harvest.md`](./cold-start-harvest.md) — the inverse flow (importing buried learnings *into* the brain layout for the first time)
168
- - [`../audit-patterns/audit-history-ledger.md`](../audit-patterns/audit-history-ledger.md) — privacy / redaction reference for the bundle export
169
- - The auto-memory section of the parent repo's `AGENTS.md` — canonical description of the memory system (types, filename conventions)
@@ -1,153 +0,0 @@
1
- ---
2
- date: 2026-04-29
3
- coverage: canonical
4
- peers:
5
- - harvest-repo-brain.md
6
- - cold-start-harvest.md
7
- - continuous-learning-loop.md
8
- status: research-verified
9
- ---
10
-
11
- # Import ops-repo harvest (consume a portable bundle into this brain)
12
-
13
- > **The premise.** Some other repo ran `harvest ops-repo --export` and produced a portable bundle. **`import ops-repo harvest`** ingests that bundle into *this* repo's `.brain/` tree, then syncs the new content into the agent's memory at `~/.claude/projects/<this-repo>/memory/` so the next session catches everything immediately.
14
-
15
- This recipe is invoked by phrases like:
16
- - "import ops-repo harvest"
17
- - "use ops-repo to import"
18
- - "ingest brain bundle"
19
- - "import bundle from <path>"
20
- - "merge another repo's brain into this one"
21
-
22
- The inverse of [`harvest-repo-brain.md`](./harvest-repo-brain.md). One produces; the other consumes. Together they let institutional memory move between repos without touching source code.
23
-
24
- ## What gets imported
25
-
26
- The bundle's `manifest.json` declares disposition per artifact. The importer respects it:
27
-
28
- | Bundle artifact | Target | Collision rule |
29
- |---|---|---|
30
- | `bundle/adrs/NNNN-*.md` | `.brain/adrs/` | Renumber on collision (next free `NNNN`); preserve original number in body as `Originally: 0007 (source-repo)` |
31
- | `bundle/postmortems/YYYY-MM-DD-*.md` | `.brain/postmortems/` | Date prefix is unique enough; on exact-match append `-imported` to filename |
32
- | `bundle/postmortems/_TEMPLATE.md` | `.brain/postmortems/_TEMPLATE.md` | If absent in target, install. If present, diff and prompt — don't auto-overwrite |
33
- | `bundle/runbooks-portable/*.md` | `.brain/runbooks/` | Same diff-and-prompt rule |
34
- | `bundle/conventions-portable/*.md` | `docs/conventions/` | Same — never auto-overwrite |
35
- | `bundle/findings-schema.json` | (use to validate `.brain/findings/INDEX.md`) | If target has no `INDEX.md`, install one with the imported schema |
36
- | `bundle/audit-history-schema.json` | (use to validate `.brain/audit-history/`) | First imported audit lands in the same shape as the source |
37
- | `bundle/config.toml.example` | `.brain/config.toml` | If target has no config, install with imported defaults; otherwise diff-and-prompt |
38
- | `bundle/agents-template.md` | (use to verify target `AGENTS.md` has parallel sections) | Read-only — informs the gap report |
39
-
40
- ## What does NOT get imported
41
-
42
- - Source files, configs, package files (the bundle should never include these; if it does, refuse to import)
43
- - Anything in `bundle/audit-history/` content — only the *schema*. Each repo's audit ledger is its own.
44
- - Anything matching the secret-pattern redactor (defense in depth — the source should have stripped these, but verify)
45
-
46
- ## Procedure
47
-
48
- User-confirmation gates marked **[gate]**.
49
-
50
- 1. **[gate] Locate the bundle.** Default path: `../brain-export-*-*/`. The user can pass an explicit path. If multiple bundles match, prompt for selection.
51
-
52
- 2. **Validate the bundle.**
53
- - `manifest.json` parses
54
- - Every `disposition: "portable"` claim has a corresponding file
55
- - Bundle size < 5 MB (refuse to import larger — likely contains junk)
56
- - No file matches secret patterns (refuse on hit)
57
- - No absolute user paths in any text file (warn-and-strip)
58
-
59
- 3. **Detect target's brain layout.**
60
- - `.brain/` exists? Use it.
61
- - Only legacy `docs/{adrs,postmortems,...}/` exists? Recommend running base `ops-repo` to migrate to `.brain/` first; abort import unless user forces.
62
- - Neither exists? Recommend `greenfield-setup.md`; abort.
63
-
64
- 4. **Plan the merges.** For each bundle artifact, compute:
65
- - Target path
66
- - Collision: none / rename / diff-and-prompt
67
- - Renumber map (for ADRs)
68
-
69
- 5. **[gate] Show the merge plan.** Render as a table; let the user veto per-row. Default interactive; allow `--yes` for bulk import.
70
-
71
- 6. **Apply the plan.**
72
- - Copy ADRs (with renumbering as planned)
73
- - Copy postmortems (with `-imported` suffix on date collisions)
74
- - Diff-prompt each runbook and convention; user picks accept / reject / merge-manually
75
- - Install schemas + config.toml if absent
76
-
77
- 7. **Update local INDEX files.**
78
- - `.brain/adrs/README.md` (if present): refresh the index to include imported ADRs with a `(imported from <source-repo>)` annotation
79
- - `.brain/postmortems/INDEX.md`: same
80
- - `.brain/findings/INDEX.md`: keep target's findings, but add an "Imported from <source>" section if the source had `## Graduations` content worth preserving
81
-
82
- 8. **Run a fresh audit.** Invoke the parent `ops-repo` audit on the freshly-imported state. The ledger entry will record the import as the audit's source event.
83
-
84
- 9. **Sync to agent memory.** Pipeline: the imported ADRs / postmortems / conventions feed the harvest pass from [`harvest-repo-brain.md`](./harvest-repo-brain.md). User can opt out (`--no-memory-sync`) but default is to run it — the import is most useful when it propagates all the way to the agent's working memory.
85
-
86
- 10. **Sync the harness if recommended.** Re-run the harness audit step from `harvest-repo-brain.md`: any pre-commit hooks the source had that aren't installed locally, propose them; any `permissions.allow` entries the source needed for its runbooks, propose them.
87
-
88
- 11. **[gate] Approve harness changes.** Settings updates always require explicit confirmation — even with `--yes`.
89
-
90
- 12. **Report.** Print a summary:
91
- ```
92
- Imported brain-export-source-repo-2026-04-29/ (manifest v1.0, 412 KB):
93
- ✓ 7 ADRs copied (5 renumbered to 0011-0017; 2 already present, skipped)
94
- ✓ 1 postmortem copied
95
- ✓ _TEMPLATE.md updated (your version was older, accepted import)
96
- ✓ 2 runbooks (1 accepted, 1 rejected — bumped to /tmp/ for review)
97
- ✓ 3 conventions (3 accepted)
98
- ✓ Schemas installed (findings-schema, audit-history-schema)
99
-
100
- Memory sync (via harvest-repo-brain pipeline):
101
- ✓ 7 project_ (from imported ADRs)
102
- ✓ 4 feedback_ (from imported postmortem + 3 conventions)
103
- MEMORY.md: 32 → 43 lines.
104
-
105
- Harness recommendations:
106
- ✓ pre-commit hook for "verify journal-date" (proposed; user approved)
107
- ✓ permissions.allow += ["Bash(npm run verify:*)"] (proposed; user approved)
108
-
109
- Audit run:
110
- ✓ Trip-wires green; ledger entry written to .brain/audit-history/2026-04-29-import-source.json
111
- ```
112
-
113
- ## Sanity checks
114
-
115
- Refuse to import if any of these fail:
116
-
117
- - [ ] Bundle's `manifest.json` is missing or invalid
118
- - [ ] Bundle contains files outside the declared dispositions
119
- - [ ] Bundle contains absolute user paths or matches secret patterns (defense in depth)
120
- - [ ] Bundle size > 5 MB
121
- - [ ] Target has uncommitted changes in `.brain/` (require clean tree to make rollback safe)
122
- - [ ] Target's git branch isn't main / a dedicated import branch (refuse to import on a release branch)
123
-
124
- Always require **explicit user confirmation** for:
125
-
126
- - Overwriting existing ADR / postmortem / convention content (default: skip on collision)
127
- - Settings.json modifications (default: prompt)
128
- - Adding pre-commit hooks (default: prompt — hooks are powerful)
129
- - Auto-syncing to agent memory (default: prompt; opt-out flag)
130
-
131
- ## Rollback
132
-
133
- The import never touches anything outside `.brain/` + `docs/conventions/` + `~/.claude/projects/<repo>/memory/` + `.claude/settings.json`. To roll back:
134
-
135
- ```bash
136
- git checkout -- .brain/ docs/conventions/ .claude/settings.json
137
- # memory files are user-scope; restore from a backup if needed
138
- ```
139
-
140
- The audit-history ledger entry that records the import is **not** rolled back — it's append-only. The next audit will show the import was reverted; that's the audit trail working as intended.
141
-
142
- ## When to NOT import
143
-
144
- - Two repos with truly divergent architectures (a Vue 3 SaaS vs an Elixir CLI). The ADRs won't translate; the postmortems won't translate; you'll spend more time triaging than the import saves.
145
- - The source bundle is older than 90 days. Brain matter ages — better to ask the source repo to re-harvest fresh.
146
- - The target repo is mid-incident. Import lands cleanly only against a steady-state target.
147
-
148
- ## See also
149
-
150
- - [`harvest-repo-brain.md`](./harvest-repo-brain.md) — the producing-side recipe; this is its inverse
151
- - [`cold-start-harvest.md`](./cold-start-harvest.md) — different flow (extracts buried learnings from an existing repo's scattered docs into the brain layout for the first time)
152
- - [`continuous-learning-loop.md`](./continuous-learning-loop.md) — the broader iterate pattern import-then-audit instantiates
153
- - [`../audit-patterns/audit-history-ledger.md`](../audit-patterns/audit-history-ledger.md) — privacy redactor reference (defense-in-depth on the import)
@@ -1,182 +0,0 @@
1
- ---
2
- date: 2026-04-27
3
- coverage: canonical
4
- peers:
5
- - greenfield-setup.md
6
- - adr-introduction.md
7
- - audit-existing-repo.md
8
- - continuous-learning-loop.md
9
- - ../doc-types/adr-pattern.md
10
- - ../doc-types/postmortem-pattern.md
11
- - ../doc-types/decisions-log.md
12
- primary_sources:
13
- - https://adr.github.io/madr/
14
- - https://sre.google/workbook/postmortem-culture/
15
- - https://learn.microsoft.com/en-us/azure/well-architected/architect-role/architecture-decision-record
16
- - https://www.cognitect.com/blog/2011/11/15/documenting-architecture-decisions
17
- status: research-verified
18
- ---
19
-
20
- # Recipe: organize ADRs, postmortems, runbooks, and decision logs (delivers Promise 5)
21
-
22
- > **The premise.** Memory primitives only compound if they have *one* obvious home each. The most common organizational failure is not absence — it's split-brain: `.brain/adrs/` AND `docs/decisions/`, both half-populated, both authoritative-looking. The agent loads both, gets contradictions, and learns nothing. This recipe makes the layout decisive.
23
-
24
- ## The four memory primitives
25
-
26
- | Primitive | What it captures | Storage | Lifecycle |
27
- |---|---|---|---|
28
- | **ADR** | A specific architectural commitment | `.brain/adrs/NNNN-*.md` | Proposed → Accepted → (Superseded) |
29
- | **Postmortem** | An incident retrospective | `.brain/postmortems/YYYY-MM-DD-*.md` | Drafted → Resolved (mostly immutable) |
30
- | **Runbook** | A repeatable operational procedure | `.brain/runbooks/<verb-noun>.md` | Living; revised in place |
31
- | **Decision log entry** (looser) | A non-architectural commitment too small for an ADR | `docs/decisions/YYYY-MM-DD-*.md` (optional) | Living, dated, lighter-weight |
32
-
33
- Plus two adjacent (not memory but co-located):
34
-
35
- | Document | Storage | Why it's not memory |
36
- |---|---|---|
37
- | **Architecture overview** | `docs/ARCHITECTURE.md` (or `.brain/architecture/`) | Describes current state, not decision history |
38
- | **Spec / RFC / pre-decision draft** | `docs/drafts/` or `docs/rfcs/` | Pre-decision; converts to ADR when accepted |
39
-
40
- ## The decision tree (which folder does this go in?)
41
-
42
- | If you can say... | It belongs in... |
43
- |---|---|
44
- | "We decided to use X instead of Y" (architectural) | `.brain/adrs/` |
45
- | "We picked library X over Y" (small, reversible) | `docs/decisions/` (optional) |
46
- | "On April 12, the checkout broke because..." | `.brain/postmortems/` |
47
- | "To roll out a new region, run these 8 steps" | `.brain/runbooks/` |
48
- | "The system has these services and they talk like..." | `docs/ARCHITECTURE.md` |
49
- | "Here's what we're considering for next quarter" | `docs/drafts/` or `docs/rfcs/` |
50
-
51
- If the team can describe each new doc in one sentence, the right folder usually pops out.
52
-
53
- ## Should I have `.brain/adrs/` AND `docs/decisions/`?
54
-
55
- **Most teams: no.** Pick one. ADRs cover both architectural and non-architectural decisions just fine — especially since MADR 4.0.0 (Sept 2024) explicitly broadens scope to non-architectural by renaming the *A* to *Any*.
56
-
57
- **Some teams: yes.** When ADRs feel too heavy for routine choices ("we picked Vitest over Jest"), a lighter `docs/decisions/` folder reduces activation energy. Trade-off: now you have two places to look. Document the split in `.brain/adrs/README.md`:
58
-
59
- ```markdown
60
- # Decision logs
61
-
62
- This repo splits decisions into two folders by weight:
63
- - `.brain/adrs/` — architectural commitments (MADR format, full context).
64
- - `docs/decisions/` — lighter-weight (one-paragraph, dated).
65
-
66
- When in doubt, prefer ADR.
67
- ```
68
-
69
- The audit checks both layouts and flags neither as wrong — only flags when both exist *without* a documented split rationale. See `../doc-types/decisions-log.md`.
70
-
71
- ## Where do design docs go?
72
-
73
- A "design doc" is usually one of:
74
-
75
- | Doc actually is... | Goes in... |
76
- |---|---|
77
- | A pre-decision proposal under discussion | `docs/drafts/` (delete after decided) or `docs/rfcs/` (keep with `Status:`) |
78
- | The decision itself, after it's made | `.brain/adrs/NNNN-*.md` |
79
- | The current architecture | `docs/ARCHITECTURE.md` |
80
- | A spec for a feature being built | `docs/specs/` |
81
-
82
- The most common confusion: someone writes a "design doc", the team accepts it, and it sits there forever as both pre-decision artifact and post-decision record. Resolve by moving the *decision* into an ADR (which references the design doc), and archiving the original.
83
-
84
- ## When is something a runbook vs a doc?
85
-
86
- | If a person needs to follow steps to *do* something | Runbook |
87
- |---|---|
88
- | If a person needs to *understand* something | Architecture / README / docs |
89
-
90
- Tells: imperative voice + numbered steps → runbook. Declarative voice + continuous prose → docs. Filename: `<verb>-<noun>.md` (`deploy-staging.md`, `rotate-secrets.md`, `roll-back.md`). Time-stamped runbooks are a smell — runbooks are living; postmortems handle "things that happened on a date".
91
-
92
- ## File-naming conventions
93
-
94
- | Folder | Convention | Why |
95
- |---|---|---|
96
- | `.brain/adrs/` | `NNNN-kebab-case-title.md` (4-digit, sequential) | Numbered for sequence; immutable after Accepted |
97
- | `.brain/postmortems/` | `YYYY-MM-DD-incident-name.md` | Sorts chronologically; date is the unique identifier |
98
- | `docs/decisions/` | `YYYY-MM-DD-decision-name.md` | Sorts chronologically; small enough that numbering is overkill |
99
- | `.brain/runbooks/` | `<verb>-<noun>.md` | No date — runbooks are living |
100
- | `.brain/architecture/` | `<topic>.md` (kebab-case) | Topical, not temporal |
101
- | `docs/drafts/` | freeform | Not yet committed |
102
- | `.brain/archive/` | `original-name-YYYY-MM-DD.md` | Provenance preserved for moved-orphans |
103
-
104
- ## Index files (`README.md` in each folder)
105
-
106
- Every memory folder gets a `README.md` index:
107
-
108
- ```markdown
109
- # Architecture Decision Records
110
-
111
- (...one-paragraph orientation...)
112
-
113
- ## Index
114
-
115
- | # | Title | Status | Date |
116
- |---|---|---|---|
117
- | 0001 | Record architecture decisions | Accepted | 2026-04-27 |
118
- | 0002 | Use Postgres over MySQL | Accepted | 2026-04-27 |
119
-
120
- _Last reviewed: 2026-04-27_
121
- ```
122
-
123
- Postmortems use a similar table sorted newest-first. Runbooks use a flat list grouped by area (deployment / observability / security / data). Auto-generation tools (`adr-log`) work but are optional — hand-curated tables stay accurate longer than people fear.
124
-
125
- ## Lifecycle: Proposed → Accepted → Superseded
126
-
127
- ADR statuses are load-bearing:
128
-
129
- - **Proposed** — under discussion. Audit flags Proposed >30 days (probably abandoned).
130
- - **Accepted** — committed. Immutable; only edited for typos, never substance.
131
- - **Rejected** — considered and chosen against. Recorded so it doesn't get re-proposed without context.
132
- - **Deprecated** — no longer active but not yet replaced.
133
- - **Superseded by ADR-NNNN** — replaced by a newer decision. Both ADRs stay; the older one stays in place with the supersession note.
134
-
135
- Postmortems: Drafted → Resolved. After Resolved, edits are limited to typos. Runbooks: continuously edited; `_Last reviewed:_` line is the freshness signal.
136
-
137
- ## How AGENTS.md exposes all of this
138
-
139
- The `Where to find things` section enumerates the homes:
140
-
141
- ```markdown
142
- ## Where to find things
143
- - **Architecture:** `docs/ARCHITECTURE.md`
144
- - **Architecture Decision Records:** `.brain/adrs/` (index: `.brain/adrs/README.md`)
145
- - **Decision log (lighter-weight):** `docs/decisions/` (only if your team uses both)
146
- - **Post-mortems:** `.brain/postmortems/` (index: `.brain/postmortems/README.md`)
147
- - **Runbooks:** `.brain/runbooks/` (index: `.brain/runbooks/README.md`)
148
- - **Drafts / RFCs:** `docs/drafts/` (pre-decision; do not treat as committed)
149
- ```
150
-
151
- The `Memory primitives` section instructs *when* to read each:
152
-
153
- ```markdown
154
- ## Memory primitives
155
- - **Before architectural decisions**, read `.brain/adrs/` newest-first.
156
- - **When debugging production issues**, search `.brain/postmortems/`.
157
- - **When running operational procedures**, look in `.brain/runbooks/`
158
- before improvising. If missing, write the runbook *while* doing it.
159
- - **Drafts in `docs/drafts/` are not commitments** — do not implement
160
- them as if they were ADRs.
161
- ```
162
-
163
- This closes the continuous-learning loop — see `continuous-learning-loop.md`.
164
-
165
- ## Common organizational anti-patterns
166
-
167
- - **`.brain/adrs/` and `docs/decisions/` both half-populated, no documented split.** Pick one or document the split.
168
- - **Postmortems in `docs/traces/`.** "Traces" reads as observability traces (OpenTelemetry / Jaeger). Use `.brain/postmortems/` or `docs/incidents/`.
169
- - **Runbooks under date-prefix names.** Runbooks are living; date-prefixes lie.
170
- - **Design docs that became ADRs without archiving the originals.** Two sources of truth on the same decision.
171
- - **No index files.** Folder is technically populated but undiscoverable without `ls`.
172
- - **Postmortems in private docs (Notion, Confluence).** Unreachable from the agent; aggressively link from AGENTS.md.
173
-
174
- ## Cross-references
175
-
176
- - ADR pattern: `../doc-types/adr-pattern.md`
177
- - Postmortem pattern: `../doc-types/postmortem-pattern.md`
178
- - Decision log: `../doc-types/decisions-log.md`
179
- - Greenfield setup (creates this layout day one): `greenfield-setup.md`
180
- - ADR introduction (retrofit): `adr-introduction.md`
181
- - Continuous-learning loop: `continuous-learning-loop.md`
182
- - AGENTS.md Memory primitives section: `../standards/agents-md-spec.md`