@bonesofspring/ai-rules 0.2.61 → 0.2.63

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 (343) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +3 -3
  3. package/bin/lib/seed-ai-local-team.js +3 -0
  4. package/bin/mavis-install.js +3 -1
  5. package/bin/opencode-install.js +3 -1
  6. package/bin/zcode-install.js +3 -1
  7. package/docs/MAVIS.md +5 -2
  8. package/docs/OPENCODE.md +5 -2
  9. package/docs/PLATFORMS.md +1 -1
  10. package/docs/PRESET-CONTRIBUTION.md +19 -16
  11. package/docs/TEAM-DB.md +7 -1
  12. package/package.json +3 -3
  13. package/presets/_shared/ai-local/scripts/check-write-scope.mjs +176 -28
  14. package/presets/_shared/ai-local/scripts/lock.mjs +60 -121
  15. package/presets/_shared/core/agent-team/agent-artifact-contracts.md +4 -0
  16. package/presets/_shared/core/agent-team/agent-team-intake.md +1 -0
  17. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +5 -2
  18. package/presets/_shared/core/meta/preset-pr-checklist.md +4 -4
  19. package/presets/_shared/core/meta/preset-twin-sync.md +1 -1
  20. package/presets/_shared/hooks/check-preset-update.mjs +4 -3
  21. package/presets/claude/android-kotlin/hooks/check-preset-update.mjs +4 -3
  22. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-intake.md +1 -0
  23. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  24. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  25. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-twin-sync.md +1 -1
  26. package/presets/claude/go/hooks/check-preset-update.mjs +4 -3
  27. package/presets/claude/go/rules/tooling-and-review/agent-team-intake.md +1 -0
  28. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  29. package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  30. package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +1 -1
  31. package/presets/claude/ios-swift/hooks/check-preset-update.mjs +4 -3
  32. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-intake.md +1 -0
  33. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  34. package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  35. package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +1 -1
  36. package/presets/claude/java/hooks/check-preset-update.mjs +4 -3
  37. package/presets/claude/java/rules/tooling-and-review/agent-team-intake.md +1 -0
  38. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  39. package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  40. package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +1 -1
  41. package/presets/claude/mcp-ts/hooks/check-preset-update.mjs +4 -3
  42. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-intake.md +1 -0
  43. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  44. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  45. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-twin-sync.md +1 -1
  46. package/presets/claude/mol/hooks/check-preset-update.mjs +4 -3
  47. package/presets/claude/mol/rules/tooling-and-review/agent-team-intake.md +1 -0
  48. package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  49. package/presets/claude/mol/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  50. package/presets/claude/mol/rules/tooling-and-review/preset-twin-sync.md +1 -1
  51. package/presets/claude/next/agents/build-verifier.md +16 -3
  52. package/presets/claude/next/agents/feature-developer.md +2 -1
  53. package/presets/claude/next/agents/task-analyst.md +2 -0
  54. package/presets/claude/next/hooks/check-preset-update.mjs +4 -3
  55. package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +1 -0
  56. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  57. package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  58. package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +1 -1
  59. package/presets/claude/nuxt/hooks/check-preset-update.mjs +4 -3
  60. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-intake.md +1 -0
  61. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  62. package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  63. package/presets/claude/nuxt/rules/tooling-and-review/preset-twin-sync.md +1 -1
  64. package/presets/claude/php-hexagonal/hooks/check-preset-update.mjs +4 -3
  65. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-intake.md +1 -0
  66. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  67. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  68. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-twin-sync.md +1 -1
  69. package/presets/claude/php-laravel/hooks/check-preset-update.mjs +4 -3
  70. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-intake.md +1 -0
  71. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  72. package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  73. package/presets/claude/php-laravel/rules/tooling-and-review/preset-twin-sync.md +1 -1
  74. package/presets/claude/svelte/hooks/check-preset-update.mjs +4 -3
  75. package/presets/claude/svelte/rules/tooling-and-review/agent-team-intake.md +1 -0
  76. package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
  77. package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +4 -4
  78. package/presets/claude/svelte/rules/tooling-and-review/preset-twin-sync.md +1 -1
  79. package/presets/cursor/android-kotlin/hooks/check-preset-update.mjs +4 -3
  80. package/presets/cursor/android-kotlin/rules/agent-team-intake.mdc +1 -0
  81. package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +2 -1
  82. package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +4 -4
  83. package/presets/cursor/android-kotlin/rules/preset-twin-sync.mdc +1 -1
  84. package/presets/cursor/go/hooks/check-preset-update.mjs +4 -3
  85. package/presets/cursor/go/rules/agent-team-intake.mdc +1 -0
  86. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +2 -1
  87. package/presets/cursor/go/rules/preset-pr-checklist.mdc +4 -4
  88. package/presets/cursor/go/rules/preset-twin-sync.mdc +1 -1
  89. package/presets/cursor/ios-swift/hooks/check-preset-update.mjs +4 -3
  90. package/presets/cursor/ios-swift/rules/agent-team-intake.mdc +1 -0
  91. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +2 -1
  92. package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +4 -4
  93. package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +1 -1
  94. package/presets/cursor/java/hooks/check-preset-update.mjs +4 -3
  95. package/presets/cursor/java/rules/agent-team-intake.mdc +1 -0
  96. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +2 -1
  97. package/presets/cursor/java/rules/preset-pr-checklist.mdc +4 -4
  98. package/presets/cursor/java/rules/preset-twin-sync.mdc +1 -1
  99. package/presets/cursor/mcp-ts/hooks/check-preset-update.mjs +4 -3
  100. package/presets/cursor/mcp-ts/rules/agent-team-intake.mdc +1 -0
  101. package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +2 -1
  102. package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +4 -4
  103. package/presets/cursor/mcp-ts/rules/preset-twin-sync.mdc +1 -1
  104. package/presets/cursor/mol/hooks/check-preset-update.mjs +4 -3
  105. package/presets/cursor/mol/rules/agent-team-intake.mdc +1 -0
  106. package/presets/cursor/mol/rules/agent-team-orchestrator.mdc +2 -1
  107. package/presets/cursor/mol/rules/preset-pr-checklist.mdc +4 -4
  108. package/presets/cursor/mol/rules/preset-twin-sync.mdc +1 -1
  109. package/presets/cursor/next/agents/build-verifier.md +16 -3
  110. package/presets/cursor/next/agents/feature-developer.md +2 -1
  111. package/presets/cursor/next/agents/task-analyst.md +2 -0
  112. package/presets/cursor/next/hooks/check-preset-update.mjs +4 -3
  113. package/presets/cursor/next/rules/agent-team-intake.mdc +1 -0
  114. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +2 -1
  115. package/presets/cursor/next/rules/preset-pr-checklist.mdc +4 -4
  116. package/presets/cursor/next/rules/preset-twin-sync.mdc +1 -1
  117. package/presets/cursor/nuxt/hooks/check-preset-update.mjs +4 -3
  118. package/presets/cursor/nuxt/rules/agent-team-intake.mdc +1 -0
  119. package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +2 -1
  120. package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +4 -4
  121. package/presets/cursor/nuxt/rules/preset-twin-sync.mdc +1 -1
  122. package/presets/cursor/php-hexagonal/hooks/check-preset-update.mjs +4 -3
  123. package/presets/cursor/php-hexagonal/rules/agent-team-intake.mdc +1 -0
  124. package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +2 -1
  125. package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +4 -4
  126. package/presets/cursor/php-hexagonal/rules/preset-twin-sync.mdc +1 -1
  127. package/presets/cursor/php-laravel/hooks/check-preset-update.mjs +4 -3
  128. package/presets/cursor/php-laravel/rules/agent-team-intake.mdc +1 -0
  129. package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +2 -1
  130. package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +4 -4
  131. package/presets/cursor/php-laravel/rules/preset-twin-sync.mdc +1 -1
  132. package/presets/cursor/svelte/hooks/check-preset-update.mjs +4 -3
  133. package/presets/cursor/svelte/rules/agent-team-intake.mdc +1 -0
  134. package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +2 -1
  135. package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +4 -4
  136. package/presets/cursor/svelte/rules/preset-twin-sync.mdc +1 -1
  137. package/presets/mavis/android-kotlin/adapter-map.json +1 -1
  138. package/presets/mavis/android-kotlin/hooks/check-preset-update.mjs +4 -3
  139. package/presets/mavis/android-kotlin/rules/agent-team-intake.md +1 -0
  140. package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +5 -2
  141. package/presets/mavis/android-kotlin/rules/preset-pr-checklist.md +4 -4
  142. package/presets/mavis/android-kotlin/rules/preset-twin-sync.md +1 -1
  143. package/presets/mavis/go/adapter-map.json +1 -1
  144. package/presets/mavis/go/hooks/check-preset-update.mjs +4 -3
  145. package/presets/mavis/go/rules/agent-team-intake.md +1 -0
  146. package/presets/mavis/go/rules/agent-team-orchestrator.md +5 -2
  147. package/presets/mavis/go/rules/preset-pr-checklist.md +4 -4
  148. package/presets/mavis/go/rules/preset-twin-sync.md +1 -1
  149. package/presets/mavis/ios-swift/adapter-map.json +1 -1
  150. package/presets/mavis/ios-swift/hooks/check-preset-update.mjs +4 -3
  151. package/presets/mavis/ios-swift/rules/agent-team-intake.md +1 -0
  152. package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +5 -2
  153. package/presets/mavis/ios-swift/rules/preset-pr-checklist.md +4 -4
  154. package/presets/mavis/ios-swift/rules/preset-twin-sync.md +1 -1
  155. package/presets/mavis/java/adapter-map.json +1 -1
  156. package/presets/mavis/java/hooks/check-preset-update.mjs +4 -3
  157. package/presets/mavis/java/rules/agent-team-intake.md +1 -0
  158. package/presets/mavis/java/rules/agent-team-orchestrator.md +5 -2
  159. package/presets/mavis/java/rules/preset-pr-checklist.md +4 -4
  160. package/presets/mavis/java/rules/preset-twin-sync.md +1 -1
  161. package/presets/mavis/mcp-ts/adapter-map.json +1 -1
  162. package/presets/mavis/mcp-ts/hooks/check-preset-update.mjs +4 -3
  163. package/presets/mavis/mcp-ts/rules/agent-team-intake.md +1 -0
  164. package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +5 -2
  165. package/presets/mavis/mcp-ts/rules/preset-pr-checklist.md +4 -4
  166. package/presets/mavis/mcp-ts/rules/preset-twin-sync.md +1 -1
  167. package/presets/mavis/mol/adapter-map.json +1 -1
  168. package/presets/mavis/mol/hooks/check-preset-update.mjs +4 -3
  169. package/presets/mavis/mol/rules/agent-team-intake.md +1 -0
  170. package/presets/mavis/mol/rules/agent-team-orchestrator.md +5 -2
  171. package/presets/mavis/mol/rules/preset-pr-checklist.md +4 -4
  172. package/presets/mavis/mol/rules/preset-twin-sync.md +1 -1
  173. package/presets/mavis/next/adapter-map.json +1 -1
  174. package/presets/mavis/next/agents/build-verifier.md +16 -3
  175. package/presets/mavis/next/agents/feature-developer.md +2 -1
  176. package/presets/mavis/next/agents/task-analyst.md +2 -0
  177. package/presets/mavis/next/hooks/check-preset-update.mjs +4 -3
  178. package/presets/mavis/next/rules/agent-team-intake.md +1 -0
  179. package/presets/mavis/next/rules/agent-team-orchestrator.md +5 -2
  180. package/presets/mavis/next/rules/preset-pr-checklist.md +4 -4
  181. package/presets/mavis/next/rules/preset-twin-sync.md +1 -1
  182. package/presets/mavis/nuxt/adapter-map.json +1 -1
  183. package/presets/mavis/nuxt/hooks/check-preset-update.mjs +4 -3
  184. package/presets/mavis/nuxt/rules/agent-team-intake.md +1 -0
  185. package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +5 -2
  186. package/presets/mavis/nuxt/rules/preset-pr-checklist.md +4 -4
  187. package/presets/mavis/nuxt/rules/preset-twin-sync.md +1 -1
  188. package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
  189. package/presets/mavis/php-hexagonal/hooks/check-preset-update.mjs +4 -3
  190. package/presets/mavis/php-hexagonal/rules/agent-team-intake.md +1 -0
  191. package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +5 -2
  192. package/presets/mavis/php-hexagonal/rules/preset-pr-checklist.md +4 -4
  193. package/presets/mavis/php-hexagonal/rules/preset-twin-sync.md +1 -1
  194. package/presets/mavis/php-laravel/adapter-map.json +1 -1
  195. package/presets/mavis/php-laravel/hooks/check-preset-update.mjs +4 -3
  196. package/presets/mavis/php-laravel/rules/agent-team-intake.md +1 -0
  197. package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +5 -2
  198. package/presets/mavis/php-laravel/rules/preset-pr-checklist.md +4 -4
  199. package/presets/mavis/php-laravel/rules/preset-twin-sync.md +1 -1
  200. package/presets/mavis/svelte/adapter-map.json +1 -1
  201. package/presets/mavis/svelte/hooks/check-preset-update.mjs +4 -3
  202. package/presets/mavis/svelte/rules/agent-team-intake.md +1 -0
  203. package/presets/mavis/svelte/rules/agent-team-orchestrator.md +5 -2
  204. package/presets/mavis/svelte/rules/preset-pr-checklist.md +4 -4
  205. package/presets/mavis/svelte/rules/preset-twin-sync.md +1 -1
  206. package/presets/opencode/android-kotlin/adapter-map.json +1 -1
  207. package/presets/opencode/android-kotlin/hooks/check-preset-update.mjs +4 -3
  208. package/presets/opencode/android-kotlin/rules/agent-team-intake.md +1 -0
  209. package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +5 -2
  210. package/presets/opencode/android-kotlin/rules/preset-pr-checklist.md +4 -4
  211. package/presets/opencode/android-kotlin/rules/preset-twin-sync.md +1 -1
  212. package/presets/opencode/go/adapter-map.json +1 -1
  213. package/presets/opencode/go/hooks/check-preset-update.mjs +4 -3
  214. package/presets/opencode/go/rules/agent-team-intake.md +1 -0
  215. package/presets/opencode/go/rules/agent-team-orchestrator.md +5 -2
  216. package/presets/opencode/go/rules/preset-pr-checklist.md +4 -4
  217. package/presets/opencode/go/rules/preset-twin-sync.md +1 -1
  218. package/presets/opencode/ios-swift/adapter-map.json +1 -1
  219. package/presets/opencode/ios-swift/hooks/check-preset-update.mjs +4 -3
  220. package/presets/opencode/ios-swift/rules/agent-team-intake.md +1 -0
  221. package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +5 -2
  222. package/presets/opencode/ios-swift/rules/preset-pr-checklist.md +4 -4
  223. package/presets/opencode/ios-swift/rules/preset-twin-sync.md +1 -1
  224. package/presets/opencode/java/adapter-map.json +1 -1
  225. package/presets/opencode/java/hooks/check-preset-update.mjs +4 -3
  226. package/presets/opencode/java/rules/agent-team-intake.md +1 -0
  227. package/presets/opencode/java/rules/agent-team-orchestrator.md +5 -2
  228. package/presets/opencode/java/rules/preset-pr-checklist.md +4 -4
  229. package/presets/opencode/java/rules/preset-twin-sync.md +1 -1
  230. package/presets/opencode/mcp-ts/adapter-map.json +1 -1
  231. package/presets/opencode/mcp-ts/hooks/check-preset-update.mjs +4 -3
  232. package/presets/opencode/mcp-ts/rules/agent-team-intake.md +1 -0
  233. package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +5 -2
  234. package/presets/opencode/mcp-ts/rules/preset-pr-checklist.md +4 -4
  235. package/presets/opencode/mcp-ts/rules/preset-twin-sync.md +1 -1
  236. package/presets/opencode/mol/adapter-map.json +1 -1
  237. package/presets/opencode/mol/hooks/check-preset-update.mjs +4 -3
  238. package/presets/opencode/mol/rules/agent-team-intake.md +1 -0
  239. package/presets/opencode/mol/rules/agent-team-orchestrator.md +5 -2
  240. package/presets/opencode/mol/rules/preset-pr-checklist.md +4 -4
  241. package/presets/opencode/mol/rules/preset-twin-sync.md +1 -1
  242. package/presets/opencode/next/adapter-map.json +1 -1
  243. package/presets/opencode/next/agents/build-verifier.md +16 -3
  244. package/presets/opencode/next/agents/feature-developer.md +2 -1
  245. package/presets/opencode/next/agents/task-analyst.md +2 -0
  246. package/presets/opencode/next/hooks/check-preset-update.mjs +4 -3
  247. package/presets/opencode/next/rules/agent-team-intake.md +1 -0
  248. package/presets/opencode/next/rules/agent-team-orchestrator.md +5 -2
  249. package/presets/opencode/next/rules/preset-pr-checklist.md +4 -4
  250. package/presets/opencode/next/rules/preset-twin-sync.md +1 -1
  251. package/presets/opencode/nuxt/adapter-map.json +1 -1
  252. package/presets/opencode/nuxt/hooks/check-preset-update.mjs +4 -3
  253. package/presets/opencode/nuxt/rules/agent-team-intake.md +1 -0
  254. package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +5 -2
  255. package/presets/opencode/nuxt/rules/preset-pr-checklist.md +4 -4
  256. package/presets/opencode/nuxt/rules/preset-twin-sync.md +1 -1
  257. package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
  258. package/presets/opencode/php-hexagonal/hooks/check-preset-update.mjs +4 -3
  259. package/presets/opencode/php-hexagonal/rules/agent-team-intake.md +1 -0
  260. package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +5 -2
  261. package/presets/opencode/php-hexagonal/rules/preset-pr-checklist.md +4 -4
  262. package/presets/opencode/php-hexagonal/rules/preset-twin-sync.md +1 -1
  263. package/presets/opencode/php-laravel/adapter-map.json +1 -1
  264. package/presets/opencode/php-laravel/hooks/check-preset-update.mjs +4 -3
  265. package/presets/opencode/php-laravel/rules/agent-team-intake.md +1 -0
  266. package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +5 -2
  267. package/presets/opencode/php-laravel/rules/preset-pr-checklist.md +4 -4
  268. package/presets/opencode/php-laravel/rules/preset-twin-sync.md +1 -1
  269. package/presets/opencode/svelte/adapter-map.json +1 -1
  270. package/presets/opencode/svelte/hooks/check-preset-update.mjs +4 -3
  271. package/presets/opencode/svelte/rules/agent-team-intake.md +1 -0
  272. package/presets/opencode/svelte/rules/agent-team-orchestrator.md +5 -2
  273. package/presets/opencode/svelte/rules/preset-pr-checklist.md +4 -4
  274. package/presets/opencode/svelte/rules/preset-twin-sync.md +1 -1
  275. package/presets/zcode/android-kotlin/adapter-map.json +1 -1
  276. package/presets/zcode/android-kotlin/hooks/check-preset-update.mjs +4 -3
  277. package/presets/zcode/android-kotlin/rules/agent-team-intake.md +1 -0
  278. package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +5 -2
  279. package/presets/zcode/android-kotlin/rules/preset-pr-checklist.md +4 -4
  280. package/presets/zcode/android-kotlin/rules/preset-twin-sync.md +1 -1
  281. package/presets/zcode/go/adapter-map.json +1 -1
  282. package/presets/zcode/go/hooks/check-preset-update.mjs +4 -3
  283. package/presets/zcode/go/rules/agent-team-intake.md +1 -0
  284. package/presets/zcode/go/rules/agent-team-orchestrator.md +5 -2
  285. package/presets/zcode/go/rules/preset-pr-checklist.md +4 -4
  286. package/presets/zcode/go/rules/preset-twin-sync.md +1 -1
  287. package/presets/zcode/ios-swift/adapter-map.json +1 -1
  288. package/presets/zcode/ios-swift/hooks/check-preset-update.mjs +4 -3
  289. package/presets/zcode/ios-swift/rules/agent-team-intake.md +1 -0
  290. package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +5 -2
  291. package/presets/zcode/ios-swift/rules/preset-pr-checklist.md +4 -4
  292. package/presets/zcode/ios-swift/rules/preset-twin-sync.md +1 -1
  293. package/presets/zcode/java/adapter-map.json +1 -1
  294. package/presets/zcode/java/hooks/check-preset-update.mjs +4 -3
  295. package/presets/zcode/java/rules/agent-team-intake.md +1 -0
  296. package/presets/zcode/java/rules/agent-team-orchestrator.md +5 -2
  297. package/presets/zcode/java/rules/preset-pr-checklist.md +4 -4
  298. package/presets/zcode/java/rules/preset-twin-sync.md +1 -1
  299. package/presets/zcode/mcp-ts/adapter-map.json +1 -1
  300. package/presets/zcode/mcp-ts/hooks/check-preset-update.mjs +4 -3
  301. package/presets/zcode/mcp-ts/rules/agent-team-intake.md +1 -0
  302. package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +5 -2
  303. package/presets/zcode/mcp-ts/rules/preset-pr-checklist.md +4 -4
  304. package/presets/zcode/mcp-ts/rules/preset-twin-sync.md +1 -1
  305. package/presets/zcode/mol/adapter-map.json +1 -1
  306. package/presets/zcode/mol/hooks/check-preset-update.mjs +4 -3
  307. package/presets/zcode/mol/rules/agent-team-intake.md +1 -0
  308. package/presets/zcode/mol/rules/agent-team-orchestrator.md +5 -2
  309. package/presets/zcode/mol/rules/preset-pr-checklist.md +4 -4
  310. package/presets/zcode/mol/rules/preset-twin-sync.md +1 -1
  311. package/presets/zcode/next/adapter-map.json +1 -1
  312. package/presets/zcode/next/agents/build-verifier.md +16 -3
  313. package/presets/zcode/next/agents/feature-developer.md +2 -1
  314. package/presets/zcode/next/agents/task-analyst.md +2 -0
  315. package/presets/zcode/next/hooks/check-preset-update.mjs +4 -3
  316. package/presets/zcode/next/rules/agent-team-intake.md +1 -0
  317. package/presets/zcode/next/rules/agent-team-orchestrator.md +5 -2
  318. package/presets/zcode/next/rules/preset-pr-checklist.md +4 -4
  319. package/presets/zcode/next/rules/preset-twin-sync.md +1 -1
  320. package/presets/zcode/nuxt/adapter-map.json +1 -1
  321. package/presets/zcode/nuxt/hooks/check-preset-update.mjs +4 -3
  322. package/presets/zcode/nuxt/rules/agent-team-intake.md +1 -0
  323. package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +5 -2
  324. package/presets/zcode/nuxt/rules/preset-pr-checklist.md +4 -4
  325. package/presets/zcode/nuxt/rules/preset-twin-sync.md +1 -1
  326. package/presets/zcode/php-hexagonal/adapter-map.json +1 -1
  327. package/presets/zcode/php-hexagonal/hooks/check-preset-update.mjs +4 -3
  328. package/presets/zcode/php-hexagonal/rules/agent-team-intake.md +1 -0
  329. package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +5 -2
  330. package/presets/zcode/php-hexagonal/rules/preset-pr-checklist.md +4 -4
  331. package/presets/zcode/php-hexagonal/rules/preset-twin-sync.md +1 -1
  332. package/presets/zcode/php-laravel/adapter-map.json +1 -1
  333. package/presets/zcode/php-laravel/hooks/check-preset-update.mjs +4 -3
  334. package/presets/zcode/php-laravel/rules/agent-team-intake.md +1 -0
  335. package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +5 -2
  336. package/presets/zcode/php-laravel/rules/preset-pr-checklist.md +4 -4
  337. package/presets/zcode/php-laravel/rules/preset-twin-sync.md +1 -1
  338. package/presets/zcode/svelte/adapter-map.json +1 -1
  339. package/presets/zcode/svelte/hooks/check-preset-update.mjs +4 -3
  340. package/presets/zcode/svelte/rules/agent-team-intake.md +1 -0
  341. package/presets/zcode/svelte/rules/agent-team-orchestrator.md +5 -2
  342. package/presets/zcode/svelte/rules/preset-pr-checklist.md +4 -4
  343. package/presets/zcode/svelte/rules/preset-twin-sync.md +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ ### Preset update notice
