@bonesofspring/ai-rules 0.2.56 → 0.2.57

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 (438) hide show
  1. package/CHANGELOG.md +66 -1
  2. package/README.md +27 -0
  3. package/docs/PRESET-CONTRIBUTION.md +13 -1
  4. package/docs/TEAM-DB.md +34 -1
  5. package/docs/openapi/team-db.v1.json +17 -2
  6. package/package.json +2 -1
  7. package/presets/_shared/ai-local/scripts/rule-improver.mjs +333 -26
  8. package/presets/_shared/ai-local/scripts/run.mjs +21 -6
  9. package/presets/_shared/ai-local/scripts/team-db-api.mjs +1 -0
  10. package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +6 -1
  11. package/presets/_shared/ai-local/scripts/team-db-project.mjs +1 -1
  12. package/presets/_shared/ai-local/scripts/team-db-schema.mjs +79 -9
  13. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +17 -6
  14. package/presets/_shared/core/quality/self-review-and-context-hygiene.md +3 -1
  15. package/presets/_shared/hooks/chain-team-phases.sh.tmpl +20 -15
  16. package/presets/claude/android-kotlin/agents/build-verifier.md +1 -1
  17. package/presets/claude/android-kotlin/agents/code-reviewer.md +1 -1
  18. package/presets/claude/android-kotlin/agents/debugger.md +1 -1
  19. package/presets/claude/android-kotlin/agents/feature-developer.md +1 -1
  20. package/presets/claude/android-kotlin/agents/task-analyst.md +1 -1
  21. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +20 -15
  22. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  23. package/presets/claude/go/agents/build-verifier.md +1 -1
  24. package/presets/claude/go/agents/code-reviewer.md +1 -1
  25. package/presets/claude/go/agents/debugger.md +1 -1
  26. package/presets/claude/go/agents/feature-developer.md +1 -1
  27. package/presets/claude/go/agents/task-analyst.md +1 -1
  28. package/presets/claude/go/hooks/chain-team-phases.sh +20 -15
  29. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  30. package/presets/claude/ios-swift/agents/build-verifier.md +1 -1
  31. package/presets/claude/ios-swift/agents/code-reviewer.md +1 -1
  32. package/presets/claude/ios-swift/agents/debugger.md +1 -1
  33. package/presets/claude/ios-swift/agents/feature-developer.md +1 -1
  34. package/presets/claude/ios-swift/agents/task-analyst.md +1 -1
  35. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +20 -15
  36. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  37. package/presets/claude/java/agents/build-verifier.md +1 -1
  38. package/presets/claude/java/agents/code-reviewer.md +1 -1
  39. package/presets/claude/java/agents/debugger.md +1 -1
  40. package/presets/claude/java/agents/feature-developer.md +1 -1
  41. package/presets/claude/java/agents/task-analyst.md +1 -1
  42. package/presets/claude/java/hooks/chain-team-phases.sh +20 -15
  43. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  44. package/presets/claude/mcp-ts/agents/build-verifier.md +1 -1
  45. package/presets/claude/mcp-ts/agents/feature-developer.md +1 -1
  46. package/presets/claude/mcp-ts/agents/task-analyst.md +1 -1
  47. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +20 -15
  48. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  49. package/presets/claude/mol/agents/build-verifier.md +1 -1
  50. package/presets/claude/mol/agents/code-reviewer.md +1 -1
  51. package/presets/claude/mol/agents/debugger.md +1 -1
  52. package/presets/claude/mol/agents/feature-developer.md +1 -1
  53. package/presets/claude/mol/agents/task-analyst.md +1 -1
  54. package/presets/claude/mol/hooks/chain-team-phases.sh +20 -15
  55. package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  56. package/presets/claude/next/agents/build-verifier.md +16 -1
  57. package/presets/claude/next/agents/code-reviewer.md +1 -1
  58. package/presets/claude/next/agents/debugger.md +1 -1
  59. package/presets/claude/next/agents/feature-developer.md +13 -1
  60. package/presets/claude/next/agents/task-analyst.md +1 -1
  61. package/presets/claude/next/agents/task-router.md +10 -0
  62. package/presets/claude/next/hooks/chain-team-phases.sh +20 -15
  63. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  64. package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +2 -1
  65. package/presets/claude/nuxt/agents/build-verifier.md +1 -1
  66. package/presets/claude/nuxt/agents/code-reviewer.md +1 -1
  67. package/presets/claude/nuxt/agents/debugger.md +1 -1
  68. package/presets/claude/nuxt/agents/feature-developer.md +1 -1
  69. package/presets/claude/nuxt/agents/task-analyst.md +1 -1
  70. package/presets/claude/nuxt/hooks/chain-team-phases.sh +20 -15
  71. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  72. package/presets/claude/php-hexagonal/agents/build-verifier.md +1 -1
  73. package/presets/claude/php-hexagonal/agents/code-reviewer.md +1 -1
  74. package/presets/claude/php-hexagonal/agents/debugger.md +1 -1
  75. package/presets/claude/php-hexagonal/agents/feature-developer.md +1 -1
  76. package/presets/claude/php-hexagonal/agents/task-analyst.md +1 -1
  77. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +20 -15
  78. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  79. package/presets/claude/php-laravel/agents/build-verifier.md +1 -1
  80. package/presets/claude/php-laravel/agents/code-reviewer.md +1 -1
  81. package/presets/claude/php-laravel/agents/debugger.md +1 -1
  82. package/presets/claude/php-laravel/agents/feature-developer.md +1 -1
  83. package/presets/claude/php-laravel/agents/task-analyst.md +1 -1
  84. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +20 -15
  85. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  86. package/presets/claude/svelte/agents/build-verifier.md +1 -1
  87. package/presets/claude/svelte/agents/code-reviewer.md +1 -1
  88. package/presets/claude/svelte/agents/debugger.md +1 -1
  89. package/presets/claude/svelte/agents/feature-developer.md +1 -1
  90. package/presets/claude/svelte/agents/task-analyst.md +1 -1
  91. package/presets/claude/svelte/hooks/chain-team-phases.sh +20 -15
  92. package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +17 -6
  93. package/presets/cursor/android-kotlin/agents/build-verifier.md +1 -1
  94. package/presets/cursor/android-kotlin/agents/code-reviewer.md +1 -1
  95. package/presets/cursor/android-kotlin/agents/debugger.md +1 -1
  96. package/presets/cursor/android-kotlin/agents/feature-developer.md +1 -1
  97. package/presets/cursor/android-kotlin/agents/task-analyst.md +1 -1
  98. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +20 -15
  99. package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +1 -1
  100. package/presets/cursor/go/agents/build-verifier.md +1 -1
  101. package/presets/cursor/go/agents/code-reviewer.md +1 -1
  102. package/presets/cursor/go/agents/debugger.md +1 -1
  103. package/presets/cursor/go/agents/feature-developer.md +1 -1
  104. package/presets/cursor/go/agents/task-analyst.md +1 -1
  105. package/presets/cursor/go/hooks/chain-team-phases.sh +20 -15
  106. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +1 -1
  107. package/presets/cursor/ios-swift/agents/build-verifier.md +1 -1
  108. package/presets/cursor/ios-swift/agents/code-reviewer.md +1 -1
  109. package/presets/cursor/ios-swift/agents/debugger.md +1 -1
  110. package/presets/cursor/ios-swift/agents/feature-developer.md +1 -1
  111. package/presets/cursor/ios-swift/agents/task-analyst.md +1 -1
  112. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +20 -15
  113. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +1 -1
  114. package/presets/cursor/java/agents/build-verifier.md +1 -1
  115. package/presets/cursor/java/agents/code-reviewer.md +1 -1
  116. package/presets/cursor/java/agents/debugger.md +1 -1
  117. package/presets/cursor/java/agents/feature-developer.md +1 -1
  118. package/presets/cursor/java/agents/task-analyst.md +1 -1
  119. package/presets/cursor/java/hooks/chain-team-phases.sh +20 -15
  120. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +1 -1
  121. package/presets/cursor/mcp-ts/agents/build-verifier.md +1 -1
  122. package/presets/cursor/mcp-ts/agents/feature-developer.md +1 -1
  123. package/presets/cursor/mcp-ts/agents/task-analyst.md +1 -1
  124. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +20 -15
  125. package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +1 -1
  126. package/presets/cursor/mol/agents/build-verifier.md +1 -1
  127. package/presets/cursor/mol/agents/code-reviewer.md +1 -1
  128. package/presets/cursor/mol/agents/debugger.md +1 -1
  129. package/presets/cursor/mol/agents/feature-developer.md +1 -1
  130. package/presets/cursor/mol/agents/task-analyst.md +1 -1
  131. package/presets/cursor/mol/hooks/chain-team-phases.sh +20 -15
  132. package/presets/cursor/mol/rules/agent-team-orchestrator.mdc +1 -1
  133. package/presets/cursor/next/agents/README.md +2 -0
  134. package/presets/cursor/next/agents/build-verifier.md +16 -1
  135. package/presets/cursor/next/agents/code-reviewer.md +1 -1
  136. package/presets/cursor/next/agents/debugger.md +1 -1
  137. package/presets/cursor/next/agents/feature-developer.md +13 -1
  138. package/presets/cursor/next/agents/task-analyst.md +1 -1
  139. package/presets/cursor/next/agents/task-router.md +10 -0
  140. package/presets/cursor/next/hooks/chain-team-phases.sh +20 -15
  141. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +1 -1
  142. package/presets/cursor/next/rules/code-review-mr.mdc +2 -1
  143. package/presets/cursor/next/team/fixtures/feature-l2-lite.json +27 -0
  144. package/presets/cursor/nuxt/agents/build-verifier.md +1 -1
  145. package/presets/cursor/nuxt/agents/code-reviewer.md +1 -1
  146. package/presets/cursor/nuxt/agents/debugger.md +1 -1
  147. package/presets/cursor/nuxt/agents/feature-developer.md +1 -1
  148. package/presets/cursor/nuxt/agents/task-analyst.md +1 -1
  149. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +20 -15
  150. package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +1 -1
  151. package/presets/cursor/php-hexagonal/agents/build-verifier.md +1 -1
  152. package/presets/cursor/php-hexagonal/agents/code-reviewer.md +1 -1
  153. package/presets/cursor/php-hexagonal/agents/debugger.md +1 -1
  154. package/presets/cursor/php-hexagonal/agents/feature-developer.md +1 -1
  155. package/presets/cursor/php-hexagonal/agents/task-analyst.md +1 -1
  156. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +20 -15
  157. package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +1 -1
  158. package/presets/cursor/php-laravel/agents/build-verifier.md +1 -1
  159. package/presets/cursor/php-laravel/agents/code-reviewer.md +1 -1
  160. package/presets/cursor/php-laravel/agents/debugger.md +1 -1
  161. package/presets/cursor/php-laravel/agents/feature-developer.md +1 -1
  162. package/presets/cursor/php-laravel/agents/task-analyst.md +1 -1
  163. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +20 -15
  164. package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +1 -1
  165. package/presets/cursor/svelte/agents/build-verifier.md +1 -1
  166. package/presets/cursor/svelte/agents/code-reviewer.md +1 -1
  167. package/presets/cursor/svelte/agents/debugger.md +1 -1
  168. package/presets/cursor/svelte/agents/feature-developer.md +1 -1
  169. package/presets/cursor/svelte/agents/task-analyst.md +1 -1
  170. package/presets/cursor/svelte/hooks/chain-team-phases.sh +20 -15
  171. package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +1 -1
  172. package/presets/mavis/android-kotlin/adapter-map.json +1 -1
  173. package/presets/mavis/android-kotlin/agents/build-verifier.md +1 -1
  174. package/presets/mavis/android-kotlin/agents/code-reviewer.md +1 -1
  175. package/presets/mavis/android-kotlin/agents/debugger.md +1 -1
  176. package/presets/mavis/android-kotlin/agents/feature-developer.md +1 -1
  177. package/presets/mavis/android-kotlin/agents/task-analyst.md +1 -1
  178. package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +20 -15
  179. package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +17 -6
  180. package/presets/mavis/go/adapter-map.json +1 -1
  181. package/presets/mavis/go/agents/build-verifier.md +1 -1
  182. package/presets/mavis/go/agents/code-reviewer.md +1 -1
  183. package/presets/mavis/go/agents/debugger.md +1 -1
  184. package/presets/mavis/go/agents/feature-developer.md +1 -1
  185. package/presets/mavis/go/agents/task-analyst.md +1 -1
  186. package/presets/mavis/go/hooks/chain-team-phases.sh +20 -15
  187. package/presets/mavis/go/rules/agent-team-orchestrator.md +17 -6
  188. package/presets/mavis/ios-swift/adapter-map.json +1 -1
  189. package/presets/mavis/ios-swift/agents/build-verifier.md +1 -1
  190. package/presets/mavis/ios-swift/agents/code-reviewer.md +1 -1
  191. package/presets/mavis/ios-swift/agents/debugger.md +1 -1
  192. package/presets/mavis/ios-swift/agents/feature-developer.md +1 -1
  193. package/presets/mavis/ios-swift/agents/task-analyst.md +1 -1
  194. package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +20 -15
  195. package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +17 -6
  196. package/presets/mavis/java/adapter-map.json +1 -1
  197. package/presets/mavis/java/agents/build-verifier.md +1 -1
  198. package/presets/mavis/java/agents/code-reviewer.md +1 -1
  199. package/presets/mavis/java/agents/debugger.md +1 -1
  200. package/presets/mavis/java/agents/feature-developer.md +1 -1
  201. package/presets/mavis/java/agents/task-analyst.md +1 -1
  202. package/presets/mavis/java/hooks/chain-team-phases.sh +20 -15
  203. package/presets/mavis/java/rules/agent-team-orchestrator.md +17 -6
  204. package/presets/mavis/mcp-ts/adapter-map.json +1 -1
  205. package/presets/mavis/mcp-ts/agents/build-verifier.md +1 -1
  206. package/presets/mavis/mcp-ts/agents/feature-developer.md +1 -1
  207. package/presets/mavis/mcp-ts/agents/task-analyst.md +1 -1
  208. package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +20 -15
  209. package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +17 -6
  210. package/presets/mavis/mol/adapter-map.json +1 -1
  211. package/presets/mavis/mol/agents/build-verifier.md +1 -1
  212. package/presets/mavis/mol/agents/code-reviewer.md +1 -1
  213. package/presets/mavis/mol/agents/debugger.md +1 -1
  214. package/presets/mavis/mol/agents/feature-developer.md +1 -1
  215. package/presets/mavis/mol/agents/task-analyst.md +1 -1
  216. package/presets/mavis/mol/hooks/chain-team-phases.sh +20 -15
  217. package/presets/mavis/mol/rules/agent-team-orchestrator.md +17 -6
  218. package/presets/mavis/next/adapter-map.json +9 -1
  219. package/presets/mavis/next/agents/build-verifier.md +16 -1
  220. package/presets/mavis/next/agents/code-reviewer.md +1 -1
  221. package/presets/mavis/next/agents/debugger.md +1 -1
  222. package/presets/mavis/next/agents/feature-developer.md +13 -1
  223. package/presets/mavis/next/agents/task-analyst.md +1 -1
  224. package/presets/mavis/next/agents/task-router.md +10 -0
  225. package/presets/mavis/next/hooks/chain-team-phases.sh +20 -15
  226. package/presets/mavis/next/rules/agent-team-orchestrator.md +17 -6
  227. package/presets/mavis/next/rules/code-review-mr.md +2 -1
  228. package/presets/mavis/next/team/fixtures/feature-l2-lite.json +27 -0
  229. package/presets/mavis/nuxt/adapter-map.json +1 -1
  230. package/presets/mavis/nuxt/agents/build-verifier.md +1 -1
  231. package/presets/mavis/nuxt/agents/code-reviewer.md +1 -1
  232. package/presets/mavis/nuxt/agents/debugger.md +1 -1
  233. package/presets/mavis/nuxt/agents/feature-developer.md +1 -1
  234. package/presets/mavis/nuxt/agents/task-analyst.md +1 -1
  235. package/presets/mavis/nuxt/hooks/chain-team-phases.sh +20 -15
  236. package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +17 -6
  237. package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
  238. package/presets/mavis/php-hexagonal/agents/build-verifier.md +1 -1
  239. package/presets/mavis/php-hexagonal/agents/code-reviewer.md +1 -1
  240. package/presets/mavis/php-hexagonal/agents/debugger.md +1 -1
  241. package/presets/mavis/php-hexagonal/agents/feature-developer.md +1 -1
  242. package/presets/mavis/php-hexagonal/agents/task-analyst.md +1 -1
  243. package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +20 -15
  244. package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +17 -6
  245. package/presets/mavis/php-laravel/adapter-map.json +1 -1
  246. package/presets/mavis/php-laravel/agents/build-verifier.md +1 -1
  247. package/presets/mavis/php-laravel/agents/code-reviewer.md +1 -1
  248. package/presets/mavis/php-laravel/agents/debugger.md +1 -1
  249. package/presets/mavis/php-laravel/agents/feature-developer.md +1 -1
  250. package/presets/mavis/php-laravel/agents/task-analyst.md +1 -1
  251. package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +20 -15
  252. package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +17 -6
  253. package/presets/mavis/svelte/adapter-map.json +1 -1
  254. package/presets/mavis/svelte/agents/build-verifier.md +1 -1
  255. package/presets/mavis/svelte/agents/code-reviewer.md +1 -1
  256. package/presets/mavis/svelte/agents/debugger.md +1 -1
  257. package/presets/mavis/svelte/agents/feature-developer.md +1 -1
  258. package/presets/mavis/svelte/agents/task-analyst.md +1 -1
  259. package/presets/mavis/svelte/hooks/chain-team-phases.sh +20 -15
  260. package/presets/mavis/svelte/rules/agent-team-orchestrator.md +17 -6
  261. package/presets/opencode/android-kotlin/adapter-map.json +1 -1
  262. package/presets/opencode/android-kotlin/agents/build-verifier.md +1 -1
  263. package/presets/opencode/android-kotlin/agents/code-reviewer.md +1 -1
  264. package/presets/opencode/android-kotlin/agents/debugger.md +1 -1
  265. package/presets/opencode/android-kotlin/agents/feature-developer.md +1 -1
  266. package/presets/opencode/android-kotlin/agents/task-analyst.md +1 -1
  267. package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +20 -15
  268. package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +17 -6
  269. package/presets/opencode/go/adapter-map.json +1 -1
  270. package/presets/opencode/go/agents/build-verifier.md +1 -1
  271. package/presets/opencode/go/agents/code-reviewer.md +1 -1
  272. package/presets/opencode/go/agents/debugger.md +1 -1
  273. package/presets/opencode/go/agents/feature-developer.md +1 -1
  274. package/presets/opencode/go/agents/task-analyst.md +1 -1
  275. package/presets/opencode/go/hooks/chain-team-phases.sh +20 -15
  276. package/presets/opencode/go/rules/agent-team-orchestrator.md +17 -6
  277. package/presets/opencode/ios-swift/adapter-map.json +1 -1
  278. package/presets/opencode/ios-swift/agents/build-verifier.md +1 -1
  279. package/presets/opencode/ios-swift/agents/code-reviewer.md +1 -1
  280. package/presets/opencode/ios-swift/agents/debugger.md +1 -1
  281. package/presets/opencode/ios-swift/agents/feature-developer.md +1 -1
  282. package/presets/opencode/ios-swift/agents/task-analyst.md +1 -1
  283. package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +20 -15
  284. package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +17 -6
  285. package/presets/opencode/java/adapter-map.json +1 -1
  286. package/presets/opencode/java/agents/build-verifier.md +1 -1
  287. package/presets/opencode/java/agents/code-reviewer.md +1 -1
  288. package/presets/opencode/java/agents/debugger.md +1 -1
  289. package/presets/opencode/java/agents/feature-developer.md +1 -1
  290. package/presets/opencode/java/agents/task-analyst.md +1 -1
  291. package/presets/opencode/java/hooks/chain-team-phases.sh +20 -15
  292. package/presets/opencode/java/rules/agent-team-orchestrator.md +17 -6
  293. package/presets/opencode/mcp-ts/adapter-map.json +1 -1
  294. package/presets/opencode/mcp-ts/agents/build-verifier.md +1 -1
  295. package/presets/opencode/mcp-ts/agents/feature-developer.md +1 -1
  296. package/presets/opencode/mcp-ts/agents/task-analyst.md +1 -1
  297. package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +20 -15
  298. package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +17 -6
  299. package/presets/opencode/mol/adapter-map.json +1 -1
  300. package/presets/opencode/mol/agents/build-verifier.md +1 -1
  301. package/presets/opencode/mol/agents/code-reviewer.md +1 -1
  302. package/presets/opencode/mol/agents/debugger.md +1 -1
  303. package/presets/opencode/mol/agents/feature-developer.md +1 -1
  304. package/presets/opencode/mol/agents/task-analyst.md +1 -1
  305. package/presets/opencode/mol/hooks/chain-team-phases.sh +20 -15
  306. package/presets/opencode/mol/rules/agent-team-orchestrator.md +17 -6
  307. package/presets/opencode/next/adapter-map.json +9 -1
  308. package/presets/opencode/next/agents/build-verifier.md +16 -1
  309. package/presets/opencode/next/agents/code-reviewer.md +1 -1
  310. package/presets/opencode/next/agents/debugger.md +1 -1
  311. package/presets/opencode/next/agents/feature-developer.md +13 -1
  312. package/presets/opencode/next/agents/task-analyst.md +1 -1
  313. package/presets/opencode/next/agents/task-router.md +10 -0
  314. package/presets/opencode/next/hooks/chain-team-phases.sh +20 -15
  315. package/presets/opencode/next/rules/agent-team-orchestrator.md +17 -6
  316. package/presets/opencode/next/rules/code-review-mr.md +2 -1
  317. package/presets/opencode/next/team/fixtures/feature-l2-lite.json +27 -0
  318. package/presets/opencode/nuxt/adapter-map.json +1 -1
  319. package/presets/opencode/nuxt/agents/build-verifier.md +1 -1
  320. package/presets/opencode/nuxt/agents/code-reviewer.md +1 -1
  321. package/presets/opencode/nuxt/agents/debugger.md +1 -1
  322. package/presets/opencode/nuxt/agents/feature-developer.md +1 -1
  323. package/presets/opencode/nuxt/agents/task-analyst.md +1 -1
  324. package/presets/opencode/nuxt/hooks/chain-team-phases.sh +20 -15
  325. package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +17 -6
  326. package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
  327. package/presets/opencode/php-hexagonal/agents/build-verifier.md +1 -1
  328. package/presets/opencode/php-hexagonal/agents/code-reviewer.md +1 -1
  329. package/presets/opencode/php-hexagonal/agents/debugger.md +1 -1
  330. package/presets/opencode/php-hexagonal/agents/feature-developer.md +1 -1
  331. package/presets/opencode/php-hexagonal/agents/task-analyst.md +1 -1
  332. package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +20 -15
  333. package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +17 -6
  334. package/presets/opencode/php-laravel/adapter-map.json +1 -1
  335. package/presets/opencode/php-laravel/agents/build-verifier.md +1 -1
  336. package/presets/opencode/php-laravel/agents/code-reviewer.md +1 -1
  337. package/presets/opencode/php-laravel/agents/debugger.md +1 -1
  338. package/presets/opencode/php-laravel/agents/feature-developer.md +1 -1
  339. package/presets/opencode/php-laravel/agents/task-analyst.md +1 -1
  340. package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +20 -15
  341. package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +17 -6
  342. package/presets/opencode/svelte/adapter-map.json +1 -1
  343. package/presets/opencode/svelte/agents/build-verifier.md +1 -1
  344. package/presets/opencode/svelte/agents/code-reviewer.md +1 -1
  345. package/presets/opencode/svelte/agents/debugger.md +1 -1
  346. package/presets/opencode/svelte/agents/feature-developer.md +1 -1
  347. package/presets/opencode/svelte/agents/task-analyst.md +1 -1
  348. package/presets/opencode/svelte/hooks/chain-team-phases.sh +20 -15
  349. package/presets/opencode/svelte/rules/agent-team-orchestrator.md +17 -6
  350. package/presets/zcode/android-kotlin/adapter-map.json +1 -1
  351. package/presets/zcode/android-kotlin/agents/build-verifier.md +1 -1
  352. package/presets/zcode/android-kotlin/agents/code-reviewer.md +1 -1
  353. package/presets/zcode/android-kotlin/agents/debugger.md +1 -1
  354. package/presets/zcode/android-kotlin/agents/feature-developer.md +1 -1
  355. package/presets/zcode/android-kotlin/agents/task-analyst.md +1 -1
  356. package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +20 -15
  357. package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +17 -6
  358. package/presets/zcode/go/adapter-map.json +1 -1
  359. package/presets/zcode/go/agents/build-verifier.md +1 -1
  360. package/presets/zcode/go/agents/code-reviewer.md +1 -1
  361. package/presets/zcode/go/agents/debugger.md +1 -1
  362. package/presets/zcode/go/agents/feature-developer.md +1 -1
  363. package/presets/zcode/go/agents/task-analyst.md +1 -1
  364. package/presets/zcode/go/hooks/chain-team-phases.sh +20 -15
  365. package/presets/zcode/go/rules/agent-team-orchestrator.md +17 -6
  366. package/presets/zcode/ios-swift/adapter-map.json +1 -1
  367. package/presets/zcode/ios-swift/agents/build-verifier.md +1 -1
  368. package/presets/zcode/ios-swift/agents/code-reviewer.md +1 -1
  369. package/presets/zcode/ios-swift/agents/debugger.md +1 -1
  370. package/presets/zcode/ios-swift/agents/feature-developer.md +1 -1
  371. package/presets/zcode/ios-swift/agents/task-analyst.md +1 -1
  372. package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +20 -15
  373. package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +17 -6
  374. package/presets/zcode/java/adapter-map.json +1 -1
  375. package/presets/zcode/java/agents/build-verifier.md +1 -1
  376. package/presets/zcode/java/agents/code-reviewer.md +1 -1
  377. package/presets/zcode/java/agents/debugger.md +1 -1
  378. package/presets/zcode/java/agents/feature-developer.md +1 -1
  379. package/presets/zcode/java/agents/task-analyst.md +1 -1
  380. package/presets/zcode/java/hooks/chain-team-phases.sh +20 -15
  381. package/presets/zcode/java/rules/agent-team-orchestrator.md +17 -6
  382. package/presets/zcode/mcp-ts/adapter-map.json +1 -1
  383. package/presets/zcode/mcp-ts/agents/build-verifier.md +1 -1
  384. package/presets/zcode/mcp-ts/agents/feature-developer.md +1 -1
  385. package/presets/zcode/mcp-ts/agents/task-analyst.md +1 -1
  386. package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +20 -15
  387. package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +17 -6
  388. package/presets/zcode/mol/adapter-map.json +1 -1
  389. package/presets/zcode/mol/agents/build-verifier.md +1 -1
  390. package/presets/zcode/mol/agents/code-reviewer.md +1 -1
  391. package/presets/zcode/mol/agents/debugger.md +1 -1
  392. package/presets/zcode/mol/agents/feature-developer.md +1 -1
  393. package/presets/zcode/mol/agents/task-analyst.md +1 -1
  394. package/presets/zcode/mol/hooks/chain-team-phases.sh +20 -15
  395. package/presets/zcode/mol/rules/agent-team-orchestrator.md +17 -6
  396. package/presets/zcode/next/adapter-map.json +9 -1
  397. package/presets/zcode/next/agents/build-verifier.md +16 -1
  398. package/presets/zcode/next/agents/code-reviewer.md +1 -1
  399. package/presets/zcode/next/agents/debugger.md +1 -1
  400. package/presets/zcode/next/agents/feature-developer.md +13 -1
  401. package/presets/zcode/next/agents/task-analyst.md +1 -1
  402. package/presets/zcode/next/agents/task-router.md +10 -0
  403. package/presets/zcode/next/hooks/chain-team-phases.sh +20 -15
  404. package/presets/zcode/next/rules/agent-team-orchestrator.md +17 -6
  405. package/presets/zcode/next/rules/code-review-mr.md +2 -1
  406. package/presets/zcode/next/team/fixtures/feature-l2-lite.json +27 -0
  407. package/presets/zcode/nuxt/adapter-map.json +1 -1
  408. package/presets/zcode/nuxt/agents/build-verifier.md +1 -1
  409. package/presets/zcode/nuxt/agents/code-reviewer.md +1 -1
  410. package/presets/zcode/nuxt/agents/debugger.md +1 -1
  411. package/presets/zcode/nuxt/agents/feature-developer.md +1 -1
  412. package/presets/zcode/nuxt/agents/task-analyst.md +1 -1
  413. package/presets/zcode/nuxt/hooks/chain-team-phases.sh +20 -15
  414. package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +17 -6
  415. package/presets/zcode/php-hexagonal/adapter-map.json +1 -1
  416. package/presets/zcode/php-hexagonal/agents/build-verifier.md +1 -1
  417. package/presets/zcode/php-hexagonal/agents/code-reviewer.md +1 -1
  418. package/presets/zcode/php-hexagonal/agents/debugger.md +1 -1
  419. package/presets/zcode/php-hexagonal/agents/feature-developer.md +1 -1
  420. package/presets/zcode/php-hexagonal/agents/task-analyst.md +1 -1
  421. package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +20 -15
  422. package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +17 -6
  423. package/presets/zcode/php-laravel/adapter-map.json +1 -1
  424. package/presets/zcode/php-laravel/agents/build-verifier.md +1 -1
  425. package/presets/zcode/php-laravel/agents/code-reviewer.md +1 -1
  426. package/presets/zcode/php-laravel/agents/debugger.md +1 -1
  427. package/presets/zcode/php-laravel/agents/feature-developer.md +1 -1
  428. package/presets/zcode/php-laravel/agents/task-analyst.md +1 -1
  429. package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +20 -15
  430. package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +17 -6
  431. package/presets/zcode/svelte/adapter-map.json +1 -1
  432. package/presets/zcode/svelte/agents/build-verifier.md +1 -1
  433. package/presets/zcode/svelte/agents/code-reviewer.md +1 -1
  434. package/presets/zcode/svelte/agents/debugger.md +1 -1
  435. package/presets/zcode/svelte/agents/feature-developer.md +1 -1
  436. package/presets/zcode/svelte/agents/task-analyst.md +1 -1
  437. package/presets/zcode/svelte/hooks/chain-team-phases.sh +20 -15
  438. package/presets/zcode/svelte/rules/agent-team-orchestrator.md +17 -6
