@bonesofspring/ai-rules 0.2.56 → 0.2.60

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 (572) hide show
  1. package/CHANGELOG.md +116 -1
  2. package/README.md +68 -3
  3. package/bin/cli.js +399 -27
  4. package/bin/lib/engine-scripts.js +3 -0
  5. package/bin/lib/mcp/catalog.js +97 -0
  6. package/bin/lib/mcp/clients.js +35 -2
  7. package/bin/lib/mcp/credentials.js +85 -1
  8. package/bin/lib/mcp/doctor.js +93 -17
  9. package/bin/lib/mcp/registry.js +10 -4
  10. package/bin/lib/seed-ai-local-team.js +8 -5
  11. package/docs/MCP-CATALOG.md +56 -0
  12. package/docs/MCP-SETUP.md +38 -6
  13. package/docs/PRESET-CONTRIBUTION.md +14 -1
  14. package/docs/TEAM-DB.md +34 -1
  15. package/docs/openapi/team-db.v1.json +17 -2
  16. package/mcp/github-proxy.mjs +133 -0
  17. package/mcp/lib/github.mjs +187 -0
  18. package/mcp/lib/streamable-http.mjs +185 -0
  19. package/mcp/lib/yandex.mjs +16 -137
  20. package/package.json +4 -1
  21. package/presets/_shared/ai-local/scripts/check-write-scope.mjs +212 -0
  22. package/presets/_shared/ai-local/scripts/rule-improver.mjs +674 -74
  23. package/presets/_shared/ai-local/scripts/run.mjs +143 -9
  24. package/presets/_shared/ai-local/scripts/team-db-api.mjs +1 -0
  25. package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +6 -1
  26. package/presets/_shared/ai-local/scripts/team-db-project.mjs +1 -1
  27. package/presets/_shared/ai-local/scripts/team-db-schema.mjs +79 -9
  28. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +29 -6
  29. package/presets/_shared/core/quality/self-review-and-context-hygiene.md +3 -1
  30. package/presets/_shared/core/review/code-review-mr.md +10 -0
  31. package/presets/_shared/hooks/chain-team-phases.sh.tmpl +163 -16
  32. package/presets/claude/android-kotlin/agents/build-verifier.md +1 -1
  33. package/presets/claude/android-kotlin/agents/code-reviewer.md +1 -1
  34. package/presets/claude/android-kotlin/agents/debugger.md +1 -1
  35. package/presets/claude/android-kotlin/agents/feature-developer.md +1 -1
  36. package/presets/claude/android-kotlin/agents/task-analyst.md +1 -1
  37. package/presets/claude/android-kotlin/commands/update.md +1 -0
  38. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +163 -16
  39. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
  40. package/presets/claude/android-kotlin/rules/tooling-and-review/code-review.md +10 -0
  41. package/presets/claude/go/agents/build-verifier.md +1 -1
  42. package/presets/claude/go/agents/code-reviewer.md +1 -1
  43. package/presets/claude/go/agents/debugger.md +1 -1
  44. package/presets/claude/go/agents/feature-developer.md +1 -1
  45. package/presets/claude/go/agents/task-analyst.md +1 -1
  46. package/presets/claude/go/commands/update.md +1 -0
  47. package/presets/claude/go/hooks/chain-team-phases.sh +163 -16
  48. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
  49. package/presets/claude/go/rules/tooling-and-review/code-review.md +10 -0
  50. package/presets/claude/ios-swift/agents/build-verifier.md +1 -1
  51. package/presets/claude/ios-swift/agents/code-reviewer.md +1 -1
  52. package/presets/claude/ios-swift/agents/debugger.md +1 -1
  53. package/presets/claude/ios-swift/agents/feature-developer.md +1 -1
  54. package/presets/claude/ios-swift/agents/task-analyst.md +1 -1
  55. package/presets/claude/ios-swift/commands/update.md +1 -0
  56. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +163 -16
  57. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
  58. package/presets/claude/ios-swift/rules/tooling-and-review/code-review.md +10 -0
  59. package/presets/claude/java/agents/build-verifier.md +1 -1
  60. package/presets/claude/java/agents/code-reviewer.md +1 -1
  61. package/presets/claude/java/agents/debugger.md +1 -1
  62. package/presets/claude/java/agents/feature-developer.md +1 -1
  63. package/presets/claude/java/agents/task-analyst.md +1 -1
  64. package/presets/claude/java/commands/update.md +1 -0
  65. package/presets/claude/java/hooks/chain-team-phases.sh +163 -16
  66. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
  67. package/presets/claude/java/rules/tooling-and-review/code-review.md +10 -0
  68. package/presets/claude/mcp-ts/agents/build-verifier.md +1 -1
  69. package/presets/claude/mcp-ts/agents/feature-developer.md +1 -1
  70. package/presets/claude/mcp-ts/agents/task-analyst.md +1 -1
  71. package/presets/claude/mcp-ts/commands/update.md +1 -0
  72. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +163 -16
  73. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
  74. package/presets/claude/mcp-ts/rules/tooling-and-review/code-review.md +10 -0
  75. package/presets/claude/mol/agents/build-verifier.md +1 -1
  76. package/presets/claude/mol/agents/code-reviewer.md +1 -1
  77. package/presets/claude/mol/agents/debugger.md +1 -1
  78. package/presets/claude/mol/agents/feature-developer.md +1 -1
  79. package/presets/claude/mol/agents/task-analyst.md +1 -1
  80. package/presets/claude/mol/commands/update.md +1 -0
  81. package/presets/claude/mol/hooks/chain-team-phases.sh +163 -16
  82. package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
  83. package/presets/claude/mol/rules/tooling-and-review/code-review-mr.md +10 -0
  84. package/presets/claude/next/agents/build-verifier.md +18 -1
  85. package/presets/claude/next/agents/code-reviewer.md +9 -1
  86. package/presets/claude/next/agents/debugger.md +1 -1
  87. package/presets/claude/next/agents/feature-developer.md +13 -1
  88. package/presets/claude/next/agents/task-analyst.md +1 -1
  89. package/presets/claude/next/agents/task-router.md +10 -0
  90. package/presets/claude/next/commands/task-continue.md +3 -1
  91. package/presets/claude/next/commands/update.md +1 -0
  92. package/presets/claude/next/hooks/chain-team-phases.sh +163 -16
  93. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
  94. package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +12 -1
  95. package/presets/claude/nuxt/agents/build-verifier.md +1 -1
  96. package/presets/claude/nuxt/agents/code-reviewer.md +1 -1
  97. package/presets/claude/nuxt/agents/debugger.md +1 -1
  98. package/presets/claude/nuxt/agents/feature-developer.md +1 -1
  99. package/presets/claude/nuxt/agents/task-analyst.md +1 -1
  100. package/presets/claude/nuxt/commands/update.md +1 -0
  101. package/presets/claude/nuxt/hooks/chain-team-phases.sh +163 -16
  102. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
  103. package/presets/claude/nuxt/rules/tooling-and-review/code-review-mr.md +10 -0
  104. package/presets/claude/php-hexagonal/agents/build-verifier.md +1 -1
  105. package/presets/claude/php-hexagonal/agents/code-reviewer.md +1 -1
  106. package/presets/claude/php-hexagonal/agents/debugger.md +1 -1
  107. package/presets/claude/php-hexagonal/agents/feature-developer.md +1 -1
  108. package/presets/claude/php-hexagonal/agents/task-analyst.md +1 -1
  109. package/presets/claude/php-hexagonal/commands/update.md +1 -0
  110. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +163 -16
  111. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
  112. package/presets/claude/php-hexagonal/rules/tooling-and-review/code-review.md +10 -0
  113. package/presets/claude/php-laravel/agents/build-verifier.md +1 -1
  114. package/presets/claude/php-laravel/agents/code-reviewer.md +1 -1
  115. package/presets/claude/php-laravel/agents/debugger.md +1 -1
  116. package/presets/claude/php-laravel/agents/feature-developer.md +1 -1
  117. package/presets/claude/php-laravel/agents/task-analyst.md +1 -1
  118. package/presets/claude/php-laravel/commands/update.md +1 -0
  119. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +163 -16
  120. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
  121. package/presets/claude/php-laravel/rules/tooling-and-review/code-review.md +10 -0
  122. package/presets/claude/svelte/agents/build-verifier.md +1 -1
  123. package/presets/claude/svelte/agents/code-reviewer.md +1 -1
  124. package/presets/claude/svelte/agents/debugger.md +1 -1
  125. package/presets/claude/svelte/agents/feature-developer.md +1 -1
  126. package/presets/claude/svelte/agents/task-analyst.md +1 -1
  127. package/presets/claude/svelte/commands/update.md +1 -0
  128. package/presets/claude/svelte/hooks/chain-team-phases.sh +163 -16
  129. package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
  130. package/presets/claude/svelte/rules/tooling-and-review/code-review-mr.md +10 -0
  131. package/presets/cursor/android-kotlin/agents/build-verifier.md +1 -1
  132. package/presets/cursor/android-kotlin/agents/code-reviewer.md +1 -1
  133. package/presets/cursor/android-kotlin/agents/debugger.md +1 -1
  134. package/presets/cursor/android-kotlin/agents/feature-developer.md +1 -1
  135. package/presets/cursor/android-kotlin/agents/task-analyst.md +1 -1
  136. package/presets/cursor/android-kotlin/commands/update.md +1 -0
  137. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +163 -16
  138. package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +1 -1
  139. package/presets/cursor/android-kotlin/rules/code-review-mr.mdc +10 -0
  140. package/presets/cursor/go/agents/build-verifier.md +1 -1
  141. package/presets/cursor/go/agents/code-reviewer.md +1 -1
  142. package/presets/cursor/go/agents/debugger.md +1 -1
  143. package/presets/cursor/go/agents/feature-developer.md +1 -1
  144. package/presets/cursor/go/agents/task-analyst.md +1 -1
  145. package/presets/cursor/go/commands/update.md +1 -0
  146. package/presets/cursor/go/hooks/chain-team-phases.sh +163 -16
  147. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +1 -1
  148. package/presets/cursor/go/rules/code-review-mr.mdc +10 -0
  149. package/presets/cursor/ios-swift/agents/build-verifier.md +1 -1
  150. package/presets/cursor/ios-swift/agents/code-reviewer.md +1 -1
  151. package/presets/cursor/ios-swift/agents/debugger.md +1 -1
  152. package/presets/cursor/ios-swift/agents/feature-developer.md +1 -1
  153. package/presets/cursor/ios-swift/agents/task-analyst.md +1 -1
  154. package/presets/cursor/ios-swift/commands/update.md +1 -0
  155. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +163 -16
  156. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +1 -1
  157. package/presets/cursor/ios-swift/rules/code-review-mr.mdc +10 -0
  158. package/presets/cursor/java/agents/build-verifier.md +1 -1
  159. package/presets/cursor/java/agents/code-reviewer.md +1 -1
  160. package/presets/cursor/java/agents/debugger.md +1 -1
  161. package/presets/cursor/java/agents/feature-developer.md +1 -1
  162. package/presets/cursor/java/agents/task-analyst.md +1 -1
  163. package/presets/cursor/java/commands/update.md +1 -0
  164. package/presets/cursor/java/hooks/chain-team-phases.sh +163 -16
  165. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +1 -1
  166. package/presets/cursor/java/rules/code-review-mr.mdc +10 -0
  167. package/presets/cursor/mcp-ts/agents/build-verifier.md +1 -1
  168. package/presets/cursor/mcp-ts/agents/feature-developer.md +1 -1
  169. package/presets/cursor/mcp-ts/agents/task-analyst.md +1 -1
  170. package/presets/cursor/mcp-ts/commands/update.md +1 -0
  171. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +163 -16
  172. package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +1 -1
  173. package/presets/cursor/mcp-ts/rules/code-review-mr.mdc +10 -0
  174. package/presets/cursor/mol/MCP.md +4 -3
  175. package/presets/cursor/mol/agents/build-verifier.md +1 -1
  176. package/presets/cursor/mol/agents/code-reviewer.md +1 -1
  177. package/presets/cursor/mol/agents/debugger.md +1 -1
  178. package/presets/cursor/mol/agents/feature-developer.md +1 -1
  179. package/presets/cursor/mol/agents/task-analyst.md +1 -1
  180. package/presets/cursor/mol/commands/update.md +1 -0
  181. package/presets/cursor/mol/hooks/chain-team-phases.sh +163 -16
  182. package/presets/cursor/mol/rules/agent-team-orchestrator.mdc +1 -1
  183. package/presets/cursor/mol/rules/code-review-mr.mdc +10 -0
  184. package/presets/cursor/next/MCP.md +4 -3
  185. package/presets/cursor/next/agents/README.md +2 -0
  186. package/presets/cursor/next/agents/build-verifier.md +18 -1
  187. package/presets/cursor/next/agents/code-reviewer.md +9 -1
  188. package/presets/cursor/next/agents/debugger.md +1 -1
  189. package/presets/cursor/next/agents/feature-developer.md +13 -1
  190. package/presets/cursor/next/agents/task-analyst.md +1 -1
  191. package/presets/cursor/next/agents/task-router.md +10 -0
  192. package/presets/cursor/next/commands/task-continue.md +3 -1
  193. package/presets/cursor/next/commands/update.md +1 -0
  194. package/presets/cursor/next/hooks/chain-team-phases.sh +163 -16
  195. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +1 -1
  196. package/presets/cursor/next/rules/code-review-mr.mdc +12 -1
  197. package/presets/cursor/next/team/fixtures/feature-l2-lite.json +27 -0
  198. package/presets/cursor/nuxt/agents/build-verifier.md +1 -1
  199. package/presets/cursor/nuxt/agents/code-reviewer.md +1 -1
  200. package/presets/cursor/nuxt/agents/debugger.md +1 -1
  201. package/presets/cursor/nuxt/agents/feature-developer.md +1 -1
  202. package/presets/cursor/nuxt/agents/task-analyst.md +1 -1
  203. package/presets/cursor/nuxt/commands/update.md +1 -0
  204. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +163 -16
  205. package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +1 -1
  206. package/presets/cursor/nuxt/rules/code-review-mr.mdc +10 -0
  207. package/presets/cursor/php-hexagonal/agents/build-verifier.md +1 -1
  208. package/presets/cursor/php-hexagonal/agents/code-reviewer.md +1 -1
  209. package/presets/cursor/php-hexagonal/agents/debugger.md +1 -1
  210. package/presets/cursor/php-hexagonal/agents/feature-developer.md +1 -1
  211. package/presets/cursor/php-hexagonal/agents/task-analyst.md +1 -1
  212. package/presets/cursor/php-hexagonal/commands/update.md +1 -0
  213. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +163 -16
  214. package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +1 -1
  215. package/presets/cursor/php-hexagonal/rules/code-review-mr.mdc +10 -0
  216. package/presets/cursor/php-laravel/agents/build-verifier.md +1 -1
  217. package/presets/cursor/php-laravel/agents/code-reviewer.md +1 -1
  218. package/presets/cursor/php-laravel/agents/debugger.md +1 -1
  219. package/presets/cursor/php-laravel/agents/feature-developer.md +1 -1
  220. package/presets/cursor/php-laravel/agents/task-analyst.md +1 -1
  221. package/presets/cursor/php-laravel/commands/update.md +1 -0
  222. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +163 -16
  223. package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +1 -1
  224. package/presets/cursor/php-laravel/rules/code-review-mr.mdc +10 -0
  225. package/presets/cursor/svelte/agents/build-verifier.md +1 -1
  226. package/presets/cursor/svelte/agents/code-reviewer.md +1 -1
  227. package/presets/cursor/svelte/agents/debugger.md +1 -1
  228. package/presets/cursor/svelte/agents/feature-developer.md +1 -1
  229. package/presets/cursor/svelte/agents/task-analyst.md +1 -1
  230. package/presets/cursor/svelte/commands/update.md +1 -0
  231. package/presets/cursor/svelte/hooks/chain-team-phases.sh +163 -16
  232. package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +1 -1
  233. package/presets/cursor/svelte/rules/code-review-mr.mdc +10 -0
  234. package/presets/mavis/android-kotlin/adapter-map.json +1 -1
  235. package/presets/mavis/android-kotlin/agents/build-verifier.md +1 -1
  236. package/presets/mavis/android-kotlin/agents/code-reviewer.md +1 -1
  237. package/presets/mavis/android-kotlin/agents/debugger.md +1 -1
  238. package/presets/mavis/android-kotlin/agents/feature-developer.md +1 -1
  239. package/presets/mavis/android-kotlin/agents/task-analyst.md +1 -1
  240. package/presets/mavis/android-kotlin/commands/update.md +1 -0
  241. package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +163 -16
  242. package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +29 -6
  243. package/presets/mavis/android-kotlin/rules/code-review-mr.md +10 -0
  244. package/presets/mavis/go/adapter-map.json +1 -1
  245. package/presets/mavis/go/agents/build-verifier.md +1 -1
  246. package/presets/mavis/go/agents/code-reviewer.md +1 -1
  247. package/presets/mavis/go/agents/debugger.md +1 -1
  248. package/presets/mavis/go/agents/feature-developer.md +1 -1
  249. package/presets/mavis/go/agents/task-analyst.md +1 -1
  250. package/presets/mavis/go/commands/update.md +1 -0
  251. package/presets/mavis/go/hooks/chain-team-phases.sh +163 -16
  252. package/presets/mavis/go/rules/agent-team-orchestrator.md +29 -6
  253. package/presets/mavis/go/rules/code-review-mr.md +10 -0
  254. package/presets/mavis/ios-swift/adapter-map.json +1 -1
  255. package/presets/mavis/ios-swift/agents/build-verifier.md +1 -1
  256. package/presets/mavis/ios-swift/agents/code-reviewer.md +1 -1
  257. package/presets/mavis/ios-swift/agents/debugger.md +1 -1
  258. package/presets/mavis/ios-swift/agents/feature-developer.md +1 -1
  259. package/presets/mavis/ios-swift/agents/task-analyst.md +1 -1
  260. package/presets/mavis/ios-swift/commands/update.md +1 -0
  261. package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +163 -16
  262. package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +29 -6
  263. package/presets/mavis/ios-swift/rules/code-review-mr.md +10 -0
  264. package/presets/mavis/java/adapter-map.json +1 -1
  265. package/presets/mavis/java/agents/build-verifier.md +1 -1
  266. package/presets/mavis/java/agents/code-reviewer.md +1 -1
  267. package/presets/mavis/java/agents/debugger.md +1 -1
  268. package/presets/mavis/java/agents/feature-developer.md +1 -1
  269. package/presets/mavis/java/agents/task-analyst.md +1 -1
  270. package/presets/mavis/java/commands/update.md +1 -0
  271. package/presets/mavis/java/hooks/chain-team-phases.sh +163 -16
  272. package/presets/mavis/java/rules/agent-team-orchestrator.md +29 -6
  273. package/presets/mavis/java/rules/code-review-mr.md +10 -0
  274. package/presets/mavis/mcp-ts/adapter-map.json +1 -1
  275. package/presets/mavis/mcp-ts/agents/build-verifier.md +1 -1
  276. package/presets/mavis/mcp-ts/agents/feature-developer.md +1 -1
  277. package/presets/mavis/mcp-ts/agents/task-analyst.md +1 -1
  278. package/presets/mavis/mcp-ts/commands/update.md +1 -0
  279. package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +163 -16
  280. package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +29 -6
  281. package/presets/mavis/mcp-ts/rules/code-review-mr.md +10 -0
  282. package/presets/mavis/mol/MCP.md +4 -3
  283. package/presets/mavis/mol/adapter-map.json +1 -1
  284. package/presets/mavis/mol/agents/build-verifier.md +1 -1
  285. package/presets/mavis/mol/agents/code-reviewer.md +1 -1
  286. package/presets/mavis/mol/agents/debugger.md +1 -1
  287. package/presets/mavis/mol/agents/feature-developer.md +1 -1
  288. package/presets/mavis/mol/agents/task-analyst.md +1 -1
  289. package/presets/mavis/mol/commands/update.md +1 -0
  290. package/presets/mavis/mol/hooks/chain-team-phases.sh +163 -16
  291. package/presets/mavis/mol/rules/agent-team-orchestrator.md +29 -6
  292. package/presets/mavis/mol/rules/code-review-mr.md +10 -0
  293. package/presets/mavis/next/MCP.md +4 -3
  294. package/presets/mavis/next/adapter-map.json +9 -1
  295. package/presets/mavis/next/agents/build-verifier.md +18 -1
  296. package/presets/mavis/next/agents/code-reviewer.md +9 -1
  297. package/presets/mavis/next/agents/debugger.md +1 -1
  298. package/presets/mavis/next/agents/feature-developer.md +13 -1
  299. package/presets/mavis/next/agents/task-analyst.md +1 -1
  300. package/presets/mavis/next/agents/task-router.md +10 -0
  301. package/presets/mavis/next/commands/task-continue.md +3 -1
  302. package/presets/mavis/next/commands/update.md +1 -0
  303. package/presets/mavis/next/hooks/chain-team-phases.sh +163 -16
  304. package/presets/mavis/next/rules/agent-team-orchestrator.md +29 -6
  305. package/presets/mavis/next/rules/code-review-mr.md +12 -1
  306. package/presets/mavis/next/team/fixtures/feature-l2-lite.json +27 -0
  307. package/presets/mavis/nuxt/adapter-map.json +1 -1
  308. package/presets/mavis/nuxt/agents/build-verifier.md +1 -1
  309. package/presets/mavis/nuxt/agents/code-reviewer.md +1 -1
  310. package/presets/mavis/nuxt/agents/debugger.md +1 -1
  311. package/presets/mavis/nuxt/agents/feature-developer.md +1 -1
  312. package/presets/mavis/nuxt/agents/task-analyst.md +1 -1
  313. package/presets/mavis/nuxt/commands/update.md +1 -0
  314. package/presets/mavis/nuxt/hooks/chain-team-phases.sh +163 -16
  315. package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +29 -6
  316. package/presets/mavis/nuxt/rules/code-review-mr.md +10 -0
  317. package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
  318. package/presets/mavis/php-hexagonal/agents/build-verifier.md +1 -1
  319. package/presets/mavis/php-hexagonal/agents/code-reviewer.md +1 -1
  320. package/presets/mavis/php-hexagonal/agents/debugger.md +1 -1
  321. package/presets/mavis/php-hexagonal/agents/feature-developer.md +1 -1
  322. package/presets/mavis/php-hexagonal/agents/task-analyst.md +1 -1
  323. package/presets/mavis/php-hexagonal/commands/update.md +1 -0
  324. package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +163 -16
  325. package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +29 -6
  326. package/presets/mavis/php-hexagonal/rules/code-review-mr.md +10 -0
  327. package/presets/mavis/php-laravel/adapter-map.json +1 -1
  328. package/presets/mavis/php-laravel/agents/build-verifier.md +1 -1
  329. package/presets/mavis/php-laravel/agents/code-reviewer.md +1 -1
  330. package/presets/mavis/php-laravel/agents/debugger.md +1 -1
  331. package/presets/mavis/php-laravel/agents/feature-developer.md +1 -1
  332. package/presets/mavis/php-laravel/agents/task-analyst.md +1 -1
  333. package/presets/mavis/php-laravel/commands/update.md +1 -0
  334. package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +163 -16
  335. package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +29 -6
  336. package/presets/mavis/php-laravel/rules/code-review-mr.md +10 -0
  337. package/presets/mavis/svelte/adapter-map.json +1 -1
  338. package/presets/mavis/svelte/agents/build-verifier.md +1 -1
  339. package/presets/mavis/svelte/agents/code-reviewer.md +1 -1
  340. package/presets/mavis/svelte/agents/debugger.md +1 -1
  341. package/presets/mavis/svelte/agents/feature-developer.md +1 -1
  342. package/presets/mavis/svelte/agents/task-analyst.md +1 -1
  343. package/presets/mavis/svelte/commands/update.md +1 -0
  344. package/presets/mavis/svelte/hooks/chain-team-phases.sh +163 -16
  345. package/presets/mavis/svelte/rules/agent-team-orchestrator.md +29 -6
  346. package/presets/mavis/svelte/rules/code-review-mr.md +10 -0
  347. package/presets/opencode/android-kotlin/adapter-map.json +1 -1
  348. package/presets/opencode/android-kotlin/agents/build-verifier.md +1 -1
  349. package/presets/opencode/android-kotlin/agents/code-reviewer.md +1 -1
  350. package/presets/opencode/android-kotlin/agents/debugger.md +1 -1
  351. package/presets/opencode/android-kotlin/agents/feature-developer.md +1 -1
  352. package/presets/opencode/android-kotlin/agents/task-analyst.md +1 -1
  353. package/presets/opencode/android-kotlin/commands/update.md +1 -0
  354. package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +163 -16
  355. package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +29 -6
  356. package/presets/opencode/android-kotlin/rules/code-review-mr.md +10 -0
  357. package/presets/opencode/go/adapter-map.json +1 -1
  358. package/presets/opencode/go/agents/build-verifier.md +1 -1
  359. package/presets/opencode/go/agents/code-reviewer.md +1 -1
  360. package/presets/opencode/go/agents/debugger.md +1 -1
  361. package/presets/opencode/go/agents/feature-developer.md +1 -1
  362. package/presets/opencode/go/agents/task-analyst.md +1 -1
  363. package/presets/opencode/go/commands/update.md +1 -0
  364. package/presets/opencode/go/hooks/chain-team-phases.sh +163 -16
  365. package/presets/opencode/go/rules/agent-team-orchestrator.md +29 -6
  366. package/presets/opencode/go/rules/code-review-mr.md +10 -0
  367. package/presets/opencode/ios-swift/adapter-map.json +1 -1
  368. package/presets/opencode/ios-swift/agents/build-verifier.md +1 -1
  369. package/presets/opencode/ios-swift/agents/code-reviewer.md +1 -1
  370. package/presets/opencode/ios-swift/agents/debugger.md +1 -1
  371. package/presets/opencode/ios-swift/agents/feature-developer.md +1 -1
  372. package/presets/opencode/ios-swift/agents/task-analyst.md +1 -1
  373. package/presets/opencode/ios-swift/commands/update.md +1 -0
  374. package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +163 -16
  375. package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +29 -6
  376. package/presets/opencode/ios-swift/rules/code-review-mr.md +10 -0
  377. package/presets/opencode/java/adapter-map.json +1 -1
  378. package/presets/opencode/java/agents/build-verifier.md +1 -1
  379. package/presets/opencode/java/agents/code-reviewer.md +1 -1
  380. package/presets/opencode/java/agents/debugger.md +1 -1
  381. package/presets/opencode/java/agents/feature-developer.md +1 -1
  382. package/presets/opencode/java/agents/task-analyst.md +1 -1
  383. package/presets/opencode/java/commands/update.md +1 -0
  384. package/presets/opencode/java/hooks/chain-team-phases.sh +163 -16
  385. package/presets/opencode/java/rules/agent-team-orchestrator.md +29 -6
  386. package/presets/opencode/java/rules/code-review-mr.md +10 -0
  387. package/presets/opencode/mcp-ts/adapter-map.json +1 -1
  388. package/presets/opencode/mcp-ts/agents/build-verifier.md +1 -1
  389. package/presets/opencode/mcp-ts/agents/feature-developer.md +1 -1
  390. package/presets/opencode/mcp-ts/agents/task-analyst.md +1 -1
  391. package/presets/opencode/mcp-ts/commands/update.md +1 -0
  392. package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +163 -16
  393. package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +29 -6
  394. package/presets/opencode/mcp-ts/rules/code-review-mr.md +10 -0
  395. package/presets/opencode/mol/MCP.md +4 -3
  396. package/presets/opencode/mol/adapter-map.json +1 -1
  397. package/presets/opencode/mol/agents/build-verifier.md +1 -1
  398. package/presets/opencode/mol/agents/code-reviewer.md +1 -1
  399. package/presets/opencode/mol/agents/debugger.md +1 -1
  400. package/presets/opencode/mol/agents/feature-developer.md +1 -1
  401. package/presets/opencode/mol/agents/task-analyst.md +1 -1
  402. package/presets/opencode/mol/commands/update.md +1 -0
  403. package/presets/opencode/mol/hooks/chain-team-phases.sh +163 -16
  404. package/presets/opencode/mol/rules/agent-team-orchestrator.md +29 -6
  405. package/presets/opencode/mol/rules/code-review-mr.md +10 -0
  406. package/presets/opencode/next/MCP.md +4 -3
  407. package/presets/opencode/next/adapter-map.json +9 -1
  408. package/presets/opencode/next/agents/build-verifier.md +18 -1
  409. package/presets/opencode/next/agents/code-reviewer.md +9 -1
  410. package/presets/opencode/next/agents/debugger.md +1 -1
  411. package/presets/opencode/next/agents/feature-developer.md +13 -1
  412. package/presets/opencode/next/agents/task-analyst.md +1 -1
  413. package/presets/opencode/next/agents/task-router.md +10 -0
  414. package/presets/opencode/next/commands/task-continue.md +3 -1
  415. package/presets/opencode/next/commands/update.md +1 -0
  416. package/presets/opencode/next/hooks/chain-team-phases.sh +163 -16
  417. package/presets/opencode/next/rules/agent-team-orchestrator.md +29 -6
  418. package/presets/opencode/next/rules/code-review-mr.md +12 -1
  419. package/presets/opencode/next/team/fixtures/feature-l2-lite.json +27 -0
  420. package/presets/opencode/nuxt/adapter-map.json +1 -1
  421. package/presets/opencode/nuxt/agents/build-verifier.md +1 -1
  422. package/presets/opencode/nuxt/agents/code-reviewer.md +1 -1
  423. package/presets/opencode/nuxt/agents/debugger.md +1 -1
  424. package/presets/opencode/nuxt/agents/feature-developer.md +1 -1
  425. package/presets/opencode/nuxt/agents/task-analyst.md +1 -1
  426. package/presets/opencode/nuxt/commands/update.md +1 -0
  427. package/presets/opencode/nuxt/hooks/chain-team-phases.sh +163 -16
  428. package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +29 -6
  429. package/presets/opencode/nuxt/rules/code-review-mr.md +10 -0
  430. package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
  431. package/presets/opencode/php-hexagonal/agents/build-verifier.md +1 -1
  432. package/presets/opencode/php-hexagonal/agents/code-reviewer.md +1 -1
  433. package/presets/opencode/php-hexagonal/agents/debugger.md +1 -1
  434. package/presets/opencode/php-hexagonal/agents/feature-developer.md +1 -1
  435. package/presets/opencode/php-hexagonal/agents/task-analyst.md +1 -1
  436. package/presets/opencode/php-hexagonal/commands/update.md +1 -0
  437. package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +163 -16
  438. package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +29 -6
  439. package/presets/opencode/php-hexagonal/rules/code-review-mr.md +10 -0
  440. package/presets/opencode/php-laravel/adapter-map.json +1 -1
  441. package/presets/opencode/php-laravel/agents/build-verifier.md +1 -1
  442. package/presets/opencode/php-laravel/agents/code-reviewer.md +1 -1
  443. package/presets/opencode/php-laravel/agents/debugger.md +1 -1
  444. package/presets/opencode/php-laravel/agents/feature-developer.md +1 -1
  445. package/presets/opencode/php-laravel/agents/task-analyst.md +1 -1
  446. package/presets/opencode/php-laravel/commands/update.md +1 -0
  447. package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +163 -16
  448. package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +29 -6
  449. package/presets/opencode/php-laravel/rules/code-review-mr.md +10 -0
  450. package/presets/opencode/svelte/adapter-map.json +1 -1
  451. package/presets/opencode/svelte/agents/build-verifier.md +1 -1
  452. package/presets/opencode/svelte/agents/code-reviewer.md +1 -1
  453. package/presets/opencode/svelte/agents/debugger.md +1 -1
  454. package/presets/opencode/svelte/agents/feature-developer.md +1 -1
  455. package/presets/opencode/svelte/agents/task-analyst.md +1 -1
  456. package/presets/opencode/svelte/commands/update.md +1 -0
  457. package/presets/opencode/svelte/hooks/chain-team-phases.sh +163 -16
  458. package/presets/opencode/svelte/rules/agent-team-orchestrator.md +29 -6
  459. package/presets/opencode/svelte/rules/code-review-mr.md +10 -0
  460. package/presets/zcode/android-kotlin/adapter-map.json +1 -1
  461. package/presets/zcode/android-kotlin/agents/build-verifier.md +1 -1
  462. package/presets/zcode/android-kotlin/agents/code-reviewer.md +1 -1
  463. package/presets/zcode/android-kotlin/agents/debugger.md +1 -1
  464. package/presets/zcode/android-kotlin/agents/feature-developer.md +1 -1
  465. package/presets/zcode/android-kotlin/agents/task-analyst.md +1 -1
  466. package/presets/zcode/android-kotlin/commands/update.md +1 -0
  467. package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +163 -16
  468. package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +29 -6
  469. package/presets/zcode/android-kotlin/rules/code-review-mr.md +10 -0
  470. package/presets/zcode/go/adapter-map.json +1 -1
  471. package/presets/zcode/go/agents/build-verifier.md +1 -1
  472. package/presets/zcode/go/agents/code-reviewer.md +1 -1
  473. package/presets/zcode/go/agents/debugger.md +1 -1
  474. package/presets/zcode/go/agents/feature-developer.md +1 -1
  475. package/presets/zcode/go/agents/task-analyst.md +1 -1
  476. package/presets/zcode/go/commands/update.md +1 -0
  477. package/presets/zcode/go/hooks/chain-team-phases.sh +163 -16
  478. package/presets/zcode/go/rules/agent-team-orchestrator.md +29 -6
  479. package/presets/zcode/go/rules/code-review-mr.md +10 -0
  480. package/presets/zcode/ios-swift/adapter-map.json +1 -1
  481. package/presets/zcode/ios-swift/agents/build-verifier.md +1 -1
  482. package/presets/zcode/ios-swift/agents/code-reviewer.md +1 -1
  483. package/presets/zcode/ios-swift/agents/debugger.md +1 -1
  484. package/presets/zcode/ios-swift/agents/feature-developer.md +1 -1
  485. package/presets/zcode/ios-swift/agents/task-analyst.md +1 -1
  486. package/presets/zcode/ios-swift/commands/update.md +1 -0
  487. package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +163 -16
  488. package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +29 -6
  489. package/presets/zcode/ios-swift/rules/code-review-mr.md +10 -0
  490. package/presets/zcode/java/adapter-map.json +1 -1
  491. package/presets/zcode/java/agents/build-verifier.md +1 -1
  492. package/presets/zcode/java/agents/code-reviewer.md +1 -1
  493. package/presets/zcode/java/agents/debugger.md +1 -1
  494. package/presets/zcode/java/agents/feature-developer.md +1 -1
  495. package/presets/zcode/java/agents/task-analyst.md +1 -1
  496. package/presets/zcode/java/commands/update.md +1 -0
  497. package/presets/zcode/java/hooks/chain-team-phases.sh +163 -16
  498. package/presets/zcode/java/rules/agent-team-orchestrator.md +29 -6
  499. package/presets/zcode/java/rules/code-review-mr.md +10 -0
  500. package/presets/zcode/mcp-ts/adapter-map.json +1 -1
  501. package/presets/zcode/mcp-ts/agents/build-verifier.md +1 -1
  502. package/presets/zcode/mcp-ts/agents/feature-developer.md +1 -1
  503. package/presets/zcode/mcp-ts/agents/task-analyst.md +1 -1
  504. package/presets/zcode/mcp-ts/commands/update.md +1 -0
  505. package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +163 -16
  506. package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +29 -6
  507. package/presets/zcode/mcp-ts/rules/code-review-mr.md +10 -0
  508. package/presets/zcode/mol/MCP.md +4 -3
  509. package/presets/zcode/mol/adapter-map.json +1 -1
  510. package/presets/zcode/mol/agents/build-verifier.md +1 -1
  511. package/presets/zcode/mol/agents/code-reviewer.md +1 -1
  512. package/presets/zcode/mol/agents/debugger.md +1 -1
  513. package/presets/zcode/mol/agents/feature-developer.md +1 -1
  514. package/presets/zcode/mol/agents/task-analyst.md +1 -1
  515. package/presets/zcode/mol/commands/update.md +1 -0
  516. package/presets/zcode/mol/hooks/chain-team-phases.sh +163 -16
  517. package/presets/zcode/mol/rules/agent-team-orchestrator.md +29 -6
  518. package/presets/zcode/mol/rules/code-review-mr.md +10 -0
  519. package/presets/zcode/next/MCP.md +4 -3
  520. package/presets/zcode/next/adapter-map.json +9 -1
  521. package/presets/zcode/next/agents/build-verifier.md +18 -1
  522. package/presets/zcode/next/agents/code-reviewer.md +9 -1
  523. package/presets/zcode/next/agents/debugger.md +1 -1
  524. package/presets/zcode/next/agents/feature-developer.md +13 -1
  525. package/presets/zcode/next/agents/task-analyst.md +1 -1
  526. package/presets/zcode/next/agents/task-router.md +10 -0
  527. package/presets/zcode/next/commands/task-continue.md +3 -1
  528. package/presets/zcode/next/commands/update.md +1 -0
  529. package/presets/zcode/next/hooks/chain-team-phases.sh +163 -16
  530. package/presets/zcode/next/rules/agent-team-orchestrator.md +29 -6
  531. package/presets/zcode/next/rules/code-review-mr.md +12 -1
  532. package/presets/zcode/next/team/fixtures/feature-l2-lite.json +27 -0
  533. package/presets/zcode/nuxt/adapter-map.json +1 -1
  534. package/presets/zcode/nuxt/agents/build-verifier.md +1 -1
  535. package/presets/zcode/nuxt/agents/code-reviewer.md +1 -1
  536. package/presets/zcode/nuxt/agents/debugger.md +1 -1
  537. package/presets/zcode/nuxt/agents/feature-developer.md +1 -1
  538. package/presets/zcode/nuxt/agents/task-analyst.md +1 -1
  539. package/presets/zcode/nuxt/commands/update.md +1 -0
  540. package/presets/zcode/nuxt/hooks/chain-team-phases.sh +163 -16
  541. package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +29 -6
  542. package/presets/zcode/nuxt/rules/code-review-mr.md +10 -0
  543. package/presets/zcode/php-hexagonal/adapter-map.json +1 -1
  544. package/presets/zcode/php-hexagonal/agents/build-verifier.md +1 -1
  545. package/presets/zcode/php-hexagonal/agents/code-reviewer.md +1 -1
  546. package/presets/zcode/php-hexagonal/agents/debugger.md +1 -1
  547. package/presets/zcode/php-hexagonal/agents/feature-developer.md +1 -1
  548. package/presets/zcode/php-hexagonal/agents/task-analyst.md +1 -1
  549. package/presets/zcode/php-hexagonal/commands/update.md +1 -0
  550. package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +163 -16
  551. package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +29 -6
  552. package/presets/zcode/php-hexagonal/rules/code-review-mr.md +10 -0
  553. package/presets/zcode/php-laravel/adapter-map.json +1 -1
  554. package/presets/zcode/php-laravel/agents/build-verifier.md +1 -1
  555. package/presets/zcode/php-laravel/agents/code-reviewer.md +1 -1
  556. package/presets/zcode/php-laravel/agents/debugger.md +1 -1
  557. package/presets/zcode/php-laravel/agents/feature-developer.md +1 -1
  558. package/presets/zcode/php-laravel/agents/task-analyst.md +1 -1
  559. package/presets/zcode/php-laravel/commands/update.md +1 -0
  560. package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +163 -16
  561. package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +29 -6
  562. package/presets/zcode/php-laravel/rules/code-review-mr.md +10 -0
  563. package/presets/zcode/svelte/adapter-map.json +1 -1
  564. package/presets/zcode/svelte/agents/build-verifier.md +1 -1
  565. package/presets/zcode/svelte/agents/code-reviewer.md +1 -1
  566. package/presets/zcode/svelte/agents/debugger.md +1 -1
  567. package/presets/zcode/svelte/agents/feature-developer.md +1 -1
  568. package/presets/zcode/svelte/agents/task-analyst.md +1 -1
  569. package/presets/zcode/svelte/commands/update.md +1 -0
  570. package/presets/zcode/svelte/hooks/chain-team-phases.sh +163 -16
  571. package/presets/zcode/svelte/rules/agent-team-orchestrator.md +29 -6
  572. package/presets/zcode/svelte/rules/code-review-mr.md +10 -0
