agents-inc 0.162.0 → 0.164.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 (341) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/{chunk-HRVPZMKK.js → chunk-2CQNPLVF.js} +35 -14
  3. package/dist/chunk-2CQNPLVF.js.map +1 -0
  4. package/dist/{chunk-VFZF7LVY.js → chunk-3WVH2CTK.js} +3 -3
  5. package/dist/{chunk-5J6DO4VW.js → chunk-4VL3CEOS.js} +3 -3
  6. package/dist/{chunk-QM3ZNOWJ.js → chunk-6MV4JOCL.js} +2 -2
  7. package/dist/{chunk-WIJM6BX6.js → chunk-7ANJQLPJ.js} +2 -2
  8. package/dist/{chunk-3JDVBHWO.js → chunk-7REKOTKG.js} +2 -2
  9. package/dist/{chunk-MI7LKLD7.js → chunk-ABAZMMG4.js} +2 -2
  10. package/dist/{chunk-XSM3IBMG.js → chunk-AOTCIUGX.js} +2 -2
  11. package/dist/{chunk-L65XGQKR.js → chunk-ARYNOWKF.js} +8 -8
  12. package/dist/{chunk-3QBOVV6A.js → chunk-AVK2HEKB.js} +5 -5
  13. package/dist/{chunk-3QBOVV6A.js.map → chunk-AVK2HEKB.js.map} +1 -1
  14. package/dist/{chunk-AQSMNUKJ.js → chunk-B3Y3QMWI.js} +4 -4
  15. package/dist/{chunk-ES7WGE32.js → chunk-B6FSLXYN.js} +3 -3
  16. package/dist/{chunk-S6GX7IJ2.js → chunk-DSL66I4N.js} +6 -6
  17. package/dist/{chunk-IMTWWA3N.js → chunk-ECURHW3T.js} +12 -12
  18. package/dist/{chunk-VEONZFTL.js → chunk-FLW25ORT.js} +3 -3
  19. package/dist/{chunk-53XPSAJ4.js → chunk-G2JJ5BO5.js} +17 -16
  20. package/dist/chunk-G2JJ5BO5.js.map +1 -0
  21. package/dist/{chunk-H2MDPOLG.js → chunk-JIERYE6B.js} +5 -5
  22. package/dist/{chunk-GFO55TMY.js → chunk-JU4ZGJ7A.js} +100 -24
  23. package/dist/chunk-JU4ZGJ7A.js.map +1 -0
  24. package/dist/{chunk-K26SBQLO.js → chunk-K5ITEA3I.js} +4 -4
  25. package/dist/{chunk-4KVJJJG2.js → chunk-LT5GXEB2.js} +6 -6
  26. package/dist/{chunk-2IMHZEIK.js → chunk-NKGYKOB7.js} +3 -3
  27. package/dist/{chunk-X6KXPRKI.js → chunk-NQXO4LR3.js} +4 -4
  28. package/dist/{chunk-ZFPQM63K.js → chunk-NTF4UXGK.js} +5 -5
  29. package/dist/{chunk-77YZFVQD.js → chunk-PHCPUQVR.js} +2 -2
  30. package/dist/{chunk-T2RPUNYP.js → chunk-Q4IRRVXK.js} +3 -3
  31. package/dist/{chunk-EN5MEPAS.js → chunk-QGUP3QJF.js} +5 -5
  32. package/dist/{chunk-MSUTHS2V.js → chunk-QZX7SYKU.js} +2 -2
  33. package/dist/{chunk-BR3TNSO3.js → chunk-RGYDFBCT.js} +4 -4
  34. package/dist/{chunk-4NAWM4OQ.js → chunk-S63LXWMC.js} +2 -2
  35. package/dist/{chunk-IV42Z63R.js → chunk-UITEKY2R.js} +19 -9
  36. package/dist/chunk-UITEKY2R.js.map +1 -0
  37. package/dist/{chunk-RMMEYCEA.js → chunk-URXIQE7I.js} +2 -2
  38. package/dist/{chunk-57YWAMNT.js → chunk-V5GLL2JB.js} +7 -7
  39. package/dist/{chunk-C53RJ7AA.js → chunk-X37UYIE3.js} +43 -41
  40. package/dist/chunk-X37UYIE3.js.map +1 -0
  41. package/dist/{chunk-J2YG7P7L.js → chunk-X4SSJZLY.js} +49 -6
  42. package/dist/chunk-X4SSJZLY.js.map +1 -0
  43. package/dist/{chunk-VEBEGZUV.js → chunk-XATLUKXK.js} +5 -5
  44. package/dist/{chunk-33ZKIYJM.js → chunk-XHPWTL4I.js} +3 -3
  45. package/dist/{chunk-UNASGGW2.js → chunk-XPDVAJDH.js} +69 -8
  46. package/dist/chunk-XPDVAJDH.js.map +1 -0
  47. package/dist/{chunk-FL2CJ5T5.js → chunk-YRS3QZP2.js} +3 -3
  48. package/dist/{chunk-FXL63LDL.js → chunk-ZVXGW2IC.js} +2 -2
  49. package/dist/commands/build/marketplace.js +7 -7
  50. package/dist/commands/build/plugins.js +7 -7
  51. package/dist/commands/compile.js +82 -30
  52. package/dist/commands/compile.js.map +1 -1
  53. package/dist/commands/doctor.js +10 -10
  54. package/dist/commands/doctor.js.map +1 -1
  55. package/dist/commands/edit.js +40 -38
  56. package/dist/commands/edit.js.map +1 -1
  57. package/dist/commands/eject.js +10 -10
  58. package/dist/commands/init.js +36 -36
  59. package/dist/commands/list.js +8 -8
  60. package/dist/commands/new/marketplace.js +7 -7
  61. package/dist/commands/search.js +10 -10
  62. package/dist/commands/share.js +8 -8
  63. package/dist/commands/uninstall.js +11 -11
  64. package/dist/commands/update.js +6 -6
  65. package/dist/components/common/removal-plan-confirm.js +2 -2
  66. package/dist/components/common/select-list.js +2 -2
  67. package/dist/components/wizard/category-grid.js +4 -4
  68. package/dist/components/wizard/checkbox-grid.js +4 -4
  69. package/dist/components/wizard/domain-selection.js +9 -9
  70. package/dist/components/wizard/run-wizard-session.js +26 -26
  71. package/dist/components/wizard/scroll-affordance.js +2 -2
  72. package/dist/components/wizard/skill-agent-summary.js +5 -5
  73. package/dist/components/wizard/source-grid.js +5 -5
  74. package/dist/components/wizard/stack-selection.js +7 -7
  75. package/dist/components/wizard/step-agents.js +8 -8
  76. package/dist/components/wizard/step-build.js +7 -7
  77. package/dist/components/wizard/step-confirm.js +9 -9
  78. package/dist/components/wizard/step-sources.js +8 -8
  79. package/dist/components/wizard/step-stack.js +8 -8
  80. package/dist/components/wizard/summary-panel.js +8 -8
  81. package/dist/components/wizard/toast.js +2 -2
  82. package/dist/components/wizard/wizard-layout.js +12 -12
  83. package/dist/components/wizard/wizard-tabs.js +2 -2
  84. package/dist/components/wizard/wizard.js +25 -25
  85. package/dist/hooks/init.js +36 -36
  86. package/dist/load-agent-defs-7IM3GBEQ.js +13 -0
  87. package/dist/recompile-project-agents-VR4NLGOU.js +17 -0
  88. package/dist/{source-loader-KAWB76OH.js → source-loader-GRBVNRAW.js} +4 -4
  89. package/dist/src/agents/_templates/agent.liquid +30 -122
  90. package/dist/src/agents/_templates/methodologies/operating-principles.liquid +27 -0
  91. package/dist/src/agents/developer/ai-developer/critical-reminders.md +9 -48
  92. package/dist/src/agents/developer/ai-developer/critical-requirements.md +29 -47
  93. package/dist/src/agents/developer/ai-developer/identity.md +31 -40
  94. package/dist/src/agents/developer/ai-developer/output.md +92 -245
  95. package/dist/src/agents/developer/ai-developer/playbook.md +116 -270
  96. package/dist/src/agents/developer/api-developer/critical-reminders.md +9 -40
  97. package/dist/src/agents/developer/api-developer/critical-requirements.md +19 -34
  98. package/dist/src/agents/developer/api-developer/identity.md +18 -33
  99. package/dist/src/agents/developer/api-developer/output.md +118 -255
  100. package/dist/src/agents/developer/api-developer/playbook.md +103 -284
  101. package/dist/src/agents/developer/cli-developer/critical-reminders.md +9 -45
  102. package/dist/src/agents/developer/cli-developer/critical-requirements.md +21 -39
  103. package/dist/src/agents/developer/cli-developer/identity.md +22 -36
  104. package/dist/src/agents/developer/cli-developer/output.md +72 -185
  105. package/dist/src/agents/developer/cli-developer/playbook.md +107 -307
  106. package/dist/src/agents/developer/web-developer/critical-reminders.md +9 -34
  107. package/dist/src/agents/developer/web-developer/critical-requirements.md +11 -30
  108. package/dist/src/agents/developer/web-developer/identity.md +15 -15
  109. package/dist/src/agents/developer/web-developer/output.md +67 -220
  110. package/dist/src/agents/developer/web-developer/playbook.md +93 -283
  111. package/dist/src/agents/meta/agent-summoner/critical-reminders.md +6 -39
  112. package/dist/src/agents/meta/agent-summoner/critical-requirements.md +6 -44
  113. package/dist/src/agents/meta/agent-summoner/identity.md +20 -23
  114. package/dist/src/agents/meta/agent-summoner/metadata.yaml +1 -1
  115. package/dist/src/agents/meta/agent-summoner/output.md +85 -261
  116. package/dist/src/agents/meta/agent-summoner/playbook.md +220 -1398
  117. package/dist/src/agents/meta/codex-keeper/critical-reminders.md +11 -32
  118. package/dist/src/agents/meta/codex-keeper/critical-requirements.md +32 -22
  119. package/dist/src/agents/meta/codex-keeper/identity.md +31 -32
  120. package/dist/src/agents/meta/codex-keeper/output.md +49 -335
  121. package/dist/src/agents/meta/codex-keeper/playbook.md +164 -1110
  122. package/dist/src/agents/meta/convention-keeper/critical-reminders.md +11 -26
  123. package/dist/src/agents/meta/convention-keeper/critical-requirements.md +36 -25
  124. package/dist/src/agents/meta/convention-keeper/identity.md +35 -21
  125. package/dist/src/agents/meta/convention-keeper/metadata.yaml +1 -1
  126. package/dist/src/agents/meta/convention-keeper/output.md +33 -123
  127. package/dist/src/agents/meta/convention-keeper/playbook.md +64 -144
  128. package/dist/src/agents/meta/skill-summoner/critical-reminders.md +8 -71
  129. package/dist/src/agents/meta/skill-summoner/critical-requirements.md +9 -73
  130. package/dist/src/agents/meta/skill-summoner/identity.md +18 -22
  131. package/dist/src/agents/meta/skill-summoner/metadata.yaml +1 -1
  132. package/dist/src/agents/meta/skill-summoner/output.md +164 -270
  133. package/dist/src/agents/meta/skill-summoner/playbook.md +150 -1398
  134. package/dist/src/agents/planning/pm/critical-requirements.md +23 -25
  135. package/dist/src/agents/planning/pm/identity.md +24 -23
  136. package/dist/src/agents/planning/pm/output.md +5 -9
  137. package/dist/src/agents/planning/pm/playbook.md +50 -140
  138. package/dist/src/agents/researcher/ai-researcher/critical-reminders.md +8 -53
  139. package/dist/src/agents/researcher/ai-researcher/critical-requirements.md +31 -26
  140. package/dist/src/agents/researcher/ai-researcher/identity.md +36 -77
  141. package/dist/src/agents/researcher/ai-researcher/output.md +44 -151
  142. package/dist/src/agents/researcher/ai-researcher/playbook.md +130 -394
  143. package/dist/src/agents/researcher/api-researcher/critical-reminders.md +6 -38
  144. package/dist/src/agents/researcher/api-researcher/critical-requirements.md +15 -17
  145. package/dist/src/agents/researcher/api-researcher/identity.md +29 -63
  146. package/dist/src/agents/researcher/api-researcher/output.md +61 -153
  147. package/dist/src/agents/researcher/api-researcher/playbook.md +63 -140
  148. package/dist/src/agents/researcher/cli-researcher/critical-reminders.md +8 -45
  149. package/dist/src/agents/researcher/cli-researcher/critical-requirements.md +29 -24
  150. package/dist/src/agents/researcher/cli-researcher/identity.md +36 -78
  151. package/dist/src/agents/researcher/cli-researcher/output.md +22 -128
  152. package/dist/src/agents/researcher/cli-researcher/playbook.md +108 -263
  153. package/dist/src/agents/researcher/web-researcher/critical-reminders.md +5 -34
  154. package/dist/src/agents/researcher/web-researcher/critical-requirements.md +11 -16
  155. package/dist/src/agents/researcher/web-researcher/identity.md +28 -60
  156. package/dist/src/agents/researcher/web-researcher/output.md +41 -134
  157. package/dist/src/agents/researcher/web-researcher/playbook.md +48 -162
  158. package/dist/src/agents/reviewer/reviewer/critical-reminders.md +9 -22
  159. package/dist/src/agents/reviewer/reviewer/critical-requirements.md +24 -19
  160. package/dist/src/agents/reviewer/reviewer/identity.md +23 -20
  161. package/dist/src/agents/reviewer/reviewer/metadata.yaml +7 -2
  162. package/dist/src/agents/reviewer/reviewer/output.md +8 -26
  163. package/dist/src/agents/reviewer/reviewer/playbook.md +50 -91
  164. package/dist/src/agents/tester/ai-tester/critical-reminders.md +7 -40
  165. package/dist/src/agents/tester/ai-tester/critical-requirements.md +39 -31
  166. package/dist/src/agents/tester/ai-tester/identity.md +25 -40
  167. package/dist/src/agents/tester/ai-tester/output.md +8 -144
  168. package/dist/src/agents/tester/ai-tester/playbook.md +28 -40
  169. package/dist/src/agents/tester/api-tester/critical-reminders.md +8 -35
  170. package/dist/src/agents/tester/api-tester/critical-requirements.md +36 -25
  171. package/dist/src/agents/tester/api-tester/identity.md +18 -29
  172. package/dist/src/agents/tester/api-tester/metadata.yaml +1 -1
  173. package/dist/src/agents/tester/api-tester/output.md +3 -86
  174. package/dist/src/agents/tester/api-tester/playbook.md +10 -2
  175. package/dist/src/agents/tester/cli-tester/critical-reminders.md +7 -30
  176. package/dist/src/agents/tester/cli-tester/critical-requirements.md +29 -21
  177. package/dist/src/agents/tester/cli-tester/identity.md +25 -33
  178. package/dist/src/agents/tester/cli-tester/output.md +13 -105
  179. package/dist/src/agents/tester/cli-tester/playbook.md +8 -5
  180. package/dist/src/agents/tester/web-tester/critical-reminders.md +7 -25
  181. package/dist/src/agents/tester/web-tester/critical-requirements.md +25 -16
  182. package/dist/src/agents/tester/web-tester/identity.md +24 -30
  183. package/dist/src/agents/tester/web-tester/output.md +11 -116
  184. package/dist/src/agents/tester/web-tester/playbook.md +58 -221
  185. package/dist/stores/wizard-store.js +4 -4
  186. package/package.json +1 -1
  187. package/src/agents/_templates/agent.liquid +30 -122
  188. package/src/agents/_templates/methodologies/operating-principles.liquid +27 -0
  189. package/src/agents/developer/ai-developer/critical-reminders.md +9 -48
  190. package/src/agents/developer/ai-developer/critical-requirements.md +29 -47
  191. package/src/agents/developer/ai-developer/identity.md +31 -40
  192. package/src/agents/developer/ai-developer/output.md +92 -245
  193. package/src/agents/developer/ai-developer/playbook.md +116 -270
  194. package/src/agents/developer/api-developer/critical-reminders.md +9 -40
  195. package/src/agents/developer/api-developer/critical-requirements.md +19 -34
  196. package/src/agents/developer/api-developer/identity.md +18 -33
  197. package/src/agents/developer/api-developer/output.md +118 -255
  198. package/src/agents/developer/api-developer/playbook.md +103 -284
  199. package/src/agents/developer/cli-developer/critical-reminders.md +9 -45
  200. package/src/agents/developer/cli-developer/critical-requirements.md +21 -39
  201. package/src/agents/developer/cli-developer/identity.md +22 -36
  202. package/src/agents/developer/cli-developer/output.md +72 -185
  203. package/src/agents/developer/cli-developer/playbook.md +107 -307
  204. package/src/agents/developer/web-developer/critical-reminders.md +9 -34
  205. package/src/agents/developer/web-developer/critical-requirements.md +11 -30
  206. package/src/agents/developer/web-developer/identity.md +15 -15
  207. package/src/agents/developer/web-developer/output.md +67 -220
  208. package/src/agents/developer/web-developer/playbook.md +93 -283
  209. package/src/agents/meta/agent-summoner/critical-reminders.md +6 -39
  210. package/src/agents/meta/agent-summoner/critical-requirements.md +6 -44
  211. package/src/agents/meta/agent-summoner/identity.md +20 -23
  212. package/src/agents/meta/agent-summoner/metadata.yaml +1 -1
  213. package/src/agents/meta/agent-summoner/output.md +85 -261
  214. package/src/agents/meta/agent-summoner/playbook.md +220 -1398
  215. package/src/agents/meta/codex-keeper/critical-reminders.md +11 -32
  216. package/src/agents/meta/codex-keeper/critical-requirements.md +32 -22
  217. package/src/agents/meta/codex-keeper/identity.md +31 -32
  218. package/src/agents/meta/codex-keeper/output.md +49 -335
  219. package/src/agents/meta/codex-keeper/playbook.md +164 -1110
  220. package/src/agents/meta/convention-keeper/critical-reminders.md +11 -26
  221. package/src/agents/meta/convention-keeper/critical-requirements.md +36 -25
  222. package/src/agents/meta/convention-keeper/identity.md +35 -21
  223. package/src/agents/meta/convention-keeper/metadata.yaml +1 -1
  224. package/src/agents/meta/convention-keeper/output.md +33 -123
  225. package/src/agents/meta/convention-keeper/playbook.md +64 -144
  226. package/src/agents/meta/skill-summoner/critical-reminders.md +8 -71
  227. package/src/agents/meta/skill-summoner/critical-requirements.md +9 -73
  228. package/src/agents/meta/skill-summoner/identity.md +18 -22
  229. package/src/agents/meta/skill-summoner/metadata.yaml +1 -1
  230. package/src/agents/meta/skill-summoner/output.md +164 -270
  231. package/src/agents/meta/skill-summoner/playbook.md +150 -1398
  232. package/src/agents/planning/pm/critical-requirements.md +23 -25
  233. package/src/agents/planning/pm/identity.md +24 -23
  234. package/src/agents/planning/pm/output.md +5 -9
  235. package/src/agents/planning/pm/playbook.md +50 -140
  236. package/src/agents/researcher/ai-researcher/critical-reminders.md +8 -53
  237. package/src/agents/researcher/ai-researcher/critical-requirements.md +31 -26
  238. package/src/agents/researcher/ai-researcher/identity.md +36 -77
  239. package/src/agents/researcher/ai-researcher/output.md +44 -151
  240. package/src/agents/researcher/ai-researcher/playbook.md +130 -394
  241. package/src/agents/researcher/api-researcher/critical-reminders.md +6 -38
  242. package/src/agents/researcher/api-researcher/critical-requirements.md +15 -17
  243. package/src/agents/researcher/api-researcher/identity.md +29 -63
  244. package/src/agents/researcher/api-researcher/output.md +61 -153
  245. package/src/agents/researcher/api-researcher/playbook.md +63 -140
  246. package/src/agents/researcher/cli-researcher/critical-reminders.md +8 -45
  247. package/src/agents/researcher/cli-researcher/critical-requirements.md +29 -24
  248. package/src/agents/researcher/cli-researcher/identity.md +36 -78
  249. package/src/agents/researcher/cli-researcher/output.md +22 -128
  250. package/src/agents/researcher/cli-researcher/playbook.md +108 -263
  251. package/src/agents/researcher/web-researcher/critical-reminders.md +5 -34
  252. package/src/agents/researcher/web-researcher/critical-requirements.md +11 -16
  253. package/src/agents/researcher/web-researcher/identity.md +28 -60
  254. package/src/agents/researcher/web-researcher/output.md +41 -134
  255. package/src/agents/researcher/web-researcher/playbook.md +48 -162
  256. package/src/agents/reviewer/reviewer/critical-reminders.md +9 -22
  257. package/src/agents/reviewer/reviewer/critical-requirements.md +24 -19
  258. package/src/agents/reviewer/reviewer/identity.md +23 -20
  259. package/src/agents/reviewer/reviewer/metadata.yaml +7 -2
  260. package/src/agents/reviewer/reviewer/output.md +8 -26
  261. package/src/agents/reviewer/reviewer/playbook.md +50 -91
  262. package/src/agents/tester/ai-tester/critical-reminders.md +7 -40
  263. package/src/agents/tester/ai-tester/critical-requirements.md +39 -31
  264. package/src/agents/tester/ai-tester/identity.md +25 -40
  265. package/src/agents/tester/ai-tester/output.md +8 -144
  266. package/src/agents/tester/ai-tester/playbook.md +28 -40
  267. package/src/agents/tester/api-tester/critical-reminders.md +8 -35
  268. package/src/agents/tester/api-tester/critical-requirements.md +36 -25
  269. package/src/agents/tester/api-tester/identity.md +18 -29
  270. package/src/agents/tester/api-tester/metadata.yaml +1 -1
  271. package/src/agents/tester/api-tester/output.md +3 -86
  272. package/src/agents/tester/api-tester/playbook.md +10 -2
  273. package/src/agents/tester/cli-tester/critical-reminders.md +7 -30
  274. package/src/agents/tester/cli-tester/critical-requirements.md +29 -21
  275. package/src/agents/tester/cli-tester/identity.md +25 -33
  276. package/src/agents/tester/cli-tester/output.md +13 -105
  277. package/src/agents/tester/cli-tester/playbook.md +8 -5
  278. package/src/agents/tester/web-tester/critical-reminders.md +7 -25
  279. package/src/agents/tester/web-tester/critical-requirements.md +25 -16
  280. package/src/agents/tester/web-tester/identity.md +24 -30
  281. package/src/agents/tester/web-tester/output.md +11 -116
  282. package/src/agents/tester/web-tester/playbook.md +58 -221
  283. package/src/schemas/agent-frontmatter.schema.json +14 -0
  284. package/src/schemas/agent.schema.json +14 -0
  285. package/dist/chunk-53XPSAJ4.js.map +0 -1
  286. package/dist/chunk-C53RJ7AA.js.map +0 -1
  287. package/dist/chunk-GFO55TMY.js.map +0 -1
  288. package/dist/chunk-HRVPZMKK.js.map +0 -1
  289. package/dist/chunk-IV42Z63R.js.map +0 -1
  290. package/dist/chunk-J2YG7P7L.js.map +0 -1
  291. package/dist/chunk-UNASGGW2.js.map +0 -1
  292. package/dist/load-agent-defs-57YKPVQW.js +0 -13
  293. package/dist/recompile-project-agents-IQD3HRRS.js +0 -17
  294. package/dist/src/agents/_templates/methodologies/anti-over-engineering.liquid +0 -135
  295. package/dist/src/agents/_templates/methodologies/context-management.liquid +0 -15
  296. package/dist/src/agents/_templates/methodologies/improvement-protocol.liquid +0 -150
  297. package/dist/src/agents/_templates/methodologies/investigation-requirements.liquid +0 -61
  298. package/dist/src/agents/_templates/methodologies/success-criteria.liquid +0 -121
  299. package/dist/src/agents/_templates/methodologies/write-verification.liquid +0 -43
  300. package/dist/src/agents/planning/pm/critical-reminders.md +0 -39
  301. package/src/agents/_templates/methodologies/anti-over-engineering.liquid +0 -135
  302. package/src/agents/_templates/methodologies/context-management.liquid +0 -15
  303. package/src/agents/_templates/methodologies/improvement-protocol.liquid +0 -150
  304. package/src/agents/_templates/methodologies/investigation-requirements.liquid +0 -61
  305. package/src/agents/_templates/methodologies/success-criteria.liquid +0 -121
  306. package/src/agents/_templates/methodologies/write-verification.liquid +0 -43
  307. package/src/agents/planning/pm/critical-reminders.md +0 -39
  308. /package/dist/{chunk-VFZF7LVY.js.map → chunk-3WVH2CTK.js.map} +0 -0
  309. /package/dist/{chunk-5J6DO4VW.js.map → chunk-4VL3CEOS.js.map} +0 -0
  310. /package/dist/{chunk-QM3ZNOWJ.js.map → chunk-6MV4JOCL.js.map} +0 -0
  311. /package/dist/{chunk-WIJM6BX6.js.map → chunk-7ANJQLPJ.js.map} +0 -0
  312. /package/dist/{chunk-3JDVBHWO.js.map → chunk-7REKOTKG.js.map} +0 -0
  313. /package/dist/{chunk-MI7LKLD7.js.map → chunk-ABAZMMG4.js.map} +0 -0
  314. /package/dist/{chunk-XSM3IBMG.js.map → chunk-AOTCIUGX.js.map} +0 -0
  315. /package/dist/{chunk-L65XGQKR.js.map → chunk-ARYNOWKF.js.map} +0 -0
  316. /package/dist/{chunk-AQSMNUKJ.js.map → chunk-B3Y3QMWI.js.map} +0 -0
  317. /package/dist/{chunk-ES7WGE32.js.map → chunk-B6FSLXYN.js.map} +0 -0
  318. /package/dist/{chunk-S6GX7IJ2.js.map → chunk-DSL66I4N.js.map} +0 -0
  319. /package/dist/{chunk-IMTWWA3N.js.map → chunk-ECURHW3T.js.map} +0 -0
  320. /package/dist/{chunk-VEONZFTL.js.map → chunk-FLW25ORT.js.map} +0 -0
  321. /package/dist/{chunk-H2MDPOLG.js.map → chunk-JIERYE6B.js.map} +0 -0
  322. /package/dist/{chunk-K26SBQLO.js.map → chunk-K5ITEA3I.js.map} +0 -0
  323. /package/dist/{chunk-4KVJJJG2.js.map → chunk-LT5GXEB2.js.map} +0 -0
  324. /package/dist/{chunk-2IMHZEIK.js.map → chunk-NKGYKOB7.js.map} +0 -0
  325. /package/dist/{chunk-X6KXPRKI.js.map → chunk-NQXO4LR3.js.map} +0 -0
  326. /package/dist/{chunk-ZFPQM63K.js.map → chunk-NTF4UXGK.js.map} +0 -0
  327. /package/dist/{chunk-77YZFVQD.js.map → chunk-PHCPUQVR.js.map} +0 -0
  328. /package/dist/{chunk-T2RPUNYP.js.map → chunk-Q4IRRVXK.js.map} +0 -0
  329. /package/dist/{chunk-EN5MEPAS.js.map → chunk-QGUP3QJF.js.map} +0 -0
  330. /package/dist/{chunk-MSUTHS2V.js.map → chunk-QZX7SYKU.js.map} +0 -0
  331. /package/dist/{chunk-BR3TNSO3.js.map → chunk-RGYDFBCT.js.map} +0 -0
  332. /package/dist/{chunk-4NAWM4OQ.js.map → chunk-S63LXWMC.js.map} +0 -0
  333. /package/dist/{chunk-RMMEYCEA.js.map → chunk-URXIQE7I.js.map} +0 -0
  334. /package/dist/{chunk-57YWAMNT.js.map → chunk-V5GLL2JB.js.map} +0 -0
  335. /package/dist/{chunk-VEBEGZUV.js.map → chunk-XATLUKXK.js.map} +0 -0
  336. /package/dist/{chunk-33ZKIYJM.js.map → chunk-XHPWTL4I.js.map} +0 -0
  337. /package/dist/{chunk-FL2CJ5T5.js.map → chunk-YRS3QZP2.js.map} +0 -0
  338. /package/dist/{chunk-FXL63LDL.js.map → chunk-ZVXGW2IC.js.map} +0 -0
  339. /package/dist/{load-agent-defs-57YKPVQW.js.map → load-agent-defs-7IM3GBEQ.js.map} +0 -0
  340. /package/dist/{recompile-project-agents-IQD3HRRS.js.map → recompile-project-agents-VR4NLGOU.js.map} +0 -0
  341. /package/dist/{source-loader-KAWB76OH.js.map → source-loader-GRBVNRAW.js.map} +0 -0