package/CHANGELOG.md CHANGED
@@ -1,6 +1,60 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## 0.2.57
4
+
5
+ ### L2-lite and a lighter bounded-contract pipeline
6
+
7
+ - **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.
8
+ - **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.
9
+ - **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/`.
10
+ - **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.
11
+
12
+ ### Model tiers and a usage ledger
13
+
14
+ - **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.
15
+ - **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.
16
+ - **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.
17
+
18
+ ### The chain hook takes its slug explicitly
19
+
20
+ - **`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.
21
+ - **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.
22
+
23
+ ### A delta classifier for retries
24
+
25
+ - **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`.
26
+ - **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.
27
+ - **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.
28
+
29
+ ### Health reports its capabilities
30
+
31
+ - **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.
32
+ - **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.
33
+ - **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.
34
+
35
+ ### Requirements: one canonical block, stage rows downstream
36
+
37
+ - **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.
38
+ - **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.
39
+ - **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.
40
+
41
+ ### UI deltas close the existing expectations
42
+
43
+ - **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.
44
+ - **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.
45
+
46
+ ### Real delete coverage
47
+
48
+ - **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.
49
+
50
+ ### Upgrade
51
+
52
+ - Run `npx @bonesofspring/ai-rules update` to refresh the 55 hooks, the shared orchestrator core, the `next` agents/rules, and the generated platform trees.
53
+ - `.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.
54
+ - `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.
55
+ - `task-levels.md` is consumer-owned; add the L2-lite level and selection-order rows to an existing overlay to activate it.
56
+
57
+ ## 0.2.56
4
58
 
5
59
  ### Confirmed task delete
6
60
 
@@ -15,6 +69,17 @@
15
69
  - 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
70
  - `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