package/CHANGELOG.md CHANGED
@@ -1,6 +1,110 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## 0.2.60
4
+
5
+ `0.2.58` (no tag, no npm version) and `0.2.59` (a tag, no npm version) were never published — their notes ship as `0.2.60`.
6
+
7
+ ### Operator control, loop preview, and install integrity
8
+
9
+ - **Operator pause sentinel.** The chain hook checks `.ai.local/STOP` (also `.ai.local/ESTOP`) before it activates or advances a step. While engaged it records `state: paused` / `phase: paused`, emits no handoff, and prints the sentinel reason; an empty or unreadable file still counts as engaged, and a sentinel that cannot be stat-ed is treated as engaged with a warning rather than ignored. The completing receipt and `attempt_finished` event still land, and a paused human gate stays open and is resumed through the same `end_human_gate` path. The seeded `.ai.local/.gitignore` gains `STOP` and `ESTOP`. Remove the file and run `/task-continue`: the command now accepts `state: paused`, resumes a paused human gate through the same path, and otherwise closes the pause through the hook instead of advancing by hand.
10
+ - **Stale-attempt takeover.** Before a new attempt opens, an `activeAttempts` entry for that step (or its parallel group) older than `AI_RULES_ATTEMPT_STALE_MS` (milliseconds; default 60 minutes, `60000` floor) with no terminal manifest receipt is reclaimed as `attempt_finished` with `outcome: "stale"` and `source: "hook"`, removed from `activeAttempts`, and named in a warning. An attempt belonging to another step is left alone — in graph mode it is reclaimed by that step's own activation or terminal receipt — a terminal receipt wins, and a fresh attempt is never reclaimed.
11
+ - **`run.mjs --dry-run`.** Runs the same derive and improver decision path and prints `DRY RUN — no files, signals, or ledger rows will be written`, then per signature the tier/action, target, before/after, and the exact file + ledger writes it would perform. It creates no lock or intent file and appends no signal or ledger row; `--status` is unchanged and still read-only.
12
+ - **`rule-improver.mjs --rollback <ref>`.** Resolves the newest invertible `rule-changes.jsonl` entry by target path, signature, or exact ISO timestamp, pre-checks that the target still holds the entry's `after`, and appends the `rollback` safety row through the existing `rollbackInverse`. A changed target or an ambiguous ref writes nothing and exits 1. The write must land inside the ledger's `.ai.local` overlay: a symlinked path component, or a real path outside the overlay, is refused before anything is written.
13
+ - **Write-scope reconciliation.** New read-only `presets/_shared/ai-local/scripts/check-write-scope.mjs`, shipped as `.ai.local/scripts/check-write-scope.mjs` and seeded as the fourteenth engine module, labels every changed path `declared` / `derived` / `out-of-scope` against the step's `writeScopes`, hard-fails an implementation step, reports a reviewer/verifier step as advisory, and supports `--step`, `--base`, `--root`, `--paths`, and `--json`. Exit `1` on an out-of-scope path in an implementation step, `0` for a reviewer/verifier advisory, `2` on a usage or config error. Wired into the build-verifier and code-reviewer prompts and documented in the orchestrator rule, never the hook.
14
+ - **Install-state doctor.** `ai-rules doctor [--json]` reports `missing` / `modified` managed files, `legacy-manifest` for a schema-v1 install, `version-mismatch`, and `stale-engine` / `missing-engine` for the shared `.ai.local/scripts/` set, naming the module. Read-only, no `--fix`; the F-1 mixed-engine `SyntaxError` is one `stale-engine` finding. Exit `0` is clean, `1` means findings, `2` a usage error.
15
+ - **Review breadth budget.** `code-review-mr` bounds the call-site sweep and the one-hop consumer read (40 changed symbols or 15 minutes) and adds a `partial` depth-pass outcome that names every unread path. The five depth passes still run on what was read; the diff stays a floor, not the boundary.
16
+ - **Gates.** `check-preset-structure.sh` runs the new `test-write-scope.mjs` and `test-install-doctor.mjs`, and its hook block runs the pause-sentinel and stale-attempt suites; the pack-tarball, CLI registration, init-clean and rule-improver ledger suites gain GitHub, rollback and seeded-script cases. The self-review contract exempts the read-only `check-write-scope.mjs` from the loop-module `child_process` ban because it shells out to git. CLI goldens are recaptured for the new engine module, the two `.ai.local/.gitignore` lines, and the changed `run.mjs` / `rule-improver.mjs` hashes.
17
+
18
+ ### Preset-tree lock: the generator and the gate stop racing
19
+
20
+ - **The race.** `yarn fix:generated` deletes and rebuilds each platform stack, so a gate that reads `presets/**` while it runs fails on a file that is momentarily absent. Both sides now take one advisory lock, `packages/ai-rules/.preset-tree-lock/` (`owner.json` = `pid`, `label`, `startedAt`).
21
+ - **Acquire and release.** A second acquire against a live owner is refused with the owner's label, pid and start time; a dead pid, a corrupt `owner.json`, or an owner-less directory is reclaimed and reported; `release` removes only the caller's lock. A lock path the OS refuses to create is skipped with a warning and the command proceeds unlocked — the lock never turns an unwritable checkout into a red build. It stays advisory: a process that never asks for it can still race.
22
+ - **CLI.** `node scripts/lib/preset-tree-lock.mjs acquire --label <label> [--pid <pid>] [--root <dir>]` exits `0` when acquired or unwritable, `1` when a live owner holds it; `release [--pid <pid>] [--root <dir>]` exits `0` released, `1` refused; a usage error exits `2`.
23
+ - **Wiring.** `fix-generated.mjs` holds the lock across every generator, the Claude settings sync, and the golden captures, and releases it in `finally`; a live owner stops the run with the next step. `check-preset-structure.sh` takes the same lock before it reads `presets/**` and releases it on exit, so a concurrent run reports "the preset tree is being regenerated; re-run the gate when it finishes" instead of failing on a missing hook. `.preset-tree-lock/` is git-ignored.
24
+ - **Fixtures.** `test-preset-tree-lock.mjs` covers acquire/release, a live owner (the second acquire leaves the owner untouched), a stale-owner reclaim, a refused foreign release, the unwritable path, and the CLI exit codes; `check-preset-structure.sh` runs it as its own row.
25
+
26
+ ### Update covers the fifth platform
27
+
28
+ - **Command surface.** All 55 `commands/update.md` files (11 stacks × 5 platforms) list `.zcode/.ai-rules-install.json` beside the other four manifests; the CLI already had `zcode` in `UPDATE_TARGETS`, but the documented record list and the dogfood install did not. `test-cli-update.mjs` parses `UPDATE_TARGETS` and asserts every shipped `update.md` documents every target root, so a sixth platform cannot leave the docs behind.
29
+ - **Dogfood install.** The root `.zcode` tree was created by `sync-dogfood-zcode.sh`, which copies preset bytes but writes no install manifest, so `update` skipped it. A one-time `init zcode --preset next` now records `.zcode/.ai-rules-install.json` (and refreshes the stale tree to the current preset); `update` reports `zcode (next)` on every run after that.
30
+
31
+ ### GitHub MCP provider
32
+
33
+ - **`mcp setup github`.** The managed pack gains a GitHub provider: the official remote GitHub MCP server (`https://api.githubcopilot.com/mcp/`) behind a stdio proxy (`mcp/github-proxy.mjs`), registered into the same five client shapes as GitLab and Yandex. The token is read from the shell (`GITHUB_TOKEN`, or `GITHUB_PERSONAL_ACCESS_TOKEN`) or from `.env.github` in the project root; the package never writes a GitHub secret and never puts one into a client config. `mcp remove --purge` never deletes the consumer-owned `.env.github`.
34
+ - **`mcp doctor` default scope.** With no provider argument the doctor checks every managed-pack provider, GitHub included. A project that had GitLab and Yandex configured and passing now also gets `github` registration and credentials failures and exits 1 until it runs `mcp setup github`; `mcp doctor github` (or any single provider) scopes the run. `mcp setup all` and `mcp add all` cover GitHub too, so `setup all` needs `GITHUB_TOKEN` (or `.env.github`) and stops at the GitHub step without one; `mcp remove all` removes the GitHub entry as well. The CLI registration suite pins the default report: GitLab, GitHub, Yandex Tracker and Yandex Wiki each appear, the run exits 1 while any of them is unconfigured, and every next step names its own setup command.
35
+ - **Credential flow.** `mcp setup github` validates the token against `GET /user` before it registers anything, refuses to run while `.env.github` is not git-ignored, and writes no credential file. `mcp doctor github` reports runtime, registration, credentials and upstream, with one actionable next step per failure (missing token, unignored file, rejected token, unreachable endpoint). A token held in `.env.github` counts as a secret at rest even when the shell shadows it, so the ignore check still applies to that file; a file that holds no token is reported as such instead of being passed over.
36
+ - **Shared transport.** The streamable-HTTP transport (one POST per JSON-RPC message, JSON or SSE response, session id and protocol-version tracking) moved to `mcp/lib/streamable-http.mjs` and is now shared by the Yandex proxy and the GitHub proxy; the Yandex error semantics (`UnauthorizedError` on 401, `UpstreamError` otherwise, token redaction) are unchanged.
37
+ - **Overrides.** `GITHUB_MCP_URL` and `GITHUB_API_URL` point the provider at a GitHub Enterprise endpoint or a local relay; `mcp run github --print-env` prints the masked mapping (`GITHUB_TOKEN=***`).
38
+ - **Client registration.** The MCP doctor previously read a hardcoded four-client map with a flat `mcpServers` key; it now resolves every client through the registry entry (`clientById`) and a dotted-key lookup (`containerAt`), so the ZCode client (`.zcode/config.json`, nested `mcp.servers`) is checked like the other four. The registry's secret-value pattern also matches `gh[pousr]_` and `github_pat_`, so a GitHub token left inside a client config is reported.
39
+ - **Docs.** `docs/MCP-SETUP.md` gains the GitHub sequence and a § Diagnostics rule for the doctor's default scope; the preset `MCP.md` lists GitHub in the managed pack. The package README documents `doctor`, `--dry-run`, `--rollback`, the fourteen-module engine set and the `STOP`/`ESTOP` ignore lines; `docs/PRESET-CONTRIBUTION.md` gains the write-scope audit row.
40
+
41
+ ### The requirements checker separates declared from executed steps
42
+
43
+ - **`--require-receipts`.** `check-requirements-compliance.mjs --task <slug|dir> --require-receipts` compares every routed step that produces a required artifact against the task's `artifact-manifest.json`: a step whose entry is not `completed` or `archived` is `E_STEP_UNEXECUTED` and exit `1`. Without the flag the same gap stays an advisory `declared, not executed: <id> (<agent>)` note, so a compliant artifact set is no longer enough when the caller asks for execution evidence. The flag applies only to `--task`; `--integrity`, `--routing`, and `--census` reject it with exit `2`.
44
+ - **Fixtures.** The checker's suite covers the advisory note, the strict `E_STEP_UNEXECUTED` failure, completed entries satisfying the flag, and the three usage errors.
45
+
46
+ ### Upgrade
47
+
48
+ - Run `npx @bonesofspring/ai-rules update` to refresh the 55 hooks and the shared orchestrator/review rules.
49
+ - `.ai.local/scripts/` stays skip-if-exists: delete `run.mjs` and `rule-improver.mjs` before the update to take `--dry-run` and `--rollback`; `check-write-scope.mjs` is new and is seeded on the next `init` or `update`.
50
+ - Run `npx @bonesofspring/ai-rules doctor` after the update; a `stale-engine` finding names the module that is still the old copy.
51
+ - The preset-tree lock and `--require-receipts` are preset-repository tooling, not installed files: no consumer action and no engine seed for either.
52
+
53
+ ## 0.2.57
54
+
55
+ ### L2-lite and a lighter bounded-contract pipeline
56
+
57
+ - **A fourth level.** The repository's `task-levels` overlay gains **L2-lite** for an additive public contract with a machine-checked gate (OpenAPI / JSON schema / protobuf), no migration, no auth / SSR-cookie / analytics / PII change, ≤ 3 work packages and ≤ 15 substantive files: the L1 execution artifacts plus the contract gate, no L2 OpenSpec. The selection order counts substantive files only — generated trees, snapshots, CLI goldens, docs, and test fixtures do not escalate the level — while L2 (no machine-checked gate), L3, and their OpenSpec path stay unchanged.
58
+ - **Ceremony budget.** L2-lite keeps the safety gates and drops the template weight: `task-analyst → api-contract-reviewer (contract change only) → feature-developer → build-verifier → security-reviewer (destructive / auth-bearing only) → code-reviewer → qa-tester (AC names e2e)`, exactly one human gate `after:task-analyst`, the 28-row block once in `brief.md`, and a ≤ 3 h / ≤ 8 step target. Exceeding the budget records `decision: replan rev N → N+1` instead of growing the template.
59
+ - **Router.** `task-router` on every `next` tree selects L2-lite at `profile: standard`, keeps only the risk specialists, sets `humanGates` to exactly `["after:task-analyst"]`, and records the level and the machine-checked gate in `routingReasons`. `feature-l2-lite.json` joins the seeded `team/fixtures/`.
60
+ - **Overlay-owned.** `init` never overwrites an existing `.ai.local/rules/task-levels.md`, so an installed overlay selects L2-lite only after the level and the selection-order rows are added to that file; the router is already updated.
61
+
62
+ ### Model tiers and a usage ledger
63
+
64
+ - **Tier map.** `.ai.local/team/model-tiers.json` (`schemaVersion`, `approvedBy`, `tiers.cheap|standard|strong`) is the provider-specific map the orchestrator resolves a `steps[i].model` tier through, passing `providerID/modelID` (or `#variant`) to the Task tool. This repository pins `cheap` and `standard` to `deepseek/deepseek-flash` and `strong` to `deepseek/deepseek-v4-pro`; `strong` is never downgraded to the parent default.
65
+ - **Fail closed.** A declared tier without a mapping stops the start with `model-tier-unmapped` instead of silently inheriting the parent model. A platform that takes no explicit model records the resolved tier in the handoff and lets the frontmatter pin apply. The tier changes no step order, gate, receipt, or retry policy.
66
+ - **Usage events.** `record-usage.mjs` appends one `usage_recorded` event (`input`, `output`, `cached`, `model`) to a task's `metrics.json` under the same advisory lock family as the hooks; the chain hook forwards a `usage` object from its input into `attempt_finished`. A count the host does not expose stays missing — nothing is estimated or invented.
67
+
68
+ ### The chain hook takes its slug explicitly
69
+
70
+ - **`TEAM_TASK_SLUG`.** All 55 `chain-team-phases.sh` bodies and the shared template prefer the environment slug over `.ai.local/team/active-task.json`; the pointer remains a single-slot fallback for the UI and older hosts. Two parallel sessions no longer overwrite each other's pointer and silently no-op a hook.
71
+ - **Callers and coverage.** The shared orchestrator and the OpenCode entry pass the slug on every call, and `m2-env-slug-overrides-pointer` proves an env slug wins over a foreign pointer slug; `m2-usage-forwarded` pins the `usage` hand-off.
72
+
73
+ ### A delta classifier for retries
74
+
75
+ - **New classifier.** `packages/ai-rules/scripts/check-preset-delta.mjs` maps a change-set to six domains (`team-db`, `app`, `preset-core`, `local-overlay`, `team-artifacts`, `docs`), lists the affected preset and app gates, and names what may be carried forward. It never runs a gate and never decides PASS/FAIL: exit `0` classified (including "no changes"), `2` usage/self-test failure. Flags: `--base <ref>`, `--paths a,b`, `--json`, `--self-test`.
76
+ - **Retry policy.** `build-verifier` runs the classifier before a re-validation: a gate in a changed domain must be re-run, and a gate in an unchanged domain may be carried only with the base ref, the classifier output, and the last green command + exit code in `validation-report.md`. Preset gates are never carried when `presets/**` or `scripts/**` changed, app gates never when `apps/team-tasks-ui/**` changed, and the team-db suites never when the `team-db` domain changed. The local `agent-pipeline-gates` rule carries the same row.
77
+ - **Wiring.** `yarn check:preset-delta` and a `preset-delta` self-test row in `check-preset-structure.sh` cover four cases: docs only, app e2e test only, OpenAPI contract, router rule.
78
+
79
+ ### Health reports its capabilities
80
+
81
+ - **API.** `GET /health` gains a required `capabilities: ["sync","delete"]` array; the OpenAPI schema adds the enum, the required list, and the example, and the contract gate still owns the frozen document.
82
+ - **UI.** `HealthDto.capabilities` stays optional so an older upstream parses; the mapper defaults it to `[]`, and `AppShell` renders a stale-upstream banner when a served API does not advertise `delete` (the copy names `restart team-db.mjs serve`). The footer no longer calls the app read-only.
83
+ - **Docs and tests.** `docs/TEAM-DB.md` states that `--allow-remote` exposes the confirmed delete and the rescan without authentication, and the app README states that `serve` loads its route table at start, so a stale process answers `405` on a route the new code serves. The API suite asserts the field; the mapper and copy suites cover the legacy shape and the banner text.
84
+
85
+ ### Requirements: one canonical block, stage rows downstream
86
+
87
+ - **Canonical downstream block.** Registry revision 5: the anchor (`brief.md` when routed, else the earliest block-bearing artifact) keeps the full 28-row table and `## Stage coverage`; every other block-bearing artifact may carry `Canonical: <anchor>.md#requirements-compliance` plus only the R-IDs its stage requires (`STAGE_REQUIREMENTS`). A full 28-row downstream block remains valid, and the anchor may never carry a canonical line.
88
+ - **Parser and checker.** `requirements-block.mjs` recognizes the canonical line (`E_CANONICAL_SYNTAX`, `E_CANONICAL_NOT_ALLOWED`) and validates the stage subset; `check-requirements-compliance.mjs` resolves the reference against the real anchor (`E_CANONICAL_REF`), allows extra touched rows on `implementation.md`, and reports canonical blocks in `--census`. The checklist documents the shape and the reference rule.
89
+ - **Local gate rules.** `gate-changes-requested` leaves the seed library and becomes an active rule; `gate-validation-failed` is added. Both point at the failing gate or the underlying behavior, never at a weaker test.
90
+
91
+ ### UI deltas close the existing expectations
92
+
93
+ - **Developer.** `feature-developer` gains an existing-suite impact check: a table shape, dialog/state machine, shared copy constant, or route/method change greps the existing specs and copy, updates every stale expectation in the same work package, runs the affected suite (not only the new test), and records the grep and the suite result in `implementation.md`. The local `agent-pipeline-gates` UI-surface row names the same duty.
94
+ - **Review.** `code-review-mr` states that with no Figma reference (no URL, fileKey/node id, or `figma-contract.json`) and `mockup-review.md` at `not-applicable`, the review emits `## Figma parity (UI) — fidelity: N/A` and raises no `REQUEST_CHANGES`; an explicit `fidelity: N/A` is not a finding, an absent one is.
95
+
96
+ ### Real delete coverage
97
+
98
+ - **Scratch server.** `yarn test:e2e:real-delete` starts the fixture API on its own temporary tree, deletes a task through the real HTTP `DELETE`, then asserts `404` on the detail route and absence from the list. The Playwright live project keeps a browser-boundary stub because it shares one projection across ~70 parallel scenarios.
99
+
100
+ ### Upgrade
101
+
102
+ - Run `npx @bonesofspring/ai-rules update` to refresh the 55 hooks, the shared orchestrator core, the `next` agents/rules, and the generated platform trees.
103
+ - `.ai.local/scripts/` stays skip-if-exists: delete `team-db-api.mjs` and `team-db-openapi.mjs` before the update to take the `capabilities` field, then restart `node .ai.local/scripts/team-db.mjs serve` — the process loads its modules at start, so an old one keeps answering the old surface.
104
+ - `model-tiers.json` is consumer-owned: create `.ai.local/team/model-tiers.json` with `tiers.cheap|standard|strong` to pin provider models; without it, the platform pin applies. The chain hook forwards usage without any script; the manual `record-usage.mjs` CLI is this repository's tooling.
105
+ - `task-levels.md` is consumer-owned; add the L2-lite level and selection-order rows to an existing overlay to activate it.
106
+
107
+ ## 0.2.56
4
108
 
