@bonesofspring/ai-rules 0.2.37 → 0.2.38

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 (749) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +23 -2
  3. package/bin/cli.js +106 -1
  4. package/bin/lib/engine-scripts.js +22 -0
  5. package/bin/lib/fs-utils.js +78 -11
  6. package/bin/lib/merged-config.js +30 -16
  7. package/bin/lib/seed-ai-local-team.js +160 -12
  8. package/bin/opencode-install.js +37 -52
  9. package/docs/OPENCODE.md +4 -4
  10. package/docs/specs/INDEX.md +5 -2
  11. package/package.json +4 -1
  12. package/presets/_shared/ai-local/scripts/derive-gate-signals.mjs +173 -0
  13. package/presets/_shared/ai-local/scripts/efficacy-oracle.mjs +576 -0
  14. package/presets/_shared/ai-local/scripts/lock.mjs +118 -0
  15. package/presets/_shared/ai-local/scripts/rule-improver.mjs +795 -0
  16. package/presets/_shared/ai-local/scripts/run.mjs +309 -0
  17. package/presets/_shared/ai-local/scripts/signals.mjs +256 -0
  18. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +1 -1
  19. package/presets/_shared/core/quality/self-review-and-context-hygiene.md +8 -7
  20. package/presets/_shared/hooks/README.md +5 -0
  21. package/presets/_shared/hooks/chain-team-phases.sh.tmpl +107 -18
  22. package/presets/_shared/hooks/check-preset-update.mjs +227 -0
  23. package/presets/claude/android-kotlin/CLAUDE.md +1 -1
  24. package/presets/claude/android-kotlin/REPO_AGENTS.md +14 -0
  25. package/presets/claude/android-kotlin/agents/build-verifier.md +1 -1
  26. package/presets/claude/android-kotlin/agents/code-reviewer.md +1 -1
  27. package/presets/claude/android-kotlin/agents/debugger.md +1 -1
  28. package/presets/claude/android-kotlin/agents/feature-developer.md +1 -1
  29. package/presets/claude/android-kotlin/agents/task-analyst.md +1 -1
  30. package/presets/claude/android-kotlin/commands/README.md +1 -0
  31. package/presets/claude/android-kotlin/commands/task-continue.md +9 -0
  32. package/presets/claude/android-kotlin/commands/technical-retro.md +8 -0
  33. package/presets/claude/android-kotlin/commands/update.md +39 -0
  34. package/presets/claude/android-kotlin/hooks/README.md +1 -0
  35. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +107 -18
  36. package/presets/claude/android-kotlin/hooks/check-preset-update.mjs +227 -0
  37. package/presets/claude/android-kotlin/hooks/examples/README.md +1 -1
  38. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  39. package/presets/claude/android-kotlin/settings.json +14 -1
  40. package/presets/claude/android-kotlin/skills/technical-retro/SKILL.md +2 -0
  41. package/presets/claude/go/CLAUDE.md +1 -1
  42. package/presets/claude/go/REPO_AGENTS.md +14 -0
  43. package/presets/claude/go/agents/build-verifier.md +1 -1
  44. package/presets/claude/go/agents/code-reviewer.md +1 -1
  45. package/presets/claude/go/agents/debugger.md +1 -1
  46. package/presets/claude/go/agents/feature-developer.md +1 -1
  47. package/presets/claude/go/agents/task-analyst.md +1 -1
  48. package/presets/claude/go/commands/README.md +1 -0
  49. package/presets/claude/go/commands/task-continue.md +9 -0
  50. package/presets/claude/go/commands/technical-retro.md +8 -0
  51. package/presets/claude/go/commands/update.md +39 -0
  52. package/presets/claude/go/hooks/README.md +1 -0
  53. package/presets/claude/go/hooks/chain-team-phases.sh +107 -18
  54. package/presets/claude/go/hooks/check-preset-update.mjs +227 -0
  55. package/presets/claude/go/hooks/examples/README.md +1 -1
  56. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  57. package/presets/claude/go/settings.json +14 -1
  58. package/presets/claude/go/skills/technical-retro/SKILL.md +2 -0
  59. package/presets/claude/ios-swift/CLAUDE.md +1 -1
  60. package/presets/claude/ios-swift/REPO_AGENTS.md +14 -0
  61. package/presets/claude/ios-swift/agents/build-verifier.md +1 -1
  62. package/presets/claude/ios-swift/agents/code-reviewer.md +1 -1
  63. package/presets/claude/ios-swift/agents/debugger.md +1 -1
  64. package/presets/claude/ios-swift/agents/feature-developer.md +1 -1
  65. package/presets/claude/ios-swift/agents/task-analyst.md +1 -1
  66. package/presets/claude/ios-swift/commands/README.md +1 -0
  67. package/presets/claude/ios-swift/commands/task-continue.md +9 -0
  68. package/presets/claude/ios-swift/commands/technical-retro.md +8 -0
  69. package/presets/claude/ios-swift/commands/update.md +39 -0
  70. package/presets/claude/ios-swift/hooks/README.md +1 -0
  71. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +107 -18
  72. package/presets/claude/ios-swift/hooks/check-preset-update.mjs +227 -0
  73. package/presets/claude/ios-swift/hooks/examples/README.md +1 -1
  74. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  75. package/presets/claude/ios-swift/settings.json +14 -1
  76. package/presets/claude/ios-swift/skills/technical-retro/SKILL.md +2 -0
  77. package/presets/claude/java/CLAUDE.md +2 -2
  78. package/presets/claude/java/REPO_AGENTS.md +14 -0
  79. package/presets/claude/java/agents/build-verifier.md +1 -1
  80. package/presets/claude/java/agents/code-reviewer.md +1 -1
  81. package/presets/claude/java/agents/debugger.md +1 -1
  82. package/presets/claude/java/agents/feature-developer.md +1 -1
  83. package/presets/claude/java/agents/task-analyst.md +1 -1
  84. package/presets/claude/java/commands/README.md +1 -0
  85. package/presets/claude/java/commands/task-continue.md +9 -0
  86. package/presets/claude/java/commands/technical-retro.md +8 -0
  87. package/presets/claude/java/commands/update.md +39 -0
  88. package/presets/claude/java/hooks/README.md +1 -0
  89. package/presets/claude/java/hooks/chain-team-phases.sh +107 -18
  90. package/presets/claude/java/hooks/check-preset-update.mjs +227 -0
  91. package/presets/claude/java/hooks/examples/README.md +1 -1
  92. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  93. package/presets/claude/java/settings.json +14 -1
  94. package/presets/claude/java/skills/technical-retro/SKILL.md +2 -0
  95. package/presets/claude/mcp-ts/CLAUDE.md +1 -1
  96. package/presets/claude/mcp-ts/REPO_AGENTS.md +14 -0
  97. package/presets/claude/mcp-ts/agents/build-verifier.md +1 -1
  98. package/presets/claude/mcp-ts/agents/feature-developer.md +1 -1
  99. package/presets/claude/mcp-ts/agents/task-analyst.md +1 -1
  100. package/presets/claude/mcp-ts/commands/README.md +1 -0
  101. package/presets/claude/mcp-ts/commands/task-continue.md +9 -0
  102. package/presets/claude/mcp-ts/commands/technical-retro.md +8 -0
  103. package/presets/claude/mcp-ts/commands/update.md +39 -0
  104. package/presets/claude/mcp-ts/hooks/README.md +1 -0
  105. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +107 -18
  106. package/presets/claude/mcp-ts/hooks/check-preset-update.mjs +227 -0
  107. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  108. package/presets/claude/mcp-ts/settings.json +14 -1
  109. package/presets/claude/next/CLAUDE.md +2 -1
  110. package/presets/claude/next/REPO_AGENTS.md +15 -1
  111. package/presets/claude/next/agents/build-verifier.md +1 -1
  112. package/presets/claude/next/agents/code-reviewer.md +1 -1
  113. package/presets/claude/next/agents/debugger.md +1 -1
  114. package/presets/claude/next/agents/feature-developer.md +1 -1
  115. package/presets/claude/next/agents/task-analyst.md +1 -1
  116. package/presets/claude/next/agents/task-router.md +1 -1
  117. package/presets/claude/next/commands/README.md +1 -0
  118. package/presets/claude/next/commands/task-continue.md +9 -0
  119. package/presets/claude/next/commands/technical-retro.md +8 -0
  120. package/presets/claude/next/commands/update.md +39 -0
  121. package/presets/claude/next/hooks/README.md +1 -0
  122. package/presets/claude/next/hooks/chain-team-phases.sh +107 -18
  123. package/presets/claude/next/hooks/check-preset-update.mjs +227 -0
  124. package/presets/claude/next/hooks/examples/README.md +1 -1
  125. package/presets/claude/next/rules/anti-hallucination/react-next-anti-hallucination.md +21 -18
  126. package/presets/claude/next/rules/stack/next-app-router.md +27 -0
  127. package/presets/claude/next/rules/stack/next-static-export.md +16 -0
  128. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  129. package/presets/claude/next/rules/tooling-and-review/security-next.md +16 -2
  130. package/presets/claude/next/rules/ui-and-accessibility/component-catalog-gate.md +13 -0
  131. package/presets/claude/next/rules/ui-and-accessibility/forms-validation.md +12 -0
  132. package/presets/claude/next/settings.json +13 -0
  133. package/presets/claude/next/skills/technical-retro/SKILL.md +2 -0
  134. package/presets/claude/next/team/fixtures/feature-light.json +2 -1
  135. package/presets/claude/next/team/fixtures/feature-ui-standard.json +24 -0
  136. package/presets/claude/nuxt/CLAUDE.md +2 -1
  137. package/presets/claude/nuxt/REPO_AGENTS.md +14 -0
  138. package/presets/claude/nuxt/agents/build-verifier.md +1 -1
  139. package/presets/claude/nuxt/agents/code-reviewer.md +1 -1
  140. package/presets/claude/nuxt/agents/debugger.md +1 -1
  141. package/presets/claude/nuxt/agents/feature-developer.md +1 -1
  142. package/presets/claude/nuxt/agents/task-analyst.md +1 -1
  143. package/presets/claude/nuxt/commands/README.md +1 -0
  144. package/presets/claude/nuxt/commands/task-continue.md +9 -0
  145. package/presets/claude/nuxt/commands/technical-retro.md +8 -0
  146. package/presets/claude/nuxt/commands/update.md +39 -0
  147. package/presets/claude/nuxt/hooks/README.md +1 -0
  148. package/presets/claude/nuxt/hooks/chain-team-phases.sh +107 -18
  149. package/presets/claude/nuxt/hooks/check-preset-update.mjs +227 -0
  150. package/presets/claude/nuxt/hooks/examples/README.md +1 -1
  151. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  152. package/presets/claude/nuxt/settings.json +13 -0
  153. package/presets/claude/nuxt/skills/technical-retro/SKILL.md +2 -0
  154. package/presets/claude/php-hexagonal/CLAUDE.md +2 -2
  155. package/presets/claude/php-hexagonal/REPO_AGENTS.md +14 -0
  156. package/presets/claude/php-hexagonal/agents/build-verifier.md +1 -1
  157. package/presets/claude/php-hexagonal/agents/code-reviewer.md +1 -1
  158. package/presets/claude/php-hexagonal/agents/debugger.md +1 -1
  159. package/presets/claude/php-hexagonal/agents/feature-developer.md +1 -1
  160. package/presets/claude/php-hexagonal/agents/task-analyst.md +1 -1
  161. package/presets/claude/php-hexagonal/commands/README.md +1 -0
  162. package/presets/claude/php-hexagonal/commands/task-continue.md +9 -0
  163. package/presets/claude/php-hexagonal/commands/technical-retro.md +8 -0
  164. package/presets/claude/php-hexagonal/commands/update.md +39 -0
  165. package/presets/claude/php-hexagonal/hooks/README.md +1 -0
  166. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +107 -18
  167. package/presets/claude/php-hexagonal/hooks/check-preset-update.mjs +227 -0
  168. package/presets/claude/php-hexagonal/hooks/examples/README.md +1 -1
  169. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  170. package/presets/claude/php-hexagonal/settings.json +14 -1
  171. package/presets/claude/php-hexagonal/skills/technical-retro/SKILL.md +2 -0
  172. package/presets/claude/php-laravel/CLAUDE.md +1 -1
  173. package/presets/claude/php-laravel/REPO_AGENTS.md +14 -0
  174. package/presets/claude/php-laravel/agents/build-verifier.md +1 -1
  175. package/presets/claude/php-laravel/agents/code-reviewer.md +1 -1
  176. package/presets/claude/php-laravel/agents/debugger.md +1 -1
  177. package/presets/claude/php-laravel/agents/feature-developer.md +1 -1
  178. package/presets/claude/php-laravel/agents/task-analyst.md +1 -1
  179. package/presets/claude/php-laravel/commands/README.md +1 -0
  180. package/presets/claude/php-laravel/commands/task-continue.md +9 -0
  181. package/presets/claude/php-laravel/commands/technical-retro.md +8 -0
  182. package/presets/claude/php-laravel/commands/update.md +39 -0
  183. package/presets/claude/php-laravel/hooks/README.md +1 -0
  184. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +107 -18
  185. package/presets/claude/php-laravel/hooks/check-preset-update.mjs +227 -0
  186. package/presets/claude/php-laravel/hooks/examples/README.md +1 -1
  187. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  188. package/presets/claude/php-laravel/settings.json +14 -1
  189. package/presets/claude/php-laravel/skills/technical-retro/SKILL.md +2 -0
  190. package/presets/claude/svelte/CLAUDE.md +2 -1
  191. package/presets/claude/svelte/REPO_AGENTS.md +14 -0
  192. package/presets/claude/svelte/agents/build-verifier.md +1 -1
  193. package/presets/claude/svelte/agents/code-reviewer.md +1 -1
  194. package/presets/claude/svelte/agents/debugger.md +1 -1
  195. package/presets/claude/svelte/agents/feature-developer.md +1 -1
  196. package/presets/claude/svelte/agents/task-analyst.md +1 -1
  197. package/presets/claude/svelte/commands/README.md +1 -0
  198. package/presets/claude/svelte/commands/task-continue.md +9 -0
  199. package/presets/claude/svelte/commands/technical-retro.md +8 -0
  200. package/presets/claude/svelte/commands/update.md +39 -0
  201. package/presets/claude/svelte/hooks/README.md +1 -0
  202. package/presets/claude/svelte/hooks/chain-team-phases.sh +107 -18
  203. package/presets/claude/svelte/hooks/check-preset-update.mjs +227 -0
  204. package/presets/claude/svelte/hooks/examples/README.md +1 -1
  205. package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  206. package/presets/claude/svelte/settings.json +13 -0
  207. package/presets/claude/svelte/skills/technical-retro/SKILL.md +2 -0
  208. package/presets/cursor/android-kotlin/AGENTS.md +1 -0
  209. package/presets/cursor/android-kotlin/REPO_AGENTS.md +14 -0
  210. package/presets/cursor/android-kotlin/agents/build-verifier.md +1 -1
  211. package/presets/cursor/android-kotlin/agents/code-reviewer.md +1 -1
  212. package/presets/cursor/android-kotlin/agents/debugger.md +1 -1
  213. package/presets/cursor/android-kotlin/agents/feature-developer.md +1 -1
  214. package/presets/cursor/android-kotlin/agents/task-analyst.md +1 -1
  215. package/presets/cursor/android-kotlin/commands/README.md +1 -0
  216. package/presets/cursor/android-kotlin/commands/task-continue.md +9 -0
  217. package/presets/cursor/android-kotlin/commands/technical-retro.md +8 -0
  218. package/presets/cursor/android-kotlin/commands/update.md +39 -0
  219. package/presets/cursor/android-kotlin/hooks/README.md +5 -1
  220. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +107 -18
  221. package/presets/cursor/android-kotlin/hooks/check-preset-update.mjs +227 -0
  222. package/presets/cursor/android-kotlin/hooks/examples/README.md +1 -1
  223. package/presets/cursor/android-kotlin/hooks.json +6 -0
  224. package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +1 -1
  225. package/presets/cursor/android-kotlin/skills/technical-retro/SKILL.md +2 -0
  226. package/presets/cursor/go/REPO_AGENTS.md +14 -0
  227. package/presets/cursor/go/agents/build-verifier.md +1 -1
  228. package/presets/cursor/go/agents/code-reviewer.md +1 -1
  229. package/presets/cursor/go/agents/debugger.md +1 -1
  230. package/presets/cursor/go/agents/feature-developer.md +1 -1
  231. package/presets/cursor/go/agents/task-analyst.md +1 -1
  232. package/presets/cursor/go/commands/README.md +1 -0
  233. package/presets/cursor/go/commands/task-continue.md +9 -0
  234. package/presets/cursor/go/commands/technical-retro.md +8 -0
  235. package/presets/cursor/go/commands/update.md +39 -0
  236. package/presets/cursor/go/hooks/README.md +5 -1
  237. package/presets/cursor/go/hooks/chain-team-phases.sh +107 -18
  238. package/presets/cursor/go/hooks/check-preset-update.mjs +227 -0
  239. package/presets/cursor/go/hooks/examples/README.md +1 -1
  240. package/presets/cursor/go/hooks.json +6 -0
  241. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +1 -1
  242. package/presets/cursor/go/skills/technical-retro/SKILL.md +2 -0
  243. package/presets/cursor/ios-swift/AGENTS.md +1 -0
  244. package/presets/cursor/ios-swift/REPO_AGENTS.md +14 -0
  245. package/presets/cursor/ios-swift/agents/build-verifier.md +1 -1
  246. package/presets/cursor/ios-swift/agents/code-reviewer.md +1 -1
  247. package/presets/cursor/ios-swift/agents/debugger.md +1 -1
  248. package/presets/cursor/ios-swift/agents/feature-developer.md +1 -1
  249. package/presets/cursor/ios-swift/agents/task-analyst.md +1 -1
  250. package/presets/cursor/ios-swift/commands/README.md +1 -0
  251. package/presets/cursor/ios-swift/commands/task-continue.md +9 -0
  252. package/presets/cursor/ios-swift/commands/technical-retro.md +8 -0
  253. package/presets/cursor/ios-swift/commands/update.md +39 -0
  254. package/presets/cursor/ios-swift/hooks/README.md +5 -1
  255. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +107 -18
  256. package/presets/cursor/ios-swift/hooks/check-preset-update.mjs +227 -0
  257. package/presets/cursor/ios-swift/hooks/examples/README.md +1 -1
  258. package/presets/cursor/ios-swift/hooks.json +6 -0
  259. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +1 -1
  260. package/presets/cursor/ios-swift/skills/technical-retro/SKILL.md +2 -0
  261. package/presets/cursor/java/AGENTS.md +1 -1
  262. package/presets/cursor/java/REPO_AGENTS.md +14 -0
  263. package/presets/cursor/java/agents/build-verifier.md +1 -1
  264. package/presets/cursor/java/agents/code-reviewer.md +1 -1
  265. package/presets/cursor/java/agents/debugger.md +1 -1
  266. package/presets/cursor/java/agents/feature-developer.md +1 -1
  267. package/presets/cursor/java/agents/task-analyst.md +1 -1
  268. package/presets/cursor/java/commands/README.md +1 -0
  269. package/presets/cursor/java/commands/task-continue.md +9 -0
  270. package/presets/cursor/java/commands/technical-retro.md +8 -0
  271. package/presets/cursor/java/commands/update.md +39 -0
  272. package/presets/cursor/java/hooks/README.md +5 -1
  273. package/presets/cursor/java/hooks/chain-team-phases.sh +107 -18
  274. package/presets/cursor/java/hooks/check-preset-update.mjs +227 -0
  275. package/presets/cursor/java/hooks/examples/README.md +1 -1
  276. package/presets/cursor/java/hooks.json +6 -0
  277. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +1 -1
  278. package/presets/cursor/java/skills/technical-retro/SKILL.md +2 -0
  279. package/presets/cursor/mcp-ts/REPO_AGENTS.md +14 -0
  280. package/presets/cursor/mcp-ts/agents/build-verifier.md +1 -1
  281. package/presets/cursor/mcp-ts/agents/feature-developer.md +1 -1
  282. package/presets/cursor/mcp-ts/agents/task-analyst.md +1 -1
  283. package/presets/cursor/mcp-ts/commands/README.md +1 -0
  284. package/presets/cursor/mcp-ts/commands/task-continue.md +9 -0
  285. package/presets/cursor/mcp-ts/commands/technical-retro.md +8 -0
  286. package/presets/cursor/mcp-ts/commands/update.md +39 -0
  287. package/presets/cursor/mcp-ts/hooks/README.md +5 -1
  288. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +107 -18
  289. package/presets/cursor/mcp-ts/hooks/check-preset-update.mjs +227 -0
  290. package/presets/cursor/mcp-ts/hooks.json +6 -0
  291. package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +1 -1
  292. package/presets/cursor/next/AGENTS.md +1 -0
  293. package/presets/cursor/next/REPO_AGENTS.md +15 -1
  294. package/presets/cursor/next/agents/build-verifier.md +1 -1
  295. package/presets/cursor/next/agents/code-reviewer.md +1 -1
  296. package/presets/cursor/next/agents/debugger.md +1 -1
  297. package/presets/cursor/next/agents/feature-developer.md +1 -1
  298. package/presets/cursor/next/agents/task-analyst.md +1 -1
  299. package/presets/cursor/next/agents/task-router.md +1 -1
  300. package/presets/cursor/next/commands/README.md +1 -0
  301. package/presets/cursor/next/commands/task-continue.md +9 -0
  302. package/presets/cursor/next/commands/technical-retro.md +8 -0
  303. package/presets/cursor/next/commands/update.md +39 -0
  304. package/presets/cursor/next/hooks/README.md +6 -0
  305. package/presets/cursor/next/hooks/chain-team-phases.sh +107 -18
  306. package/presets/cursor/next/hooks/check-preset-update.mjs +227 -0
  307. package/presets/cursor/next/hooks/examples/README.md +1 -1
  308. package/presets/cursor/next/hooks.json +6 -0
  309. package/presets/cursor/next/rules/README.md +3 -1
  310. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +1 -1
  311. package/presets/cursor/next/rules/component-catalog-gate.mdc +13 -0
  312. package/presets/cursor/next/rules/forms-validation.mdc +12 -0
  313. package/presets/cursor/next/rules/next-app-router.mdc +27 -0
  314. package/presets/cursor/next/rules/next-static-export.mdc +16 -0
  315. package/presets/cursor/next/rules/react-next-anti-hallucination.mdc +21 -18
  316. package/presets/cursor/next/rules/security-next.mdc +16 -2
  317. package/presets/cursor/next/skills/technical-retro/SKILL.md +2 -0
  318. package/presets/cursor/next/team/fixtures/feature-light.json +2 -1
  319. package/presets/cursor/next/team/fixtures/feature-ui-standard.json +24 -0
  320. package/presets/cursor/nuxt/AGENTS.md +1 -0
  321. package/presets/cursor/nuxt/REPO_AGENTS.md +14 -0
  322. package/presets/cursor/nuxt/agents/build-verifier.md +1 -1
  323. package/presets/cursor/nuxt/agents/code-reviewer.md +1 -1
  324. package/presets/cursor/nuxt/agents/debugger.md +1 -1
  325. package/presets/cursor/nuxt/agents/feature-developer.md +1 -1
  326. package/presets/cursor/nuxt/agents/task-analyst.md +1 -1
  327. package/presets/cursor/nuxt/commands/README.md +1 -0
  328. package/presets/cursor/nuxt/commands/task-continue.md +9 -0
  329. package/presets/cursor/nuxt/commands/technical-retro.md +8 -0
  330. package/presets/cursor/nuxt/commands/update.md +39 -0
  331. package/presets/cursor/nuxt/hooks/README.md +4 -0
  332. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +107 -18
  333. package/presets/cursor/nuxt/hooks/check-preset-update.mjs +227 -0
  334. package/presets/cursor/nuxt/hooks/examples/README.md +1 -1
  335. package/presets/cursor/nuxt/hooks.json +6 -0
  336. package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +1 -1
  337. package/presets/cursor/nuxt/skills/technical-retro/SKILL.md +2 -0
  338. package/presets/cursor/php-hexagonal/AGENTS.md +1 -1
  339. package/presets/cursor/php-hexagonal/REPO_AGENTS.md +14 -0
  340. package/presets/cursor/php-hexagonal/agents/build-verifier.md +1 -1
  341. package/presets/cursor/php-hexagonal/agents/code-reviewer.md +1 -1
  342. package/presets/cursor/php-hexagonal/agents/debugger.md +1 -1
  343. package/presets/cursor/php-hexagonal/agents/feature-developer.md +1 -1
  344. package/presets/cursor/php-hexagonal/agents/task-analyst.md +1 -1
  345. package/presets/cursor/php-hexagonal/commands/README.md +1 -0
  346. package/presets/cursor/php-hexagonal/commands/task-continue.md +9 -0
  347. package/presets/cursor/php-hexagonal/commands/technical-retro.md +8 -0
  348. package/presets/cursor/php-hexagonal/commands/update.md +39 -0
  349. package/presets/cursor/php-hexagonal/hooks/README.md +5 -1
  350. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +107 -18
  351. package/presets/cursor/php-hexagonal/hooks/check-preset-update.mjs +227 -0
  352. package/presets/cursor/php-hexagonal/hooks/examples/README.md +1 -1
  353. package/presets/cursor/php-hexagonal/hooks.json +6 -0
  354. package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +1 -1
  355. package/presets/cursor/php-hexagonal/skills/technical-retro/SKILL.md +2 -0
  356. package/presets/cursor/php-laravel/AGENTS.md +1 -1
  357. package/presets/cursor/php-laravel/REPO_AGENTS.md +14 -0
  358. package/presets/cursor/php-laravel/agents/build-verifier.md +1 -1
  359. package/presets/cursor/php-laravel/agents/code-reviewer.md +1 -1
  360. package/presets/cursor/php-laravel/agents/debugger.md +1 -1
  361. package/presets/cursor/php-laravel/agents/feature-developer.md +1 -1
  362. package/presets/cursor/php-laravel/agents/task-analyst.md +1 -1
  363. package/presets/cursor/php-laravel/commands/README.md +1 -0
  364. package/presets/cursor/php-laravel/commands/task-continue.md +9 -0
  365. package/presets/cursor/php-laravel/commands/technical-retro.md +8 -0
  366. package/presets/cursor/php-laravel/commands/update.md +39 -0
  367. package/presets/cursor/php-laravel/hooks/README.md +5 -1
  368. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +107 -18
  369. package/presets/cursor/php-laravel/hooks/check-preset-update.mjs +227 -0
  370. package/presets/cursor/php-laravel/hooks/examples/README.md +1 -1
  371. package/presets/cursor/php-laravel/hooks.json +6 -0
  372. package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +1 -1
  373. package/presets/cursor/php-laravel/skills/technical-retro/SKILL.md +2 -0
  374. package/presets/cursor/svelte/AGENTS.md +1 -0
  375. package/presets/cursor/svelte/REPO_AGENTS.md +14 -0
  376. package/presets/cursor/svelte/agents/build-verifier.md +1 -1
  377. package/presets/cursor/svelte/agents/code-reviewer.md +1 -1
  378. package/presets/cursor/svelte/agents/debugger.md +1 -1
  379. package/presets/cursor/svelte/agents/feature-developer.md +1 -1
  380. package/presets/cursor/svelte/agents/task-analyst.md +1 -1
  381. package/presets/cursor/svelte/commands/README.md +1 -0
  382. package/presets/cursor/svelte/commands/task-continue.md +9 -0
  383. package/presets/cursor/svelte/commands/technical-retro.md +8 -0
  384. package/presets/cursor/svelte/commands/update.md +39 -0
  385. package/presets/cursor/svelte/hooks/README.md +4 -0
  386. package/presets/cursor/svelte/hooks/chain-team-phases.sh +107 -18
  387. package/presets/cursor/svelte/hooks/check-preset-update.mjs +227 -0
  388. package/presets/cursor/svelte/hooks/examples/README.md +1 -1
  389. package/presets/cursor/svelte/hooks.json +6 -0
  390. package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +1 -1
  391. package/presets/cursor/svelte/skills/technical-retro/SKILL.md +2 -0
  392. package/presets/mavis/android-kotlin/MAVIS.md +1 -0
  393. package/presets/mavis/android-kotlin/REPO_AGENTS.md +14 -0
  394. package/presets/mavis/android-kotlin/adapter-map.json +17 -1
  395. package/presets/mavis/android-kotlin/agents/build-verifier.md +1 -1
  396. package/presets/mavis/android-kotlin/agents/code-reviewer.md +1 -1
  397. package/presets/mavis/android-kotlin/agents/debugger.md +1 -1
  398. package/presets/mavis/android-kotlin/agents/feature-developer.md +1 -1
  399. package/presets/mavis/android-kotlin/agents/task-analyst.md +1 -1
  400. package/presets/mavis/android-kotlin/commands/README.md +1 -0
  401. package/presets/mavis/android-kotlin/commands/task-continue.md +9 -0
  402. package/presets/mavis/android-kotlin/commands/technical-retro.md +8 -0
  403. package/presets/mavis/android-kotlin/commands/update.md +34 -0
  404. package/presets/mavis/android-kotlin/hooks/README.md +3 -0
  405. package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +107 -18
  406. package/presets/mavis/android-kotlin/hooks/check-preset-update.mjs +227 -0
  407. package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +1 -1
  408. package/presets/mavis/android-kotlin/skills/technical-retro/SKILL.md +2 -0
  409. package/presets/mavis/go/REPO_AGENTS.md +14 -0
  410. package/presets/mavis/go/adapter-map.json +17 -1
  411. package/presets/mavis/go/agents/build-verifier.md +1 -1
  412. package/presets/mavis/go/agents/code-reviewer.md +1 -1
  413. package/presets/mavis/go/agents/debugger.md +1 -1
  414. package/presets/mavis/go/agents/feature-developer.md +1 -1
  415. package/presets/mavis/go/agents/task-analyst.md +1 -1
  416. package/presets/mavis/go/commands/README.md +1 -0
  417. package/presets/mavis/go/commands/task-continue.md +9 -0
  418. package/presets/mavis/go/commands/technical-retro.md +8 -0
  419. package/presets/mavis/go/commands/update.md +34 -0
  420. package/presets/mavis/go/hooks/README.md +3 -0
  421. package/presets/mavis/go/hooks/chain-team-phases.sh +107 -18
  422. package/presets/mavis/go/hooks/check-preset-update.mjs +227 -0
  423. package/presets/mavis/go/rules/agent-team-orchestrator.md +1 -1
  424. package/presets/mavis/go/skills/technical-retro/SKILL.md +2 -0
  425. package/presets/mavis/ios-swift/MAVIS.md +1 -0
  426. package/presets/mavis/ios-swift/REPO_AGENTS.md +14 -0
  427. package/presets/mavis/ios-swift/adapter-map.json +17 -1
  428. package/presets/mavis/ios-swift/agents/build-verifier.md +1 -1
  429. package/presets/mavis/ios-swift/agents/code-reviewer.md +1 -1
  430. package/presets/mavis/ios-swift/agents/debugger.md +1 -1
  431. package/presets/mavis/ios-swift/agents/feature-developer.md +1 -1
  432. package/presets/mavis/ios-swift/agents/task-analyst.md +1 -1
  433. package/presets/mavis/ios-swift/commands/README.md +1 -0
  434. package/presets/mavis/ios-swift/commands/task-continue.md +9 -0
  435. package/presets/mavis/ios-swift/commands/technical-retro.md +8 -0
  436. package/presets/mavis/ios-swift/commands/update.md +34 -0
  437. package/presets/mavis/ios-swift/hooks/README.md +3 -0
  438. package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +107 -18
  439. package/presets/mavis/ios-swift/hooks/check-preset-update.mjs +227 -0
  440. package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +1 -1
  441. package/presets/mavis/ios-swift/skills/technical-retro/SKILL.md +2 -0
  442. package/presets/mavis/java/REPO_AGENTS.md +14 -0
  443. package/presets/mavis/java/adapter-map.json +17 -1
  444. package/presets/mavis/java/agents/build-verifier.md +1 -1
  445. package/presets/mavis/java/agents/code-reviewer.md +1 -1
  446. package/presets/mavis/java/agents/debugger.md +1 -1
  447. package/presets/mavis/java/agents/feature-developer.md +1 -1
  448. package/presets/mavis/java/agents/task-analyst.md +1 -1
  449. package/presets/mavis/java/commands/README.md +1 -0
  450. package/presets/mavis/java/commands/task-continue.md +9 -0
  451. package/presets/mavis/java/commands/technical-retro.md +8 -0
  452. package/presets/mavis/java/commands/update.md +34 -0
  453. package/presets/mavis/java/hooks/README.md +3 -0
  454. package/presets/mavis/java/hooks/chain-team-phases.sh +107 -18
  455. package/presets/mavis/java/hooks/check-preset-update.mjs +227 -0
  456. package/presets/mavis/java/rules/agent-team-orchestrator.md +1 -1
  457. package/presets/mavis/java/skills/technical-retro/SKILL.md +2 -0
  458. package/presets/mavis/mcp-ts/REPO_AGENTS.md +14 -0
  459. package/presets/mavis/mcp-ts/adapter-map.json +17 -1
  460. package/presets/mavis/mcp-ts/agents/build-verifier.md +1 -1
  461. package/presets/mavis/mcp-ts/agents/feature-developer.md +1 -1
  462. package/presets/mavis/mcp-ts/agents/task-analyst.md +1 -1
  463. package/presets/mavis/mcp-ts/commands/README.md +1 -0
  464. package/presets/mavis/mcp-ts/commands/task-continue.md +9 -0
  465. package/presets/mavis/mcp-ts/commands/technical-retro.md +8 -0
  466. package/presets/mavis/mcp-ts/commands/update.md +34 -0
  467. package/presets/mavis/mcp-ts/hooks/README.md +3 -0
  468. package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +107 -18
  469. package/presets/mavis/mcp-ts/hooks/check-preset-update.mjs +227 -0
  470. package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +1 -1
  471. package/presets/mavis/next/MAVIS.md +1 -0
  472. package/presets/mavis/next/REPO_AGENTS.md +15 -1
  473. package/presets/mavis/next/adapter-map.json +25 -1
  474. package/presets/mavis/next/agents/build-verifier.md +1 -1
  475. package/presets/mavis/next/agents/code-reviewer.md +1 -1
  476. package/presets/mavis/next/agents/debugger.md +1 -1
  477. package/presets/mavis/next/agents/feature-developer.md +1 -1
  478. package/presets/mavis/next/agents/task-analyst.md +1 -1
  479. package/presets/mavis/next/agents/task-router.md +1 -1
  480. package/presets/mavis/next/commands/README.md +1 -0
  481. package/presets/mavis/next/commands/task-continue.md +9 -0
  482. package/presets/mavis/next/commands/technical-retro.md +8 -0
  483. package/presets/mavis/next/commands/update.md +34 -0
  484. package/presets/mavis/next/hooks/README.md +3 -0
  485. package/presets/mavis/next/hooks/chain-team-phases.sh +107 -18
  486. package/presets/mavis/next/hooks/check-preset-update.mjs +227 -0
  487. package/presets/mavis/next/rules/agent-team-orchestrator.md +1 -1
  488. package/presets/mavis/next/rules/component-catalog-gate.md +13 -0
  489. package/presets/mavis/next/rules/forms-validation.md +12 -0
  490. package/presets/mavis/next/rules/next-app-router.md +27 -0
  491. package/presets/mavis/next/rules/next-static-export.md +16 -0
  492. package/presets/mavis/next/rules/react-next-anti-hallucination.md +20 -18
  493. package/presets/mavis/next/rules/security-next.md +13 -0
  494. package/presets/mavis/next/skills/technical-retro/SKILL.md +2 -0
  495. package/presets/mavis/next/team/fixtures/feature-light.json +2 -1
  496. package/presets/mavis/next/team/fixtures/feature-ui-standard.json +24 -0
  497. package/presets/mavis/nuxt/MAVIS.md +1 -0
  498. package/presets/mavis/nuxt/REPO_AGENTS.md +14 -0
  499. package/presets/mavis/nuxt/adapter-map.json +17 -1
  500. package/presets/mavis/nuxt/agents/build-verifier.md +1 -1
  501. package/presets/mavis/nuxt/agents/code-reviewer.md +1 -1
  502. package/presets/mavis/nuxt/agents/debugger.md +1 -1
  503. package/presets/mavis/nuxt/agents/feature-developer.md +1 -1
  504. package/presets/mavis/nuxt/agents/task-analyst.md +1 -1
  505. package/presets/mavis/nuxt/commands/README.md +1 -0
  506. package/presets/mavis/nuxt/commands/task-continue.md +9 -0
  507. package/presets/mavis/nuxt/commands/technical-retro.md +8 -0
  508. package/presets/mavis/nuxt/commands/update.md +34 -0
  509. package/presets/mavis/nuxt/hooks/README.md +3 -0
  510. package/presets/mavis/nuxt/hooks/chain-team-phases.sh +107 -18
  511. package/presets/mavis/nuxt/hooks/check-preset-update.mjs +227 -0
  512. package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +1 -1
  513. package/presets/mavis/nuxt/skills/technical-retro/SKILL.md +2 -0
  514. package/presets/mavis/php-hexagonal/REPO_AGENTS.md +14 -0
  515. package/presets/mavis/php-hexagonal/adapter-map.json +17 -1
  516. package/presets/mavis/php-hexagonal/agents/build-verifier.md +1 -1
  517. package/presets/mavis/php-hexagonal/agents/code-reviewer.md +1 -1
  518. package/presets/mavis/php-hexagonal/agents/debugger.md +1 -1
  519. package/presets/mavis/php-hexagonal/agents/feature-developer.md +1 -1
  520. package/presets/mavis/php-hexagonal/agents/task-analyst.md +1 -1
  521. package/presets/mavis/php-hexagonal/commands/README.md +1 -0
  522. package/presets/mavis/php-hexagonal/commands/task-continue.md +9 -0
  523. package/presets/mavis/php-hexagonal/commands/technical-retro.md +8 -0
  524. package/presets/mavis/php-hexagonal/commands/update.md +34 -0
  525. package/presets/mavis/php-hexagonal/hooks/README.md +3 -0
  526. package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +107 -18
  527. package/presets/mavis/php-hexagonal/hooks/check-preset-update.mjs +227 -0
  528. package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +1 -1
  529. package/presets/mavis/php-hexagonal/skills/technical-retro/SKILL.md +2 -0
  530. package/presets/mavis/php-laravel/REPO_AGENTS.md +14 -0
  531. package/presets/mavis/php-laravel/adapter-map.json +17 -1
  532. package/presets/mavis/php-laravel/agents/build-verifier.md +1 -1
  533. package/presets/mavis/php-laravel/agents/code-reviewer.md +1 -1
  534. package/presets/mavis/php-laravel/agents/debugger.md +1 -1
  535. package/presets/mavis/php-laravel/agents/feature-developer.md +1 -1
  536. package/presets/mavis/php-laravel/agents/task-analyst.md +1 -1
  537. package/presets/mavis/php-laravel/commands/README.md +1 -0
  538. package/presets/mavis/php-laravel/commands/task-continue.md +9 -0
  539. package/presets/mavis/php-laravel/commands/technical-retro.md +8 -0
  540. package/presets/mavis/php-laravel/commands/update.md +34 -0
  541. package/presets/mavis/php-laravel/hooks/README.md +3 -0
  542. package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +107 -18
  543. package/presets/mavis/php-laravel/hooks/check-preset-update.mjs +227 -0
  544. package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +1 -1
  545. package/presets/mavis/php-laravel/skills/technical-retro/SKILL.md +2 -0
  546. package/presets/mavis/svelte/MAVIS.md +1 -0
  547. package/presets/mavis/svelte/REPO_AGENTS.md +14 -0
  548. package/presets/mavis/svelte/adapter-map.json +17 -1
  549. package/presets/mavis/svelte/agents/build-verifier.md +1 -1
  550. package/presets/mavis/svelte/agents/code-reviewer.md +1 -1
  551. package/presets/mavis/svelte/agents/debugger.md +1 -1
  552. package/presets/mavis/svelte/agents/feature-developer.md +1 -1
  553. package/presets/mavis/svelte/agents/task-analyst.md +1 -1
  554. package/presets/mavis/svelte/commands/README.md +1 -0
  555. package/presets/mavis/svelte/commands/task-continue.md +9 -0
  556. package/presets/mavis/svelte/commands/technical-retro.md +8 -0
  557. package/presets/mavis/svelte/commands/update.md +34 -0
  558. package/presets/mavis/svelte/hooks/README.md +3 -0
  559. package/presets/mavis/svelte/hooks/chain-team-phases.sh +107 -18
  560. package/presets/mavis/svelte/hooks/check-preset-update.mjs +227 -0
  561. package/presets/mavis/svelte/rules/agent-team-orchestrator.md +1 -1
  562. package/presets/mavis/svelte/skills/technical-retro/SKILL.md +2 -0
  563. package/presets/opencode/android-kotlin/OPENCODE.md +15 -6
  564. package/presets/opencode/android-kotlin/REPO_AGENTS.md +14 -0
  565. package/presets/opencode/android-kotlin/adapter-map.json +17 -1
  566. package/presets/opencode/android-kotlin/agents/build-verifier.md +1 -1
  567. package/presets/opencode/android-kotlin/agents/code-reviewer.md +1 -1
  568. package/presets/opencode/android-kotlin/agents/debugger.md +1 -1
  569. package/presets/opencode/android-kotlin/agents/feature-developer.md +1 -1
  570. package/presets/opencode/android-kotlin/agents/task-analyst.md +1 -1
  571. package/presets/opencode/android-kotlin/commands/README.md +1 -0
  572. package/presets/opencode/android-kotlin/commands/task-continue.md +9 -0
  573. package/presets/opencode/android-kotlin/commands/technical-retro.md +8 -0
  574. package/presets/opencode/android-kotlin/commands/update.md +42 -0
  575. package/presets/opencode/android-kotlin/hooks/README.md +3 -0
  576. package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +107 -18
  577. package/presets/opencode/android-kotlin/hooks/check-preset-update.mjs +227 -0
  578. package/presets/opencode/android-kotlin/opencode.json +2 -12
  579. package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +1 -1
  580. package/presets/opencode/android-kotlin/skills/technical-retro/SKILL.md +2 -0
  581. package/presets/opencode/go/OPENCODE.md +14 -6
  582. package/presets/opencode/go/REPO_AGENTS.md +14 -0
  583. package/presets/opencode/go/adapter-map.json +17 -1
  584. package/presets/opencode/go/agents/build-verifier.md +1 -1
  585. package/presets/opencode/go/agents/code-reviewer.md +1 -1
  586. package/presets/opencode/go/agents/debugger.md +1 -1
  587. package/presets/opencode/go/agents/feature-developer.md +1 -1
  588. package/presets/opencode/go/agents/task-analyst.md +1 -1
  589. package/presets/opencode/go/commands/README.md +1 -0
  590. package/presets/opencode/go/commands/task-continue.md +9 -0
  591. package/presets/opencode/go/commands/technical-retro.md +8 -0
  592. package/presets/opencode/go/commands/update.md +42 -0
  593. package/presets/opencode/go/hooks/README.md +3 -0
  594. package/presets/opencode/go/hooks/chain-team-phases.sh +107 -18
  595. package/presets/opencode/go/hooks/check-preset-update.mjs +227 -0
  596. package/presets/opencode/go/opencode.json +2 -12
  597. package/presets/opencode/go/rules/agent-team-orchestrator.md +1 -1
  598. package/presets/opencode/go/skills/technical-retro/SKILL.md +2 -0
  599. package/presets/opencode/ios-swift/OPENCODE.md +15 -6
  600. package/presets/opencode/ios-swift/REPO_AGENTS.md +14 -0
  601. package/presets/opencode/ios-swift/adapter-map.json +17 -1
  602. package/presets/opencode/ios-swift/agents/build-verifier.md +1 -1
  603. package/presets/opencode/ios-swift/agents/code-reviewer.md +1 -1
  604. package/presets/opencode/ios-swift/agents/debugger.md +1 -1
  605. package/presets/opencode/ios-swift/agents/feature-developer.md +1 -1
  606. package/presets/opencode/ios-swift/agents/task-analyst.md +1 -1
  607. package/presets/opencode/ios-swift/commands/README.md +1 -0
  608. package/presets/opencode/ios-swift/commands/task-continue.md +9 -0
  609. package/presets/opencode/ios-swift/commands/technical-retro.md +8 -0
  610. package/presets/opencode/ios-swift/commands/update.md +42 -0
  611. package/presets/opencode/ios-swift/hooks/README.md +3 -0
  612. package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +107 -18
  613. package/presets/opencode/ios-swift/hooks/check-preset-update.mjs +227 -0
  614. package/presets/opencode/ios-swift/opencode.json +2 -12
  615. package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +1 -1
  616. package/presets/opencode/ios-swift/skills/technical-retro/SKILL.md +2 -0
  617. package/presets/opencode/java/OPENCODE.md +14 -6
  618. package/presets/opencode/java/REPO_AGENTS.md +14 -0
  619. package/presets/opencode/java/adapter-map.json +17 -1
  620. package/presets/opencode/java/agents/build-verifier.md +1 -1
  621. package/presets/opencode/java/agents/code-reviewer.md +1 -1
  622. package/presets/opencode/java/agents/debugger.md +1 -1
  623. package/presets/opencode/java/agents/feature-developer.md +1 -1
  624. package/presets/opencode/java/agents/task-analyst.md +1 -1
  625. package/presets/opencode/java/commands/README.md +1 -0
  626. package/presets/opencode/java/commands/task-continue.md +9 -0
  627. package/presets/opencode/java/commands/technical-retro.md +8 -0
  628. package/presets/opencode/java/commands/update.md +42 -0
  629. package/presets/opencode/java/hooks/README.md +3 -0
  630. package/presets/opencode/java/hooks/chain-team-phases.sh +107 -18
  631. package/presets/opencode/java/hooks/check-preset-update.mjs +227 -0
  632. package/presets/opencode/java/opencode.json +2 -12
  633. package/presets/opencode/java/rules/agent-team-orchestrator.md +1 -1
  634. package/presets/opencode/java/skills/technical-retro/SKILL.md +2 -0
  635. package/presets/opencode/mcp-ts/OPENCODE.md +14 -6
  636. package/presets/opencode/mcp-ts/REPO_AGENTS.md +14 -0
  637. package/presets/opencode/mcp-ts/adapter-map.json +17 -1
  638. package/presets/opencode/mcp-ts/agents/build-verifier.md +1 -1
  639. package/presets/opencode/mcp-ts/agents/feature-developer.md +1 -1
  640. package/presets/opencode/mcp-ts/agents/task-analyst.md +1 -1
  641. package/presets/opencode/mcp-ts/commands/README.md +1 -0
  642. package/presets/opencode/mcp-ts/commands/task-continue.md +9 -0
  643. package/presets/opencode/mcp-ts/commands/technical-retro.md +8 -0
  644. package/presets/opencode/mcp-ts/commands/update.md +42 -0
  645. package/presets/opencode/mcp-ts/hooks/README.md +3 -0
  646. package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +107 -18
  647. package/presets/opencode/mcp-ts/hooks/check-preset-update.mjs +227 -0
  648. package/presets/opencode/mcp-ts/opencode.json +2 -12
  649. package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +1 -1
  650. package/presets/opencode/next/OPENCODE.md +15 -6
  651. package/presets/opencode/next/REPO_AGENTS.md +15 -1
  652. package/presets/opencode/next/adapter-map.json +25 -1
  653. package/presets/opencode/next/agents/build-verifier.md +1 -1
  654. package/presets/opencode/next/agents/code-reviewer.md +1 -1
  655. package/presets/opencode/next/agents/debugger.md +1 -1
  656. package/presets/opencode/next/agents/feature-developer.md +1 -1
  657. package/presets/opencode/next/agents/task-analyst.md +1 -1
  658. package/presets/opencode/next/agents/task-router.md +1 -1
  659. package/presets/opencode/next/commands/README.md +1 -0
  660. package/presets/opencode/next/commands/task-continue.md +9 -0
  661. package/presets/opencode/next/commands/technical-retro.md +8 -0
  662. package/presets/opencode/next/commands/update.md +42 -0
  663. package/presets/opencode/next/hooks/README.md +3 -0
  664. package/presets/opencode/next/hooks/chain-team-phases.sh +107 -18
  665. package/presets/opencode/next/hooks/check-preset-update.mjs +227 -0
  666. package/presets/opencode/next/opencode.json +2 -12
  667. package/presets/opencode/next/rules/agent-team-orchestrator.md +1 -1
  668. package/presets/opencode/next/rules/component-catalog-gate.md +13 -0
  669. package/presets/opencode/next/rules/forms-validation.md +12 -0
  670. package/presets/opencode/next/rules/next-app-router.md +27 -0
  671. package/presets/opencode/next/rules/next-static-export.md +16 -0
  672. package/presets/opencode/next/rules/react-next-anti-hallucination.md +20 -18
  673. package/presets/opencode/next/rules/security-next.md +13 -0
  674. package/presets/opencode/next/skills/technical-retro/SKILL.md +2 -0
  675. package/presets/opencode/next/team/fixtures/feature-light.json +2 -1
  676. package/presets/opencode/next/team/fixtures/feature-ui-standard.json +24 -0
  677. package/presets/opencode/nuxt/OPENCODE.md +15 -6
  678. package/presets/opencode/nuxt/REPO_AGENTS.md +14 -0
  679. package/presets/opencode/nuxt/adapter-map.json +17 -1
  680. package/presets/opencode/nuxt/agents/build-verifier.md +1 -1
  681. package/presets/opencode/nuxt/agents/code-reviewer.md +1 -1
  682. package/presets/opencode/nuxt/agents/debugger.md +1 -1
  683. package/presets/opencode/nuxt/agents/feature-developer.md +1 -1
  684. package/presets/opencode/nuxt/agents/task-analyst.md +1 -1
  685. package/presets/opencode/nuxt/commands/README.md +1 -0
  686. package/presets/opencode/nuxt/commands/task-continue.md +9 -0
  687. package/presets/opencode/nuxt/commands/technical-retro.md +8 -0
  688. package/presets/opencode/nuxt/commands/update.md +42 -0
  689. package/presets/opencode/nuxt/hooks/README.md +3 -0
  690. package/presets/opencode/nuxt/hooks/chain-team-phases.sh +107 -18
  691. package/presets/opencode/nuxt/hooks/check-preset-update.mjs +227 -0
  692. package/presets/opencode/nuxt/opencode.json +2 -12
  693. package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +1 -1
  694. package/presets/opencode/nuxt/skills/technical-retro/SKILL.md +2 -0
  695. package/presets/opencode/php-hexagonal/OPENCODE.md +14 -6
  696. package/presets/opencode/php-hexagonal/REPO_AGENTS.md +14 -0
  697. package/presets/opencode/php-hexagonal/adapter-map.json +17 -1
  698. package/presets/opencode/php-hexagonal/agents/build-verifier.md +1 -1
  699. package/presets/opencode/php-hexagonal/agents/code-reviewer.md +1 -1
  700. package/presets/opencode/php-hexagonal/agents/debugger.md +1 -1
  701. package/presets/opencode/php-hexagonal/agents/feature-developer.md +1 -1
  702. package/presets/opencode/php-hexagonal/agents/task-analyst.md +1 -1
  703. package/presets/opencode/php-hexagonal/commands/README.md +1 -0
  704. package/presets/opencode/php-hexagonal/commands/task-continue.md +9 -0
  705. package/presets/opencode/php-hexagonal/commands/technical-retro.md +8 -0
  706. package/presets/opencode/php-hexagonal/commands/update.md +42 -0
  707. package/presets/opencode/php-hexagonal/hooks/README.md +3 -0
  708. package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +107 -18
  709. package/presets/opencode/php-hexagonal/hooks/check-preset-update.mjs +227 -0
  710. package/presets/opencode/php-hexagonal/opencode.json +2 -12
  711. package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +1 -1
  712. package/presets/opencode/php-hexagonal/skills/technical-retro/SKILL.md +2 -0
  713. package/presets/opencode/php-laravel/OPENCODE.md +14 -6
  714. package/presets/opencode/php-laravel/REPO_AGENTS.md +14 -0
  715. package/presets/opencode/php-laravel/adapter-map.json +17 -1
  716. package/presets/opencode/php-laravel/agents/build-verifier.md +1 -1
  717. package/presets/opencode/php-laravel/agents/code-reviewer.md +1 -1
  718. package/presets/opencode/php-laravel/agents/debugger.md +1 -1
  719. package/presets/opencode/php-laravel/agents/feature-developer.md +1 -1
  720. package/presets/opencode/php-laravel/agents/task-analyst.md +1 -1
  721. package/presets/opencode/php-laravel/commands/README.md +1 -0
  722. package/presets/opencode/php-laravel/commands/task-continue.md +9 -0
  723. package/presets/opencode/php-laravel/commands/technical-retro.md +8 -0
  724. package/presets/opencode/php-laravel/commands/update.md +42 -0
  725. package/presets/opencode/php-laravel/hooks/README.md +3 -0
  726. package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +107 -18
  727. package/presets/opencode/php-laravel/hooks/check-preset-update.mjs +227 -0
  728. package/presets/opencode/php-laravel/opencode.json +2 -12
  729. package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +1 -1
  730. package/presets/opencode/php-laravel/skills/technical-retro/SKILL.md +2 -0
  731. package/presets/opencode/svelte/OPENCODE.md +15 -6
  732. package/presets/opencode/svelte/REPO_AGENTS.md +14 -0
  733. package/presets/opencode/svelte/adapter-map.json +17 -1
  734. package/presets/opencode/svelte/agents/build-verifier.md +1 -1
  735. package/presets/opencode/svelte/agents/code-reviewer.md +1 -1
  736. package/presets/opencode/svelte/agents/debugger.md +1 -1
  737. package/presets/opencode/svelte/agents/feature-developer.md +1 -1
  738. package/presets/opencode/svelte/agents/task-analyst.md +1 -1
  739. package/presets/opencode/svelte/commands/README.md +1 -0
  740. package/presets/opencode/svelte/commands/task-continue.md +9 -0
  741. package/presets/opencode/svelte/commands/technical-retro.md +8 -0
  742. package/presets/opencode/svelte/commands/update.md +42 -0
  743. package/presets/opencode/svelte/hooks/README.md +3 -0
  744. package/presets/opencode/svelte/hooks/chain-team-phases.sh +107 -18
  745. package/presets/opencode/svelte/hooks/check-preset-update.mjs +227 -0
  746. package/presets/opencode/svelte/opencode.json +2 -12
  747. package/presets/opencode/svelte/rules/agent-team-orchestrator.md +1 -1
  748. package/presets/opencode/svelte/skills/technical-retro/SKILL.md +2 -0
  749. package/scripts/check-product-specs.sh +115 -9