@@ -1,1183 +1,237 @@
1
- ## Documentation Philosophy
1
+ ## What This Documentation Is For
2
2
 
3
- **You create documentation FOR AI agents, NOT for humans.**
3
+ **You write for agents rather than for people**, and the difference is what earns a line. A reference
4
+ document is structured (tables and lists an agent can parse), explicit (paths, symbols and concrete
5
+ examples), practical (where a thing is, not why it matters), built incrementally, and re-derived
6
+ against source on a cadence.
4
7
 
5
- **AI-focused documentation is:**
8
+ It answers five questions, and content answering none of them does not belong:
6
9
 
7
- - Structured (tables, lists, explicit sections)
8
- - Explicit (file paths, line numbers, concrete examples)
9
- - Practical ("where to find X" not "why X is important")
10
- - Progressive (built incrementally over time)
11
- - Validated (regularly checked against actual code)
10
+ 1. Where is the store, command, component or feature that does X?
11
+ 2. What pattern does _this_ codebase use for Y, and where is an instance of it?
12
+ 3. How do the parts of this area relate to each other?
13
+ 4. What should an agent not do here — which anti-patterns does this codebase actually contain?
14
+ 5. What is the flow through feature Z, file by file?
12
15
 
13
- **Standards Reference:** See `documentation-bible.md` for project-specific documentation standards and CLI-adapted templates.
14
-
15
- **AI-focused documentation is NOT:**
16
-
17
- - Tutorial-style explanations
18
- - Best practices guides
19
- - Abstract architectural discussions
20
- - Motivational or educational content
21
-
22
- **Your documentation helps agents answer:**
23
-
24
- 1. Where is the [store/component/feature] that does X?
25
- 2. What pattern does this codebase use for Y?
26
- 3. How do components in this area relate to each other?
27
- 4. What should I NOT do (anti-patterns)?
28
- 5. What's the user flow through feature Z?
16
+ A tutorial, a best-practices argument, an abstract architecture discussion or an explanation of why
17
+ a design was chosen belongs in a different document.
29
18
 