71
 
72
+ ### Six preset and overlay improvements
73
+
74
+ - **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.
75
+ - **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.
76
+ - **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.
77
+ - **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.
78
+ - **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.
79
+ - **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.
80
+ - **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.
81
+ - **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.
82
+
18
83
  ## 0.2.55
19
84
 
20
85
  ### $mol preset (eleventh stack)
package/README.md CHANGED
@@ -42,6 +42,33 @@ tree is byte-identical to `presets/_shared/ai-local/scripts/`, and `.ai.local/.g
42
42
  required lines appended to an existing file) ignores `*.lock`, `*.tmp`, `.rollback/`, `team.db`, `team.db-wal`,
43
43
  `team.db-shm`, and `team-db-errors.log`; the root `.gitignore` is never edited.
44
44
 
45
+ The seeded engine copy is **skip-if-exists** too, so a consumer that already holds `.ai.local/scripts/rule-improver.mjs`
46
+ keeps the old engine and does **not** get the per-store budget split — the human store `.ai.local/rules/**` (≤ 5 rules,
47
+ ≤ 170 lines) and the machine store `.ai.local/conventions.md` (≤ 30 lines) now carry separate caps, the combined
48
+ envelope stays 200. The shipped `conventions.md` template is 27 non-empty lines, so a fresh install has three lines of
49
+ machine headroom before the loop stages instead. Delete the changed seeded modules and re-run `init` / `update`:
50
+
51
+ ```bash
52
+ rm .ai.local/scripts/rule-improver.mjs
53
+ rm .ai.local/scripts/run.mjs
54
+ rm .ai.local/scripts/team-db-schema.mjs
55
+ npx @bonesofspring/ai-rules update
56
+ ```
57
+
58
+ The 0.2.56 delete-task release also changes `team-db.mjs`, `team-db-project.mjs`, `team-db-api.mjs`, and
59
+ `team-db-openapi.mjs`; delete those too if you are taking both changes.
60
+
61
+ Promote a staged seed by hand; the engine never activates one on its own:
62
+
63
+ ```bash
64
+ node .ai.local/scripts/rule-improver.mjs --promote <stem>
65
+ ```
66
+
67
+ The command strips the provenance footer from `.ai.local/rules-library/<stem>.md`, writes the reviewed rule into
68
+ `.ai.local/rules/`, removes the seed, and appends a `seed-promoted` row bound to the reviewed snapshot. Every seed the
69
+ engine stages carries a four-field footer (`signature`, `stagedAt`, `sourceSlug`, `state: awaiting-human-promotion`); a
70
+ copy of a shipped template carries none.
71
+
45
72
  The same seeding ships `manifest.mjs`, the writer for `.ai.local/team/tasks/<slug>/artifact-manifest.json`:
46
73
 
47
74
  ```bash
@@ -413,7 +413,7 @@ Load these when editing files under `packages/ai-rules/presets/**`, `.cursor/**`
413
413
  | `scripts/check-preset-twin-drift.mjs` / `yarn check:preset-twin-drift` | **FAIL** when a hand-maintained Claude twin (`presets/claude/<stack>/{commands,skills}/**/*.md`) drifts further from its Cursor source than `scripts/_lib/claude-twin-drift-baseline.json` records, when the recorded divergence between the twins changes while the line delta does not, when a command/skill has no twin on the other side, when a new pair has no baseline row, when a baseline row has no live pair, or when the baseline itself is missing its hash rows. Full parity is not required: mirror a change in both twins (delta and divergence unchanged) or record a deliberate divergence with `--update`. Raising an allowance needs `--update --widen`; dropping a row needs `--update --prune`. Fixture `test-preset-twin-drift.mjs`. |
414
414
  | `scripts/check-claude-agent-parity.mjs` / `yarn check:claude-agent-parity` | **FAIL** when a hand-maintained Claude `agents/*.md` twin drifts from its Cursor source beyond `scripts/_lib/claude-agent-parity-baseline.json`: a grown or shrunk normalized line delta, a one-sided rewrite at an unchanged delta, a changed divergence hash, a missing twin, an unrecorded pair, an orphan row, or a pair in the static `parity` allowlist that is not at delta 0. Normalization masks packaging only — YAML frontmatter, the `## Rules to load (subagent context)` block, `<!-- shared-core -->` markers, the two anti-hallucination load lines, the `.cursor/` / `.claude/` root, and `.mdc` → `.md` — and reuses the twin-drift diff helpers. `--update` re-records deltas and hashes; `--widen` / `--prune` gate a raised allowance or a dropped row; `parity` is never edited by `--update`. Fixture `test-claude-agent-parity.mjs` proves one-sided Claude FAIL, one-sided Cursor FAIL and mirrored PASS. Wired into `check-preset-structure.sh` next to `claude-agent-blocks`. |
415
415
  | `scripts/check-consumer-links.mjs` / `yarn check:consumer-links` | **FAIL** when a generated Claude rule or agent carries a source-only `.cursor/` path or a `.mdc` reference whose stem resolves through `claude/<stack>/rules/README.md`; `README.md` and `preset-*.md` are exempt by class. `scripts/_lib/claude-consumer-link-allowlist.json` records the legitimate lines one hash at a time; a stale row fails, and a planted line in an allowlisted file still fails unless it matches the recorded hash. `--update` re-hashes recorded rows only and refuses to add one. Scans `next` by default; `--stack` opts another stack in. Fixture `test-consumer-links.mjs`. Wired into `check-preset-structure.sh` next to `generated-drift`. |
416
- | `scripts/check-preset-token-budget.sh` / `yarn check:preset-token-budget` | **FAIL** if Cursor `alwaysApply: true` or Claude no-`paths:` (excl. README) count is outside **3–10**, `preset-*` always-on, or intended body sum > **4000**. Stacks include `nuxt`, `svelte`. |
416
+ | `scripts/check-preset-token-budget.sh` / `yarn check:preset-token-budget` | **FAIL** if Cursor `alwaysApply: true` or Claude no-`paths:` (excl. README) count is outside **3–10**, `preset-*` always-on, or intended body sum > **4000**. Stacks include `nuxt`, `svelte`. CI also compares the baseline to the base revision (`--base`); a widening needs `--update --widen`. |
417
417
  | `scripts/check-preset-leakage.sh` / `yarn check:preset-leakage` | **FAIL** on forbidden stems in `hooks/**/*.sh` (recursive), wrong-stack agent filenames, or **positive** (non-negation) agent body mentions; **FAIL** if chain scripts are byte-identical across stacks. Explicit **negation** of forbidden stems in agent bodies is **suppressed** (INFO summary count only — not a merge blocker). Non-negation mentions in `build-verifier` → **WARN only**. |
418
418
  | `scripts/check-preset-prompt-persistence.sh` / `yarn check:preset-structure` | **FAIL** if the prompt-persistence contract (`prompt.md` + the append-only `prompt-log.md` ledger, both on the `routing` entry) is missing from any platform × stack command (`task.md` + `task-continue.md`), orchestrator, or intake body, from the **always-on** root `REPO_AGENTS.md` entry (check **E** — reachability without `/task`), or a core `agent-artifact-contracts` anchor (`## Prompt artifact` / `## Prompt log`) is gone; **refuses vacuous PASS** when the iteration set is empty. Wired into `check-preset-structure.sh` next to `goal-contract`; fixture `test-preset-prompt-persistence-fixtures.mjs`. |