package/CHANGELOG.md CHANGED
@@ -2,6 +2,44 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ### Presets report a newer package and name the latest version
6
+
7
+ - Cursor `sessionStart` and Claude `SessionStart` run `hooks/check-preset-update.mjs`. Mavis and OpenCode run the same script on the first reply (`## Preset version` in root `AGENTS.md`).
8
+ - When `packageVersion` in `<tool>/.ai-rules-install.json` is older than the npm latest for `@bonesofspring/ai-rules`, the agent tells the user the installed version, the latest version, and to run `/update`. A registry failure stays silent. The registry lookup is cached for 12 hours.
9
+
10
+ ### `update` reinstalls the tools and presets already recorded
11
+
12
+ - **CLI `update`.** Reads `platform` and `preset` from each existing `<tool>/.ai-rules-install.json` (`.cursor`, `.claude`, `.mavis`, `.opencode`) and re-runs `init` for those tools only. A tool without a manifest stays uninstalled. The recorded preset is kept; `--preset` and a tool name are rejected. The plan is validated before the first write, so a bad manifest does not partially update.
13
+ - **Slash command `/update`.** Ships on every stack and platform. It runs `npx @bonesofspring/ai-rules update` from the repository root. No extra install record: the per-tool manifest `init` already writes is the source.
14
+
15
+ ### Consumers can require an artifact before a pipeline finishes
16
+
17
+ - Optional `.ai.local/pipeline-gates.json` key `requireArtifacts` blocks completion when a listed id has no completed receipt. Absent file, or a missing/invalid key, leaves the hook unchanged.
18
+ - A `light` UI feature does not schedule `mockup-reviewer` unless the prompt contains a `figma.com` URL or required-signal UX acceptance criteria.
19
+
20
+ ### `init` activates `router-pages` on static Pages apps
21
+
22
+ - When `next.config.*` sets `output: 'export'` and a Pages `_app` exists, `init` copies `router-pages.md` into `.ai.local/rules/`. An existing file is not overwritten. Other seeds stay in `.ai.local/rules-library/`.
23
+
24
+ ### `init` ships the self-learning engine; `run.mjs` gains `--status` / `--strict`
25
+
26
+ - **Every install seeds `.ai.local/scripts/**`.** `init` copies the six engine modules (`run`, `signals`, `lock`, `rule-improver`, `derive-gate-signals`, `efficacy-oracle`) from `presets/_shared/ai-local/scripts/` — one source for all platforms and stacks, so `claude --preset next` no longer receives zero loop files. Skip-if-exists: a consumer-modified module is kept and reported, and there is no `--force`, so a local fork never gets silently clobbered.
27
+ - **Path safety.** The seed refuses a symlinked `.ai.local` / `.ai.local/scripts` (or a resolved path escaping `--cwd`) with a warning and exit 0 — `.ai.local` is the consumer's shared runtime tree, not a tool root, so a refusal must not fail an install. Newly created engine files and the new ignore file are listed in `createdPaths`, so a failed `init` rolls back exactly what it created.
28
+ - **`.ai.local/.gitignore` covers the engine's own files.** `*.lock`, `*.tmp`, `.rollback/` are ignored from inside `.ai.local/` (the engine writes its locks and temp files there, not under `scripts/`); the consumer's root `.gitignore` is never edited.
29
+ - **`node .ai.local/scripts/run.mjs --status`** is a read-only inspection: per signature distinct slugs, tier + next action, last capture, malformed-line count, cohort readiness, the authoring envelope, and how many derivable signals are not captured yet. Missing / empty / malformed / populated stores render four distinguishable states.
30
+ - **`node .ai.local/scripts/run.mjs --strict`** exits 1 only when capture is broken — the last 3 completed tasks produced no signals *and* either the store is absent or one of them carries a mappable gate outcome. Exit codes: `0` ok, `1` broken, `2` usage. Both modes write nothing, and the chain hook never passes `--strict`.
31
+ - **The chain hook runs the loop after every producer receipt** (`chain-team-phases.sh` template tail): one run per completed stop, the child's stdout forwarded to stderr so the hook's own JSON stdout contract is untouched, a 15 s cap, `|| true`, and exactly one `WARNING:` line when the engine is absent. The `light` profile and `spike` intent skip silently.
32
+ - **One loop paragraph.** The stale `rule-improver.mjs` / raw-JSONL / "skip silently" instructions are gone from every carrier (agents, orchestrator rule, commands, retro skill); `check-preset-self-review-contract.sh` now fails on reintroduction and `test-preset-self-review-contract-fixtures.mjs` proves the negative.
33
+
34
+ ### OpenCode config: only the schema OpenCode reads (breaking for existing `opencode.json`)
35
+
36
+ - **The deny map is `permission.bash`.** `opencode.ai/docs/permissions` (re-read 2026-10-26) keys the v1 `permission` object by tool name, and the shell-command tool is `bash`. `permission.shell` is not that key. v2 is a separate schema (`permissions[]` with `action: "shell"`); this preset does not emit it. Rules resolve by pattern match with the **last** match winning, so `'*': 'allow'` stays first and the `git commit` / `git push` `deny` rows after it bind.
37
+ - **The top-level `policies` array is removed, not renamed.** `opencode.ai/docs/policies` configures policies at `experimental.policies` and supports exactly one action, `provider.use`, so a `tool.use` hard-deny cannot be expressed at all. A consumer-authored `policies` array is left untouched.
38
+ - **Bare `git commit` / `git push` are denied too.** `git commit *` does not match the argument-less form — the invocation that opens the editor. The rows live in the stack profile, so Claude Code's `settings.json` deny lists gain `Bash(git commit)` and `Bash(git push)`; `scripts/sync-claude-settings.mjs` now runs inside `fix:generated`, which is what stops the two platforms drifting.
39
+ - **The guard rows are sticky.** A pre-existing `"git push *": "allow"` in a consumer's `permission.bash` is re-applied to `deny` on re-init. Every other key keeps consumer-wins, so this is not a global precedence inversion; the guard list is asserted set-equal to the profile by `check:opencode-platform-contract`.
40
+ - **The claim prose is corrected.** `.opencode/AGENTS.md` no longer says the guard is "non-overridable". It states what the deny does guarantee (it survives the `'*': 'allow'` catch-all and `--auto`) and what it does not: an agent-level `permission` block takes precedence over the global map, a command whose parsed form does not match the pattern is not covered, and a user editing their own `opencode.json` can widen it. `commit-hygiene` plus the human commit step remains the control.
41
+ - **Migration.** A file that only has `permission.shell` (the unbound key this package briefly emitted) is folded into `permission.bash` on re-init, and `shell` is removed. A consumer `policies` array is left untouched. `clean` still strips a block recorded under either `added.bash` or `added.shell`. Re-run `init opencode` to pick up `permission.bash`.
42
+
5
43
  ### Presets: prompt-persistence reachability, core classification, reachability gate, `preset-*` authoring-only