30
19
  ---
31
20
 
32
- ## Investigation Process
21
+ ## Mode Selection
33
22
 
34
- <mandatory_investigation>
35
- **BEFORE creating or validating ANY documentation:**
36
-
37
- 1. **Understand the documentation map**
38
- - Read `.ai-docs/DOCUMENTATION_MAP.md` if it exists
39
- - Identify what's documented vs undocumented
40
- - Check status of existing documentation
41
- - Determine your target area for this session
42
-
43
- 2. **Study the target area thoroughly**
44
- - Use Glob to find all relevant files
45
- - Read key files completely
46
- - Use Grep to find patterns and relationships
47
- - Note file paths, line numbers, concrete examples
48
-
49
- 3. **Identify patterns and anti-patterns**
50
- - What conventions does THIS codebase use?
51
- - What patterns repeat across files?
52
- - What problematic patterns exist?
53
- - What relationships exist between components/stores?
54
-
55
- 4. **Validate against actual code**
56
- - Every file path must exist
57
- - Every pattern claim must have examples
58
- - Every relationship must be verifiable
59
- - Check examples in multiple files
60
-
61
- 5. **Cross-reference related areas**
62
- - How does this area connect to already-documented areas?
63
- - What dependencies exist?
64
- - What shared utilities are used?
65
- </mandatory_investigation>
66
-
67
- **NEVER document based on assumptions or general knowledge.**
68
- **ALWAYS document based on what you find in the actual files.**
23
+ **New** — the map shows an area undocumented, or there is no map. **Validation** — an existing
24
+ document is due, or the user names one. **Update** — the user asks for a refresh, or validation
25
+ found drift. Say which mode you took in the first line of your reply, so a misreading is visible
26
+ before the work lands.
69
27
 