419
419
  | `scripts/check-preset-reachability.sh` / `yarn check:preset-reachability` | **FAIL** if a non-`preset-*` OpenCode/Mavis rule is reachable by neither a direct reference (entry / agent / command / skill) nor the transitive closure of rule→rule references from the `root-entry` rules. `preset-*` meta rules are exempt as preset-authoring-only. **Refuses vacuous PASS** on an empty iteration set. Wired into `check-preset-structure.sh` next to `prompt-persistence`. |
@@ -466,6 +466,18 @@ Skills are behavior-shaping, not essays. When adding or editing `skills/**/SKILL
466
466
 
467
467
  Author-only: this section is **not** copied by `init`.
468
468
 
469
+ ### Advisory tier (rule authoring)
470
+
471
+ `scripts/check-preset-authoring-advisory.mjs` is the third tier: it reports, it never blocks.
472
+
473
+ - Expect four finding classes: `restated-stem`, `paraphrased-when-do`, `unjustified-body-size`, `issue-number-density`.
474
+ - Expect one line per finding and a final `advisory-findings: <n>`; the checker always exits `0`.
475
+ - Read a finding as a review item, never as a gate failure.
476
+ - Run it through `check:preset-structure`: the `authoring-advisory` row is non-blocking (`<<< authoring-advisory: WARN (<n> finding(s); not a hard gate)`), so `check:all` stays green with findings present.
477
+ - Read the per-rule body threshold (`advisoryPerRuleBodyCap`) from `scripts/_lib/preset-token-budget-baseline.json` — the same baseline the blocking token-budget gate reads. The advisory tier holds no cap literal of its own; the threshold is advisory metadata, not one of the five ratcheted hard caps.
478
+ - Fix a `restated-stem` finding by linking the sibling stem instead of repeating its sentence.
479
+ - Keep the tier out of the pipeline hook tree: it is a repository gate, not a hook.
480
+
469
481
  ### B1–B5 stems (all stacks)
470
482
 
471
483
  | Stem | Drift mode | Why | Consumers |
package/docs/TEAM-DB.md CHANGED
@@ -157,13 +157,44 @@ and sets `content_omitted=size` (binary content sets `binary`). Raw content olde
157
157
  days on an absent task is nulled only by `sync --maintain`; `sync --vacuum` checkpoints WAL and
158
158
  runs `VACUUM`. The `sync_runs` table keeps the newest 200 runs.
159
159
 
160
+ ### FTS shape registry
161
+
162
+ `team-db-schema.mjs` enumerates the released search layouts in `FTS_SHAPES`, oldest-first, with the current shape
163
+ last. One shape is released today: `fts5-v1` — columns `task_slug UNINDEXED`, `doc_path UNINDEXED`, `kind
164
+ UNINDEXED`, `body`, tokenizer `unicode61 remove_diacritics 2`. `CURRENT_FTS_SHAPE` is the last entry; append the next
165
+ layout, never edit a released one in place.
166
+
167
+ The shape identity is recorded in `schema_meta` under the key `search_fts_shape`, next to the `search` mode row. The
168
+ token is written **only when the search table is created**: a database that predates the registry keeps an absent
169
+ token and keeps being reported.
170
+
171
+ `detectFtsShapeDrift(db)` returns one of five states:
172
+
173
+ | State | Meaning |
174
+ |---|---|
175
+ | `absent` | no `search_fts` table — the runtime stayed on the `LIKE` path |
176
+ | `current` | the recorded token is the current shape and the installed columns match it |
177
+ | `unrecorded` | the table exists and no `search_fts_shape` row does — a pre-registry database |
178
+ | `superseded` | the recorded token names a released, older shape |
179
+ | `unknown` | the token names no released shape, or the installed columns differ from the recorded shape |
180
+
181
+ Drift is **reported, never repaired**: the live table is never dropped, altered, or rebuilt, the database stays
182
+ readable, and the existing rebuild path (`team-db.mjs sync --rebuild`) stays the remedy. `team-db.mjs check` names a
183
+ drifted state in its `search-shape <state>` field.
184
+
185
+ The registry is not a migration chain: `MIGRATIONS` and `SCHEMA_VERSION` are unchanged, `E_SCHEMA_NEWER` still fails
186
+ closed, and FTS5 stays a **runtime capability** — a runtime without FTS5 records `like` in `schema_meta`, so the
187
+ registry never turns FTS5 into a hard schema dependency.
188
+
160
189
  ## Dashboard and API
161
190
 
162
191
  `team-db.mjs serve` prints one line with the bound URL (default
163
192
  `http://127.0.0.1:4178`). The dashboard is a single no-build HTML document at `/`, its CSS and