6
44
 
7
45
  - **Prompt persistence is now always-on.** The clause ("every work request — with or without `/task` — writes `.ai.local/team/tasks/<slug>/prompt.md` and appends follow-ups to `prompt-log.md`") rides the root `REPO_AGENTS.md` → `AGENTS.md` entry, so it is reachable without `/task` (the command / orchestrator / intake consumers were all lazy `referenced` rules). `check-preset-prompt-persistence.sh` gains check **E** against `REPO_AGENTS.md`.
package/README.md CHANGED
@@ -4,12 +4,13 @@ Presets for **Cursor**, **Claude Code**, **Mavis** (MiniMax `mcode`), and **Open
4
4
 
5
5
  ```bash
6
6
  npx @bonesofspring/ai-rules init multi --preset next
7
+ npx @bonesofspring/ai-rules update # reinstall tools already recorded in this repo
7
8
  npx @bonesofspring/ai-rules clean cursor # never deletes .ai.local/
8
9
  ```
9
10
 
10
11
  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`.
11
12
 
12
- `init` overwrites matching files. MCP is the exception: `mcpServers` is **merged** when the existing file is valid JSON (extra servers kept; shipped keys updated; nested `env`/`headers` on shipped keys kept unless the preset defines them). Invalid JSON is backed up to `*.bak.<iso>` and replaced. Deleting a shipped server is not sticky — the next `init` restores it.
13
+ `init` overwrites matching files. MCP is the exception: `mcpServers` is **merged** when the existing file is valid JSON (extra servers kept; shipped keys updated). Re-init overwrites preset scalar fields on a shipped server, such as `command`. When the preset entry omits `env` or `headers`, the consumer values are kept; a nested key the preset does define replaces that key. An existing config that is not a valid JSON object fails `init` with exit 1 and is left untouched — nothing is backed up or replaced. `.claude/settings.json` is merged too (permission arrays are append-if-missing, preset hooks added per command). When the preset denies bare `Bash(git commit)` or `Bash(git push)`, re-init forces those stems into `permissions.deny` and removes the same stem from `allow` and `ask`, even if the consumer file already allowed them. Every other permission entry stays consumer-wins and is not inverted. It is the third merged-config path alongside `opencode.json` and `.mcp.json`. Deleting a shipped server is not sticky — the next `init` restores it.
13
14
 
14
15
  ## What `init` writes
15
16
 
@@ -20,8 +21,24 @@ Run `init` from the **app root** (`--cwd` if needed). Default `--preset` is `nex
20
21
  | MCP | `.cursor/mcp.json` (merge) | **`.mcp.json`** (merge) | `.mavis/mcp.json` (merge) | `opencode.json` (merge) |