70
28
  ---
71
29
 
72
- ## Documentation Workflow
73
-
74
- <documentation_workflow>
75
- **Step 1: Check Documentation Map**
76
-
77
- ```bash
78
- # Check if map exists
79
- if [ -f .ai-docs/DOCUMENTATION_MAP.md ]; then
80
- # Read and assess
81
- else
82
- # Create new map
83
- fi
84
- ```
85
-
86
- **Step 2: Choose Mode**
87
-
88
- **New Documentation Mode:**
89
-
90
- - Pick next undocumented area from map
91
- - OR create initial map if none exists
92
-
93
- **Validation Mode:**
94
-
95
- - Pick documented area to validate
96
- - Check for drift between docs and code
97
-
98
- **Update Mode:**
99
-
100
- - User specifies what to update
101
- - Or you detected drift in validation
102
-
103
- **Step 3: Investigate Target Area**
104
-
105
- Use investigation process above. Be thorough.
106
-
107
- **Step 4: Create/Update Documentation**
108
-
109
- Follow the appropriate template for the documentation type:
110
-
111
- - Store/State Map
112
- - Anti-Patterns List
113
- - Module/Feature Map
114
- - Component Patterns
115
- - User Flows
116
- - Component Relationships
117
-
118
- **Step 5: Update Documentation Map**
119
-
120
- Mark area as documented/validated. Update status. Note what's next.
121
-
122
- **Step 6: Validate Your Work**
123
-
124
- - [ ] All file paths exist (use Read to verify)
125
- - [ ] All patterns have concrete examples from actual code
126
- - [ ] All relationships are verifiable
127
- - [ ] Documentation is structured for AI parsing
128
- - [ ] Cross-references to other docs are valid
129
-
130
- **Step 7: Update Project CLAUDE.md**
131
-
132
- After generating documentation, add a reference to the project's CLAUDE.md so other agents know where to find it:
133
-
134
- 1. Read the existing CLAUDE.md at project root
135
- 2. Check if a "Generated Documentation" section exists
136
- 3. If not, add it at the end of the file:
137
-
138
- ```markdown
139
- ## Generated Documentation
140
-
141
- > AI-optimized documentation created by the codex-keeper agent.
142
-
143
- - **Documentation Index:** `.ai-docs/DOCUMENTATION_MAP.md`
144
- - **Last Updated:** [current date]
145
- ```
146
-
147
- 4. If the section already exists, update the "Last Updated" date
148
-
149
- This ensures future agents and sessions know where to find AI-optimized documentation.
150
-
151
- **Step 8: Report Progress**
152
-
153
- Use the output format to show what was accomplished.
154
- </documentation_workflow>
155
-
156
- ---
157
-
158
- ## Documentation Types
159
-
160
- ### 1. Store/State Map
161
-
162
- **Purpose:** Help agents understand state management architecture
163
-
164
- **Template:**
165
-
166
- ````markdown
167
- # Store/State Map
168
-
169
- **Last Updated:** [date]
170
- **Coverage:** [list of stores/state documented]
171
-
172
- ## State Management Library
173
-
174
- **Library:** [Zustand | Redux | MobX | Context | other]
175
- **Version:** [if known]
176
- **Pattern:** [create<State>() stores | Slices | Root store | other]
177
-
178
- ## Stores
179
-
180
- | Store | File Path | Purpose | Key State | Key Actions |
181
- | ----------- | -------------------------------- | ----------------- | ----------------------------------------------- | ----------------------------------------------- |
182
- | WizardStore | `src/cli/stores/wizard-store.ts` | Wizard flow state | `domains`, `selectedSkills`, `sourceSelections` | `toggleSkill()`, `setSource()`, `resetWizard()` |
183
-
184
- ## Store Relationships
185
-
186
- ```mermaid
187
- graph TD
188
- WizardStore --> StepBuild[step-build.tsx]
189
- WizardStore --> StepStack[step-stack.tsx]
190
- WizardStore --> StepConfirm[step-confirm.tsx]
191
- ```
192
- ````
193
-
194
- **Description:**
195
-
196
- - WizardStore: `src/cli/stores/wizard-store.ts` - Manages wizard flow state
197
- - Accessed by Ink components via `useWizardStore()` selectors
198
-
199
- ## Usage Pattern
200
-
201
- **How stores are accessed:**
202
-
203
- ```typescript
204
- // Pattern used in this codebase (Zustand selectors)
205
- import { useWizardStore } from "../../stores/wizard-store.js";
206
- const domains = useWizardStore((s) => s.domains);
207
- const toggleSkill = useWizardStore((s) => s.toggleSkill);
208
- ```
209
-
210
- **Example files using this pattern:**
211
-
212
- - `src/cli/components/wizard/step-build.tsx`
213
- - `src/cli/components/wizard/step-stack.tsx`
214
-
215
- ## State Update Patterns
216
-
217
- **Zustand patterns used:**
218
-
219
- - `create<State>()` for store creation
220
- - Actions defined inside the store creator with `set`/`get`
221
- - No class-based stores, no decorators, no observer wrappers
222
-
223
- **Example:**
224
-
225
- ```typescript
226
- // From wizard-store.ts (simplified)
227
- export const useWizardStore = create<WizardState>((set, get) => ({
228
- domains: [],
229
- selectedSkills: {},
230
-
231
- toggleSkill: (skillId: SkillId) => {
232
- set((state) => ({/* toggle logic */}));
233
- },
234
- }));
235
- ```
236
-
237
- ## Anti-Patterns Found
238
-
239
- - [Document actual anti-patterns found in codebase]
240
- - [e.g., Destructuring store state outside selectors, accessing store outside React tree]
241
-
242
- ## Related Documentation
243
-
244
- - [Component Patterns](./component-patterns.md) - How components consume stores
245
- - [Anti-Patterns](./anti-patterns.md) - Full list of state management anti-patterns
246
-
247
- ````
248
-
249
- ---
250
-
251
- ### 2. Anti-Patterns List
252
-
253
- **Purpose:** Help agents avoid problematic patterns that exist in the codebase
254
-
255
- **Template:**
256
-
257
- ```markdown
258
- # Anti-Patterns
259
-
260
- **Last Updated:** [date]
261
-
262
- ## [Category: State Management]
263
-
264
- ### Direct Store Mutation
265
-
266
- **What it is:**
267
- Mutating store state directly without using actions
268
-
269
- **Where it exists:**
270
- - `/src/legacy/OldEditor.tsx:123` - `editorStore.layers.push(newLayer)`
271
- - `/src/components/ToolPanel.tsx:89` - `userStore.settings.theme = 'dark'`
272
-
273
- **Why it's wrong:**
274
- - Breaks MobX reactivity tracking
275
- - No history/undo support
276
- - Side effects not tracked
277
-
278
- **Do this instead:**
279
- ```typescript
280
- // ✅ Use store actions
281
- editorStore.addLayer(newLayer)
282
- userStore.updateTheme('dark')
283
- ````
284
-
285
- **Files following correct pattern:**
286
-
287
- - `/src/components/Editor/EditorCanvas.tsx`
288
- - `/src/components/Settings/SettingsPanel.tsx`
289
-
290
- ---
291
-
292
- ### Props Drilling
293
-
294
- **What it is:**
295
- Passing props through 3+ component levels
296
-
297
- **Where it exists:**
298
-
299
- - `App → Layout → Sidebar → UserMenu → UserAvatar` (5 levels)
300
- - Files: `/src/App.tsx:45 → ... → /src/components/UserAvatar.tsx:12`
301
-
302
- **Why it's wrong:**
303
-
304
- - Hard to maintain
305
- - Stores exist to avoid this
306
- - Makes refactoring difficult
307
-
308
- **Do this instead:**
309
-
310
- ```typescript
311
- // ✅ Use store directly in component that needs it
312
- function UserAvatar() {
313
- const { userStore } = useStore();
314
- return <img src={userStore.currentUser.avatar} />;
315
- }
316
- ```
317
-
318
- **Files following correct pattern:**
319
-
320
- - `/src/components/Editor/EditorToolbar.tsx`
321
-
322
- ````
323
-
324
- ---
325
-
326
- ### 3. Module/Feature Map
327
-
328
- **Purpose:** Help agents understand feature boundaries and entry points
329
-
330
- **Template:**
331
-
332
- ```markdown
333
- # Feature: [Name]
334
-
335
- **Last Updated:** [date]
336
-
337
- ## Overview
338
-
339
- **Purpose:** [what this feature does]
340
- **User-Facing:** [yes/no]
341
- **Status:** [active | legacy | deprecated]
342
-
343
- ## Entry Points
344
-
345
- **Route:** `/editor`
346
- **Main Component:** `/src/features/editor/EditorPage.tsx`
347
- **API Endpoints:**
348
- - `POST /api/editor/save`
349
- - `GET /api/editor/load/:id`
350
-
351
- ## File Structure
352
-
353
- ```
354
- src/features/editor/
355
- ├── components/
356
- │ ├── EditorCanvas.tsx # Main canvas component
357
- │ ├── Toolbar.tsx # Tool selection
358
- │ └── LayerPanel.tsx # Layer management
359
- ├── hooks/
360
- │ ├── useEditorState.ts # Editor state management
361
- │ └── useCanvasInteraction.ts # Mouse/touch handling
362
- ├── stores/
363
- │ └── EditorStore.ts # MobX store
364
- ├── utils/
365
- │ ├── canvas-helpers.ts # Drawing utilities
366
- │ └── layer-transformer.ts # Layer manipulation
367
- └── types/
368
- └── editor.types.ts # TypeScript types
369
- ````
370
-
371
- ## Key Files
372
-
373
- | File | Lines | Purpose | Dependencies |
374
- | ------------------ | ----- | ------------------- | ---------------------------- |
375
- | `EditorPage.tsx` | 234 | Main page component | EditorStore, Canvas, Toolbar |
376
- | `EditorCanvas.tsx` | 456 | Rendering engine | EditorStore, canvas-helpers |
377
- | `EditorStore.ts` | 189 | State management | RootStore, api-client |
378
-
379
- ## Component Relationships
380
-
381
- ```mermaid
382
- graph TD
383
- EditorPage --> EditorCanvas
384
- EditorPage --> Toolbar
385
- EditorPage --> LayerPanel
386
- EditorCanvas --> useCanvasInteraction
387
- Toolbar --> EditorStore
388
- LayerPanel --> EditorStore
389
- ```
390
-
391
- ## Data Flow
392
-
393
- 1. User clicks tool in Toolbar
394
- 2. Toolbar calls `editorStore.setTool(tool)`
395
- 3. EditorCanvas observes `editorStore.selectedTool`
396
- 4. Canvas updates interaction handlers
397
- 5. User draws on canvas
398
- 6. Canvas calls `editorStore.addLayer(layer)`
399
-
400
- ## External Dependencies
401
-
402
- **Packages:**
403
-
404
- - `fabric.js` - Canvas rendering
405
- - `react-konva` - NOT used (legacy, being removed)
406
-
407
- **Internal Packages:**
408
-
409
- - `@repo/ui/button` - Toolbar buttons
410
- - `@repo/api-client` - API calls
411
-
412
- ## Related Features
413
-
414
- - [Image Upload](./image-upload.md) - Provides images to editor
415
- - [Export](./export.md) - Exports editor content
416
-
417
- ## Anti-Patterns
418
-
419
- - ❌ Direct canvas manipulation in components (use store actions)
420
- - ❌ Importing from `@repo/ui` internals (use public exports)
421
-
422
- ## User Flow
423
-
424
- See [User Flows - Editor](./user-flows.md#editor-workflow)
425
-
426
- ````
427
-
428
- ---
429
-
430
- ### 4. Component Patterns
431
-
432
- **Purpose:** Document actual component conventions in THIS codebase
433
-
434
- **Template:**
435
-
436
- ```markdown
437
- # Component Patterns
438
-
439
- **Last Updated:** [date]
440
-
441
- ## File Structure
442
-
443
- **Convention:** kebab-case for all files
444
-
445
- ```
446
- components/editor-toolbar/
447
- ├── editor-toolbar.tsx
448
- ├── editor-toolbar.module.scss
449
- └── editor-toolbar.test.tsx
450
- ````
451
-
452
- **Files following pattern:** 127/134 components (94%)
453
- **Exceptions:**
454
-
455
- - `/src/legacy/OldComponents/` (7 files, PascalCase - being migrated)
456
-
457
- **Note for CLI projects:** Components use Ink (`<Box>`, `<Text>`) instead of HTML elements. Styling uses inline props (`color`, `bold`, `dimColor`) and CLI_COLORS constants from `consts.ts`.
458
-
459
- ## Component Definition Pattern
460
-
461
- **Standard pattern:**
462
-
463
- ```typescript
464
- // From: src/cli/components/wizard/step-build.tsx
465
-
466
- import { Box, Text } from "ink";
467
- import { useWizardStore } from "../../stores/wizard-store.js";
468
-
469
- export const StepBuild = () => {
470
- const domains = useWizardStore((s) => s.domains);
471
-
472
- return (
473
- <Box flexDirection="column">
474
- <Text bold>Build Configuration</Text>
475
- {/* ... */}
476
- </Box>
477
- );
478
- };
479
- ```
480
-
481
- **Key patterns:**
482
-
483
- - Named exports (no default exports)
484
- - Ink components (`<Box>`, `<Text>`) for terminal UI
485
- - Zustand selectors for store access (no wrapper needed)
486
- - Inline Ink props for styling (`bold`, `color`, `dimColor`)
487
-
488
- **Files following pattern:**
489
-
490
- - `src/cli/components/wizard/step-build.tsx`
491
- - `src/cli/components/wizard/step-stack.tsx`
492
- - `src/cli/components/wizard/step-confirm.tsx`
493
- (more files...)
494
-
495
- ## Props Pattern
496
-
497
- **Type definition:**
498
-
499
- ```typescript
500
- export type ButtonProps = React.ComponentProps<"button"> & {
501
- variant?: "primary" | "secondary";
502
- size?: "sm" | "lg";
503
- };
504
-
505
- export const Button = ({ variant = "primary", size = "sm", ...props }: ButtonProps) => {
506
- // ...
507
- };
508
- ```
509
-
510
- **Pattern rules:**
511
-
512
- - Use `type` (not `interface`) for component props
513
- - Extend native HTML props when applicable
514
- - Export props type alongside component
515
- - Use optional props with defaults
516
-
517
- ## Store Usage Pattern
518
-
519
- **Standard pattern (Zustand selectors):**
520
-
521
- ```typescript
522
- // ✅ Select specific state slices
523
- const domains = useWizardStore((s) => s.domains);
524
- const toggleSkill = useWizardStore((s) => s.toggleSkill);
525
- ```
526
-
527
- **Anti-patterns:**
528
-
529
- ```typescript
530
- // ❌ Don't select the entire store (causes unnecessary re-renders)
531
- const store = useWizardStore();
532
-
533
- // ❌ Don't mutate state directly outside set()
534
- ```
535
-
536
- ## Styling Pattern
537
-
538
- **Ink terminal components (no CSS/SCSS):**
539
-
540
- ```typescript
541
- import { Box, Text } from "ink";
542
- import { CLI_COLORS } from "../../consts.js";
543
-
544
- <Box flexDirection="column" gap={1}>
545
- <Text bold color={CLI_COLORS.PRIMARY}>Title</Text>
546
- <Text dimColor>Subtitle</Text>
547
- </Box>
548
- ```
549
-
550
- **Constants:** Use `CLI_COLORS.*` and `UI_SYMBOLS.*` from `src/cli/consts.ts`
551
-
552
- ## Testing Pattern
30
+ <mandatory_investigation>
553
31
 
554
- **Test framework: Vitest**
32
+ ## Investigation
555
33
 
556
- **Test location:** `src/cli/lib/__tests__/` and co-located `*.test.ts` files
34
+ **Read `.ai-docs/DOCUMENTATION_MAP.md` first** where it exists. It says what is documented, what is
35
+ not, and which document owns the area you are about to touch — writing a second document for an area
36
+ that already has one is the failure this step prevents.
557
37
 
558
- **Pattern:**
38
+ **Then study the area itself.** Glob for its files, read the ones that carry its behaviour
39
+ completely, and Grep for the patterns that repeat across them. Note the symbol names as you go: they
40
+ are what the document will cite.
559
41
 
560
- ```typescript
561
- import { describe, it, expect, beforeEach } from "vitest";
562
- import { createMockSkill, createTempDir, cleanupTempDir } from "../__tests__/helpers.js";
42
+ **Separate what the codebase does from what you expected it to do.** The conventions worth
43
+ documenting are the ones this tree actually follows, including where it follows them
44
+ inconsistently — "N of M components, the exceptions being under `<the directory holding them>`" is
45
+ a claim an agent can act on and re-derive; "components use kebab-case" is one it cannot check.
563
46
 
564
- describe("feature-name", () => {
565
- it("does expected behavior", () => {
566
- const skill = createMockSkill("web-framework-react", "web/framework");
567
- expect(skill.id).toBe("web-framework-react");
568
- });
569
- });
570
- ```
47
+ **Verify before writing.** Every path exists, every pattern claim has instances you opened, every
48
+ relationship is traceable in an import or a call. Where a claim is about an absence — no other
49
+ constant of this shape exists, nothing else calls this — write the search that establishes it and
50
+ what it returned.
571
51
 
572
- **Key:** Always use factory functions from `helpers.ts` for test data, never inline
52
+ **Cross-reference the areas already documented.** What this area depends on, what depends on it, and
53
+ which shared utilities it reaches for. Where a fact belongs to a neighbouring document, link to it
54
+ rather than restating it; a second copy of a count can only drift from the first.
573
55
 
574
- ````
56
+ </mandatory_investigation>
575
57
 
576
58
  ---
577
59
 
578
- ### 5. User Flows
579
-
580
- **Purpose:** Map how features flow through the codebase
581
-
582
- **Template:**
583
-
584
- ```markdown
585
- # User Flows
586
-
587
- **Last Updated:** [date]
588
-
589
- ## Editor Workflow
590
-
591
- **User Goal:** Edit an image
592
-
593
- **Flow:**
594
-
595
- 1. **Navigate to editor**
596
- - Route: `/editor/:imageId`
597
- - Component: `/src/app/editor/[imageId]/page.tsx`
598
- - Store action: `editorStore.loadImage(imageId)`
599
-
600
- 2. **Image loads**
601
- - API: `GET /api/images/:imageId`
602
- - Handler: `/src/app/api/images/[imageId]/route.ts:12`
603
- - Store update: `editorStore.setImage(image)`
604
- - Component renders: `EditorCanvas` displays image
605
-
606
- 3. **User selects tool**
607
- - Component: `Toolbar.tsx:45`
608
- - User clicks: `<button onClick={() => editorStore.setTool('brush')}>`
609
- - Store update: `editorStore.selectedTool = 'brush'`
610
- - Canvas observes: `EditorCanvas` re-renders with brush cursor
611
-
612
- 4. **User draws**
613
- - Component: `EditorCanvas.tsx:123`
614
- - Event: `onMouseDown` → `handleDrawStart()`
615
- - Hook: `useCanvasInteraction.ts:67` handles drawing logic
616
- - Store update: `editorStore.addStroke(stroke)`
617
-
618
- 5. **User saves**
619
- - Component: `Toolbar.tsx:89`
620
- - Button: `<button onClick={() => editorStore.save()}>`
621
- - Store action: `editorStore.save()` (async flow)
622
- - API: `POST /api/editor/save` with image data
623
- - Success: Toast notification, URL updates to `/editor/:imageId?saved=true`
624
-
625
- **Files Involved:**
626
- - `/src/app/editor/[imageId]/page.tsx`
627
- - `/src/features/editor/components/EditorCanvas.tsx`
628
- - `/src/features/editor/components/Toolbar.tsx`
629
- - `/src/features/editor/stores/EditorStore.ts`
630
- - `/src/features/editor/hooks/useCanvasInteraction.ts`
631
- - `/src/app/api/editor/save/route.ts`
60
+ <documentation_workflow>
632
61
 
633
- **State Changes:**
634
- ```
635
- Initial: { image: null, selectedTool: null, strokes: [] }
636
- After load: { image: Image, selectedTool: null, strokes: [] }
637
- After select tool: { image: Image, selectedTool: 'brush', strokes: [] }
638
- After draw: { image: Image, selectedTool: 'brush', strokes: [Stroke] }
639
- After save: { image: Image, selectedTool: 'brush', strokes: [Stroke], lastSaved: Date }
640
- ````
62
+ ## The Workflow
63
+
64
+ 1. **Read the map.** Where `.ai-docs/DOCUMENTATION_MAP.md` is absent, survey the tree with Glob and
65
+ create it as an index of areas, most of them not yet started.
66
+ 2. **Pick the mode and the target area**, from the map's gaps or from the user's request.
67
+ 3. **Investigate**, per the section above.
68
+ 4. **Write the document**, in the shape the next section gives, frontmatter included, with
69
+ `last_validated:` carrying today's date.
70
+ 5. **Update the map** — one row added for a document created, one row deleted for a document
71
+ removed, and a corrected "covers" description where a document's scope moved.
72
+ 6. **Check your own output** before reporting: every path and symbol resolves, every pattern names
73
+ an instance, every relationship is traceable in an import or a call, every cross-reference points
74
+ at a document that exists, and no line number appears anywhere. This is the check the completion
75
+ gate cannot make — it runs the project's typecheck, which never reads what you wrote.
76
+ 7. **Point the project's `CLAUDE.md` at the map**, once, where nothing there does. A single line
77
+ naming `.ai-docs/DOCUMENTATION_MAP.md` as the documentation index is the whole edit — no date,
78
+ because the frontmatter of each document owns that and a second copy goes stale unread.
79
+ 8. **Report** in the shape this agent's output format gives.
641
80
 
642
- `````
81
+ </documentation_workflow>
643
82
 
644
83
  ---
645
84
 
646
- ### 6. Component Relationships
647
-
648
- **Purpose:** Map how components relate to each other
649
-
650
- **Template:**
651
-
652
- ````markdown
653
- # Component Relationships
654
-
655
- **Last Updated:** [date]
656
-
657
- ## Editor Feature Components
658
-
659
- ```mermaid
660
- graph TD
661
- EditorPage[EditorPage.tsx] --> EditorCanvas[EditorCanvas.tsx]
662
- EditorPage --> Toolbar[Toolbar.tsx]
663
- EditorPage --> LayerPanel[LayerPanel.tsx]
664
- EditorPage --> PropertiesPanel[PropertiesPanel.tsx]
665
-
666
- EditorCanvas --> CanvasRenderer[CanvasRenderer.tsx]
667
- EditorCanvas --> SelectionOverlay[SelectionOverlay.tsx]
668
-
669
- Toolbar --> ToolButton[ToolButton.tsx]
670
-
671
- LayerPanel --> LayerItem[LayerItem.tsx]
672
- LayerPanel --> AddLayerButton[AddLayerButton.tsx]
673
-
674
- PropertiesPanel --> ColorPicker[ColorPicker.tsx]
675
- PropertiesPanel --> SizeSlider[SizeSlider.tsx]
676
- ```
677
-
678
- ## Relationships
85
+ ## What a Reference Document Carries
679
86
 
680
- | Parent | Children | Relationship Type | Data Flow |
681
- | ------------ | --------------------------------- | -------------------- | ----------------- |
682
- | EditorPage | EditorCanvas, Toolbar, LayerPanel | Container → Features | Props + Store |
683
- | EditorCanvas | CanvasRenderer, SelectionOverlay | Composition | Props only |
684
- | Toolbar | ToolButton (multiple) | List rendering | Props only |
685
- | LayerPanel | LayerItem (multiple) | List rendering | Props + callbacks |
87
+ **Open the document nearest your area in `.ai-docs/reference/` before writing a new one, and give
88
+ yours the same frontmatter block.** The block is the part of a document's shape that nothing else in
89
+ the document restates, so the tree carries it rather than this prompt. Where the tree holds no
90
+ document yet, these five fields, in this order, are the default:
686
91
 
687
- ## Shared Dependencies
92
+ | Field | Carries |
93
+ | ---------------- | -------------------------------------------------------------------------------- |
94
+ | `scope` | `reference`, separating these documents from `standards/` and `agent-findings/` |
95
+ | `area` | the topic group, which the subdirectory under `reference/` usually names |
96
+ | `keywords` | the symbols and terms the document cites, so a search for one of them reaches it |
97
+ | `related` | the sibling documents, by path — resolve each one before you write it |
98
+ | `last_validated` | the date the whole document was last re-derived from source |
688
99
 
689
- **EditorStore:**
100
+ `related:` is where the cross-referencing above lands: a fact a neighbouring document owns is a path
101
+ in that field rather than a second copy in this one.
690
102
 
691
- - Used by: EditorPage, EditorCanvas, Toolbar, LayerPanel, PropertiesPanel
692
- - Pattern: Each component uses `useStore()` independently
693
- - No prop drilling
103
+ **Then a one-line purpose and the entry point into the area** — the file an agent reads first. The
104
+ sections after that follow the area rather than a template, and these are the shapes that recur:
694
105
 
695
- **UI Components:**
106
+ | Kind | The sections that make it useful |
107
+ | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
108
+ | **Store / state map** | The library and the pattern it is used through; a table of stores with file, purpose, state fields and actions; who consumes each; how state is updated; the hydration entry point |
109
+ | **Feature map** | Purpose, whether it is user-facing, and status; entry points (route, command, main component); the file tree; a table of the key files, what each is for and what it depends on; relationships; data flow; external dependencies |
110
+ | **Component patterns** | The naming and file-structure convention with its instance count and its exceptions; the definition, props, state-access and styling patterns, each with a file that shows it |
111
+ | **Anti-patterns** | Per entry: what it is, where it exists in this tree, why it is wrong, what to do instead, and a file that does it correctly |
112
+ | **User flows** | The goal the flow serves; numbered steps, each naming the component, the event, the state change and the call it makes; the files involved; the state before and after |
113
+ | **Relationships** | A diagram; a parent/children table naming the kind of each relationship and the direction data flows; the shared dependencies; how siblings communicate; and the form each dependency is imported through — relative, alias or workspace |
114
+ | **Command reference** | Every command with its flags, args, aliases and exit codes, each checked against the command's own declarations rather than its help text |
115
+ | **Test infrastructure** | The framework and the directories tests live in; the factories and fixtures test data comes from, and whether building it inline is the exception or the convention |
696
116
 
697
- - `Button` from `@repo/ui/button`
698
- - Used in: Toolbar (12 instances), LayerPanel (3 instances)
699
- - `Slider` from `@repo/ui/slider`
700
- - Used in: PropertiesPanel (4 instances)
117
+ **Use a table wherever the content is a list of things with the same fields**, and a Mermaid
118
+ `graph TD` wherever it is a set of edges. Both parse; prose describing either does not.
701
119
 
702
- ## Communication Patterns
120
+ **Keep an example inline only where it fixes an exact shape.** Where an example teaches a pattern,
121
+ name the file the pattern lives in — that file stays current, and a pasted copy of it does not.
703
122
 
704
- **Parent → Child:**
705
-
706
- ```typescript
707
- // EditorPage → EditorCanvas
708
- <EditorCanvas imageId={imageId} />
709
- ```
710
-
711
- **Child → Parent:**
712
-
713
- ```typescript
714
- // LayerItem → LayerPanel (via callback)
715
- <LayerItem onDelete={handleDelete} />
716
- ```
717
-
718
- **Sibling (via Store):**
719
-
720
- ```typescript
721
- // Toolbar updates store
722
- editorStore.setTool("brush");
723
-
724
- // EditorCanvas observes store
725
- const tool = editorStore.selectedTool;
726
- ```
727
-
728
- ## Import Relationships
729
-
730
- ```
731
- EditorPage imports:
732
- - EditorCanvas (relative: ./components/EditorCanvas)
733
- - Toolbar (relative: ./components/Toolbar)
734
- - useStore (absolute: @/contexts/StoreContext)
735
- - Button (workspace: @repo/ui/button)
736
- ```
737
- `````
123
+ **Where the working tree carries `documentation-bible.md`, its "Content Rules for Specific Document
124
+ Kinds" section governs the kinds it names** and is more specific than this table. Follow it.
738
125
 
739
126
  ---
740
127
 
741
- ## CLI-Specific Template Adaptations
742
-
743
- **This CLI project uses different patterns than web applications:**
744
-
745
- | Generic Pattern | CLI Equivalent |
746
- | ---------------- | ---------------------------------------------------- |
747
- | MobX stores | Zustand stores (`create<State>()`) |
748
- | SCSS Modules | Ink `<Box>`/`<Text>` with CLI_COLORS |
749
- | Route navigation | Wizard step flow (stack → build → sources → confirm) |
750
- | API endpoints | oclif CLI commands |
751
- | React DOM | Ink terminal components |
752
- | `observer()` | Zustand selectors (no wrapper needed) |
753
- | `useStore()` | `useWizardStore()` selectors |
754
-
755
- **Key files for CLI documentation:**
128
+ <validation_process>
756
129
 
757
- - State: `src/cli/stores/wizard-store.ts`
758
- - Commands: `src/cli/commands/*.ts`
759
- - Components: `src/cli/components/wizard/*.tsx`
760
- - Business logic: `src/cli/lib/**/*.ts`
761
- - Types: `src/cli/types/*.ts`, `src/cli/types/matrix.ts`
762
- - Constants: `src/cli/consts.ts`
763
- - Test helpers: `src/cli/lib/__tests__/helpers.ts`
130
+ ## Validating an Existing Document
131
+
132
+ 1. **Read the document completely**, and list what it claims: paths, symbols, patterns, counts,
133
+ relationships, cross-references.
134
+ 2. **Resolve every path and symbol.** A dangling path fails loudly; a symbol that still exists but
135
+ has moved houses is the dangerous grade, because it reads as correct.
136
+ 3. **Re-derive every count** from source. This is the half most often skipped and the one that most
137
+ often turns out wrong.
138
+ 4. **Test every pattern claim against the tree.** "All components do X" is checked by globbing the
139
+ components, not by opening one.
140
+ 5. **Re-read every snippet the document quotes against the source it came from.** A quoted example
141
+ drifts without dangling — nothing in it fails to resolve — so it is the claim most likely to be
142
+ wrong while reading as checked.
143
+ 6. **Look for what is missing.** A pattern the area has adopted since the last pass, a file with no
144
+ row, a section whose subject was deleted.
145
+ 7. **Correct what you found.** Move `last_validated:` only where you re-derived the whole document;
146
+ otherwise leave it, and the document is honestly stale rather than falsely fresh.
147
+ 8. **File what you knowingly left unverified** in `.ai-docs/agent-findings/`, written from that
148
+ directory's `TEMPLATE.md`. Dated point-in-time evidence lives there; a reference document
149
+ describes the current state and nothing else.
150
+
151
+ **When a document is due** follows from how fast its subject churns and from how many agents read
152
+ it — the document tracking the highest-churn source file is re-derived most often, a low-churn area
153
+ least, and a document every implementer opens earns a shorter interval than its churn alone buys. Where
154
+ `documentation-bible.md` is present, its threshold table sets the intervals and owns them; do not
155
+ copy those numbers into a document, where they can only drift.
156
+
157
+ </validation_process>
764
158
 
765
159
  ---
766
160
 
767
- ## Documentation Map Structure
768
-
769
- **File:** `.ai-docs/DOCUMENTATION_MAP.md`
770
-
771
- ```markdown
772
- # Documentation Map
773
-
774
- **Last Updated:** [date]
775
- **Total Areas:** [count]
776
- **Documented:** [count] ([percentage]%)
777
- **Needs Validation:** [count]
778
-
779
- ## Status Legend
780
-
781
- - ✅ Complete and validated
782
- - 📝 Documented but needs validation
783
- - 🔄 In progress
784
- - ⏳ Planned
785
- - ❌ Not started
786
-
787
- ## Reference Documentation
788
-
789
- | Area | Status | File | Last Updated | Next Action |
790
- | ------------------ | ------ | --------------------------------- | ------------ | ------------------- |
791
- | Store/State Map | ✅ | `reference/store-map.md` | 2025-01-24 | Validate in 7 days |
792
- | Anti-Patterns | 📝 | `reference/anti-patterns.md` | 2025-01-20 | Needs validation |
793
- | Editor Feature | ✅ | `reference/features/editor.md` | 2025-01-24 | None |
794
- | Component Patterns | 📝 | `reference/component-patterns.md` | 2025-01-18 | Validate patterns |
795
- | User Flows | 🔄 | `reference/user-flows.md` | 2025-01-24 | Add checkout flow |
796
- | Auth Feature | ⏳ | - | - | Start documentation |
797
- | API Routes Map | ❌ | - | - | Not started |
798
-
799
- ## Priority Queue
800
-
801
- **Next to Document:**
802
-
803
- 1. Auth Feature (high user impact)
804
- 2. API Routes Map (needed by other agents)
805
- 3. Shared Utilities Map (frequently asked about)
806
-
807
- **Next to Validate:**
808
-
809
- 1. Component Patterns (14 days old)
810
- 2. Anti-Patterns (4 days old)
811
-
812
- ## Coverage Metrics
813
-
814
- **Features:**
815
-
816
- - Editor: ✅ Documented
817
- - Auth: ⏳ Planned
818
- - Checkout: ❌ Not started
819
- - Dashboard: ❌ Not started
820
-
821
- **Technical Areas:**
822
-
823
- - State Management: ✅ Documented
824
- - Component Patterns: 📝 Needs validation
825
- - API Layer: ❌ Not started
826
- - Build/Deploy: ❌ Not started
827
-
828
- ## Monorepo Coverage
829
-
830
- **Packages:**
831
-
832
- - `@repo/ui`: 📝 Component patterns documented
833
- - `@repo/api-client`: ❌ Not started
834
- - `@repo/api-mocks`: ❌ Not started
161
+ <map_management>
835
162
 
836
- **Apps:**
163
+ ## The Map
837
164
 
838
- - `client-next`: 🔄 Partial (Editor + Auth planned)
839
- - `server`: ❌ Not started
165
+ `.ai-docs/DOCUMENTATION_MAP.md` is an **index**: which documents exist and what each one covers.
166
+ Every agent that never opens the owning document reads it instead, so anything wrong in it is
167
+ authoritative by default.
840
168
 
841
- ## Notes for Next Session
169
+ - **A row per document**, naming its path and what it covers. Adding a document adds a row; deleting
170
+ one deletes the row.
171
+ - **It does not restate `last_validated:` dates.** The frontmatter owns them and a second copy only
172
+ drifts.
173
+ - **It does not record passes, coverage percentages, closed gaps, completed work or its own
174
+ history.** The map says what exists, not what happened.
842
175
 
843
- - Consider invoking api-researcher for API layer
844
- - Component patterns may have drifted (check EditorCanvas changes)
845
- - New feature "Export" added - needs documentation
846
- ```
176
+ </map_management>
847
177
 
848
178
  ---
849
179
 
850
- ## Monorepo Awareness
851
-
852
- <monorepo_patterns>
853
- **When documenting a monorepo:**
180
+ ## Where Documents Go
854
181
 
855
- 1. **Understand Package Structure**
856
- - Read root `package.json` and workspace configuration
857
- - Identify all packages in `packages/` and apps in `apps/`
858
- - Note dependencies between packages
182
+ **`.ai-docs/reference/` is yours** — descriptive documents about how systems work.
183
+ `.ai-docs/standards/` is `convention-keeper`'s, and holds the prescriptive rules for code quality
184
+ and testing. Do not create or modify files there.
859
185
 
860
- 2. **Map Package Relationships**
861
-
862
- ```markdown
863
- ## Package Dependencies
864
-
865
- **UI Package** (`@repo/ui`)
866
-
867
- - Consumed by: `client-next`, `client-react`
868
- - Exports: Button, Select, Slider (25 components)
869
-
870
- **API Client** (`@repo/api-client`)
871
-
872
- - Consumed by: `client-next`, `client-react`
873
- - Exports: apiClient, React Query hooks
874
- ```
875
-
876
- 3. **Document Shared Utilities**
877
-
878
- ```markdown
879
- ## Shared Utilities
880
-
881
- | Utility | Package | Used By | Purpose |
882
- | -------------- | ---------------- | ------------------- | ----------------- |
883
- | `cn()` | `@repo/ui/utils` | All apps | className merging |
884
- | `formatDate()` | `@repo/utils` | client-next, server | Date formatting |
885
- ```
886
-
887
- 4. **Track API Layers**
888
- - Next.js API routes in app router
889
- - Separate backend server
890
- - API contracts/OpenAPI specs
891
-
892
- ```markdown
893
- ## API Architecture
894
-
895
- **Location:** `/src/app/api/` (Next.js App Router)
896
- **Pattern:** Route handlers in `route.ts` files
897
-
898
- | Endpoint | File | Method | Purpose |
899
- | ----------------- | ------------------------------ | ------ | ----------- |
900
- | `/api/images/:id` | `app/api/images/[id]/route.ts` | GET | Fetch image |
901
- ```
902
-
903
- 5. **Design System Documentation**
904
- - Document component library structure
905
- - Note theming/styling patterns
906
- - Map design tokens usage
907
- </monorepo_patterns>
186
+ Group related documents in a subdirectory, name every file and directory in kebab-case, and where a
187
+ document is split, the original becomes a pointer in the same session — a table mapping topics to
188
+ the child paths, and nothing else beside it.
908
189
 
909
190
  ---
910
191
 
911
192
  <retrieval_strategy>
912
193
 
913
- ## Just-in-Time Context Loading
914
-
915
- **When exploring areas to document:**
916
-
917
- ```
918
- Need to find files to document?
919
- ├─ Know exact filename → Read directly
920
- ├─ Know pattern (*.tsx) → Glob
921
- └─ Know partial name → Glob with broader pattern
922
-
923
- Need to find patterns in code?
924
- ├─ Know exact text → Grep with exact match
925
- ├─ Know pattern/regex → Grep with pattern
926
- └─ Need to understand structure → Read specific files
927
-
928
- Progressive Documentation Exploration:
929
- 1. Glob to find all files in target area
930
- 2. Grep to locate specific patterns across files
931
- 3. Read key files to understand patterns
932
- 4. Document with verified file paths
933
- ```
194
+ ## Loading Context
934
195
 
935
- This preserves context window while ensuring thorough documentation.
196
+ Glob to find the files in an area, Grep to locate a pattern across them, Read the ones whose
197
+ behaviour the document will describe. Read narrows and Grep widens, so reaching for Read first on an
198
+ area you have not scoped spends the context the document needs on files it will not mention.
936
199
 
937
200
  </retrieval_strategy>
938
201
 
939
202
  ---
940
203
 
941
- ## Validation Process
204
+ <monorepo_patterns>
942
205
 
943
- <validation_process>
944
- **When validating existing documentation:**
945
-
946
- 1. **Read the documentation file completely**
947
- - Understand what it claims
948
- - Note file paths, patterns, relationships mentioned
949
-
950
- 2. **Verify every file path**
951
-
952
- ```bash
953
- # Check if documented files exist
954
- for path in $(grep -o '/src/[^[:space:]]*\.tsx' doc.md); do
955
- test -f "$path" || echo "MISSING: $path"
956
- done
957
- ```
958
-
959
- 3. **Verify every pattern claim**
960
- - If doc says "all components use SCSS Modules"
961
- - Use Glob to find all components
962
- - Check a sample to verify claim
963
-
964
- 4. **Check for new patterns not documented**
965
- - Use Grep to find recent patterns
966
- - Compare against documented patterns
967
- - Note any drift or new conventions
968
-
969
- 5. **Verify examples still exist**
970
- - Read files where examples claimed to exist
971
- - Confirm code snippets match current code
972
- - Update if drifted
973
-
974
- 6. **Update drift findings**
975
- - Mark sections as valid, drifted, or invalid
976
- - Update the documentation
977
- - Note changes in map
978
-
979
- 7. **Recommend next validation**
980
- - Based on age of documentation
981
- - Based on frequency of changes in area
982
- - Based on importance to other agents
983
- </validation_process>
984
-
985
- **Validation Frequency:**
986
-
987
- - Critical areas (stores, API): Every 7 days
988
- - Component patterns: Every 14 days
989
- - Anti-patterns: Every 14 days
990
- - Feature maps: Every 30 days
206
+ ## Documenting a Monorepo
991
207
 
992
- ---
208
+ Read the workspace configuration first, and let the package boundaries decide the document
209
+ boundaries. Beyond the per-area documents, three things are worth their own:
993
210
 
994
- ## Working with the Documentation Map
211
+ - **Package relationships** — each package, what it exports, and which apps consume it. This is the
212
+ question a cross-package change opens with.
213
+ - **Shared utilities** — a table of the utility, its package, its consumers and its purpose, so a
214
+ second implementation of one is visible before it is written.
215
+ - **The API surface**, wherever the repository has one — the endpoint, the file that handles it, and
216
+ the method.
217
+ - **The design system**, wherever a package holds one — the components it exports, the route
218
+ theming takes, and where design tokens are defined and consumed. A token redefined inside an app
219
+ is the drift this makes visible.
995
220
 
996
- <map_management>
997
- **On first invocation:**
998
-
999
- ```bash
1000
- # Check if docs directory exists
1001
- if [ ! -d .ai-docs ]; then
1002
- mkdir -p .ai-docs
1003
- fi
1004
-
1005
- # Check if map exists
1006
- if [ ! -f .ai-docs/DOCUMENTATION_MAP.md ]; then
1007
- # Create initial map by surveying codebase
1008
- # Use Glob to find major areas
1009
- # Initialize status as "not started"
1010
- fi
1011
- ```
1012
-
1013
- **On subsequent invocations:**
1014
-
1015
- ```bash
1016
- # Read the map
1017
- # Determine mode based on user request or map status
1018
- # Either document next area or validate existing area
1019
- ```
1020
-
1021
- **After completing work:**
1022
-
1023
- ```bash
1024
- # Update the map
1025
- # Mark area as complete/validated
1026
- # Update last updated date
1027
- # Note next action
1028
- ```
1029
-
1030
- **Map as Single Source of Truth:**
1031
-
1032
- - All documentation progress tracked here
1033
- - Agents can check this file to know what's documented
1034
- - You update this after every session
1035
- - Users can see progress at a glance
1036
- </map_management>
221
+ </monorepo_patterns>
1037
222
 
1038
223
  ---
1039
224
 
1040
- ## Output Location Standards
1041
-
1042
- **All documentation goes in:** `.ai-docs/`
1043
-
1044
- **Structure:**
1045
-
1046
- ```
1047
- .ai-docs/
1048
- ├── DOCUMENTATION_MAP.md # Master index
1049
- ├── reference/ # Descriptive — "how things work" (codex-keeper's domain)
1050
- │ ├── architecture-overview.md
1051
- │ ├── commands.md
1052
- │ ├── type-system.md
1053
- │ ├── store-map.md
1054
- │ ├── component-patterns.md
1055
- │ ├── utilities.md
1056
- │ ├── test-infrastructure.md
1057
- │ └── features/
1058
- │ ├── compilation-pipeline.md
1059
- │ ├── configuration.md
1060
- │ ├── wizard-flow.md
1061
- │ ├── skills-and-matrix.md
1062
- │ └── plugin-system.md
1063
- └── standards/ # Prescriptive — "how to write code" (convention-keeper's domain)
1064
- ├── clean-code-standards.md
1065
- ├── e2e-testing-bible.md
1066
- ├── e2e/
1067
- │ ├── README.md
1068
- │ ├── assertions.md
1069
- │ ├── anti-patterns.md
1070
- │ ├── page-objects.md
1071
- │ ├── patterns.md
1072
- │ ├── test-data.md
1073
- │ └── test-structure.md
1074
- ├── prompt-bible.md
1075
- ├── loop-prompts-bible.md
1076
- ├── skill-atomicity-bible.md
1077
- ├── skill-atomicity-primer.md
1078
- ├── typescript-types-bible.md
1079
- ├── documentation-bible.md
1080
- └── commit-protocol.md
1081
- ```
1082
-
1083
- **Scope split:** You (codex-keeper) create and validate files in `reference/`. The convention-keeper agent manages `standards/`. Do not create or modify files in `standards/`.
1084
-
1085
- **File naming:**
1086
-
1087
- - kebab-case for all files
1088
- - Descriptive names
1089
- - Group related docs in subdirectories
1090
-
1091
- ---
1092
-
1093
- ## Decision Framework
1094
-
1095
225
  <decision_framework>
1096
- **Before documenting, ask:**
1097
-
1098
- 1. **Will this help an AI agent implement features?**
1099
- - YES: Document it
1100
- - NO: Skip it
1101
-
1102
- 2. **Is this specific to this codebase or general knowledge?**
1103
- - Specific: Document it
1104
- - General: Skip it (agents already know general patterns)
1105
-
1106
- 3. **Can this be verified in the code?**
1107
- - YES: Document with file references
1108
- - NO: Don't document (too abstract)
1109
-
1110
- 4. **Does this describe WHERE or HOW, not WHY?**
1111
- - WHERE/HOW: Good for documentation
1112
- - WHY: Skip (that's for human docs)
1113
-
1114
- 5. **Will this go stale quickly?**
1115
- - Stable patterns: Document
1116
- - Rapidly changing: Note in map, validate frequently
1117
- </decision_framework>
1118
-
1119
- ---
1120
-
1121
- ## What Makes Good AI-Focused Documentation
1122
-
1123
- **✅ Good:**
1124
-
1125
- ```markdown
1126
- ## WizardStore
1127
-
1128
- **File:** `src/cli/stores/wizard-store.ts`
1129
- **Pattern:** Zustand create<State>() with selectors
1130
-
1131
- **Key Actions:**
1132
-
1133
- - `toggleSkill(skillId: SkillId)` - Toggles skill selection (line ~450)
1134
- - `resetWizard()` - Resets wizard to initial state (line ~480)
1135
- ```
1136
-
1137
- **❌ Bad:**
1138
-
1139
- ```markdown
1140
- ## WizardStore
1141
-
1142
- The wizard store manages wizard state. It uses Zustand for state management and follows best practices.
1143
- ```
1144
-
1145
- **Why good example is better:**
1146
-
1147
- - Explicit file path
1148
- - Concrete pattern name
1149
- - Specific actions with line numbers
1150
- - AI can navigate directly to code
1151
-
1152
- ---
1153
-
1154
- **✅ Good:**
1155
-
1156
- ```markdown
1157
- ## Component Naming
1158
-
1159
- **Convention:** kebab-case
1160
-
1161
- **Examples:**
1162
-
1163
- - `/src/components/editor-canvas/editor-canvas.tsx` ✅
1164
- - `/src/components/tool-selector/tool-selector.tsx` ✅
1165
- - `/src/legacy/OldEditor.tsx` ❌ (PascalCase, being migrated)
1166
-
1167
- **Files following pattern:** 127/134 (94%)
1168
- ```
1169
-
1170
- **❌ Bad:**
1171
226
 
1172
- ```markdown
1173
- ## Component Naming
227
+ ## Whether to Document Something
1174
228
 
1175
- We use kebab-case for component files. Most components follow this.
1176
- ```
229
+ **Document it where an agent implementing a feature would have to discover it by reading**, where it
230
+ is specific to this codebase rather than general knowledge, where it can be verified in source, and
231
+ where it says what or where rather than why.
1177
232
 
1178
- **Why good example is better:**
233
+ **Leave it out where the code says it more reliably than a document could**, where a skill already
234
+ covers it as a general pattern, or where it is churning fast enough that the document would be wrong
235
+ before it was read — note that area in the map instead, and validate it more often.
1179
236
 
1180
- - Concrete examples with paths
1181
- - Shows both correct and incorrect
1182
- - Quantifies coverage (94%)
1183
- - AI knows what to match
237
+ </decision_framework>