6
+
7
+ - **The `Shape:` sample carries the recorded version.** `check-preset-update.mjs` interpolated `latest` but left `<installed>` as a literal, so an agent that copied the sample verbatim printed the placeholder to the user instead of the installed version.
8
+ - **ZCode installs are checked.** `TOOL_ROOTS` includes `.zcode`, so a ZCode-only install is compared with the latest release and appears in the notice.
9
+
10
+ ### Release gate and a fast loop gate
11
+
12
+ - **`yarn release:gate`.** The full structure composite, the `.ai.local` engine tests, and the strict product-specs dogfood run in one release-only command. It refuses `AI_RULES_SKIP_HOOK_TESTS=1` / `AI_RULES_SKIP_PACK_TESTS=1` and a dirty tracked tree, records the release `HEAD`, and writes a report under `.release-gate/`.
13
+ - **`yarn check:fast`.** The loop gate is now `check-preset-fast.sh` (~50 s: generated drift, twin drift, token budget, frontmatter, consumer links, next attached budget, OpenCode platform contract self-test), not the composite with the hook suites skipped. `test-cli-init-clean` moves to the delta gates and CI.
14
+ - **`yarn check:changed`.** The delta classifier prints `affected loop gates` and a separate `release-only gates` line; the preset-domain list names the targeted checks instead of `check:preset-structure (full)`.
15
+ - **Preset agent DoD.** `feature-developer` and `build-verifier` send preset-source changes to `check:changed` + `check:fast`; the full gate is release-only. The PR checklist separates merge from release.
16
+ - **`check:all` removed.** It duplicated the composite; use `yarn release:gate`.
17
+
18
+ ## 0.2.62
19
+
20
+ ### Engine lock and write audit
21
+
22
+ - **One lock protocol.** `<lock>.d` is the only mutual exclusion for the self-learning journal: a `mkdir` with `owner.json`, no `perl`, no `flock`, no shell. Before, a host with `perl` and a container without it locked different paths (`flock` on the file, `mkdir` on the sibling directory) and could enter together; the `AI_RULES_LOCK_NO_PERL` switch and the short-lived `perl` helper are gone, which also removes one fork per acquisition and the `lock timeout` it could raise while the mutex was free.
23
+ - **Reclaim cannot evict a live owner.** A dead owner is removed inside an atomic `<lock>.d.reclaim` guard, and the owner is re-read after the guard is taken. The previous rename could move a directory another contender had just created, admitting two writers to the journal and the manifest. Fixture: `test-platform-lock-exclusion.mjs` (cross-mode exclusion both ways, plus a five-iteration two-contender reclaim race).
24
+ - **Step-scoped write audit.** `check-write-scope.mjs --step <id> --save-baseline` records every dirty path with its content hash before a step writes; the audit then reports only paths the step created or changed. `--base HEAD` alone attributed every earlier step of the session to the current one, because agents never commit. `--paths` and `--base` stay as escape hatches.
25
+ - **A legacy pipeline is a skip.** `check-write-scope.mjs` exits `3` (SKIP, with `skipReason` and a `hint` in the JSON payload) when the pipeline has no step ids or no `writeScopes`. `build-verifier` records that under `## Soft notes` instead of failing, so a mandatory gate no longer becomes unsatisfiable for work that predates the schema. Step ids are backfillable with `team-db.mjs migrate-tasks`; `writeScopes` are only ever declared by `task-router`.
26
+ - **Install surface.** `.ai.local/.gitignore` gains `team/.write-scope/`; `update` adds the line to an existing ignore file and seeds the unchanged scripts.
27
+
3
28
  ## 0.2.61