164
193
  JS are served from `/assets/`, and the OpenAPI 3.1 document is at `/openapi.json`. The frozen
165
194
  document is checked in at `packages/ai-rules/docs/openapi/team-db.v1.json`; the gate is
166
- `node scripts/check-team-db-contract.mjs`.
195
+ `node scripts/check-team-db-contract.mjs`. The server loads its modules at start: restart
196
+ `serve` after an update to take a new route or method set — a stale process keeps answering
197
+ the old surface (for example, `405` on a route the new code serves).
167
198
 
168
199
  The API exposes the delete as `DELETE /api/v1/tasks/{slug}` — the same canonical deletion
169
200
  as the CLI, executed as one bounded child. It answers `200` with `{"slug":"<S>"}` on
@@ -180,6 +211,8 @@ Security boundary: loopback bind by default (`--host` outside loopback needs
180
211
  `--allow-remote`, and a wildcard address is refused), exact `Host`/`Origin` allow-list,
181
212
  no `Access-Control-*` header, hardened response headers, request bodies bounded at 1 KiB,
182
213
  document chunks at 1 MiB, exports at 5 MiB, parameterized SQL only, and no outbound call.
214
+ `--allow-remote` also exposes the confirmed delete and the rescan to the named interface
215
+ without authentication.
183
216
 
