@adia-ai/adia-ui-forge 0.1.3 → 0.8.1

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 +4 -7
  2. package/CHANGELOG.md +35 -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 +28 -3
  90. package/skills/{adia-ui-release → adia-release}/scripts/dispatch-publish.mjs +10 -7
  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 +38 -31
  95. package/skills/{adia-ui-release → adia-release}/scripts/tag-lockstep.mjs +7 -3
  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,211 +0,0 @@
1
- ---
2
- date: 2026-04-27
3
- coverage: canonical
4
- peers:
5
- - greenfield-setup.md
6
- - memory-organization.md
7
- - audit-existing-repo.md
8
- - continuous-learning-loop.md
9
- - ../doc-types/adr-pattern.md
10
- primary_sources:
11
- - https://www.cognitect.com/blog/2011/11/15/documenting-architecture-decisions
12
- - https://adr.github.io/madr/
13
- - https://github.com/joelparkerhenderson/architecture-decision-record
14
- - https://github.com/npryce/adr-tools
15
- status: research-verified
16
- ---
17
-
18
- # Recipe: introduce ADRs to an established repo (delivers Promise 5)
19
-
20
- > **The premise.** A repo without ADRs has scattered architectural memory — decisions live in PR descriptions, Slack archives, code comments, and senior engineers' heads. The "continuously-learning" promise is broken until the repo has a place to land decisions *at decision time*. This recipe creates that place and seeds it just enough that the practice survives.
21
-
22
- ## What this recipe is *not*
23
-
24
- - **Not** a backfill-everything-ever campaign. Reconstructing 10 years of decisions almost never finishes.
25
- - **Not** a bureaucratic gate. Most PRs aren't architectural; most don't need ADRs.
26
- - **Not** a tooling adoption. `adr-tools` (Pryce) is optional and lightly maintained as of April 2026. `mkdir .brain/adrs/` is enough to start.
27
-
28
- ## What this recipe *is*
29
-
30
- A 60-minute setup that (1) creates `.brain/adrs/` with an index and the bootstrap ADR; (2) backfills 3-5 *load-bearing* historical decisions; (3) wires the AGENTS.md `Memory primitives` section; (4) adds the architectural-impact checkbox to the PR template; (5) briefs the team in one paragraph.
31
-
32
- ## Step 1 — Create the ADR home + index
33
-
34
- ```bash
35
- mkdir -p docs/adrs
36
-
37
- cat > .brain/adrs/README.md <<'EOF'
38
- # Architecture Decision Records
39
-
40
- This folder captures architectural decisions. Each ADR is dated, numbered,
41
- and immutable — decisions don't get edited; they get superseded.
42
-
43
- Format: MADR 4.0.0 (https://adr.github.io/madr/) for new ADRs.
44
- Read newest-first. See `../../AGENTS.md` "Memory primitives" for when
45
- to consult.
46
-
47
- ## Index
48
-
49
- | # | Title | Status | Date |
50
- |---|---|---|---|
51
- | 0001 | Record architecture decisions | Accepted | 2026-04-27 |
52
-
53
- _Last reviewed: 2026-04-27_
54
- EOF
55
- ```
56
-
57
- ## Step 2 — Bootstrap ADR 0001
58
-
59
- Use the Nygard format ([cognitect.com 2011](https://www.cognitect.com/blog/2011/11/15/documenting-architecture-decisions)) for the bootstrap; canonical templates in `../doc-types/adr-pattern.md`. The bootstrap ADR records the decision to *use ADRs* — without it, future contributors don't know whether the practice is required.
60
-
61
- Save as `.brain/adrs/0001-record-architecture-decisions.md` (full content in `greenfield-setup.md`). Update the README index.
62
-
63
- ## Step 3 — Backfill 3-5 load-bearing historical ADRs
64
-
65
- This is where teams either succeed or burn out. **Do not try to backfill every past decision.** Pick the 3-5 commitments that (a) are still live, (b) get questioned by new contributors, (c) would change the agent's behavior if it knew them.
66
-
67
- ### How to find them — git archaeology in 20 minutes
68
-
69
- ```bash
70
- # 1. Framework / library / runtime introductions
71
- git log --diff-filter=A --name-only --pretty=format:'%h %ad %s' --date=short \
72
- -- 'package.json' 'Gemfile' 'requirements.txt' 'go.mod' 'Cargo.toml' \
73
- 'pyproject.toml' '*.csproj' 'pom.xml' 'mix.exs' | head -50
74
-
75
- # 2. DB-related decisions
76
- git log --all --oneline --grep -E -i 'postgres|mysql|mongo|redis|sqlite|dynamo' | head -30
77
-
78
- # 3. Deployment platform decisions
79
- git log --all --oneline --grep -E -i 'deploy|kubernetes|cloud-run|fly|render|vercel|heroku' | head -30
80
-
81
- # 4. Auth / security decisions
82
- git log --all --oneline --grep -E -i 'auth|jwt|session|oauth|saml' | head -20
83
- ```
84
-
85
- Triangulate with the team: "What three things do people ask about most often?"
86
-
87
- ### Typical high-value backfill candidates
88
-
89
- | ADR # | Decision shape | Why it earns its place |
90
- |---|---|---|
91
- | 0002 | Framework choice (e.g., Next.js over Remix) | Agent reaches for wrong framework conventions otherwise |
92
- | 0003 | Database choice (e.g., Postgres over MySQL) | Affects schema design, query patterns |
93
- | 0004 | Deployment platform (e.g., Cloud Run, not k8s) | Affects observability, CI, ops |
94
- | 0005 | Auth provider (e.g., Auth0 over rolling our own) | Affects security model, user model |
95
- | 0006 | Module boundaries (e.g., monorepo, not split repos) | Affects refactor blast radius |
96
-
97
- ### Backfill ADR template
98
-
99
- Backfill ADRs **explicitly mark themselves as backfilled**. The team didn't go through the ADR process at the time — that's fine, just be honest.
100
-
101
- ```markdown
102
- # 2. Use Postgres over MySQL
103
-
104
- Date: 2026-04-27 (decision made: 2024-03-12; backfilled retroactively)
105
-
106
- ## Status
107
- Accepted
108
-
109
- ## Context
110
- [Reconstructed from git log + PR #142 + memory of who was around. Some
111
- of the original constraint analysis is unrecoverable; this ADR captures
112
- the load-bearing context.]
113
-
114
- In Q1 2024, we needed a relational database for the user-account service.
115
- Drivers: JSONB for flexible user-profile fields, mature partitioning for
116
- the multi-tenant rollout, team familiarity (3 of 5 had Postgres experience).
117
-
118
- ## Decision
119
- Postgres 15. Hosted on RDS in us-east-1.
120
-
121
- ## Consequences
122
- - Locked into Postgres dialect (we use JSONB ops + LATERAL joins).
123
- - Migrating later requires schema rewrite + data backfill.
124
- - Connection pool management is a known op concern (see
125
- `.brain/postmortems/2026-04-12-checkout-outage.md`).
126
- ```
127
-
128
- The "(decision made: ... ; backfilled retroactively)" tag is critical — tells the next reader the ADR isn't reconstructing perfect history, just the load-bearing summary.
129
-
130
- **Stop at 3-5.** A 6th tempting backfill is usually scope creep. Add to the backlog and let it appear when someone next touches the relevant area.
131
-
132
- ## Step 4 — Wire AGENTS.md Memory primitives
133
-
134
- If AGENTS.md doesn't have a `Memory primitives` section, add one. If it does, add the ADR pointer:
135
-
136
- ```markdown
137
- ## Where to find things
138
- (...)
139
- - **Architecture Decision Records:** `.brain/adrs/` (index: `.brain/adrs/README.md`)
140
-
141
- ## Memory primitives
142
- - **Before architectural decisions**, read `.brain/adrs/` newest-first.
143
- If your proposed change conflicts with an `Accepted` ADR, write a new
144
- ADR superseding it; don't silently override.
145
- ```
146
-
147
- Without this section, the ADRs exist but the agent doesn't know to read them — single most-common loop break (see `continuous-learning-loop.md`).
148
-
149
- ## Step 5 — Update the PR template
150
-
151
- Add the architectural-impact checkbox to `.github/pull_request_template.md`:
152
-
153
- ```markdown
154
- ## Architectural impact
155
- - [ ] No architectural change (no ADR needed)
156
- - [ ] Architectural change — ADR added at: `.brain/adrs/NNNN-*.md`
157
- - [ ] Architectural change — ADR exemption granted by: [name]
158
- Reason: [why no ADR]
159
- ```
160
-
161
- Optionally add the auto-detection CI workflow from `continuous-learning-loop.md` that warns when architectural files change without an accompanying ADR.
162
-
163
- ## Step 6 — Brief the team
164
-
165
- One paragraph. Post in #engineering:
166
-
167
- > We've added `.brain/adrs/` for architectural decisions. New decisions
168
- > that change framework / DB / deployment / auth / module boundaries
169
- > get an ADR alongside the PR. The PR template has a checkbox to remind.
170
- > We've backfilled 5 historical ones (Postgres, Cloud Run, Next.js,
171
- > Auth0, monorepo). Format is MADR 4.0.0 — see `.brain/adrs/README.md`.
172
- > AGENTS.md now points to this folder so LLM agents read it before
173
- > architectural changes.
174
-
175
- Don't send a 500-word memo — short, factual, links.
176
-
177
- ## Verification checklist
178
-
179
- - [ ] `.brain/adrs/` exists with `README.md` index
180
- - [ ] `0001-record-architecture-decisions.md` is `Accepted`
181
- - [ ] 3-5 backfill ADRs landed, each marked retroactive in the date line
182
- - [ ] AGENTS.md `Where to find things` references `.brain/adrs/`
183
- - [ ] AGENTS.md `Memory primitives` instructs newest-first reading
184
- - [ ] `.github/pull_request_template.md` has architectural-impact checkbox
185
- - [ ] Team brief sent
186
-
187
- ## When to choose Nygard vs MADR vs Y-statements
188
-
189
- | Format | When to use |
190
- |---|---|
191
- | **Nygard** (Title / Date / Status / Context / Decision / Consequences) | Small teams, fast cadence, straightforward decisions |
192
- | **MADR 4.0.0** (adds Deciders / Considered Options / Decision Drivers) | Larger teams, audit-trail matters, multi-option |
193
- | **Y-statements** (Zimmermann SATURN 2012) | One-line reversible choices; or summary atop a longer ADR |
194
-
195
- The audit treats all three as valid; `../doc-types/adr-pattern.md` covers detection.
196
-
197
- ## Common mistakes
198
-
199
- - **Backfilling everything.** Past 5 ADRs you're doing archaeology, not setup.
200
- - **No bootstrap ADR.** Without `0001`, future contributors don't know whether ADRs are mandatory.
201
- - **Backfill ADRs that pretend they were written contemporaneously.** Reads as historical revisionism.
202
- - **Adding ADRs but not the AGENTS.md pointer.** Corpus exists; agent doesn't read it.
203
- - **PR template without the checkbox.** New decisions don't get captured.
204
-
205
- ## Cross-references
206
-
207
- - ADR pattern (templates, anti-patterns, audit checks): `../doc-types/adr-pattern.md`
208
- - Memory organization (where ADRs sit relative to runbooks/postmortems): `memory-organization.md`
209
- - Greenfield setup (the day-one version): `greenfield-setup.md`
210
- - Continuous-learning loop (the system this plugs into): `continuous-learning-loop.md`
211
- - AGENTS.md Memory primitives section: `../standards/agents-md-spec.md`
@@ -1,234 +0,0 @@
1
- ---
2
- date: 2026-04-27
3
- coverage: canonical
4
- peers:
5
- - greenfield-setup.md
6
- - adr-introduction.md
7
- - memory-organization.md
8
- primary_sources:
9
- - SKILL.md (this skill's own audit categories)
10
- status: needs-research-enhancement
11
- ---
12
-
13
- # Recipe: audit an existing repo
14
-
15
- > **The end-to-end procedure** for running `ops-repo` against a real repo and producing an actionable gap report. Includes the v1.5 `.brain/` layout migration recipe.
16
-
17
- ## Inputs
18
-
19
- - A path to a git repo (working tree)
20
- - Optional: severity threshold (`critical` / `high` / `medium` / `low`) — default `medium`
21
- - Optional: write-mode flag (`recommend-only` / `apply-fixes`) — default `recommend-only`
22
-
23
- ## Outputs
24
-
25
- - `stale-docs-audit.md` (or stdout) with the gap report
26
- - (If `apply-fixes`) edits to `AGENTS.md`, `CLAUDE.md`, etc., or new files in `.brain/`
27
-
28
- ## The 7-step procedure
29
-
30
- ### Step 1 — Discovery
31
-
32
- Enumerate everything that matters:
33
-
34
- ```bash
35
- # Entry-file candidates at root
36
- ls -la AGENTS.md CLAUDE.md README.md CONTRIBUTING.md SECURITY.md \
37
- .cursorrules .windsurfrules .aider.conf.yml 2>/dev/null
38
-
39
- # Cursor newer-style rules folder
40
- ls -la .cursor/rules/ 2>/dev/null
41
-
42
- # Continue config
43
- ls -la .continue/ 2>/dev/null
44
-
45
- # GitHub Copilot instructions
46
- ls -la .github/copilot-instructions.md 2>/dev/null
47
-
48
- # Brain artifacts (v1.5 layout) + legacy docs/ tree
49
- find .brain docs -type f -name '*.md' 2>/dev/null
50
- find . -maxdepth 2 \( -name 'CHANGELOG*.md' -o -name 'ARCHITECTURE.md' -o -name 'PLAN.md' -o -name 'ROADMAP.md' \) 2>/dev/null
51
- ```
52
-
53
- Build two sets:
54
- - **EntryFiles**: files found at the root that are entry candidates
55
- - **DocFiles**: files found anywhere under `.brain/` or `docs/`, plus well-known top-level docs (CHANGELOG.md, ARCHITECTURE.md, PLAN.md, ROADMAP.md)
56
-
57
- **Git-sync mode detection.** Check `.gitignore`. If `.brain/` (the directory itself, not just `.brain/cache/` or `.brain/cold-start/`) appears in `.gitignore`, the repo is in `local-only` mode (per `../guidance/reliability-dial.md` § Git sync). The audit still runs against the working tree, but Promise 5 findings apply to the local clone only — multi-contributor recipes (`concurrent-learnings-merge.md`, `cold-start-harvest.md`) and the auto-archive PR workflow are moot in this mode and should be skipped.
58
-
59
- ### Step 2 — Pointer trace
60
-
61
- For each file in `EntryFiles`, parse it as Markdown and extract every relative-path link or backtick-quoted path. Build a set:
62
-
63
- - **PointedTo**: union of all paths referenced from any entry file
64
-
65
- Cross-check against `DocFiles`:
66
-
67
- - **PointedTo ∩ DocFiles** — files reachable from entry. ✅
68
- - **PointedTo \ DocFiles** — referenced but missing. ❌ *Broken pointer.*
69
- - **DocFiles \ PointedTo** — exist but unreachable. 🟡 *Orphan.*
70
-
71
- ### Step 3 — Canonical determination
72
-
73
- Decide which entry file is *canonical* (the one that should hold instructions; others should redirect to it).
74
-
75
- Decision tree:
76
-
77
- ```
78
- Is AGENTS.md present and ≥30 lines?
79
- YES → AGENTS.md is canonical.
80
- NO → Is exactly one fat (≥30 lines) entry file present?
81
- YES → Recommend renaming it to AGENTS.md.
82
- NO → Are multiple fat files present?
83
- YES → DRIFT. Recommend consolidation.
84
- NO → No canonical file. CRITICAL gap.
85
- ```
86
-
87
- ### Step 4 — Thin-pointer compliance
88
-
89
- For every entry file that is NOT canonical, verify it's a thin pointer:
90
-
91
- - Length ≤ 15 lines
92
- - References the canonical file by name
93
- - No substantive instructions of its own
94
-
95
- Findings:
96
- - **Fat non-canonical** → drift risk → recommend converting to pointer.
97
- - **Wrong target** → e.g. CLAUDE.md exists, points at `AGENTS.md`, but AGENTS.md doesn't exist → broken redirect.
98
-
99
- ### Step 5 — Memory-primitive check
100
-
101
- For each of the standard memory homes, check existence and pointer-from-AGENTS.md:
102
-
103
- | Home | Required? | If missing |
104
- |---|---|---|
105
- | `.brain/adrs/` (or legacy `docs/adrs/`) | Recommended | "No ADR home — recommend introducing them. See `recipes/adr-introduction.md`." |
106
- | `.brain/decisions/` | Optional | If absent and no ADRs either, both flagged. |
107
- | `.brain/postmortems/` (or legacy `docs/postmortems/` / `docs/incidents/`) | Optional | Flag only if repo has had production incidents (heuristic: search for `incident`, `outage`, `post-mortem` in commit log). |
108
- | `CHANGELOG.md` | Strongly recommended | Flag as gap if missing. |
109
- | `.brain/runbooks/` (or legacy `docs/runbooks/`) | Optional | Flag if production-facing repo. |
110
-
111
- ### Step 6 — Staleness probe
112
-
113
- For each file in `DocFiles`:
114
-
115
- - **Last modified** > 6 months ago AND **no `_Last reviewed:_` line** → flag as needs-review.
116
- - File contains references to symbols/files that no longer exist in the repo → flag as broken-reference.
117
- - File contains commands that fail dry-run (e.g., `npm install` but project is pnpm) → flag as command-stale. (Best-effort; may require running commands.)
118
-
119
- ### Step 7 — Synthesize the gap report
120
-
121
- Write `stale-docs-audit.md` with sections:
122
-
123
- ```markdown
124
- # Stale-docs audit — <repo name>
125
-
126
- _Generated: 2026-04-27_
127
-
128
- ## Summary
129
-
130
- - **Critical**: 1 finding
131
- - **High**: 3 findings
132
- - **Medium**: 7 findings
133
- - **Low**: 4 findings
134
-
135
- ## Critical
136
-
137
- ### MISSING — AGENTS.md
138
- [detail per the entry-file-coverage.md output shape]
139
-
140
- ## High
141
-
142
- ### DRIFT — CLAUDE.md vs .cursorrules
143
- [detail]
144
-
145
- ### NO ADR HOME
146
- The repo has architectural decisions scattered across PR descriptions and code
147
- comments but no `.brain/adrs/`. Recommend introducing ADRs.
148
-
149
- [continue per severity]
150
-
151
- ## Recommended fixes (ordered)
152
-
153
- 1. Rename `CLAUDE.md` → `AGENTS.md`; create thin `CLAUDE.md` redirect.
154
- 2. Create `.brain/adrs/` with `0001-record-architecture-decisions.md`.
155
- 3. Add "Where to find things" and "Memory primitives" sections to AGENTS.md.
156
- 4. Update `.cursorrules` to be a thin pointer.
157
- 5. Resolve drift between CLAUDE.md and .cursorrules: pnpm vs npm.
158
-
159
- ## Suggested edits (when in apply-fixes mode)
160
-
161
- [concrete diffs — not applied without explicit user confirmation]
162
- ```
163
-
164
- ## Migration: legacy `docs/` layout → `.brain/`
165
-
166
- If the audit finds memory artifacts in `docs/{adrs,postmortems,runbooks,archive,architecture}/` (the pre-v1.5 layout), the recommended migration is one git move that preserves history:
167
-
168
- ```bash
169
- mkdir -p .brain
170
-
171
- # Move each memory primitive that exists. Skip silently if absent.
172
- [ -d docs/adrs ] && git mv docs/adrs .brain/adrs
173
- [ -d docs/postmortems ] && git mv docs/postmortems .brain/postmortems
174
- # Or if the repo used the docs/incidents alias:
175
- [ -d docs/incidents ] && [ ! -d .brain/postmortems ] && git mv docs/incidents .brain/postmortems
176
- [ -d docs/runbooks ] && git mv docs/runbooks .brain/runbooks
177
- [ -d docs/archive ] && git mv docs/archive .brain/archive
178
- [ -d docs/architecture ] && git mv docs/architecture .brain/architecture
179
- [ -d docs/ops-repo/audit-history ] && git mv docs/ops-repo/audit-history .brain/audit-history
180
-
181
- # Config + transient state homes
182
- [ -f .ops-repo.toml ] && git mv .ops-repo.toml .brain/config.toml
183
- [ -d .ops-repo/changesets ] && git mv .ops-repo/changesets .brain/changesets
184
-
185
- git commit -m "chore: migrate memory layer to .brain/ (ops-repo v1.5)"
186
- ```
187
-
188
- After the move, also update:
189
-
190
- - **`AGENTS.md`** — every "Where to find things" pointer (`docs/adrs/` → `.brain/adrs/`, etc.)
191
- - **`.gitignore`** — add `.brain/cache/` and `.brain/cold-start/working/` (transient state)
192
- - **`.github/workflows/`** — rename `repo-fixer-*.yml` → `repo-brain-*.yml` if hooks were installed pre-v1.3
193
- - **Workflow path filters / lychee globs** — add `'.brain/**/*.md'` next to `'docs/**/*.md'` (verbatim recipes in `self-healing-hooks.md`)
194
-
195
- The audit recognizes either layout — **migration is opt-in for v1.5**, not enforced. Repos that prefer the established `docs/{adrs,...}/` convention can stay there; the audit's checks adapt. Greenfield setup defaults to `.brain/`.
196
-
197
- **What stays at the repo root regardless of layout:**
198
-
199
- - `AGENTS.md`, `CLAUDE.md`
200
- - `README.md`, `CONTRIBUTING.md`, `SECURITY.md`, `CODE_OF_CONDUCT.md`
201
- - `ARCHITECTURE.md` (matklad pattern)
202
- - `CHANGELOG.md`
203
- - `PLAN.md`, `ROADMAP.md` (if used)
204
-
205
- ## Apply-fixes mode safety rules
206
-
207
- When `apply-fixes` is on:
208
-
209
- 1. **Never delete a file** without showing the user and asking.
210
- 2. **Never overwrite a file >50 lines** without showing a diff and asking.
211
- 3. **Always commit each fix as a separate commit** with a clear message — this is reversible.
212
- 4. **Never rewrite git history.**
213
- 5. If asked to delete an orphaned doc, prefer **moving to `.brain/archive/`** with a date suffix over outright deletion.
214
-
215
- ## Common findings on real repos
216
-
217
- From running this audit across real-world projects, the most frequent gaps:
218
-
219
- 1. **No AGENTS.md, fat CLAUDE.md** — repo predates the standard or only used Claude Code.
220
- 2. **No "Where to find things" section** — naked entry; agent has nothing to navigate.
221
- 3. **CLAUDE.md and .cursorrules drifted** — duplicate maintenance burden, rarely consistent.
222
- 4. **No ADR home** — decisions scattered across PRs.
223
- 5. **Stale build commands** — entry file says `npm` but repo migrated to pnpm/bun.
224
- 6. **Orphaned `docs/old-plan.md`** — never cleaned up after being superseded.
225
- 7. **Undated `ARCHITECTURE.md`** — no way to know if it's current.
226
- 8. **Pre-v1.5 `docs/` layout** — opportunity to migrate to `.brain/` (see § Migration above).
227
-
228
- ## Cross-references
229
-
230
- - Entry-file checks: `../audit-patterns/entry-file-coverage.md`
231
- - Pointer validation: `../audit-patterns/pointer-validation.md`
232
- - Orphan detection: `../audit-patterns/orphan-detection.md`
233
- - Greenfield setup: `greenfield-setup.md`
234
- - Adding ADRs to existing repo: `adr-introduction.md`