4
29
 
5
30
  ### Cross-platform support
package/README.md CHANGED
@@ -52,7 +52,7 @@ node .ai.local/scripts/run.mjs --strict # read-only check: exit 1 when capture
52
52
  node .ai.local/scripts/run.mjs --dry-run # read-only preview: decision, target, before/after, exact writes
53
53
  ```
54
54
 
55
- `build-verifier` and `code-reviewer` also run the read-only write audit `node .ai.local/scripts/check-write-scope.mjs --slug <slug> --step <step-id>`: it labels every changed path `declared`, `derived`, or `out-of-scope` against the step's `writeScopes`. It is never a hook gate.
55
+ `build-verifier` and `code-reviewer` also run the read-only write audit `node .ai.local/scripts/check-write-scope.mjs --slug <slug> --step <step-id>`: it labels every changed path `declared`, `derived`, or `out-of-scope` against the step's `writeScopes`. The orchestrator saves the step baseline (`--step <step-id> --save-baseline`) before the step writes, so the audit covers that step rather than the whole session. A pipeline that predates `writeScopes` exits `3` (skip), never a failure. It is never a hook gate.
56
56
 
57
57
  `init` seeds the engine with **skip-if-exists** — a modified `run.mjs` stays yours and is reported as kept; there is no
58
58
  `--force`. The seeded tree is byte-identical to `presets/_shared/ai-local/scripts/`, and `.ai.local/.gitignore` (created
@@ -217,7 +217,7 @@ Optional check: `yarn check:product-specs [<repo-root>]` (WARN) or `--strict`. T
217
217
 
218
218
  ## Anti-hallucination
219
219
 
220
- Every installed preset ships requestable `anti-hallucination-contract` (not always-on). Writer roles — implementer, unit-test, e2e, qa, and `code-reviewer` — also load that stack's floor stem. `yarn check:preset-structure` fails if a role or skill binding is removed. Register a new skill family in `SKILL_CONTRACT_CLASS` (`writer` or `reader`). Details: [`docs/PRESET-CONTRIBUTION.md`](docs/PRESET-CONTRIBUTION.md).
220
+ Every installed preset ships requestable `anti-hallucination-contract` (not always-on). Writer roles — implementer, unit-test, e2e, qa, and `code-reviewer` — also load that stack's floor stem. `yarn release:gate` fails if a role or skill binding is removed. Register a new skill family in `SKILL_CONTRACT_CLASS` (`writer` or `reader`). Details: [`docs/PRESET-CONTRIBUTION.md`](docs/PRESET-CONTRIBUTION.md).
221
221
 
222
222
  ## Contributing
223
223
 
@@ -227,7 +227,7 @@ Every installed preset ships requestable `anti-hallucination-contract` (not alwa
227
227
  - MCP setup: [`docs/MCP-SETUP.md`](docs/MCP-SETUP.md)
228
228
  - MCP catalog: [`docs/MCP-CATALOG.md`](docs/MCP-CATALOG.md)
229
229
  - Dogfood: [`scripts/sync-dogfood-cursor.sh`](scripts/sync-dogfood-cursor.sh), [`scripts/sync-dogfood-claude.sh`](scripts/sync-dogfood-claude.sh), [`scripts/sync-dogfood-mavis.sh`](scripts/sync-dogfood-mavis.sh), [`scripts/sync-dogfood-opencode.sh`](scripts/sync-dogfood-opencode.sh) — seeds `.ai.local/team`, preserves slugs
230
- - Gates: `yarn check:preset-structure`
230
+ - Gates: loop `yarn check:changed` + `yarn check:fast`; release `yarn release:gate`
231
231
 
232
232
  `_shared` is not an installable `--preset`.
233
233
 
@@ -19,6 +19,7 @@ const AI_LOCAL_GITIGNORE = [
19
19
  '# Files written by the in-task self-learning engine and by legacy-team',
20
20
  '# migration backups. Local safety net — never commit.',
21
21
  '*.lock',
22
+ '*.lock.d/',
22
23
  '*.tmp',
23
24
  '.rollback/',
24
25
  '.template-base.json',
@@ -36,6 +37,8 @@ const AI_LOCAL_GITIGNORE = [
36
37
  '# Scheduler runtime state; jobs.json stays tracked (jobs as code).',
37
38
  'team/scheduler/runs/',
38
39
  'team/scheduler/state.json',
40
+ '# Per-step write-scope baselines; derived from git, never a project input.',
41
+ 'team/.write-scope/',
39
42
  'team/upstream/cursor.json',
40
43
  '',
41
44
  ].join('\n');
@@ -269,7 +269,9 @@ function cmdInitMavis({ preset, cwdOption, helpers }) {
269
269
  managedFiles[item.rel] = sha256File(item.dest);
270
270
  }
271
271
  const manifest = {
272
- schemaVersion: 1,
272
+ // Mirrors MANIFEST_SCHEMA_VERSION in cli.js: a v2 manifest lists only preset
273
+ // files, so `doctor` and update pruning can trust it.
274
+ schemaVersion: 2,
273
275
  packageVersion: packageVersion(packageRoot),
274
276
  platform: 'mavis',
275
277
  preset: stack,
@@ -466,7 +466,9 @@ function cmdInitOpencode({ preset, cwdOption, helpers }) {
466
466
  managedFiles[item.rel] = sha256File(item.dest);
467
467
  }
468
468
  const manifest = {
469
- schemaVersion: 1,
469
+ // Mirrors MANIFEST_SCHEMA_VERSION in cli.js: a v2 manifest lists only preset
470
+ // files, so `doctor` and update pruning can trust it.
471
+ schemaVersion: 2,
470
472
  packageVersion: packageVersion(packageRoot),
471
473
  platform: 'opencode',
472
474
  preset: stack,
@@ -366,7 +366,9 @@ function cmdInitZcode({ preset, cwdOption, helpers }) {
366
366
  managedFiles[item.rel] = sha256File(item.dest);
367
367
  }
368
368
  const manifest = {
369
- schemaVersion: 1,
369
+ // Mirrors MANIFEST_SCHEMA_VERSION in cli.js: a v2 manifest lists only preset
370
+ // files, so `doctor` and update pruning can trust it.
371
+ schemaVersion: 2,
370
372
  packageVersion: packageVersion(packageRoot),
371
373
  platform: 'zcode',
372
374
  preset: stack,
package/docs/MAVIS.md CHANGED
@@ -115,15 +115,18 @@ Desktop/CLI versions in the compatibility doc are **operator snapshots**, not pa
115
115
  | [`MAVIS-COMPATIBILITY.md`](./MAVIS-COMPATIBILITY.md) | Probe evidence and go/no-go |
116
116
  | [`PRESET-CONTRIBUTION.md`](./PRESET-CONTRIBUTION.md) | Sibling adapter authoring |
117
117
 
118
- Validate after preset edits:
118
+ Validate after preset edits (loop):
119
119
 
120
120
  ```bash
