@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,154 +0,0 @@
1
- ---
2
- name: browser-bundle-node-imports
3
- applies-to: monorepos with shared packages reachable from both Node and browser bundles
4
- severity: hard-runtime-regression (silent in tests)
5
- detected: 2026-05-12 (chat-ui v0.4.7 §72 follow-up)
6
- related-postmortem: chat-ui/.brain/postmortems/2026-05-12-browser-bundle-node-imports.md
7
- ---
8
-
9
- # Audit pattern — Browser bundle crashes from top-level `import 'node:*'`
10
-
11
- ## The bug class
12
-
13
- A module that needs to work in both Node (server-side smoke, tests, MCP, evals) and the browser (live app surface) statically imports `node:fs`, `node:path`, `node:url`, `node:crypto`, etc. at module top level. The module is reachable from the browser bundle via static import chain.
14
-
15
- In the browser, Vite (or any bundler) externalizes the `node:*` modules — it can't bundle them. Vite emits a shim that throws on **property access**, not on import resolution. So:
16
-
17
- 1. Bundler logs a warning: `Module "node:path" has been externalized for browser compatibility.`
18
- 2. Module's top-level code accesses a property (`path.dirname(...)`, `fs.existsSync(...)`).
19
- 3. Module init throws.
20
- 4. First consumer up the import chain fails to mount.
21
- 5. User sees either a hard error or a graceful-degradation message ("demo mode", "fallback enabled", etc.) depending on the import site's catch handling.
22
-
23
- ## Why it's hard to catch
24
-
25
- - **Vitest is Node-only.** Tests pass.
26
- - **The bundler doesn't fail-fast.** It externalizes and warns; the bug surfaces only when production code accesses the externalized stub.
27
- - **`@vite-ignore` on inner dynamic imports is a known defensive pattern** but doesn't help here — the failure is at top-level static import, before any runtime branch.
28
- - **Sibling modules may already be correctly dual-mode'd.** The pattern is well-known; one module gets fixed; the next sibling slips through.
29
- - **No CI gate detects this.** A `vite build` smoke would catch it, but most repos run `vitest` + `npm test` and call it done.
30
-
31
- ## The discriminating signal
32
-
33
- Top-level static `import .* 'node:*'` in a module reachable from the browser bundle. Distinct from:
34
-
35
- ```js
36
- // SAFE — dynamic, Node-only branch
37
- if (IS_NODE) {
38
- const fs = await import(/* @vite-ignore */ 'node:fs');
39
- }
40
- ```
41
-
42
- vs.
43
-
44
- ```js
45
- // UNSAFE — runs at module init regardless of environment
46
- import fs from 'node:fs';
47
- const __dirname = fs.existsSync(...); // throws in browser
48
- ```
49
-
50
- ## How to audit
51
-
52
- ```bash
53
- # Find every browser-reachable module with top-level static node:* imports
54
- grep -rln "^import .* 'node:" packages/ apps/ playgrounds/ catalog/ 2>/dev/null \
55
- | grep -v 'node_modules\|dist/\|/test/\|\.test\.\|/evals/\|/scripts/\|server\.js'
56
- ```
57
-
58
- Each hit is a candidate. Triage:
59
-
60
- 1. **Node-only file (`.mjs` extension + imports `playwright`/`fs`/etc. liberally)** → safe, ignore.
61
- 2. **Used only by Node-only consumers (MCP scripts, evals, tests)** → safe.
62
- 3. **Imported by anything in `core/`, `strategies/monolithic/`, `strategies/zettel/` (if lazy-loaded) — trace upward.** If the chain reaches `apps/*/app/*.contents.js` or a similar browser entry, it's a bug.
63
- 4. **Lazy-loaded via `await import('./this-module.js')`** → safe (the static-import trap doesn't fire).
64
-
65
- Look for protective comments in registries / barrels: e.g.,
66
-
67
- ```js
68
- // Zettel is lazy-loaded — it transitively imports node:fs / node:path / node:url.
69
- // Static-importing it here would break browser loads of core/generator.js.
70
- ```
71
-
72
- That comment is the canonical protective documentation — when you see it, the lazy-load wall is intentional. Check that the wall hasn't been breached by a sibling `import` statement at the top of another file in the same package.
73
-
74
- ## The fix pattern
75
-
76
- Replace top-level static `import 'node:*'` with the dual-mode loader:
77
-
78
- ```js
79
- const IS_NODE =
80
- typeof process !== 'undefined' &&
81
- typeof process.versions?.node === 'string';
82
-
83
- // Vite resolves this at build time; at runtime in Node the variable is unused.
84
- let _globModules = null;
85
- if (!IS_NODE) {
86
- try {
87
- _globModules = import.meta.glob('../path/to/files/**/*.json', {
88
- query: '?raw',
89
- import: 'default',
90
- eager: false,
91
- });
92
- } catch {
93
- // Not in a Vite context — no data in this realm.
94
- }
95
- }
96
-
97
- async function _loadNode() {
98
- const fs = await import(/* @vite-ignore */ 'node:fs');
99
- const path = await import(/* @vite-ignore */ 'node:path');
100
- // ... Node-only logic
101
- }
102
-
103
- async function _loadBrowser() {
104
- if (!_globModules) return;
105
- for (const [, loader] of Object.entries(_globModules)) {
106
- const raw = await loader();
107
- // ... browser-only logic
108
- }
109
- }
110
-
111
- export async function load() {
112
- if (IS_NODE) await _loadNode();
113
- else await _loadBrowser();
114
- }
115
-
116
- // Eager top-level load: Node side awaits; browser side fires-and-forgets
117
- // (because module-init top-level await is permitted but blocks all importers).
118
- if (IS_NODE) {
119
- await load();
120
- } else {
121
- load().catch(() => {});
122
- }
123
- ```
124
-
125
- The `import.meta.glob(...)` pattern is Vite-specific. For non-Vite bundlers, swap in the bundler's equivalent or expose a `setLoader(fn)` hook.
126
-
127
- ## Trip-wires (what to add)
128
-
129
- 1. **Pre-cut audit**: run the grep above as part of the release F-N1 dry-run. Hit count == 0 for browser-reachable surface, OR every hit traces to a Node-only-consumer chain.
130
-
131
- 2. **Static-source audit** — shipped as `scripts/release/check-browser-safe.mjs` (§83, v0.4.8). Walks `packages/*` for `*.js` / `*.mjs`, filters out Node-only directories via `NODE_ONLY_PATTERNS`, and greps for top-level `import ... from 'node:*'` statements. Exits 0 on clean tree; `--strict` exits 1 on findings. Wired into `npm run check` composite + the lockstep-release skill's pre-cut step. Faster than a vite-build approach (~1s on 536 files vs ~minute per app); the build-based companion is deferred until the static check proves insufficient.
132
-
133
- 3. **Playwright end-to-end probe**: extend any existing smoke spec (e.g. `smoke:genui-error-ux`) to assert specific behavior that requires the browser-side composition library / catalog to be loaded (e.g. retrieval strategy is reported, not just "demo mode"). Catches the symptom even if the trip-wire grep misses an instance.
134
-
135
- ## Common patterns this catches
136
-
137
- - Loaders that walk a corpus directory at module init (`fs.readdirSync` → `Map` of records)
138
- - Cache files that hash + write fingerprints (`crypto.createHash` + `fs.writeFile`)
139
- - Issue reporters that write `.brain/findings/` JSONL files (`fs.appendFile`)
140
- - Path resolvers that compute `__dirname` from `import.meta.url`
141
-
142
- In each case, the Node use case is real, but it must be guarded.
143
-
144
- ## What this audit does NOT catch
145
-
146
- - Runtime calls to `process.env.SOMETHING` (those are separate; Vite injects polyfills) — those need `typeof process !== 'undefined'` guards but the failure mode is different.
147
- - `Buffer` references (browser polyfill is fragmented; see Vite docs).
148
- - Worker / service-worker boundaries (`new Worker(new URL(...))`) — those need their own audit.
149
-
150
- ## Reference incident
151
-
152
- chat-ui v0.4.7 §72 follow-up — `packages/a2ui/compose/strategies/zettel/composition-library.js` had top-level `import 'node:fs/path/url'` from the v0.4.4 §38 fragment-library → composition-library rename. Reached the browser via `gen-ui.contents.js → @adia-ai/a2ui-compose → core/reference.js → strategies/zettel/composition-library.js`. Fixed in commit `76dbcff2`. Postmortem: `/Users/kimba/Projects/adia/gen-ui-kit/.brain/postmortems/2026-05-12-browser-bundle-node-imports.md`. Latent for ~8 days. Detected by user runtime, not CI.
153
-
154
- Sibling module `retrieval/component-catalog.js` had the same risk but was correctly dual-mode'd in an earlier arc. The pattern was known; the fix was not propagated. **The audit gap was: no one ran the discriminating grep across the package after fixing the first module.**
@@ -1,75 +0,0 @@
1
- # `[Unreleased]` block bloat detection
2
-
3
- **Added:** 2026-05-02 after the AdiaUI repo's root `CHANGELOG.md`
4
- accumulated 933 lines of stale-promoted content that already existed
5
- in dated entries above.
6
-
7
- ## The drift class
8
-
9
- Each release cut authors a new dated entry (`## [YYYY-MM-DD — …]`)
10
- but doesn't wipe the `[Unreleased]` content that was just promoted.
11
- Over weeks, `[Unreleased]` accumulates content that's already shipped.
12
-
13
- Effects:
14
- - File size bloats (root CHANGELOG was 3118 → 2202 lines after wipe).
15
- - New readers can't tell what's actually pending — the long block
16
- looks like a backlog about to ship.
17
- - `[Unreleased]` becomes a duplicate-content hazard for grep ("was
18
- this fixed?" → it appears in 3 places).
19
-
20
- ## Detection
21
-
22
- ```bash
23
- # Count lines per package's [Unreleased] block
24
- for f in CHANGELOG.md packages/**/CHANGELOG.md; do
25
- unreleased_lines=$(awk '/^## \[Unreleased\]/,/^## \[/' "$f" 2>/dev/null | wc -l)
26
- echo "$f: $unreleased_lines lines"
27
- done | sort -t: -k2 -n -r
28
- ```
29
-
30
- **Threshold:** > 30 lines is a smell. Likely duplicates the dated
31
- entry below. The actual content of `[Unreleased]` should be:
32
-
33
- - Short (1-3 lines) summary of pending work for the next cut, OR
34
- - `_No pending changes._` when nothing is staged
35
-
36
- ## Fix recipe
37
-
38
- 1. Read the next dated entry below `[Unreleased]`.
39
- 2. For each item in `[Unreleased]`, check if it's covered in the
40
- dated entry. If yes, delete from `[Unreleased]`. If no, the
41
- content is genuinely pending — leave it (or move to a more
42
- accurate dated entry if it shipped earlier).
43
- 3. Verify: line count drops; `git diff` shows only the wipe.
44
-
45
- Python helper for the bulk wipe (when `[Unreleased]` is fully
46
- duplicate content):
47
-
48
- ```python
49
- import pathlib
50
- p = pathlib.Path("CHANGELOG.md")
51
- text = p.read_text()
52
- lines = text.splitlines()
53
- ur_start = next(i for i, l in enumerate(lines) if l.startswith("## [Unreleased]"))
54
- next_section = next(i for i in range(ur_start+1, len(lines)) if lines[i].startswith("## [2026-"))
55
- sep_idx = next(i for i in range(next_section-1, ur_start, -1) if lines[i].startswith("---"))
56
-
57
- replacement = ["## [Unreleased]", "", "_No pending changes._", ""]
58
- new_lines = lines[:ur_start] + replacement + lines[sep_idx:]
59
- p.write_text("\n".join(new_lines) + "\n")
60
- ```
61
-
62
- ## Prevention
63
-
64
- After every release cut:
65
- 1. Wipe the released-package `[Unreleased]` to `_No pending changes._`
66
- OR a 1-3 line summary of what's staged for the next cut.
67
- 2. Wipe the root CHANGELOG `[Unreleased]` (if applicable).
68
- 3. Verify: `wc -l <changelog>` is consistent with prior cuts.
69
-
70
- This is item #5 of the lockstep-release post-publish admin checklist.
71
-
72
- ## Related
73
-
74
- - See [`feedback_changelog_unreleased_drift.md`](`~/.claude/projects/<repo>/memory/`) — the user-memory entry capturing this lesson.
75
- - `stale-audit` skill — runs this check as part of its 7-check sweep.
@@ -1,187 +0,0 @@
1
- ---
2
- date: 2026-04-27
3
- coverage: canonical
4
- peers:
5
- - entry-file-coverage.md
6
- - redundancy-detection.md
7
- - token-waste-detection.md
8
- - staleness-tooling.md
9
- - ../doc-types/adr-pattern.md
10
- - ../doc-types/postmortem-pattern.md
11
- - ../recipes/self-healing-hooks.md
12
- - ../recipes/continuous-learning-loop.md
13
- primary_sources:
14
- - https://agents.md — AGENTS.md canonical spec (AAIF / Linux Foundation, Aug 2025)
15
- - https://adr.github.io/ — Architectural Decision Records
16
- - https://github.com/joelparkerhenderson/architecture-decision-record
17
- - https://sre.google/sre-book/postmortem-culture/ — Google SRE Book, postmortem culture
18
- - https://increment.com/on-call/whats-the-incident/ — Incident response patterns
19
- status: research-verified
20
- ---
21
-
22
- # Coverage gaps (delivers Promise 1, "less-wasteful" + Promise 5, "continuously-learning")
23
-
24
- > **The premise.** A repo without an AGENTS.md is invisible to multi-tool agents; a repo without ADRs has no memory of why anything is the way it is; a repo without postmortems is condemned to relearn the same outage. This audit catches the *missing* canonical files — not the bloated ones, not the stale ones, the ones that aren't there at all.
25
-
26
- ## Why this is Promise 1 + Promise 5
27
-
28
- | Promise | Why missing canonicals violate it |
29
- |---|---|
30
- | **1. Less-wasteful** | An agent that can't find AGENTS.md re-derives conventions every session. A missing CHANGELOG forces every agent into `git log` archaeology. |
31
- | **5. Continuously-learning** | Without ADRs, decisions evaporate after PRs merge. Without postmortems, the org relearns the same outage. |
32
-
33
- Sibling `entry-file-coverage.md` checks that AGENTS.md/CLAUDE.md/.cursorrules are well-formed. *This* pattern checks the broader canonical set.
34
-
35
- ## The expected canonical set
36
-
37
- | Tier | Path | Severity if missing | Why |
38
- |---|---|---|---|
39
- | **Required** | `AGENTS.md` | Critical | Multi-tool entry point; without it, no agent knows the repo |
40
- | **Required** | `CLAUDE.md` (or symlink → `AGENTS.md`) | Critical | Claude Code does not read AGENTS.md natively (issue #31005) |
41
- | **Required** | `README.md` | High | Human + LLM landing; GitHub renders it; first thing every search hits |
42
- | **Required** | `CHANGELOG.md` | High | Append-only history; without it, "what changed" is git-archaeology |
43
- | **Required** | `.brain/adrs/` | Medium | Decision memory; promise 5 home |
44
- | **Conditional** | `.brain/postmortems/` | Medium *if production-facing* | Incident memory; only meaningful if the repo deploys |
45
- | **Recommended** | `ARCHITECTURE.md` | Low | Big-picture reference (matklad pattern, repo root); substitutable with well-organized ADRs |
46
- | **Recommended** | `PLAN.md` | Low | Forward-looking roadmap; substitutable with issues |
47
- | **Recommended** | `.brain/runbooks/` | Low *if production-facing* | Operational memory; on-call counterpart to postmortems |
48
- | **Recommended** | `CONTRIBUTING.md` | Low | Contributor guide; collapsible into AGENTS.md |
49
- | **Recommended** | `SECURITY.md` | Low | Vuln-disclosure pointer; GitHub surfaces it natively |
50
-
51
- The conditional tier triggers on the production-facing heuristic below. The recommended tier is advisory — emit a finding, don't fail the audit.
52
-
53
- ## The production-facing heuristic
54
-
55
- Postmortems and runbooks only matter if the repo runs in production. The audit infers production-facing from any of:
56
-
57
- | Signal | What it says |
58
- |---|---|
59
- | `Dockerfile` (or `Containerfile`) | Builds a container — likely deployable |
60
- | `.github/workflows/*deploy*.yml` (or `*release*.yml`, `*publish*.yml`) | CI deploys this |
61
- | `kubernetes/`, `k8s/`, `helm/`, `charts/` | Deploys to k8s |
62
- | `terraform/`, `*.tf`, `pulumi/`, `cdk.json` | Manages live infrastructure |
63
- | `fly.toml`, `vercel.json`, `netlify.toml`, `render.yaml`, `railway.json`, `app.yaml` | Deploys to a PaaS |
64
- | `serverless.yml`, `sam.yaml`, `template.yaml` | Deploys serverless |
65
-
66
- Any one signal flips the conditional tier on. Library-only repos skip postmortems and runbooks — but still get ADRs.
67
-
68
- ## Detection logic
69
-
70
- ```bash
71
- #!/usr/bin/env bash
72
- # coverage-gaps.sh — emit findings for missing canonical docs
73
- set -euo pipefail
74
-
75
- emit() {
76
- # severity, path, message
77
- printf 'COVERAGE-GAP\t%s\t%s\t%s\n' "$1" "$2" "$3"
78
- }
79
-
80
- # 1. Required tier — always checked
81
- [ -f AGENTS.md ] || emit critical AGENTS.md \
82
- "No AGENTS.md at repo root. Multi-tool agents have no entry point."
83
-
84
- if [ ! -f CLAUDE.md ] && [ ! -L CLAUDE.md ]; then
85
- emit critical CLAUDE.md \
86
- "No CLAUDE.md (Claude Code does not read AGENTS.md natively as of Apr 2026). Symlink or thin pointer required."
87
- fi
88
-
89
- [ -f README.md ] || emit high README.md \
90
- "No README.md at repo root. Human and LLM landing surface missing."
91
-
92
- [ -f CHANGELOG.md ] || emit high CHANGELOG.md \
93
- "No CHANGELOG.md. 'What changed lately' becomes git-archaeology for every agent."
94
-
95
- [ -d .brain/adrs ] || [ -d docs/adrs ] || [ -d docs/adr ] || [ -d docs/decisions ] || emit medium .brain/adrs/ \
96
- "No ADR directory. Decision memory will evaporate after PRs merge. (Promise 5)"
97
-
98
- # 2. Conditional tier — production-facing check
99
- production=false
100
- for signal in Dockerfile Containerfile fly.toml vercel.json netlify.toml \
101
- render.yaml railway.json app.yaml serverless.yml sam.yaml \
102
- template.yaml docker-compose.prod.yml cdk.json pulumi.yaml; do
103
- [ -e "$signal" ] && production=true && break
104
- done
105
- [ "$production" = false ] && compgen -G ".github/workflows/*deploy*" >/dev/null 2>&1 && production=true
106
- [ "$production" = false ] && compgen -G ".github/workflows/*release*" >/dev/null 2>&1 && production=true
107
- [ "$production" = false ] && compgen -G ".github/workflows/*publish*" >/dev/null 2>&1 && production=true
108
- [ "$production" = false ] && [ -d kubernetes ] && production=true
109
- [ "$production" = false ] && [ -d k8s ] && production=true
110
- [ "$production" = false ] && [ -d helm ] && production=true
111
- [ "$production" = false ] && [ -d terraform ] && production=true
112
- [ "$production" = false ] && compgen -G "*.tf" >/dev/null 2>&1 && production=true
113
-
114
- if [ "$production" = true ]; then
115
- [ -d .brain/postmortems ] || [ -d docs/postmortems ] || [ -d docs/incidents ] || emit medium .brain/postmortems/ \
116
- "Production-facing repo (deploy artifacts detected) but no postmortems directory. Incident memory will be lost. (Promise 5)"
117
- [ -d .brain/runbooks ] || [ -d docs/runbooks ] || [ -d docs/operations ] || emit low .brain/runbooks/ \
118
- "Production-facing repo but no runbooks directory. On-call response memory missing."
119
- fi
120
-
121
- # 3. Recommended tier — advisory only
122
- [ -f ARCHITECTURE.md ] || emit low ARCHITECTURE.md \
123
- "No ARCHITECTURE.md. Big-picture reference missing (matklad pattern, repo root; substitutable with ADR set)."
124
- [ -f PLAN.md ] || emit low PLAN.md \
125
- "No PLAN.md. Forward-looking roadmap missing (substitutable with issues)."
126
- [ -f CONTRIBUTING.md ] || emit low CONTRIBUTING.md \
127
- "No CONTRIBUTING.md. Contributor guide can be collapsed into AGENTS.md for small repos."
128
- [ -f SECURITY.md ] || emit low SECURITY.md \
129
- "No SECURITY.md. Vulnerability-disclosure pointer missing."
130
- ```
131
-
132
- The output is one tab-separated finding per line, ready to fold into the audit report. The full hook lives in `../recipes/self-healing-hooks.md`.
133
-
134
- ## Output shape (the gap-report row)
135
-
136
- ```markdown
137
- - **MISSING — `.brain/postmortems/`** (severity: medium)
138
- - Production-facing: `Dockerfile`, `.github/workflows/deploy.yml`, `terraform/` present.
139
- - **Promise impact:** Promise 5 — the repo will relearn the same outage.
140
- - **Recommendation:** create `.brain/postmortems/` from `../doc-types/postmortem-pattern.md`; backfill one recent incident.
141
-
142
- - **MISSING — `CHANGELOG.md`** (severity: high)
143
- - **Promise impact:** Promise 1 — every agent re-derives "what changed lately" from `git log`.
144
- - **Recommendation:** Keep-a-Changelog format; seed with `## [Unreleased]` if history is unrecoverable.
145
- ```
146
-
147
- ## Substitution rules (when "missing" is actually OK)
148
-
149
- The audit is opinionated, not pedantic. Three substitutions are accepted:
150
-
151
- | Expected | Acceptable substitute | Why |
152
- |---|---|---|
153
- | `.brain/adrs/` | `docs/decisions/` or `docs/adr/` (legacy) | Naming variant; same content shape |
154
- | `.brain/postmortems/` | `docs/incidents/` (legacy) | Naming variant |
155
- | `ARCHITECTURE.md` | Populated `.brain/adrs/` of 5+ entries | ADRs collectively *are* the architecture story |
156
-
157
- ## What this pattern is NOT for
158
-
159
- - **Content quality** — coverage-gaps checks *presence*. `format-hygiene.md` and `stale-content.md` catch quality.
160
- - **Bloated files** — `token-waste-detection.md` handles oversize.
161
- - **Drift between two existing files** — `redundancy-detection.md` handles drift.
162
- - **Orphans** — `orphan-detection.md` (sibling, Promise 1).
163
-
164
- ## Severity rubric (consolidated)
165
-
166
- | Finding | Severity | Promise impacted |
167
- |---|---|---|
168
- | AGENTS.md missing | Critical | 1 |
169
- | CLAUDE.md missing (no symlink) | Critical | 1 |
170
- | README.md missing | High | 1 |
171
- | CHANGELOG.md missing | High | 1, 5 |
172
- | `.brain/adrs/` missing | Medium | 5 |
173
- | `.brain/postmortems/` missing (production-facing) | Medium | 5 |
174
- | `.brain/runbooks/` missing (production-facing) | Low | 5 |
175
- | `ARCHITECTURE.md` missing | Low | 1 |
176
- | `CONTRIBUTING.md`, `SECURITY.md`, `PLAN.md` | Low | advisory |
177
-
178
- ## Cross-references
179
-
180
- - Entry-file shape (sibling audit, AGENTS.md/CLAUDE.md form): `entry-file-coverage.md`
181
- - Format hygiene (does each canonical have the right shape?): `format-hygiene.md`
182
- - Redundancy between existing canonicals: `redundancy-detection.md`
183
- - Stale content within existing canonicals: `staleness-tooling.md`, `stale-content.md`
184
- - ADR shape: `../doc-types/adr-pattern.md`
185
- - Postmortem shape: `../doc-types/postmortem-pattern.md`
186
- - Self-healing hook (where these checks run on commit): `../recipes/self-healing-hooks.md`
187
- - Continuous learning loop (Promise 5 home): `../recipes/continuous-learning-loop.md`
@@ -1,122 +0,0 @@
1
- ---
2
- date: 2026-04-27
3
- coverage: canonical
4
- peers:
5
- - pointer-validation.md
6
- - orphan-detection.md
7
- - ../standards/cross-tool-matrix.md
8
- primary_sources:
9
- - https://agents.md — AGENTS.md canonical spec
10
- - https://github.com/anthropics/claude-code/issues/31005 — Claude Code AGENTS.md request (open Apr 2026)
11
- - https://github.blog/changelog/2025-08-28-copilot-coding-agent-now-supports-agents-md-custom-instructions/
12
- - https://cursor.com/docs/rules — Cursor rules format
13
- - https://docs.continue.dev/customize/deep-dives/rules
14
- status: research-verified
15
- ---
16
-
17
- # Audit pattern: entry-file coverage
18
-
19
- > **The first audit pass.** Before checking pointers, freshness, or orphans, verify that the right entry files exist and are well-formed.
20
-
21
- ## What this pattern checks
22
-
23
- | # | Check | Pass criterion |
24
- |---|---|---|
25
- | 1 | `AGENTS.md` exists at repo root | Yes |
26
- | 2 | `AGENTS.md` has a "Where to find things" section | Yes — non-trivial section listing doc subfolders |
27
- | 3 | `AGENTS.md` has a "Memory primitives" section | Yes — points to ADRs, decisions, traces |
28
- | 4 | `AGENTS.md` has a `_Last reviewed:_` line or YAML `date:` | Yes |
29
- | 5 | If `CLAUDE.md` exists, it's a thin pointer (≤15 lines, references AGENTS.md) | Yes |
30
- | 6 | If `.cursor/rules` or `.cursorrules` exists, it's a thin pointer | Yes |
31
- | 7 | If `.windsurfrules` exists, it's a thin pointer | Yes |
32
- | 8 | If `.aider.conf.yml`, `.continue/`, etc., exist — examined for drift | Yes |
33
- | 9 | If `README.md` exists, it links to AGENTS.md (or AGENTS.md links from it) | Yes |
34
- | 10 | No two entry files contain conflicting content (drift detection) | Yes |
35
-
36
- ## Files to enumerate
37
-
38
- The following should be examined as candidate entry files for LLM coding agents:
39
-
40
- | Path | Tool / convention | Reads AGENTS.md natively? |
41
- |---|---|---|
42
- | `AGENTS.md` | The canonical multi-tool standard (AAIF/Linux Foundation, Aug 2025) | n/a |
43
- | `CLAUDE.md` | Anthropic Claude Code | **No** (issue #31005) |
44
- | `~/.claude/CLAUDE.md` | Claude Code user-global; `CLAUDE.local.md` for personal overrides | **No** |
45
- | `.cursorrules` | Cursor (deprecated, still works) | Yes, also reads AGENTS.md |
46
- | `.cursor/rules/*.mdc` | Cursor (current) | Yes, also reads AGENTS.md |
47
- | `.windsurfrules`, `.windsurf/rules/` | Windsurf (Cognition since Dec 2025) | Yes |
48
- | `.aider.conf.yml` + `CONVENTIONS.md` | Aider | Configurable (not auto) |
49
- | `.continue/rules/*.md` | Continue.dev | **Not yet** (issue #6716) |
50
- | `.github/copilot-instructions.md`, `.github/instructions/**/*.instructions.md` | GitHub Copilot | Yes (added 2025-08-28); also reads CLAUDE.md, GEMINI.md |
51
- | `README.md` | Human + LLM landing | n/a |
52
- | `CONTRIBUTING.md` | Contributor guide (often agent-relevant) | n/a |
53
- | `GEMINI.md` | Google Gemini CLI / Jules | Yes — primary |
54
- | `~/.codex/AGENTS.md`, `AGENTS.override.md` | OpenAI Codex (user-global, override) | Yes — primary |
55
-
56
- > **Not in this matrix:** `HERMES.md` doesn't exist as a convention (NousResearch's Hermes Agent uses `~/.hermes/skills/`, not a project file). `GAS_TOWN.md` doesn't exist either (Gas Town is Steve Yegge's multi-agent orchestrator, not an agent). See `../standards/cross-tool-matrix.md`.
57
-
58
- Some of these may not apply to a given repo; that's fine. The audit checks them and reports presence/absence.
59
-
60
- ## How to run the check (procedural)
61
-
62
- ```text
63
- 1. List files at repo root with names matching the entry-file table above.
64
- 2. For each found file:
65
- a. Get size, last-modified date.
66
- b. Read content.
67
- c. Classify: "fat" (>15 lines, looks like instructions) vs "thin" (≤15 lines, looks like a redirect).
68
- d. Extract any relative-path references (./docs/..., docs/...).
69
- 3. Determine canonical:
70
- a. If AGENTS.md exists and is fat → AGENTS.md is canonical.
71
- b. If AGENTS.md missing but CLAUDE.md is fat → recommend "promote CLAUDE.md → AGENTS.md".
72
- c. If multiple fat entry files exist → flag drift; recommend consolidation.
73
- 4. Verify thin-pointer expectation:
74
- a. For every entry file that is NOT canonical, check it is thin.
75
- b. If thin: pass.
76
- c. If fat: flag as drift risk.
77
- 5. For the canonical file, verify required sections:
78
- a. "Where to find things" / equivalent
79
- b. "Memory primitives" / equivalent
80
- c. Build / test / run commands
81
- d. Trust boundaries (optional but recommended)
82
- e. Date or "Last reviewed" line.
83
- ```
84
-
85
- ## Output shape (the gap-report row)
86
-
87
- For each finding, emit a row like:
88
-
89
- ```markdown
90
- - **MISSING — AGENTS.md** (severity: high)
91
- - The repo has no `AGENTS.md` at the root.
92
- - `CLAUDE.md` exists and is 240 lines, looks canonical.
93
- - **Recommendation:** rename `CLAUDE.md` → `AGENTS.md`, then create a thin `CLAUDE.md` redirecting to it.
94
- - **Recipe:** see `recipes/audit-existing-repo.md` step 4.
95
-
96
- - **DRIFT — CLAUDE.md vs .cursorrules** (severity: medium)
97
- - Both files contain non-trivial instructions but differ.
98
- - `CLAUDE.md`: 180 lines, lists `pnpm` build commands.
99
- - `.cursorrules`: 95 lines, lists `npm` build commands. Probably stale.
100
- - **Recommendation:** consolidate into AGENTS.md; demote both to thin pointers.
101
-
102
- - **NAKED ENTRY — AGENTS.md** (severity: medium)
103
- - `AGENTS.md` exists but has no "Where to find things" section.
104
- - Doc subfolders exist (`.brain/adrs/`, `PLAN.md`) but are unreachable from the entry file.
105
- - **Recommendation:** add a "Where to find things" section listing the subfolders. See `standards/agents-md-spec.md`.
106
- ```
107
-
108
- ## Severity rubric
109
-
110
- | Severity | Meaning | Examples |
111
- |---|---|---|
112
- | **Critical** | Entry-file is missing entirely; no LLM agent can read this repo | No AGENTS.md AND no CLAUDE.md AND no README.md with instructions |
113
- | **High** | Canonical entry-file missing; substantive content lives in a non-canonical file | No AGENTS.md, but fat CLAUDE.md exists |
114
- | **Medium** | Canonical exists but is incomplete or has drift risk | Fat AGENTS.md + fat CLAUDE.md (drift); naked AGENTS.md (no pointers) |
115
- | **Low** | Canonical and pointers correct, but missing dated metadata | AGENTS.md has no `_Last reviewed:_` line |
116
-
117
- ## Cross-references
118
-
119
- - AGENTS.md spec details: `../standards/agents-md-spec.md`
120
- - CLAUDE.md thin-pointer pattern: `../standards/claude-md-convention.md`
121
- - Pointer validation (next audit pattern): `pointer-validation.md`
122
- - Full audit recipe: `../recipes/audit-existing-repo.md`