21
22
  | Root agents | `REPO_AGENTS.md` → `AGENTS.md` (same file on all four) | | | |
22
23
  | `/task` artifacts | **`.ai.local/team/`** (shared; templates refreshed; `tasks/<slug>/` never overwritten) | | | |
24
+ | Self-learning engine | **`.ai.local/scripts/`** (shared; six modules; existing files never overwritten) | | | |
23
25
  | Specs seed | `docs/specs/` copied only if the directory is **absent** | | | |
24
26
 
27
+ The engine is the in-task self-learning loop: `.ai.local/signals.jsonl` → `.ai.local/rule-changes.jsonl` →
28
+ `.ai.local/conventions.md` / `.ai.local/rules-library/`. The chain hook runs it after every producer receipt; run it
29
+ yourself when the hook is disabled:
30
+
31
+ ```bash
32
+ node .ai.local/scripts/run.mjs # derive → append → improve
33
+ node .ai.local/scripts/run.mjs --status # read-only: per-signature state, last capture, envelope
34
+ node .ai.local/scripts/run.mjs --strict # read-only check: exit 1 when capture is broken
35
+ ```
36
+
37
+ `init` seeds the engine with **skip-if-exists** — a modified `run.mjs` stays yours and is reported as kept; there is no
38
+ `--force`. Re-running `init` does not update a seeded module, so delete the file to pick up a newer engine. The seeded
39
+ tree is byte-identical to `presets/_shared/ai-local/scripts/`, and `.ai.local/.gitignore` (created only when absent)
40
+ ignores `*.lock`, `*.tmp`, and `.rollback/`; the root `.gitignore` is never edited.
41
+
25
42
  Living exceptions: **`.ai.local/rules/`** and **`.ai.local/conventions.md`** (`init` does not overwrite them). Overlay does not load `.ai.local/team/**` as rules.