121
121
  cd packages/ai-rules
122
- bash scripts/check-preset-structure.sh
122
+ yarn check:changed
123
+ yarn check:fast
123
124
  node scripts/check-mavis-platform-contract.mjs --self-test
124
125
  node scripts/check-mavis-adapter-map.mjs --self-test
125
126
  ```
126
127
 
128
+ The full `scripts/check-preset-structure.sh` composite runs in `yarn release:gate` before a release.
129
+
127
130
  ## Released stacks
128
131
 
129
132
  `init mavis --preset <stack>` and `init multi --preset <stack>` install Mavis for every stack in `presets/mavis/platform-contract.json` `releasedStacks` (all 11). Per-stack always-on rules live in `scripts/lib/stack-platform-profiles.mjs`. Derive with `node scripts/generate-mavis.mjs --stack <stack>` from Cursor SoT — never from Claude.
package/docs/OPENCODE.md CHANGED
@@ -139,15 +139,18 @@ row; the job asserts its resolved rules with `opencode debug agents` before the
139
139
  | [`OPENCODE-COMPATIBILITY.md`](./OPENCODE-COMPATIBILITY.md) | Evidence and go/no-go |
140
140
  | [`PRESET-CONTRIBUTION.md`](./PRESET-CONTRIBUTION.md) | Sibling adapter authoring |
141
141
 
142
- Validate after preset edits:
142
+ Validate after preset edits (loop):
143
143
 
144
144
  ```bash