5
109
  ### Confirmed task delete
6
110
 
@@ -15,6 +119,17 @@
15
119
  - Run `npx @bonesofspring/ai-rules update`, then delete the four changed modules in `.ai.local/scripts/` (`team-db.mjs`, `team-db-project.mjs`, `team-db-api.mjs`, `team-db-openapi.mjs`) to take the delete verb and route; seeding stays skip-if-exists.
16
120
  - `AI_RULES_TEAM_DB_DISABLE=1` still stops every write point: the delete answers `503 E_DISABLED` over the API and refuses with exit 1 in the CLI.
17
121
 
122
+ ### Six preset and overlay improvements
123
+
124
+ - **Token-budget caps leave the checker.** The always-on count, the body cap, the slim-companion floor, and the 57-stem slim-companion allow-list move into `scripts/_lib/preset-token-budget-baseline.json`; every allow-list entry carries a reason. The numbers do not move — always-on 3–10, body sum ≤ 4000, slim-companion floor 5 lines. `check-preset-token-budget.sh --update` refuses to widen; only `--update --widen` accepts a widening and re-records the sanction. CI also compares the baseline to the base revision (`--base`), so an unrecorded edit of `caps` and `sanctioned` together no longer bypasses the ratchet; a recorded sanction remains a visible diff. The checker body holds no cap literal.
125
+ - **A third, advisory authoring tier.** `scripts/check-preset-authoring-advisory.mjs` reports four finding classes — `restated-stem`, `paraphrased-when-do`, `unjustified-body-size`, `issue-number-density` — one line per finding and a final `advisory-findings: <n>`. It always exits `0` and runs as a non-blocking row in `check:preset-structure` (and therefore `check:all`), so findings never block a release. The per-rule body threshold is the distinct `advisoryPerRuleBodyCap` baseline field; the tier holds no second copy of the number.
126
+ - **Per-store overlay budgets.** The in-task self-learning loop accounts the human store (`.ai.local/rules/**`, ≤ 5 rules and ≤ 170 lines) and the machine store (`.ai.local/conventions.md`, ≤ 30 lines) separately; the combined envelope stays 200 lines, and a saturated store refuses only its own write. The shipped `conventions.md` template is 27 non-empty lines, so a fresh install has three lines of machine headroom before the loop stages instead. `run.mjs --status` prints two envelopes. ADR `0001` guard 2 is amended in the same change.
127
+ - **Seed provenance and a mediated promotion.** Every seed the engine stages carries a four-field footer (`signature`, `stagedAt`, `sourceSlug`, `state: awaiting-human-promotion`) and no free text. `rule-improver.mjs --promote <stem>` strips every footer line, writes the reviewed rule into `.ai.local/rules/`, removes the seed, and appends a `seed-promoted` row bound to the reviewed snapshot — a seed edited between staging and promotion is reported as a divergence. A failed promotion leaves a recoverable commit intent; the next engine run finishes or drops it. Nothing auto-activates a seed.
128
+ - **An FTS shape registry for the team-db projection.** The released search layouts are enumerated oldest-first (`fts5-v1` today) and the installed layout is recorded in `schema_meta` under `search_fts_shape`. A drifted layout is **reported** in five states (`absent`, `current`, `unrecorded`, `superseded`, `unknown`) and never rebuilt: the live table stays untouched, `MIGRATIONS` and `SCHEMA_VERSION` are unchanged, `E_SCHEMA_NEWER` still fails closed, and FTS5 stays a runtime capability.
129
+ - **The learning loop's speed boundary.** The shared-core stem states that the loop runs no model-driven pass — rule text is template-derived from the validated signature, and a model-driven pass, if one is ever added, must be default-off and write only to the staged band. A hard gate row now checks the sentence in the core stem and in all 276 marker carriers, derives the loop-module list from `engine-scripts.js`, and rejects common static and dynamic HTTP/model imports in those modules.
130
+ - **Upgrade the consumer engine.** `.ai.local/scripts/` is seeded skip-if-exists: delete the changed modules — `rule-improver.mjs`, `run.mjs`, and `team-db-schema.mjs` for this preset work, plus `team-db.mjs`, `team-db-project.mjs`, `team-db-api.mjs`, and `team-db-openapi.mjs` for the delete-task work in the same release — and re-run `npx @bonesofspring/ai-rules update` to take the per-store budget split, the two-envelope status, the provenance footer, `--promote`, and the FTS shape registry.
131
+ - **Gates.** `check-preset-token-budget.sh`, `check-preset-structure.sh` (advisory row non-blocking), `check-rule-eval.mjs`, `check-shared-core-drift.sh`, `check-generated-drift.mjs`, `check-preset-self-review-contract.sh`, `test-team-db-schema.mjs`, `check-team-db-contract.mjs`, `test-rule-improver-ledger.mjs`, and `test-cli-init-clean.mjs` pass; the 55 CLI goldens are recaptured, never hand-edited.
132
+
18
133
  ## 0.2.55