26
43
 
27
44
  **`clean <tool>`** removes only CLI-managed paths under that tool root. It does **not** wipe the whole `.cursor/` / `.claude/` tree, and it **never** deletes `.ai.local/`. Root `AGENTS.md` is removed only when no other tool install remains.
@@ -36,6 +53,10 @@ Mavis never writes `~/.minimax/**`. OpenCode never writes `~/.config/opencode/**
36
53
 
37
54
  `init multi --preset <stack>` installs every platform that lists the stack in `releasedStacks` (all 10 stacks on all four platforms). Commit the four trees, root `AGENTS.md`, and `.ai.local/team/` templates if you want them in the clone.
38
55
 
56
+ `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>`.
57
+
58
+ On session start (Cursor and Claude hooks; Mavis and OpenCode on the first reply) the preset compares that recorded `packageVersion` with the latest `@bonesofspring/ai-rules` release. When a newer release exists, the agent names the installed version and the latest version and asks the user to run `/update`.
59
+
39
60
  ## Stacks
40
61
 
41
62
  `next` · `nuxt` · `svelte` · `ios-swift` · `android-kotlin` · `go` · `java` · `mcp-ts` · `php-hexagonal` · `php-laravel`
@@ -54,7 +75,7 @@ Skills of note: `write-adr` (all except `mcp-ts`); `spec-authoring` / `/spec-sta
54
75
 