145
145
  cd packages/ai-rules
146
- bash scripts/check-preset-structure.sh
146
+ yarn check:changed
147
+ yarn check:fast
147
148
  node scripts/check-opencode-platform-contract.mjs --self-test
148
149
  node scripts/check-opencode-adapter-map.mjs --self-test
149
150
  ```
150
151
 
152
+ The full `scripts/check-preset-structure.sh` composite runs in `yarn release:gate` before a release.
153
+
151
154
  ## Released stacks
152
155
 
153
156
  `init opencode --preset <stack>` and `init multi --preset <stack>` install OpenCode for every stack in `presets/opencode/platform-contract.json` `releasedStacks` (all 11). Per-stack always-on rules and `permission.edit` allow-lists live in `scripts/lib/stack-platform-profiles.mjs`. Derive with `node scripts/generate-opencode.mjs --stack <stack>` from Cursor SoT — never from Claude.
package/docs/PLATFORMS.md CHANGED
@@ -12,7 +12,7 @@ macOS and Linux are fully supported. Windows is supported with the prerequisites
12
12
  | Node.js for the `team-db` SQLite projection | **>= 22.13** | `team-db.mjs` uses `node:sqlite`. Below 22.13 the projection degrades to file-only with one diagnostic line; the rest of the engine keeps working. |
13
13
  | `git` | required | Install state, generated-file drift, and every gate read the work tree through `git`. |
14
14
  | `bash` | required for the chain hook only | The Cursor/Claude guard and the hook resolver run through Node. `chain-team-phases.sh` itself is still a bash script. |
15
- | `perl` | optional | The engine lock uses a `perl` `flock` fast path. Without `perl` it falls back to a directory lock with the same mutual exclusion. |
15
+ | `perl` | not required | The engine lock is a sibling directory `<lock>.d` (`mkdir` + `owner.json`), so the same path excludes every process on a shared checkout. No `flock` helper and no shell, so a runtime without `perl` is not a slower path. |
16
16
 
17
17
  ### Windows `bash`
18
18
 
@@ -169,24 +169,25 @@ Summary:
169
169
  - [ ] Reachability: every new OpenCode/Mavis rule is named by an agent/command/skill/entry or an always-on rule (or is `preset-*` authoring-only) — `scripts/check-preset-reachability.sh`
170
170
  - [ ] Embed drift: `scripts/check-shared-core-drift.sh` after core/embed edits
171
171
  - [ ] Anti-hallucination: `check-anti-hallucination-coverage.mjs` passes. New skill families are registered in `SKILL_CONTRACT_CLASS` (`writer` loads the stack floor; `reader` loads the contract only). `code-review` is `writer`.
172
- - [ ] Structure gates: `yarn check:preset-structure` (or `bash scripts/check-preset-structure.sh`) passes
172
+ - [ ] Structure gates: `yarn check:fast` in the loop; `yarn release:gate` before a release (the full `bash scripts/check-preset-structure.sh` composite)
173
173
  - [ ] Twin drift: after editing a Claude `commands/**` or `skills/**` file, `node scripts/check-preset-twin-drift.mjs` passes — mirror the change in the Cursor twin (delta and divergence unchanged) or record a deliberate divergence with `--update`. A deliberate divergence that **raises** an allowance needs `--update --widen`; dropping a baseline row needs `--update --prune`. A plain `--update` refuses both.
174
174
  - [ ] Generated trees regenerated (`generate-mavis.mjs` + `generate-opencode.mjs`) and CLI goldens recaptured (`capture-cli-golden.mjs`) after any preset-installed file changes
175
175
 
176
- Validation: `yarn check:preset-structure` + the `preset-pr-checklist` rule; CI workflow `preset-structure.yml` (`check`, `hooks`, `ai-local-engine-tests`).
176
+ Validation: `yarn check:fast` + the `preset-pr-checklist` rule; the full composite runs in `yarn release:gate`; CI workflow `preset-structure.yml` (`check`, `hooks`, `ai-local-engine-tests`).
177
177
 
178
178
  ## Release order
179
179
 
180
180
  The published artifact must document the release it carries.
181
181
 
182
182
  1. Write the `CHANGELOG.md` section for the version and bump `packages/ai-rules/package.json` to that version **in one commit** — the gate compares the two, so a changelog-only commit is red.
183
- 2. Tag the release and publish the tag.
183
+ 2. Run `yarn release:gate` on that commit and keep `release-gate-report.json`.
184
+ 3. Tag the release and publish the tag.
184
185
 
185
186
  A tag that carries a version bump without its changelog section ships the previous release's notes. `scripts/check-release-consistency.mjs` (wired into `check-preset-structure.sh`, alias `yarn check:release-consistency`) fails the build when `package.json` version and the newest `## <version>` heading in `CHANGELOG.md` disagree; fixture `test-release-consistency.mjs` covers the two failure shapes.
186
187
 
187
188
  ## Anti-hallucination oracle
188
189
 
189
- `yarn check:preset-structure` runs `scripts/check-anti-hallucination-coverage.mjs` immediately after the Claude agent-block check. FAIL means a released stack dropped the shared contract, a writer role dropped `STACK_FLOOR_STEMS`, a Cursor agent or in-scope skill lost the load-line marker, `/task` or the shared orchestrator named a floor stem, or a generated `## Rules to load` block no longer contains the stem `getZoneRulesForAgent` requires. The gate does not scan consumer `app/**` and does not call Context7.
190
+ `yarn release:gate` runs `scripts/check-anti-hallucination-coverage.mjs` inside the composite, immediately after the Claude agent-block check. FAIL means a released stack dropped the shared contract, a writer role dropped `STACK_FLOOR_STEMS`, a Cursor agent or in-scope skill lost the load-line marker, `/task` or the shared orchestrator named a floor stem, or a generated `## Rules to load` block no longer contains the stem `getZoneRulesForAgent` requires. The gate does not scan consumer `app/**` and does not call Context7.
190
191
 
191
192
  `scripts/test-anti-hallucination-coverage.mjs` clones `zoneRulesByRole`, deletes `anti-hallucination-contract` from `next.reviewer`, and expects FAIL mentioning `next` and `reviewer`. It does not edit the preset tree.
192
193
 
@@ -263,7 +264,7 @@ Consumer guide: [`ZCODE.md`](./ZCODE.md). Compatibility evidence: [`ZCODE-COMPAT
263
264
  | Validation | code-reviewer **WARN** drift / **FAIL** broken INDEX or missing required FM on touched specs; `check:preset-structure` **FAIL** missing assets/twins/requestable; optional `scripts/check-product-specs.sh` (**WARN** default, **`--strict`** FAIL; ships in the npm `files` tarball). Checker is bash INDEX/keys/headings — it does **not** evaluate `frontmatter-v1.schema.json` |
264
265
  | Dogfood | `dogfood/mcp-ts-sample/docs/specs/` — mcp-ts field semantics (`routes` = tool names) |
265
266
 
266
- When adding or changing either stem: update **both** ×20 adapters, README mapping rows, and run `check:shared-core-drift` + `check:preset-structure`.
267
+ When adding or changing either stem: update **both** ×20 adapters, README mapping rows, and run `check:shared-core-drift` + the delta gates; the full `release:gate` runs before a release.
267
268
 
268
269
  ---
269
270
 
@@ -408,7 +409,7 @@ Load these when editing files under `packages/ai-rules/presets/**`, `.cursor/**`
408
409
  |--------------|---------|
409
410
  | `yarn fix:generated` | Regenerate every released generated platform and recapture the CLI goldens it owns (`cursor/next`, `claude/next`, and every Mavis/OpenCode stack). Run after changing Cursor SoT, before fail-only checks. Capture a non-`next` Cursor/Claude golden explicitly with `node scripts/capture-cli-golden.mjs <cursor|claude> <stack>`; never hand-edit one. Dogfood sync remains separate. |
410
411
  | `scripts/sync-dogfood-cursor.sh` | Copy `presets/cursor/<preset>/` → root `.cursor/` (`AI_RULES_DOGFOOD_PRESET`, default `next`). Also copies `REPO_AGENTS.md` → repo-root `AGENTS.md`. Seeds `.ai.local/team` templates; preserves `.ai.local/team/tasks/`. |
411
- | `scripts/check-shared-core-drift.sh` / `yarn check:shared-core-drift` | Check embed-mode adapters vs core; lists lineage consumers. **Always hard:** every `_shared/core/**` file must be classified `embed | lineage | internal` in `_lib/embed-stems.json` (unclassified → exit 1). Drift is soft by default; set `AI_RULES_DRIFT_FAIL=1` (or use `check:preset-structure`) to exit non-zero. A stem listed in `requiredSentences` is checked in the core **and in every adapter of that stem, whatever the lineage class** — the body comparison cannot cover a platform whose adapter is not a byte-embed of the core (the Cursor family reorders, omits and adds sections), so the normative fragments of that stem are pinned separately. |
412
+ | `scripts/check-shared-core-drift.sh` / `yarn check:shared-core-drift` | Check embed-mode adapters vs core; lists lineage consumers. **Always hard:** every `_shared/core/**` file must be classified `embed | lineage | internal` in `_lib/embed-stems.json` (unclassified → exit 1). Drift is soft by default; set `AI_RULES_DRIFT_FAIL=1` (or use `release:gate`) to exit non-zero. A stem listed in `requiredSentences` is checked in the core **and in every adapter of that stem, whatever the lineage class** — the body comparison cannot cover a platform whose adapter is not a byte-embed of the core (the Cursor family reorders, omits and adds sections), so the normative fragments of that stem are pinned separately. |
412
413
  | `scripts/check-preset-twin-map.sh` / `yarn check:preset-twin-map` | **FAIL** if Cursor `.mdc` missing from Claude mapping table, twin file missing, or orphan topic `.md` (excl. `**/README.md`). Stacks: `next`, `nuxt`, `svelte`, `mol`, `ios-swift`, `android-kotlin`, `go`, `java`, `mcp-ts`, `php-hexagonal`, `php-laravel`. **Rules only** — commands and skills are guarded by `check-preset-twin-drift.mjs`. |
413
414
  | `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