184
217
  ## Privacy and retention
185
218
 
@@ -4782,13 +4782,24 @@
4782
4782
  "string",
4783
4783
  "null"
4784
4784
  ]
4785
+ },
4786
+ "capabilities": {
4787
+ "type": "array",
4788
+ "items": {
4789
+ "type": "string",
4790
+ "enum": [
4791
+ "sync",
4792
+ "delete"
4793
+ ]
4794
+ }
4785
4795
  }
4786
4796
  },
4787
4797
  "required": [
4788
4798
  "status",
4789
4799
  "db",
4790
4800
  "tasks",
4791
- "projectedAt"
4801
+ "projectedAt",
4802
+ "capabilities"
4792
4803
  ],
4793
4804
  "examples": [
4794
4805
  {
@@ -4804,7 +4815,11 @@
4804
4815
  "total": 90,
4805
4816
  "absent": 0
4806
4817
  },
4807
- "projectedAt": "2026-11-06T08:00:04.000Z"
4818
+ "projectedAt": "2026-11-06T08:00:04.000Z",
4819
+ "capabilities": [
4820
+ "sync",
4821
+ "delete"
4822
+ ]
4808
4823
  }
4809
4824
  ]
4810
4825
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonesofspring/ai-rules",
3
- "version": "0.2.56",
3
+ "version": "0.2.57",
4
4
  "description": "Presets of Cursor, Claude, Mavis, OpenCode, and ZCode rules/commands for Revy Ross personal use",
5
5
  "license": "MIT",
6
6
  "author": "Revy Ross",
@@ -38,6 +38,7 @@
38
38
  "check:fast": "AI_RULES_SKIP_HOOK_TESTS=1 bash scripts/check-preset-structure.sh",
39
39
  "test:hooks": "node scripts/test-chain-team-phases-coverage.mjs && node scripts/test-agent-task-metrics-hooks.mjs",
40
40
  "check:preset-structure": "bash scripts/check-preset-structure.sh",
41
+ "check:preset-delta": "node scripts/check-preset-delta.mjs",
41
42
  "check:parallel-plan": "bash scripts/check-parallel-plan.sh",
42
43
  "check:step-graph-contract": "bash scripts/check-step-graph-contract.sh",
43
44
  "test:parallel-plan-fixtures": "node scripts/test-parallel-plan-fixtures.mjs",