19
134
 
20
135
  ### $mol preset (eleventh stack)
package/README.md CHANGED
@@ -6,7 +6,9 @@ Presets for **Cursor**, **Claude Code**, **Mavis** (MiniMax `mcode`), **OpenCode
6
6
  npx @bonesofspring/ai-rules init multi --preset next
7
7
  npx @bonesofspring/ai-rules update # reinstall tools already recorded in this repo
8
8
  npx @bonesofspring/ai-rules update --merge-ai-local # fast-forward files whose recorded base still matches; edits and pre-record files stay put
9
+ npx @bonesofspring/ai-rules doctor # read-only install health: managed files, engine set, version
9
10
  npx @bonesofspring/ai-rules clean cursor # never deletes .ai.local/
11
+ npx @bonesofspring/ai-rules init mcp --all # third-party catalog: context7, playwright, chrome-devtools, figma-desktop, figma-cloud
10
12
  ```
11
13
 
12
14
  Run `init` from the **app root** (`--cwd` if needed). Default `--preset` is `next`. Forms: `init cursor --preset next`, `init cursor next`, `init cursor`. Global: `npm i -g @bonesofspring/ai-rules`.
@@ -23,9 +25,22 @@ Run `init` from the **app root** (`--cwd` if needed). Default `--preset` is `nex
23
25
  | Root agents | `REPO_AGENTS.md` → `AGENTS.md` (same file on all five; ZCode loads it natively) | | | | |