415
  | `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`. |
@@ -421,10 +422,10 @@ Load these when editing files under `packages/ai-rules/presets/**`, `.cursor/**`
421
422
  | `scripts/check-preset-language-policy.sh` / `yarn check:preset-structure` | **FAIL** if the native-language policy is absent: the core `_shared/core/agent-team/language-policy.md` tokens, the `language-policy` consumer + `<!-- shared-core -->` marker, the Cursor `globs:`/`alwaysApply: false` + Claude `paths:` shape, the `## Language` setting home (with a BCP-47 marker) in `ai-local/conventions.md`, the always-on anchors (`ai-local-overlay` + `<app-core>` + `REPO_AGENTS.md` must contain `native language` and `every user message`), or the `language:` persistence token in `commands/task.md`; **refuses vacuous PASS** when the iteration set is empty. Wired into `check-preset-structure.sh` next to `goal-contract` / `prompt-persistence`; fixture `test-preset-language-policy-fixtures.mjs`. |
422
423
  | `scripts/check-preset-self-review-contract.sh` / `yarn check:preset-structure` | **FAIL** if the producer-side self-review / context-hygiene contract is absent: the core `_shared/core/quality/self-review-and-context-hygiene.md` tokens (G0 non-vacuous guard), the `<!-- shared-core: quality/self-review-and-context-hygiene.md -->` marker on `task-analyst` / `feature-developer` / `build-verifier` (×10) and on `debugger` / `code-reviewer` where present (skip-if-absent → `mcp-ts`), the `Self-review` + `re-anchor` tokens on every orchestrator rule, `Self-review` in `team/README.md` + `commands/task.md`, and leakage-free core + docs; **refuses vacuous PASS** when the iteration set is empty. Also holds two prose contracts: the canonical self-learning-loop sentence must not be followed by unsanctioned prose (an allowlist of sanctioned clauses; the tail is bounded by the carrier's **section**, not by a blank line, so prose moved one paragraph down still fails — a tail in a later `## ` section is out of scope), and every retro carrier (command, skill, rule) must state `finding_category`. Wired into `check-preset-structure.sh` next to `goal-contract`; fixture `test-preset-self-review-contract-fixtures.mjs`. |
423
424
  | `scripts/check-anti-hallucination-coverage.mjs` | **FAIL** when the shared contract, a Cursor load-line embed, a writer stack floor, or a generated Rules-to-load stem is missing. Writer roles are `implementer`, `unit-test`, `e2e`, `qa`, and `reviewer` (`code-reviewer` loads `STACK_FLOOR_STEMS` plus the contract). `/task` and the orchestrator must not name a floor stem. Does not scan consumer `app/**` and does not call Context7. Fixture `test-anti-hallucination-coverage.mjs` deletes `anti-hallucination-contract` from `next.reviewer` in memory and expects FAIL mentioning `next` and `reviewer`. Wired into `check-preset-structure.sh` immediately after `check-claude-agent-blocks.mjs`. |
424
- | `presets/_shared/ai-local/scripts/check-write-scope.mjs` | Read-only post-step audit: compares the actual changed paths with the current `pipeline.json` step's `writeScopes` and labels each path `declared`, `derived` (task folder, engine mirror, generated platform tree/golden/hook, dogfood tree, adapter map), or `out-of-scope`, with the source named. Shipped to consumers as `.ai.local/scripts/check-write-scope.mjs` (`ENGINE_SCRIPTS`). `--slug <slug> [--step <id>] [--base <ref>] [--root <project>] [--paths a,b] [--json]`. The baseline defaults to `HEAD` (uncommitted change-set, untracked included); pass `--base` for a committed change-set. Exit `1` for an out-of-scope path on an implementation step, `0` for a reviewer/verifier step (advisory), `2` on a usage/config error. Fixture `test-write-scope.mjs`; wired into the build-verifier and code-reviewer prompts, never a hook. |
425
- | `scripts/check-preset-structure.sh` / `yarn check:preset-structure` | Orchestrator: twin-map + token-budget + leakage + shared-core drift + anti-hallucination coverage + rule-eval (**all hard**; drift via `AI_RULES_DRIFT_FAIL=1`). |
425
+ | `presets/_shared/ai-local/scripts/check-write-scope.mjs` | Read-only post-step audit: compares the actual changed paths with the current `pipeline.json` step's `writeScopes` and labels each path `declared`, `derived` (task folder, engine mirror, generated platform tree/golden/hook, dogfood tree, adapter map), or `out-of-scope`, with the source named. Shipped to consumers as `.ai.local/scripts/check-write-scope.mjs` (`ENGINE_SCRIPTS`). `--slug <slug> [--step <id>] [--base <ref>] [--root <project>] [--paths a,b] [--save-baseline] [--json]`. Baseline resolution: `--paths`, then `--base <ref>`, then the step baseline written by `--step <id> --save-baseline` (every dirty path with its content hash, so an earlier step's path is not attributed to this one and an already-dirty path the step edits still is), then `HEAD` (whole uncommitted change-set, reported with a notice). Exit `1` for an out-of-scope path on an implementation step, `0` for a reviewer/verifier step (advisory), `2` on a usage/config error, `3` (SKIP) when the pipeline predates step ids or `writeScopes` and is therefore not auditable. Fixture `test-write-scope.mjs`; wired into the build-verifier and code-reviewer prompts, never a hook. |
426
+ | `scripts/check-preset-structure.sh` / `yarn check:preset-structure` | Low-level orchestrator: twin-map + token-budget + leakage + shared-core drift + anti-hallucination coverage + rule-eval (**all hard**; drift via `AI_RULES_DRIFT_FAIL=1`). Invoked by `yarn release:gate` and CI; not a feature-task gate. |
426
427
  | `scripts/check-product-specs.sh` / `yarn check:product-specs` | Opt-in consumer tree check: frontmatter v1 keys + required body headings on `docs/specs/**` (bash; does **not** run JSON Schema). Ships in the npm package `files` (`scripts/`). **WARN** by default; **`--strict`** exits non-zero. |