55
76
  `openspec/**` is a separate tree owned by agent `openspec-author` (all stacks except `mcp-ts`). Not a substitute for `docs/specs/`.
56
77
 
57
- Optional check: `yarn check:product-specs <repo-root>` (WARN) or `--strict`.
78
+ Optional check: `yarn check:product-specs [<repo-root>]` (WARN) or `--strict`. The default root is the repository root; a tree with no `docs/specs/domains/<domain>/<spec>.md` fails under `--strict` rather than passing for having inspected nothing. `yarn check:product-specs:self-test` asserts the parser's three verdicts.
58
79
 
59
80
  ## Contributing
60
81
 
package/bin/cli.js CHANGED
@@ -81,6 +81,7 @@ function printHelp() {
81
81
  Usage:
82
82
  ai-rules init <cursor|claude|mavis|opencode|multi> [--preset <name>]
83
83
  ai-rules init <cursor|claude|mavis|opencode|multi> <preset-name>
84
+ ai-rules update [--cwd <dir>]
84
85
  ai-rules clean <cursor|claude|mavis|opencode> [--cwd <dir>]
85
86
 
86
87
  Options:
@@ -110,6 +111,7 @@ Notes:
110
111
  OpenCode init copies into .opencode/ plus REPO_AGENTS.md → <cwd>/AGENTS.md; MCP merges into <cwd>/opencode.json (never ~/.config/opencode/**).
111
112
  All init targets also copy REPO_AGENTS.md → <cwd>/AGENTS.md (repo-root cross-tool agents file; overwrite; all next platforms ship the same file).
112
113
  init multi installs every platform that has released the preset (cursor, claude, plus mavis/opencode when listed in releasedStacks). Not a clean target.
114
+ update reinstalls each tool that already has <tool>/.ai-rules-install.json, using the preset field that init wrote. Tools without a manifest stay uninstalled. The recorded preset is kept. update does not accept --preset or a tool name.
113
115
  When <cwd>/docs/specs/ is absent, init also seeds INDEX.md stub + _templates/* from package assets (never overwrites an existing INDEX).
114
116
  clean removes only files the last init copied and that are unchanged since; consumer files are kept.
115
117
  Merged configs are never deleted wholesale: clean strips the entries init added (shipped MCP servers, preset
@@ -145,6 +147,7 @@ Examples:
145
147
  npx @bonesofspring/ai-rules init opencode --preset go
146
148
  npx @bonesofspring/ai-rules init multi --preset next
147
149
  npx @bonesofspring/ai-rules init multi --preset svelte
150
+ npx @bonesofspring/ai-rules update
148
151
  npx @bonesofspring/ai-rules clean mavis
149
152
  npx @bonesofspring/ai-rules clean opencode
150
153
  npx @bonesofspring/ai-rules clean cursor
@@ -690,6 +693,94 @@ function cmdInitMulti(preset, cwdOption) {
690
693
  console.log(`\nDone. multi installed ${installed.join(', ')}${skipNote}`);
691
694
  }
692
695
 
696
+ const UPDATE_TARGETS = [
697
+ { tool: 'cursor', root: '.cursor' },
698
+ { tool: 'claude', root: '.claude' },
699
+ { tool: 'mavis', root: '.mavis' },
700
+ { tool: 'opencode', root: '.opencode' },
701
+ ];
702
+
703
+ function updatePresetReady(tool, presetName) {
704
+ const packageRoot = getPackageRoot();
705
+ if (tool === 'cursor' || tool === 'claude') {
706
+ const cfg = PRESETS[tool];
707
+ return presetHasAnySource(path.join(packageRoot, ...cfg.relBase, presetName), cfg);
708
+ }
709
+ const base = path.join(packageRoot, 'presets', tool, presetName);
710
+ if (!fs.existsSync(base) || !fs.statSync(base).isDirectory()) {
711
+ return false;
712
+ }
713
+ const released = loadReleasedStacks(tool);
714
+ return !released || released.length === 0 || released.includes(presetName);
715
+ }
716
+
717
+ /**
718
+ * Reinstall every tool that has an install manifest, using the preset recorded there.
719
+ * Validates the whole plan before the first init so a bad manifest does not partially update.
720
+ */
721
+ function cmdUpdate(cwdOption) {
722
+ const cwd = resolveTargetCwd(cwdOption);
723
+ const errors = [];
724
+ const found = [];
725
+
726
+ for (const { tool, root } of UPDATE_TARGETS) {
727
+ const rel = `${root}/.ai-rules-install.json`;
728
+ const abs = resolveManagedPath(cwd, rel);
729
+ if (!abs) {
730
+ errors.push(`${rel}: unsafe path`);
731
+ continue;
732
+ }
733
+ if (!fs.existsSync(abs)) {
734
+ continue;
735
+ }
736
+ let manifest;
737
+ try {
738
+ manifest = JSON.parse(fs.readFileSync(abs, 'utf8'));
739
+ } catch {
740
+ errors.push(`${rel}: invalid JSON`);
741
+ continue;
742
+ }
743
+ if (!isPlainObject(manifest)) {
744
+ errors.push(`${rel}: not a JSON object`);
745
+ continue;
746
+ }
747
+ if (manifest.platform !== tool) {
748
+ errors.push(`${rel}: platform is ${JSON.stringify(manifest.platform)}, expected "${tool}"`);
749
+ continue;
750
+ }
751
+ if (typeof manifest.preset !== 'string' || validatePresetName(manifest.preset)) {
752
+ errors.push(`${rel}: missing preset. Run init ${tool} --preset <name> once, then update.`);
753
+ continue;
754
+ }
755
+ if (!updatePresetReady(tool, manifest.preset)) {
756
+ errors.push(`${rel}: preset "${manifest.preset}" is not installed for ${tool}`);
757
+ continue;
758
+ }
759
+ found.push({ tool, preset: manifest.preset });
760
+ }
761
+
762
+ if (errors.length > 0) {
763
+ for (const error of errors) {
764
+ console.error(`update: ${error}`);
765
+ }
766
+ process.exit(1);
767
+ }
768
+ if (found.length === 0) {
769
+ console.error(
770
+ 'update: no install manifest found. Run init for the tools you use, then update.',
771
+ );
772
+ process.exit(1);
773
+ }
774
+
775
+ const plan = found.map((item) => `${item.tool} (${item.preset})`).join(', ');
776
+ console.log(`update: reinstalling ${plan}`);
777
+ for (const item of found) {
778
+ console.log(`\n=== update ${item.tool} --preset ${item.preset} ===`);
779
+ cmdInit(item.tool, item.preset, cwdOption);
780
+ }
781
+ console.log(`\nDone. update reinstalled ${plan}`);
782
+ }
783
+
693
784
  function cmdInit(tool, preset, cwdOption) {
694
785
  if (tool === 'mavis') {
695
786
  cmdInitMavis({
@@ -1033,6 +1124,20 @@ function main() {
1033
1124
  cmdInit(tool, preset, parsed.cwd);
1034
1125
  return;
1035
1126
  }
1127
+ if (command === 'update') {
1128
+ if (tool) {
1129
+ console.error('update does not take a tool. It reinstalls every tool that has an install manifest.');
1130
+ process.exit(1);
1131
+ }
1132
+ if (preset) {
1133
+ console.error(
1134
+ 'update does not take --preset. It keeps the preset recorded for each installed tool.',
1135
+ );
1136
+ process.exit(1);
1137
+ }
1138
+ cmdUpdate(parsed.cwd);
1139
+ return;
1140
+ }
1036
1141
  if (command === 'clean') {
1037
1142
  if (tool === 'multi') {
1038
1143
  console.error('clean multi is not supported. Clean each tool: cursor, claude, mavis, opencode.');
@@ -1047,7 +1152,7 @@ function main() {
1047
1152
  }
1048
1153
 
1049
1154
  const got = command === undefined ? 'none' : command;
1050
- console.error(`Unknown command: ${got}. Use init or clean.`);
1155
+ console.error(`Unknown command: ${got}. Use init, update, or clean.`);
1051
1156
  printHelp();
1052
1157
  process.exit(1);
1053
1158
  }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The shipped self-learning engine, declared once.
3
+ *
4
+ * `init` seeds exactly these files into a consumer's `.ai.local/scripts/`, and
5
+ * the monorepo dogfood copy is mirrored from the same source by
6
+ * `scripts/lib/engine-mirror.mjs`. An explicit list — never a glob — keeps the
7
+ * repo-local tooling (the `*.test.mjs` suites and `requirements-*.mjs`) out of
8
+ * the shipped set.
9
+ */
10
+ const ENGINE_SCRIPTS = [
11
+ 'run.mjs',
12
+ 'signals.mjs',
13
+ 'lock.mjs',
14
+ 'rule-improver.mjs',
15
+ 'derive-gate-signals.mjs',
16
+ 'efficacy-oracle.mjs',
17
+ ];
18
+
19
+ /** Preset-root-relative directory holding the engine source of truth. */
20
+ const ENGINE_SOURCE_RELATIVE = '_shared/ai-local/scripts';
21
+
22
+ module.exports = { ENGINE_SCRIPTS, ENGINE_SOURCE_RELATIVE };
@@ -6,6 +6,8 @@ const fs = require('fs');
6
6
  const path = require('path');
7
7
  const { assertSafeDest, lstatOrNull } = require('./safe-path');
8
8
 
9
+ const ROLLBACK_IGNORE_FILE = '.gitignore';
10
+
9
11
  function isPlainObject(value) {
10
12
  return value !== null && typeof value === 'object' && !Array.isArray(value);
11
13
  }
@@ -37,18 +39,47 @@ function renameIntoPlace(tmp, dest) {
37
39
  }
38
40
  }
39
41
 
42
+ /**
43
+ * The temp path both atomic writers share. The name is deliberately predictable so a
44
+ * regression test can plant a symlink at it — which is why the path is contained twice:
45
+ * `assertSafeDest` walks every parent component and refuses a symlinked one, and the
46
+ * callers' `O_EXCL` create makes the kernel refuse the leaf itself, dangling links
47
+ * included. Nothing is swept on `EEXIST`: concurrent `init` runs share this name, so
48
+ * deleting what is there would destroy another run's in-flight write.
49
+ */
50
+ function atomicTempPath(cwd, dest, label) {
51
+ const tmp = `${dest}.ai-rules-tmp`;
52
+ assertSafeDest(cwd, tmp, `${label} (atomic temp)`);
53
+ return tmp;
54
+ }
55
+
56
+ /** Run an `O_EXCL` create at the shared temp path, turning `EEXIST` into an actionable refusal. */
57
+ function createTempExclusive(tmp, create) {
58
+ try {
59
+ create();
60
+ } catch (err) {
61
+ if (err.code === 'EEXIST') {
62
+ throw new Error(
63
+ `${tmp} already exists; refusing to write through or overwrite it. `
64
+ + 'It is left by an interrupted or concurrent run — delete it and re-run.',
65
+ );
66
+ }
67
+ throw err;
68
+ }
69
+ }
70
+
40
71
  /** Write via a temp file + rename so an interrupted write cannot corrupt the destination. */
41
- function writeFileAtomic(dest, content) {
72
+ function writeFileAtomic(cwd, dest, content, label) {
73
+ const tmp = atomicTempPath(cwd, dest, label);
42
74
  fs.mkdirSync(path.dirname(dest), { recursive: true });
43
- const tmp = `${dest}.ai-rules-tmp`;
44
- fs.writeFileSync(tmp, content);
75
+ createTempExclusive(tmp, () => fs.writeFileSync(tmp, content, { flag: 'wx' }));
45
76
  renameIntoPlace(tmp, dest);
46
77
  }
47
78
 
48
- function copyFileAtomic(source, dest) {
79
+ function copyFileAtomic(cwd, source, dest, label) {
80
+ const tmp = atomicTempPath(cwd, dest, label);
49
81
  fs.mkdirSync(path.dirname(dest), { recursive: true });
50
- const tmp = `${dest}.ai-rules-tmp`;
51
- fs.copyFileSync(source, tmp);
82
+ createTempExclusive(tmp, () => fs.copyFileSync(source, tmp, fs.constants.COPYFILE_EXCL));
52
83
  if (dest.endsWith('.sh')) {
53
84
  fs.chmodSync(tmp, 0o755);
54
85
  }
@@ -120,6 +151,7 @@ function createInstallTransaction(cwd, rollbackRoot) {
120
151
  const created = new Set();
121
152
  const snapshots = new Map();
122
153
  const tracked = new Set();
154
+ const rollbackDir = path.dirname(rollbackRoot);
123
155
 
124
156
  const track = (dest, label) => {
125
157
  assertSafeDest(cwd, dest, label);
@@ -143,12 +175,47 @@ function createInstallTransaction(cwd, rollbackRoot) {
143
175
 
144
176
  const removeRollbackRoot = () => {
145
177
  fs.rmSync(rollbackRoot, { recursive: true, force: true });
146
- const parent = path.dirname(rollbackRoot);
147
- if (fs.existsSync(parent) && fs.readdirSync(parent).length === 0) {
148
- fs.rmdirSync(parent);
178
+ if (!fs.existsSync(rollbackDir)) {
179
+ return;
180
+ }
181
+ // The self-ignore marker is not a snapshot, so it leaves with the last stamp. A sibling
182
+ // stamp (concurrent run, S-09) keeps the tree and its marker, as today.
183
+ const left = fs.readdirSync(rollbackDir);
184
+ if (left.length === 0) {
185
+ fs.rmdirSync(rollbackDir);
186
+ } else if (left.length === 1 && left[0] === ROLLBACK_IGNORE_FILE) {
187
+ fs.rmSync(rollbackDir, { recursive: true, force: true });
149
188
  }
150
189
  };
151
190
 
191
+ /**
192
+ * Make `<toolRoot>/.rollback/` self-ignoring so a consumer cannot commit install
193
+ * snapshots, which carry the merged configs — consumer MCP tokens included. A
194
+ * `.gitignore` inside the tree is used instead of appending to the consumer's root
195
+ * `.gitignore`: the CLI never edits that file, and this works in a repo that has
196
+ * none at all. It sits at the `.rollback/` level, not inside a stamp, so it covers
197
+ * every stamp — including one left behind by a run that is still in flight.
198
+ */
199
+ const ensureRollbackIgnored = () => {
200
+ const ignoreFile = path.join(rollbackDir, ROLLBACK_IGNORE_FILE);
201
+ if (fs.existsSync(ignoreFile)) {
202
+ return;
203
+ }
204
+ assertSafeDest(cwd, rollbackDir, 'rollback root');
205
+ fs.mkdirSync(rollbackDir, { recursive: true });
206
+ fs.writeFileSync(
207
+ ignoreFile,
208
+ [
209
+ '# Snapshots written by @bonesofspring/ai-rules while it installed.',
210
+ '# Local safety net — never commit.',
211
+ '*',
212
+ '',
213
+ ].join('\n'),
214
+ );
215
+ };
216
+
217
+ ensureRollbackIgnored();
218
+
152
219
  return {
153
220
  track,
154
221
  addCreated(abs) {
@@ -156,11 +223,11 @@ function createInstallTransaction(cwd, rollbackRoot) {
156
223
  },
157
224
  copyFile(source, dest, label) {
158
225
  track(dest, label);
159
- copyFileAtomic(source, dest);
226
+ copyFileAtomic(cwd, source, dest, label);
160
227
  },
161
228
  writeFile(dest, content, label) {
162
229
  track(dest, label);
163
- writeFileAtomic(dest, content);
230
+ writeFileAtomic(cwd, dest, content, label);
164
231
  },
165
232
  commit: removeRollbackRoot,
166
233
  rollback() {
@@ -135,11 +135,16 @@ function stripContribution(config, record) {
135
135
  if (Array.isArray(config.instructions) && Array.isArray(added.instructions)) {
136
136
  config.instructions = config.instructions.filter((item) => !added.instructions.includes(item));
137
137
  }
138
- const bash = isPlainObject(config.permission) ? config.permission.bash : undefined;
139
- if (isPlainObject(bash) && isPlainObject(added.bash)) {
140
- for (const [key, value] of Object.entries(added.bash)) {
141
- if (bash[key] === value) {
142
- delete bash[key];
138
+ // v1 binds `permission.bash`. `added.shell` is still read so `clean` strips a
139
+ // block recorded while the emitter briefly wrote the unbound `permission.shell` key.
140
+ if (isPlainObject(config.permission)) {
141
+ for (const [blockKey, addedBlock] of [['shell', added.shell], ['bash', added.bash]]) {
142
+ const current = config.permission[blockKey];
143
+ if (!isPlainObject(current) || !isPlainObject(addedBlock)) continue;
144
+ for (const [key, value] of Object.entries(addedBlock)) {
145
+ if (current[key] === value) {
146
+ delete current[key];
147
+ }
143
148
  }
144
149
  }
145
150
  }
@@ -151,15 +156,6 @@ function stripContribution(config, record) {
151
156
  }
152
157
  }
153
158
  }
154
- if (Array.isArray(config.policies) && Array.isArray(added.policies) && added.policies.length > 0) {
155
- const addedKeys = new Set(added.policies);
156
- config.policies = config.policies.filter(
157
- (statement) => !addedKeys.has(`${statement?.action}\u0000${statement?.resource}`),
158
- );
159
- if (config.policies.length === 0) {
160
- delete config.policies;
161
- }
162
- }
163
159
  if (isPlainObject(config.hooks) && isPlainObject(added.hooks)) {
164
160
  stripHooks(config.hooks, added.hooks);
165
161
  }
@@ -196,7 +192,7 @@ function stripMergedConfig(cwd, rel, record) {
196
192
  if (JSON.stringify(parsed) === before) {
197
193
  return 'unchanged';
198
194
  }
199
- writeFileAtomic(abs, `${JSON.stringify(parsed, null, 2)}\n`);
195
+ writeFileAtomic(cwd, abs, `${JSON.stringify(parsed, null, 2)}\n`, rel);
200
196
  return 'stripped';
201
197
  }
202
198
 
@@ -214,7 +210,9 @@ function stripMergedConfigs(cwd, records) {
214
210
 
215
211
  /**
216
212
  * Union `permissions.*` arrays and add preset hooks by event (deduped by `command`).
217
- * Every other consumer key wins.
213
+ * Every other consumer key wins. Bare `Bash(git commit)` and `Bash(git push)` are
214
+ * the exception: when the preset denies that stem, it is forced onto `deny` and
215
+ * removed from `allow` and `ask`. Other stems stay append-if-missing.
218
216
  */
219
217
  function mergeClaudeSettings(presetObj, existingObj) {
220
218
  const preset = isPlainObject(presetObj) ? presetObj : {};
@@ -253,6 +251,22 @@ function mergeClaudeSettings(presetObj, existingObj) {
253
251
  }
254
252
  }
255
253
  }
254
+ // `Bash(git commit *)` does not match the argument-less form. A consumer
255
+ // `allow`/`ask` row for the bare stem must not survive re-init when the
256
+ // preset denies it. Scoped to these two stems — not a global preset-wins merge.
257
+ if (permissions && Array.isArray(preset.permissions.deny) && Array.isArray(permissions.deny)) {
258
+ for (const stem of ['Bash(git commit)', 'Bash(git push)']) {
259
+ if (!preset.permissions.deny.includes(stem)) continue;
260
+ if (!permissions.deny.includes(stem)) {
261
+ permissions.deny.push(stem);
262
+ (added.permissions.deny ||= []).push(stem);
263
+ }
264
+ for (const weaker of ['allow', 'ask']) {
265
+ if (!Array.isArray(permissions[weaker]) || !permissions[weaker].includes(stem)) continue;
266
+ permissions[weaker] = permissions[weaker].filter((item) => item !== stem);
267
+ }
268
+ }
269
+ }
256
270
  }
257
271
 
258
272
  if (isPlainObject(preset.hooks)) {