24
26
  | `/task` artifacts | **`.ai.local/team/`** (shared; templates refreshed; `tasks/<slug>/` never overwritten) | | | |
25
27
  | Template drift | **`.ai.local/.template-base.json`** (shared; one record per tree of files that hold a shipped template byte; `update` prints one drift line, `update --merge-ai-local` fast-forwards a file only when its recorded base still matches and reports the rest) | | | |
26
- | Self-learning engine | **`.ai.local/scripts/`** (shared; thirteen scripts — the engine, `manifest.mjs`, and the six `team-db*.mjs` projection modules; existing files never overwritten) | | | |
28
+ | Self-learning engine | **`.ai.local/scripts/`** (shared; fourteen scripts — the engine, `manifest.mjs`, the six `team-db*.mjs` projection modules, and the read-only `check-write-scope.mjs` write audit; existing files never overwritten) | | | |
27
29
  | Specs seed | `docs/specs/` copied only if the directory is **absent** | | | |
28
30
 
31
+ ### Project MCP catalog
32
+
33
+ `init mcp` writes the third-party servers this package uses into every installed client; `--tools` narrows the list to the clients you name. Entries render in each client's native shape and merge like `init`: extra servers, the consumer's `env` / `headers`, and other top-level keys stay. Names: `context7`, `playwright` (Claude's id is `playwright-test`), `chrome-devtools`, `figma-desktop` (alias `figma`, the local `http://127.0.0.1:3845/mcp` server), and `figma-cloud` (the remote `https://mcp.figma.com/mcp` server); `--all` selects every one.
34
+
35
+ ```bash
36
+ npx @bonesofspring/ai-rules init mcp context7
37
+ npx @bonesofspring/ai-rules init mcp figma-desktop figma-cloud
38
+ npx @bonesofspring/ai-rules init mcp --all --tools cursor,claude
39
+ ```
40
+
41
+ Details: [`docs/MCP-CATALOG.md`](docs/MCP-CATALOG.md). The credential-bearing pack (GitLab, GitHub, Yandex) is a separate command group: the `mcp setup|add|remove|doctor|refresh|run` namespace.
42
+
43
+
29
44
  The engine is the in-task self-learning loop: `.ai.local/signals.jsonl` → `.ai.local/rule-changes.jsonl` →
30
45
  `.ai.local/conventions.md` / `.ai.local/rules-library/`. The chain hook runs it after every producer receipt; run it
31
46
  yourself when the hook is disabled:
@@ -34,13 +49,60 @@ yourself when the hook is disabled:
34
49
  node .ai.local/scripts/run.mjs # derive → append → improve
35
50
  node .ai.local/scripts/run.mjs --status # read-only: per-signature state, last capture, envelope
36
51
  node .ai.local/scripts/run.mjs --strict # read-only check: exit 1 when capture is broken
52
+ node .ai.local/scripts/run.mjs --dry-run # read-only preview: decision, target, before/after, exact writes
37
53
  ```
38
54
 
55
+ `build-verifier` and `code-reviewer` also run the read-only write audit `node .ai.local/scripts/check-write-scope.mjs --slug <slug> --step <step-id>`: it labels every changed path `declared`, `derived`, or `out-of-scope` against the step's `writeScopes`. It is never a hook gate.
56
+
39
57
  `init` seeds the engine with **skip-if-exists** — a modified `run.mjs` stays yours and is reported as kept; there is no
40
58
  `--force`. Re-running `init` does not update a seeded module, so delete the file to pick up a newer engine. The seeded
41
59
  tree is byte-identical to `presets/_shared/ai-local/scripts/`, and `.ai.local/.gitignore` (created when absent, missing
42
- required lines appended to an existing file) ignores `*.lock`, `*.tmp`, `.rollback/`, `team.db`, `team.db-wal`,
43
- `team.db-shm`, and `team-db-errors.log`; the root `.gitignore` is never edited.
60
+ required lines appended to an existing file) ignores `*.lock`, `*.tmp`, `.rollback/`, `STOP`, `ESTOP`, `team.db`,
61
+ `team.db-wal`, `team.db-shm`, and `team-db-errors.log`; the root `.gitignore` is never edited.
62
+
63
+ The seeded engine copy is **skip-if-exists** too, so a consumer that already holds `.ai.local/scripts/rule-improver.mjs`
64
+ keeps the old engine and does **not** get the per-store budget split — the human store `.ai.local/rules/**` (≤ 5 rules,
65
+ ≤ 170 lines) and the machine store `.ai.local/conventions.md` (≤ 30 lines) now carry separate caps, the combined
66
+ envelope stays 200. The shipped `conventions.md` template is 27 non-empty lines, so a fresh install has three lines of
67
+ machine headroom before the loop stages instead. Delete the changed seeded modules and re-run `init` / `update`:
68
+
69
+ ```bash
70
+ rm .ai.local/scripts/rule-improver.mjs
71
+ rm .ai.local/scripts/run.mjs
72
+ rm .ai.local/scripts/team-db-schema.mjs
73
+ npx @bonesofspring/ai-rules update
74
+ ```
75
+
76
+ `--dry-run` and `--rollback` live in the newer `run.mjs` / `rule-improver.mjs`, so the same two deletions take them.
77
+
78
+ The 0.2.56 delete-task release also changes `team-db.mjs`, `team-db-project.mjs`, `team-db-api.mjs`, and
79
+ `team-db-openapi.mjs`; delete those too if you are taking both changes.
80
+
81
+ Promote a staged seed by hand; the engine never activates one on its own:
82
+
83
+ ```bash
84
+ node .ai.local/scripts/rule-improver.mjs --promote <stem>
85
+ ```
86
+
87
+ The command strips the provenance footer from `.ai.local/rules-library/<stem>.md`, writes the reviewed rule into
88
+ `.ai.local/rules/`, removes the seed, and appends a `seed-promoted` row bound to the reviewed snapshot. Every seed the
89
+ engine stages carries a four-field footer (`signature`, `stagedAt`, `sourceSlug`, `state: awaiting-human-promotion`); a
90
+ copy of a shipped template carries none.
91
+
92
+ Undo one auto-applied ledger entry; the command is fail-closed:
93
+
94
+ ```bash
95
+ node .ai.local/scripts/rule-improver.mjs --rollback <target|signature|ISO timestamp>
96
+ ```
97
+
98
+ `--rollback` resolves the newest matching `rule-changes.jsonl` entry, refuses when the
99
+ target changed since that entry or the ref is ambiguous, and appends a `rollback` safety row
100
+ that is itself the inverse. It writes nothing on refusal.
101
+
102
+ `--dry-run` runs the same derive and improver decision path as the real loop, prints
103
+ `DRY RUN — no files, signals, or ledger rows will be written`, and shows per signature the tier/action, target,
104
+ before/after, and the exact file and ledger writes it would perform. It creates no lock, no intent file, and no
105
+ signal append; `--status` stays read-only and unchanged.
44
106
 
45
107
  The same seeding ships `manifest.mjs`, the writer for `.ai.local/team/tasks/<slug>/artifact-manifest.json`:
46
108
 
@@ -95,6 +157,8 @@ Mavis never writes `~/.minimax/**`. OpenCode never writes `~/.config/opencode/**
95
157
 
96
158
  `update` reinstalls each tool whose `<tool>/.ai-rules-install.json` is already present, using the `preset` field `init` wrote (`platform` + `preset`). Slash command `/update` runs that CLI. A tool without a manifest stays uninstalled, and the recorded preset stays as stored. To switch preset, run `init <tool> --preset <name>`.
97
159
 
160
+ `doctor` is the read-only install-state check. For every installed platform it reports `missing` or `modified` managed files, a manifest without a `managedFiles` map, `legacy-manifest` for schema v1, and a `version-mismatch` between the manifest's `packageVersion` and the package you are running. Once per project it compares `.ai.local/scripts/` with `presets/_shared/ai-local/scripts/` and reports `stale-engine` (naming the module) or `missing-engine`; the F-1 class — an old `run.mjs` next to a newer `rule-improver.mjs` — is exactly one `stale-engine` finding. `--json` prints one object. Exit `0` means clean, `1` means findings, `2` means a usage error (unknown option, bad positional, bad `--cwd`). There is no `--fix`: fix by re-running `init` / `update` after deleting the changed seeded module.
161
+
98
162
  On session start (Cursor and Claude hooks; Mavis, OpenCode, and ZCode on the first reply) the preset compares that recorded `packageVersion` with the latest `@bonesofspring/ai-rules` release. When a newer release exists, the reply opens with a level-2 heading and a blockquote naming the installed version, the latest version, and `/update`. That block stays out of the task answer. `/update` then says the update finished successfully, or that it did not, without quoting the exit code.
99
163
 
100
164
  ## Stacks
@@ -128,6 +192,7 @@ Every installed preset ships requestable `anti-hallucination-contract` (not alwa
128
192
  - Guide: [`docs/PRESET-CONTRIBUTION.md`](docs/PRESET-CONTRIBUTION.md)
129
193
  - Overlay: [`docs/LOCAL-OVERLAY.md`](docs/LOCAL-OVERLAY.md)
130
194
  - MCP setup: [`docs/MCP-SETUP.md`](docs/MCP-SETUP.md)
195
+ - MCP catalog: [`docs/MCP-CATALOG.md`](docs/MCP-CATALOG.md)
131
196
  - Dogfood: [`scripts/sync-dogfood-cursor.sh`](scripts/sync-dogfood-cursor.sh), [`scripts/sync-dogfood-claude.sh`](scripts/sync-dogfood-claude.sh), [`scripts/sync-dogfood-mavis.sh`](scripts/sync-dogfood-mavis.sh), [`scripts/sync-dogfood-opencode.sh`](scripts/sync-dogfood-opencode.sh) — seeds `.ai.local/team`, preserves slugs
132
197
  - Gates: `yarn check:preset-structure`
133
198