427
- | `yarn check:product-specs:dogfood` | Same script against monorepo `dogfood/mcp-ts-sample`. Soft WARN inside `check:preset-structure` + CI step (`continue-on-error`); not a hard consumer CI gate. |
428
+ | `yarn check:product-specs:dogfood` | Same script against monorepo `dogfood/mcp-ts-sample`. Soft WARN inside the composite + CI step (`continue-on-error`); the release gate runs `--strict`; not a hard consumer CI gate. |
428
429
  | `scripts/check-rule-eval.mjs` / `yarn check:rule-eval` | **Hard gate** inside `check-preset-structure.sh`: validates Incorrect/Correct pairs + `impact:` on **next-only** golden stems (`eval/next/manifest.json`). Backend / ios / php-hexagonal / php-laravel stems are out of scope until a stack adds `eval/<stack>/`. |
429
430
  | `scripts/check-release-consistency.mjs` / `yarn check:release-consistency` | **FAIL** when `packages/ai-rules/package.json` version and the newest `## <version>` heading in `CHANGELOG.md` disagree — a tag must not ship the previous release's notes. Wired into `check-preset-structure.sh`; fixture `test-release-consistency.mjs`. |
430
431
  | `scripts/check-team-db-contract.mjs` / `yarn check:team-db-contract` | **FAIL** when the checked-in OpenAPI 3.1 document (`docs/openapi/team-db.v1.json`) drifts from `team-db-openapi.mjs`, fails the vendored 3.1 meta-schema (sha256-pinned), loses an `operationId`, diverges from `ROUTE_TABLE` in either direction, carries an invalid example, or leaves a `$ref` unresolved. `--write` is the only writer; no network at gate time. Wired into `check-preset-structure.sh`. |
@@ -434,16 +435,18 @@ Load these when editing files under `packages/ai-rules/presets/**`, `.cursor/**`
434
435
  Run from `packages/ai-rules/`:
435
436
 
436
437
  ```bash
437
- yarn check:preset-structure
438
- # or
439
- bash scripts/check-preset-structure.sh
438
+ yarn check:changed
439
+ yarn check:fast
440
+ # release only, from the repo root:
441
+ yarn release:gate
440
442
  ```
441
443
 
442
444
  Iteration versus release:
443
445
 
444
- - **`yarn check:changed`** — the changed-domain classifier (`check-preset-delta.mjs --base HEAD`, or `--paths a,b`). Run the gates it names; this is the cheap loop.
445
- - **`yarn check:fast`** — the structure gate without the ~40-minute hook matrix (`AI_RULES_SKIP_HOOK_TESTS=1`). Use it before handoff.
446
- - **`yarn check:preset-structure`** — the full release gate, hook suites included; run it alone before a release.
446
+ - **`yarn check:changed`** — the changed-domain classifier (`check-preset-delta.mjs --base HEAD`, or `--paths a,b`). Run the gates it names; this is the cheap loop. It prints `affected loop gates` and a separate `release-only gates` line.
447
+ - **`yarn check:fast`** — the ~50-second loop gate (`check-preset-fast.sh`: generated drift, twin drift, token budget, frontmatter, consumer links, next attached budget, OpenCode platform contract self-test). `test-cli-init-clean` stays in the delta gates and CI. Use it before handoff.
448
+ - **`yarn release:gate`** — the full release gate: `check-preset-structure.sh` with the hook suites, `test:ai-local`, and the strict product-specs dogfood. Run it alone on the release commit before a tag.
449
+ - **`yarn check:preset-structure`** — the low-level composite; CI and `release:gate` call it. Do not run it in a feature task.
447
450
 
448
451
  `check-generated-drift` caches generated trees in the OS temp directory, keyed by a digest of the Cursor/`_shared` sources and the generator libraries. A source or generator edit misses the cache and regenerates; the cache is disposable and never hides drift.
449
452
 
@@ -484,7 +487,7 @@ Author-only: this section is **not** copied by `init`.
484
487
  - Expect four finding classes: `restated-stem`, `paraphrased-when-do`, `unjustified-body-size`, `issue-number-density`.
485
488
  - Expect one line per finding and a final `advisory-findings: <n>`; the checker always exits `0`.
486
489
  - Read a finding as a review item, never as a gate failure.
487
- - 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.
490
+ - Run it through the composite (inside `release:gate`): the `authoring-advisory` row is non-blocking (`<<< authoring-advisory: WARN (<n> finding(s); not a hard gate)`), so the release gate stays green with findings present.
488
491
  - 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.
489
492
  - Fix a `restated-stem` finding by linking the sibling stem instead of repeating its sentence.
490
493
  - Keep the tier out of the pipeline hook tree: it is a repository gate, not a hook.
package/docs/TEAM-DB.md CHANGED
@@ -367,12 +367,18 @@ the confirmed task delete and the rescan to the named interface without authenti
367
367
  A job definition carries arbitrary `argv` and run-now enqueues it, so that surface
368
368
  executes operator-supplied commands as the API user; see `## Scheduled jobs`.
369
369
 
370
+ ## Prompt capture
371
+
372
+ `prompt.md` and `prompt-log.md` are read by the existing projection. An inline work request calls `sync --slug <slug>` once after writing `prompt.md`; a post-terminal entry calls the same once after appending to `prompt-log.md`. Both are bounded, off the critical path, and never fail the file write. A missed projection is staleness, not data loss — the next full sync rebuilds the row.
373
+
370
374
  ## Privacy and retention
371
375
 
372
376
  Prompts are copied verbatim into `prompts` and `documents`. The database is local, git-ignored,
373
377
  and readable by the same OS user who can read the task folder; that is the trust boundary.
374
378
  There is no upload, telemetry, or remote asset. `sync --maintain` nulls raw document content
375
- for tasks absent longer than 90 days while keeping normalized rows and hashes.
379
+ for tasks absent longer than 90 days while keeping normalized rows and hashes. It does not
380
+ null `prompts.content`: prompt retention equals task-folder retention, and deleting the folder
381
+ is the lever.
376
382
 
377
383
  Run output crosses the same boundary and is **not** redacted: `scheduler/runs/**` holds a
378
384
  child's `stdout` and `stderr` verbatim, a job inherits the listed `envPassthrough` names, and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonesofspring/ai-rules",
3
- "version": "0.2.61",
3
+ "version": "0.2.63",
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",
@@ -35,11 +35,11 @@
35
35
  "scripts/close-agent-task-human-gate.mjs"
36
36
  ],
37
37
  "scripts": {
38
- "check:all": "bash scripts/check-preset-structure.sh && node scripts/check-rule-eval.mjs && node scripts/test-parallel-plan-fixtures.mjs",
39
- "check:fast": "AI_RULES_SKIP_HOOK_TESTS=1 bash scripts/check-preset-structure.sh",
38
+ "check:fast": "bash scripts/check-preset-fast.sh",
40
39
  "check:changed": "node scripts/check-preset-delta.mjs --base HEAD",
41
40
  "test:hooks": "node scripts/test-chain-team-phases-coverage.mjs && node scripts/test-agent-task-metrics-hooks.mjs",
42
41
  "check:preset-structure": "bash scripts/check-preset-structure.sh",
42
+ "release:gate": "bash scripts/release-gate.sh",
43
43
  "check:platform-scripts": "node scripts/check-platform-scripts.mjs",
44
44
  "test:platform": "node scripts/run-platform-tests.mjs",
45
45
  "check:preset-delta": "node scripts/check-preset-delta.mjs",