@bonesofspring/ai-rules 0.2.77 → 0.2.80

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 (908) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/README.md +4 -2
  3. package/bin/lib/engine-scripts.js +9 -0
  4. package/bin/lib/seed-ai-local-team.js +2 -0
  5. package/docs/LOCAL-OVERLAY.md +4 -4
  6. package/docs/PRESET-CONTRIBUTION.md +9 -8
  7. package/docs/TEAM-DB.md +160 -22
  8. package/docs/openapi/team-db.v1.json +2879 -1858
  9. package/package.json +6 -1
  10. package/presets/_shared/ai-local/scripts/aggregate-agent-task-metrics.mjs +23 -0
  11. package/presets/_shared/ai-local/scripts/check-task-repositories.mjs +264 -0
  12. package/presets/_shared/ai-local/scripts/check-verification.mjs +275 -0
  13. package/presets/_shared/ai-local/scripts/check-write-scope.mjs +72 -18
  14. package/presets/_shared/ai-local/scripts/manifest.mjs +78 -4
  15. package/presets/_shared/ai-local/scripts/rr-migrate-repositories.mjs +481 -0
  16. package/presets/_shared/ai-local/scripts/rule-improver.mjs +366 -13
  17. package/presets/_shared/ai-local/scripts/run.mjs +29 -6
  18. package/presets/_shared/ai-local/scripts/team-db-api.mjs +211 -12
  19. package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +289 -3
  20. package/presets/_shared/ai-local/scripts/team-db-project.mjs +1065 -4
  21. package/presets/_shared/ai-local/scripts/team-db-schema.mjs +144 -15
  22. package/presets/_shared/ai-local/scripts/team-db-tracker.mjs +29 -10
  23. package/presets/_shared/ai-local/scripts/team-db.mjs +65 -5
  24. package/presets/_shared/core/agent-team/agent-artifact-contracts.md +9 -4
  25. package/presets/_shared/core/agent-team/task-framing.md +1 -0
  26. package/presets/_shared/core/meta/preset-layering.md +4 -4
  27. package/presets/_shared/core/meta/preset-pr-checklist.md +2 -1
  28. package/presets/_shared/core/meta/preset-twin-sync.md +12 -5
  29. package/presets/_shared/core/quality/self-review-and-context-hygiene.md +1 -1
  30. package/presets/_shared/core/quality/verification-before-completion.md +28 -4
  31. package/presets/_shared/core/review/code-review-mr.md +1 -0
  32. package/presets/_shared/core/review/receiving-code-review.md +1 -0
  33. package/presets/_shared/hooks/chain-team-phases.sh.tmpl +382 -27
  34. package/presets/claude/android-kotlin/CLAUDE.md +1 -1
  35. package/presets/claude/android-kotlin/agents/build-verifier.md +1 -1
  36. package/presets/claude/android-kotlin/agents/code-reviewer.md +1 -1
  37. package/presets/claude/android-kotlin/agents/debugger.md +1 -1
  38. package/presets/claude/android-kotlin/agents/feature-developer.md +1 -1
  39. package/presets/claude/android-kotlin/agents/task-analyst.md +1 -1
  40. package/presets/claude/android-kotlin/agents/task-router.md +2 -0
  41. package/presets/claude/android-kotlin/commands/README.md +1 -0
  42. package/presets/claude/android-kotlin/commands/rr-migrate-repositories.md +59 -0
  43. package/presets/claude/android-kotlin/commands/task.md +4 -0
  44. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +382 -27
  45. package/presets/claude/android-kotlin/rules/tooling-and-review/ai-local-overlay.md +1 -1
  46. package/presets/claude/android-kotlin/rules/tooling-and-review/code-review.md +1 -0
  47. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-layering.md +4 -4
  48. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  49. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-twin-sync.md +12 -5
  50. package/presets/claude/go/CLAUDE.md +1 -1
  51. package/presets/claude/go/agents/build-verifier.md +1 -1
  52. package/presets/claude/go/agents/code-reviewer.md +1 -1
  53. package/presets/claude/go/agents/debugger.md +1 -1
  54. package/presets/claude/go/agents/feature-developer.md +1 -1
  55. package/presets/claude/go/agents/task-analyst.md +1 -1
  56. package/presets/claude/go/agents/task-router.md +2 -0
  57. package/presets/claude/go/commands/README.md +1 -0
  58. package/presets/claude/go/commands/rr-migrate-repositories.md +59 -0
  59. package/presets/claude/go/commands/task.md +4 -0
  60. package/presets/claude/go/hooks/chain-team-phases.sh +382 -27
  61. package/presets/claude/go/rules/tooling-and-review/ai-local-overlay.md +1 -1
  62. package/presets/claude/go/rules/tooling-and-review/code-review.md +1 -0
  63. package/presets/claude/go/rules/tooling-and-review/preset-layering.md +4 -4
  64. package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  65. package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +12 -5
  66. package/presets/claude/ios-swift/CLAUDE.md +1 -1
  67. package/presets/claude/ios-swift/agents/build-verifier.md +4 -1
  68. package/presets/claude/ios-swift/agents/code-reviewer.md +1 -1
  69. package/presets/claude/ios-swift/agents/debugger.md +1 -1
  70. package/presets/claude/ios-swift/agents/feature-developer.md +1 -1
  71. package/presets/claude/ios-swift/agents/task-analyst.md +1 -1
  72. package/presets/claude/ios-swift/agents/task-router.md +2 -0
  73. package/presets/claude/ios-swift/commands/README.md +1 -0
  74. package/presets/claude/ios-swift/commands/rr-migrate-repositories.md +59 -0
  75. package/presets/claude/ios-swift/commands/task.md +4 -0
  76. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +382 -27
  77. package/presets/claude/ios-swift/rules/tooling-and-review/ai-local-overlay.md +1 -1
  78. package/presets/claude/ios-swift/rules/tooling-and-review/code-review.md +1 -0
  79. package/presets/claude/ios-swift/rules/tooling-and-review/preset-layering.md +4 -4
  80. package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  81. package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +12 -5
  82. package/presets/claude/java/CLAUDE.md +1 -1
  83. package/presets/claude/java/agents/build-verifier.md +1 -1
  84. package/presets/claude/java/agents/code-reviewer.md +1 -1
  85. package/presets/claude/java/agents/debugger.md +1 -1
  86. package/presets/claude/java/agents/feature-developer.md +1 -1
  87. package/presets/claude/java/agents/task-analyst.md +1 -1
  88. package/presets/claude/java/agents/task-router.md +2 -0
  89. package/presets/claude/java/commands/README.md +1 -0
  90. package/presets/claude/java/commands/rr-migrate-repositories.md +59 -0
  91. package/presets/claude/java/commands/task.md +4 -0
  92. package/presets/claude/java/hooks/chain-team-phases.sh +382 -27
  93. package/presets/claude/java/rules/tooling-and-review/ai-local-overlay.md +1 -1
  94. package/presets/claude/java/rules/tooling-and-review/code-review.md +1 -0
  95. package/presets/claude/java/rules/tooling-and-review/preset-layering.md +4 -4
  96. package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  97. package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +12 -5
  98. package/presets/claude/mcp-ts/CLAUDE.md +1 -1
  99. package/presets/claude/mcp-ts/agents/build-verifier.md +1 -1
  100. package/presets/claude/mcp-ts/agents/feature-developer.md +1 -1
  101. package/presets/claude/mcp-ts/agents/task-analyst.md +1 -1
  102. package/presets/claude/mcp-ts/agents/task-router.md +2 -0
  103. package/presets/claude/mcp-ts/commands/README.md +1 -0
  104. package/presets/claude/mcp-ts/commands/rr-migrate-repositories.md +59 -0
  105. package/presets/claude/mcp-ts/commands/task.md +4 -0
  106. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +382 -27
  107. package/presets/claude/mcp-ts/rules/tooling-and-review/ai-local-overlay.md +1 -1
  108. package/presets/claude/mcp-ts/rules/tooling-and-review/code-review.md +1 -0
  109. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-layering.md +4 -4
  110. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  111. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-twin-sync.md +12 -5
  112. package/presets/claude/mol/CLAUDE.md +1 -1
  113. package/presets/claude/mol/agents/build-verifier.md +4 -1
  114. package/presets/claude/mol/agents/code-reviewer.md +1 -1
  115. package/presets/claude/mol/agents/debugger.md +1 -1
  116. package/presets/claude/mol/agents/feature-developer.md +1 -1
  117. package/presets/claude/mol/agents/task-analyst.md +1 -1
  118. package/presets/claude/mol/agents/task-router.md +2 -0
  119. package/presets/claude/mol/commands/README.md +1 -0
  120. package/presets/claude/mol/commands/rr-migrate-repositories.md +59 -0
  121. package/presets/claude/mol/commands/task.md +4 -0
  122. package/presets/claude/mol/hooks/chain-team-phases.sh +382 -27
  123. package/presets/claude/mol/rules/tooling-and-review/ai-local-overlay.md +1 -1
  124. package/presets/claude/mol/rules/tooling-and-review/code-review-mr.md +1 -0
  125. package/presets/claude/mol/rules/tooling-and-review/preset-layering.md +4 -4
  126. package/presets/claude/mol/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  127. package/presets/claude/mol/rules/tooling-and-review/preset-twin-sync.md +12 -5
  128. package/presets/claude/next/CLAUDE.md +1 -1
  129. package/presets/claude/next/agents/build-verifier.md +6 -1
  130. package/presets/claude/next/agents/code-reviewer.md +1 -1
  131. package/presets/claude/next/agents/debugger.md +1 -1
  132. package/presets/claude/next/agents/feature-developer.md +1 -1
  133. package/presets/claude/next/agents/task-analyst.md +1 -1
  134. package/presets/claude/next/agents/task-router.md +2 -0
  135. package/presets/claude/next/commands/README.md +1 -0
  136. package/presets/claude/next/commands/rr-migrate-repositories.md +59 -0
  137. package/presets/claude/next/commands/task.md +4 -0
  138. package/presets/claude/next/commands/ui-start.md +12 -4
  139. package/presets/claude/next/commands/ui-stop.md +5 -2
  140. package/presets/claude/next/hooks/chain-team-phases.sh +382 -27
  141. package/presets/claude/next/rules/tooling-and-review/ai-local-overlay.md +2 -1
  142. package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +1 -0
  143. package/presets/claude/next/rules/tooling-and-review/preset-layering.md +4 -4
  144. package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  145. package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +12 -5
  146. package/presets/claude/nuxt/CLAUDE.md +1 -1
  147. package/presets/claude/nuxt/agents/build-verifier.md +4 -1
  148. package/presets/claude/nuxt/agents/code-reviewer.md +1 -1
  149. package/presets/claude/nuxt/agents/debugger.md +1 -1
  150. package/presets/claude/nuxt/agents/feature-developer.md +1 -1
  151. package/presets/claude/nuxt/agents/task-analyst.md +1 -1
  152. package/presets/claude/nuxt/agents/task-router.md +2 -0
  153. package/presets/claude/nuxt/commands/README.md +1 -0
  154. package/presets/claude/nuxt/commands/rr-migrate-repositories.md +59 -0
  155. package/presets/claude/nuxt/commands/task.md +4 -0
  156. package/presets/claude/nuxt/hooks/chain-team-phases.sh +382 -27
  157. package/presets/claude/nuxt/rules/tooling-and-review/ai-local-overlay.md +1 -1
  158. package/presets/claude/nuxt/rules/tooling-and-review/code-review-mr.md +1 -0
  159. package/presets/claude/nuxt/rules/tooling-and-review/preset-layering.md +4 -4
  160. package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  161. package/presets/claude/nuxt/rules/tooling-and-review/preset-twin-sync.md +12 -5
  162. package/presets/claude/php-hexagonal/CLAUDE.md +1 -1
  163. package/presets/claude/php-hexagonal/agents/build-verifier.md +1 -1
  164. package/presets/claude/php-hexagonal/agents/code-reviewer.md +1 -1
  165. package/presets/claude/php-hexagonal/agents/debugger.md +1 -1
  166. package/presets/claude/php-hexagonal/agents/feature-developer.md +1 -1
  167. package/presets/claude/php-hexagonal/agents/task-analyst.md +1 -1
  168. package/presets/claude/php-hexagonal/agents/task-router.md +2 -0
  169. package/presets/claude/php-hexagonal/commands/README.md +1 -0
  170. package/presets/claude/php-hexagonal/commands/rr-migrate-repositories.md +59 -0
  171. package/presets/claude/php-hexagonal/commands/task.md +4 -0
  172. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +382 -27
  173. package/presets/claude/php-hexagonal/rules/tooling-and-review/ai-local-overlay.md +1 -1
  174. package/presets/claude/php-hexagonal/rules/tooling-and-review/code-review.md +1 -0
  175. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-layering.md +4 -4
  176. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  177. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-twin-sync.md +12 -5
  178. package/presets/claude/php-laravel/CLAUDE.md +1 -1
  179. package/presets/claude/php-laravel/agents/build-verifier.md +1 -1
  180. package/presets/claude/php-laravel/agents/code-reviewer.md +1 -1
  181. package/presets/claude/php-laravel/agents/debugger.md +1 -1
  182. package/presets/claude/php-laravel/agents/feature-developer.md +1 -1
  183. package/presets/claude/php-laravel/agents/task-analyst.md +1 -1
  184. package/presets/claude/php-laravel/agents/task-router.md +2 -0
  185. package/presets/claude/php-laravel/commands/README.md +1 -0
  186. package/presets/claude/php-laravel/commands/rr-migrate-repositories.md +59 -0
  187. package/presets/claude/php-laravel/commands/task.md +4 -0
  188. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +382 -27
  189. package/presets/claude/php-laravel/rules/tooling-and-review/ai-local-overlay.md +1 -1
  190. package/presets/claude/php-laravel/rules/tooling-and-review/code-review.md +1 -0
  191. package/presets/claude/php-laravel/rules/tooling-and-review/preset-layering.md +4 -4
  192. package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  193. package/presets/claude/php-laravel/rules/tooling-and-review/preset-twin-sync.md +12 -5
  194. package/presets/claude/svelte/CLAUDE.md +1 -1
  195. package/presets/claude/svelte/agents/build-verifier.md +4 -1
  196. package/presets/claude/svelte/agents/code-reviewer.md +1 -1
  197. package/presets/claude/svelte/agents/debugger.md +1 -1
  198. package/presets/claude/svelte/agents/feature-developer.md +1 -1
  199. package/presets/claude/svelte/agents/task-analyst.md +1 -1
  200. package/presets/claude/svelte/agents/task-router.md +2 -0
  201. package/presets/claude/svelte/commands/README.md +1 -0
  202. package/presets/claude/svelte/commands/rr-migrate-repositories.md +59 -0
  203. package/presets/claude/svelte/commands/task.md +4 -0
  204. package/presets/claude/svelte/hooks/chain-team-phases.sh +382 -27
  205. package/presets/claude/svelte/rules/tooling-and-review/ai-local-overlay.md +1 -1
  206. package/presets/claude/svelte/rules/tooling-and-review/code-review-mr.md +1 -0
  207. package/presets/claude/svelte/rules/tooling-and-review/preset-layering.md +4 -4
  208. package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +2 -1
  209. package/presets/claude/svelte/rules/tooling-and-review/preset-twin-sync.md +12 -5
  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/agents/task-router.md +2 -0
  216. package/presets/cursor/android-kotlin/commands/README.md +1 -0
  217. package/presets/cursor/android-kotlin/commands/rr-migrate-repositories.md +59 -0
  218. package/presets/cursor/android-kotlin/commands/task.md +4 -0
  219. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +382 -27
  220. package/presets/cursor/android-kotlin/rules/ai-local-overlay.mdc +1 -1
  221. package/presets/cursor/android-kotlin/rules/code-review-mr.mdc +1 -0
  222. package/presets/cursor/android-kotlin/rules/preset-layering.mdc +4 -4
  223. package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +2 -1
  224. package/presets/cursor/android-kotlin/rules/preset-twin-sync.mdc +12 -5
  225. package/presets/cursor/go/agents/build-verifier.md +1 -1
  226. package/presets/cursor/go/agents/code-reviewer.md +1 -1
  227. package/presets/cursor/go/agents/debugger.md +1 -1
  228. package/presets/cursor/go/agents/feature-developer.md +1 -1
  229. package/presets/cursor/go/agents/task-analyst.md +1 -1
  230. package/presets/cursor/go/agents/task-router.md +2 -0
  231. package/presets/cursor/go/commands/README.md +1 -0
  232. package/presets/cursor/go/commands/rr-migrate-repositories.md +59 -0
  233. package/presets/cursor/go/commands/task.md +4 -0
  234. package/presets/cursor/go/hooks/chain-team-phases.sh +382 -27
  235. package/presets/cursor/go/rules/ai-local-overlay.mdc +1 -1
  236. package/presets/cursor/go/rules/code-review-mr.mdc +1 -0
  237. package/presets/cursor/go/rules/preset-layering.mdc +4 -4
  238. package/presets/cursor/go/rules/preset-pr-checklist.mdc +2 -1
  239. package/presets/cursor/go/rules/preset-twin-sync.mdc +12 -5
  240. package/presets/cursor/ios-swift/agents/build-verifier.md +4 -1
  241. package/presets/cursor/ios-swift/agents/code-reviewer.md +1 -1
  242. package/presets/cursor/ios-swift/agents/debugger.md +1 -1
  243. package/presets/cursor/ios-swift/agents/feature-developer.md +1 -1
  244. package/presets/cursor/ios-swift/agents/task-analyst.md +1 -1
  245. package/presets/cursor/ios-swift/agents/task-router.md +2 -0
  246. package/presets/cursor/ios-swift/commands/README.md +1 -0
  247. package/presets/cursor/ios-swift/commands/rr-migrate-repositories.md +59 -0
  248. package/presets/cursor/ios-swift/commands/task.md +4 -0
  249. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +382 -27
  250. package/presets/cursor/ios-swift/rules/ai-local-overlay.mdc +1 -1
  251. package/presets/cursor/ios-swift/rules/code-review-mr.mdc +1 -0
  252. package/presets/cursor/ios-swift/rules/preset-layering.mdc +4 -4
  253. package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +2 -1
  254. package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +12 -5
  255. package/presets/cursor/java/agents/build-verifier.md +1 -1
  256. package/presets/cursor/java/agents/code-reviewer.md +1 -1
  257. package/presets/cursor/java/agents/debugger.md +1 -1
  258. package/presets/cursor/java/agents/feature-developer.md +1 -1
  259. package/presets/cursor/java/agents/task-analyst.md +1 -1
  260. package/presets/cursor/java/agents/task-router.md +2 -0
  261. package/presets/cursor/java/commands/README.md +1 -0
  262. package/presets/cursor/java/commands/rr-migrate-repositories.md +59 -0
  263. package/presets/cursor/java/commands/task.md +4 -0
  264. package/presets/cursor/java/hooks/chain-team-phases.sh +382 -27
  265. package/presets/cursor/java/rules/ai-local-overlay.mdc +1 -1
  266. package/presets/cursor/java/rules/code-review-mr.mdc +1 -0
  267. package/presets/cursor/java/rules/preset-layering.mdc +4 -4
  268. package/presets/cursor/java/rules/preset-pr-checklist.mdc +2 -1
  269. package/presets/cursor/java/rules/preset-twin-sync.mdc +12 -5
  270. package/presets/cursor/mcp-ts/agents/build-verifier.md +1 -1
  271. package/presets/cursor/mcp-ts/agents/feature-developer.md +1 -1
  272. package/presets/cursor/mcp-ts/agents/task-analyst.md +1 -1
  273. package/presets/cursor/mcp-ts/agents/task-router.md +2 -0
  274. package/presets/cursor/mcp-ts/commands/README.md +1 -0
  275. package/presets/cursor/mcp-ts/commands/rr-migrate-repositories.md +59 -0
  276. package/presets/cursor/mcp-ts/commands/task.md +4 -0
  277. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +382 -27
  278. package/presets/cursor/mcp-ts/rules/ai-local-overlay.mdc +1 -1
  279. package/presets/cursor/mcp-ts/rules/code-review-mr.mdc +1 -0
  280. package/presets/cursor/mcp-ts/rules/preset-layering.mdc +4 -4
  281. package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +2 -1
  282. package/presets/cursor/mcp-ts/rules/preset-twin-sync.mdc +12 -5
  283. package/presets/cursor/mol/agents/build-verifier.md +4 -1
  284. package/presets/cursor/mol/agents/code-reviewer.md +1 -1
  285. package/presets/cursor/mol/agents/debugger.md +1 -1
  286. package/presets/cursor/mol/agents/feature-developer.md +1 -1
  287. package/presets/cursor/mol/agents/task-analyst.md +1 -1
  288. package/presets/cursor/mol/agents/task-router.md +2 -0
  289. package/presets/cursor/mol/commands/README.md +1 -0
  290. package/presets/cursor/mol/commands/rr-migrate-repositories.md +59 -0
  291. package/presets/cursor/mol/commands/task.md +4 -0
  292. package/presets/cursor/mol/hooks/chain-team-phases.sh +382 -27
  293. package/presets/cursor/mol/rules/ai-local-overlay.mdc +1 -1
  294. package/presets/cursor/mol/rules/code-review-mr.mdc +1 -0
  295. package/presets/cursor/mol/rules/preset-layering.mdc +4 -4
  296. package/presets/cursor/mol/rules/preset-pr-checklist.mdc +2 -1
  297. package/presets/cursor/mol/rules/preset-twin-sync.mdc +12 -5
  298. package/presets/cursor/next/agents/build-verifier.md +6 -1
  299. package/presets/cursor/next/agents/code-reviewer.md +1 -1
  300. package/presets/cursor/next/agents/debugger.md +1 -1
  301. package/presets/cursor/next/agents/feature-developer.md +1 -1
  302. package/presets/cursor/next/agents/task-analyst.md +1 -1
  303. package/presets/cursor/next/agents/task-router.md +2 -0
  304. package/presets/cursor/next/commands/README.md +1 -0
  305. package/presets/cursor/next/commands/rr-migrate-repositories.md +59 -0
  306. package/presets/cursor/next/commands/task.md +4 -0
  307. package/presets/cursor/next/commands/ui-start.md +12 -4
  308. package/presets/cursor/next/commands/ui-stop.md +5 -2
  309. package/presets/cursor/next/hooks/chain-team-phases.sh +382 -27
  310. package/presets/cursor/next/rules/ai-local-overlay.mdc +2 -1
  311. package/presets/cursor/next/rules/code-review-mr.mdc +1 -0
  312. package/presets/cursor/next/rules/preset-layering.mdc +4 -4
  313. package/presets/cursor/next/rules/preset-pr-checklist.mdc +2 -1
  314. package/presets/cursor/next/rules/preset-twin-sync.mdc +12 -5
  315. package/presets/cursor/nuxt/agents/build-verifier.md +4 -1
  316. package/presets/cursor/nuxt/agents/code-reviewer.md +1 -1
  317. package/presets/cursor/nuxt/agents/debugger.md +1 -1
  318. package/presets/cursor/nuxt/agents/feature-developer.md +1 -1
  319. package/presets/cursor/nuxt/agents/task-analyst.md +1 -1
  320. package/presets/cursor/nuxt/agents/task-router.md +2 -0
  321. package/presets/cursor/nuxt/commands/README.md +1 -0
  322. package/presets/cursor/nuxt/commands/rr-migrate-repositories.md +59 -0
  323. package/presets/cursor/nuxt/commands/task.md +4 -0
  324. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +382 -27
  325. package/presets/cursor/nuxt/rules/ai-local-overlay.mdc +1 -1
  326. package/presets/cursor/nuxt/rules/code-review-mr.mdc +1 -0
  327. package/presets/cursor/nuxt/rules/preset-layering.mdc +4 -4
  328. package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +2 -1
  329. package/presets/cursor/nuxt/rules/preset-twin-sync.mdc +12 -5
  330. package/presets/cursor/php-hexagonal/agents/build-verifier.md +1 -1
  331. package/presets/cursor/php-hexagonal/agents/code-reviewer.md +1 -1
  332. package/presets/cursor/php-hexagonal/agents/debugger.md +1 -1
  333. package/presets/cursor/php-hexagonal/agents/feature-developer.md +1 -1
  334. package/presets/cursor/php-hexagonal/agents/task-analyst.md +1 -1
  335. package/presets/cursor/php-hexagonal/agents/task-router.md +2 -0
  336. package/presets/cursor/php-hexagonal/commands/README.md +1 -0
  337. package/presets/cursor/php-hexagonal/commands/rr-migrate-repositories.md +59 -0
  338. package/presets/cursor/php-hexagonal/commands/task.md +4 -0
  339. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +382 -27
  340. package/presets/cursor/php-hexagonal/rules/ai-local-overlay.mdc +1 -1
  341. package/presets/cursor/php-hexagonal/rules/code-review-mr.mdc +1 -0
  342. package/presets/cursor/php-hexagonal/rules/preset-layering.mdc +4 -4
  343. package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +2 -1
  344. package/presets/cursor/php-hexagonal/rules/preset-twin-sync.mdc +12 -5
  345. package/presets/cursor/php-laravel/agents/build-verifier.md +1 -1
  346. package/presets/cursor/php-laravel/agents/code-reviewer.md +1 -1
  347. package/presets/cursor/php-laravel/agents/debugger.md +1 -1
  348. package/presets/cursor/php-laravel/agents/feature-developer.md +1 -1
  349. package/presets/cursor/php-laravel/agents/task-analyst.md +1 -1
  350. package/presets/cursor/php-laravel/agents/task-router.md +2 -0
  351. package/presets/cursor/php-laravel/commands/README.md +1 -0
  352. package/presets/cursor/php-laravel/commands/rr-migrate-repositories.md +59 -0
  353. package/presets/cursor/php-laravel/commands/task.md +4 -0
  354. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +382 -27
  355. package/presets/cursor/php-laravel/rules/ai-local-overlay.mdc +1 -1
  356. package/presets/cursor/php-laravel/rules/code-review-mr.mdc +1 -0
  357. package/presets/cursor/php-laravel/rules/preset-layering.mdc +4 -4
  358. package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +2 -1
  359. package/presets/cursor/php-laravel/rules/preset-twin-sync.mdc +12 -5
  360. package/presets/cursor/svelte/agents/build-verifier.md +4 -1
  361. package/presets/cursor/svelte/agents/code-reviewer.md +1 -1
  362. package/presets/cursor/svelte/agents/debugger.md +1 -1
  363. package/presets/cursor/svelte/agents/feature-developer.md +1 -1
  364. package/presets/cursor/svelte/agents/task-analyst.md +1 -1
  365. package/presets/cursor/svelte/agents/task-router.md +2 -0
  366. package/presets/cursor/svelte/commands/README.md +1 -0
  367. package/presets/cursor/svelte/commands/rr-migrate-repositories.md +59 -0
  368. package/presets/cursor/svelte/commands/task.md +4 -0
  369. package/presets/cursor/svelte/hooks/chain-team-phases.sh +382 -27
  370. package/presets/cursor/svelte/rules/ai-local-overlay.mdc +1 -1
  371. package/presets/cursor/svelte/rules/code-review-mr.mdc +1 -0
  372. package/presets/cursor/svelte/rules/preset-layering.mdc +4 -4
  373. package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +2 -1
  374. package/presets/cursor/svelte/rules/preset-twin-sync.mdc +12 -5
  375. package/presets/mavis/android-kotlin/adapter-map.json +9 -1
  376. package/presets/mavis/android-kotlin/agents/build-verifier.md +1 -1
  377. package/presets/mavis/android-kotlin/agents/code-reviewer.md +1 -1
  378. package/presets/mavis/android-kotlin/agents/debugger.md +1 -1
  379. package/presets/mavis/android-kotlin/agents/feature-developer.md +1 -1
  380. package/presets/mavis/android-kotlin/agents/task-analyst.md +1 -1
  381. package/presets/mavis/android-kotlin/agents/task-router.md +2 -0
  382. package/presets/mavis/android-kotlin/commands/README.md +1 -0
  383. package/presets/mavis/android-kotlin/commands/rr-migrate-repositories.md +54 -0
  384. package/presets/mavis/android-kotlin/commands/task.md +4 -0
  385. package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +382 -27
  386. package/presets/mavis/android-kotlin/rules/ai-local-overlay.md +1 -1
  387. package/presets/mavis/android-kotlin/rules/code-review-mr.md +1 -0
  388. package/presets/mavis/android-kotlin/rules/preset-layering.md +4 -4
  389. package/presets/mavis/android-kotlin/rules/preset-pr-checklist.md +2 -1
  390. package/presets/mavis/android-kotlin/rules/preset-twin-sync.md +12 -5
  391. package/presets/mavis/go/adapter-map.json +9 -1
  392. package/presets/mavis/go/agents/build-verifier.md +1 -1
  393. package/presets/mavis/go/agents/code-reviewer.md +1 -1
  394. package/presets/mavis/go/agents/debugger.md +1 -1
  395. package/presets/mavis/go/agents/feature-developer.md +1 -1
  396. package/presets/mavis/go/agents/task-analyst.md +1 -1
  397. package/presets/mavis/go/agents/task-router.md +2 -0
  398. package/presets/mavis/go/commands/README.md +1 -0
  399. package/presets/mavis/go/commands/rr-migrate-repositories.md +54 -0
  400. package/presets/mavis/go/commands/task.md +4 -0
  401. package/presets/mavis/go/hooks/chain-team-phases.sh +382 -27
  402. package/presets/mavis/go/rules/ai-local-overlay.md +1 -1
  403. package/presets/mavis/go/rules/code-review-mr.md +1 -0
  404. package/presets/mavis/go/rules/preset-layering.md +4 -4
  405. package/presets/mavis/go/rules/preset-pr-checklist.md +2 -1
  406. package/presets/mavis/go/rules/preset-twin-sync.md +12 -5
  407. package/presets/mavis/ios-swift/adapter-map.json +9 -1
  408. package/presets/mavis/ios-swift/agents/build-verifier.md +4 -1
  409. package/presets/mavis/ios-swift/agents/code-reviewer.md +1 -1
  410. package/presets/mavis/ios-swift/agents/debugger.md +1 -1
  411. package/presets/mavis/ios-swift/agents/feature-developer.md +1 -1
  412. package/presets/mavis/ios-swift/agents/task-analyst.md +1 -1
  413. package/presets/mavis/ios-swift/agents/task-router.md +2 -0
  414. package/presets/mavis/ios-swift/commands/README.md +1 -0
  415. package/presets/mavis/ios-swift/commands/rr-migrate-repositories.md +54 -0
  416. package/presets/mavis/ios-swift/commands/task.md +4 -0
  417. package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +382 -27
  418. package/presets/mavis/ios-swift/rules/ai-local-overlay.md +1 -1
  419. package/presets/mavis/ios-swift/rules/code-review-mr.md +1 -0
  420. package/presets/mavis/ios-swift/rules/preset-layering.md +4 -4
  421. package/presets/mavis/ios-swift/rules/preset-pr-checklist.md +2 -1
  422. package/presets/mavis/ios-swift/rules/preset-twin-sync.md +12 -5
  423. package/presets/mavis/java/adapter-map.json +9 -1
  424. package/presets/mavis/java/agents/build-verifier.md +1 -1
  425. package/presets/mavis/java/agents/code-reviewer.md +1 -1
  426. package/presets/mavis/java/agents/debugger.md +1 -1
  427. package/presets/mavis/java/agents/feature-developer.md +1 -1
  428. package/presets/mavis/java/agents/task-analyst.md +1 -1
  429. package/presets/mavis/java/agents/task-router.md +2 -0
  430. package/presets/mavis/java/commands/README.md +1 -0
  431. package/presets/mavis/java/commands/rr-migrate-repositories.md +54 -0
  432. package/presets/mavis/java/commands/task.md +4 -0
  433. package/presets/mavis/java/hooks/chain-team-phases.sh +382 -27
  434. package/presets/mavis/java/rules/ai-local-overlay.md +1 -1
  435. package/presets/mavis/java/rules/code-review-mr.md +1 -0
  436. package/presets/mavis/java/rules/preset-layering.md +4 -4
  437. package/presets/mavis/java/rules/preset-pr-checklist.md +2 -1
  438. package/presets/mavis/java/rules/preset-twin-sync.md +12 -5
  439. package/presets/mavis/mcp-ts/adapter-map.json +9 -1
  440. package/presets/mavis/mcp-ts/agents/build-verifier.md +1 -1
  441. package/presets/mavis/mcp-ts/agents/feature-developer.md +1 -1
  442. package/presets/mavis/mcp-ts/agents/task-analyst.md +1 -1
  443. package/presets/mavis/mcp-ts/agents/task-router.md +2 -0
  444. package/presets/mavis/mcp-ts/commands/README.md +1 -0
  445. package/presets/mavis/mcp-ts/commands/rr-migrate-repositories.md +54 -0
  446. package/presets/mavis/mcp-ts/commands/task.md +4 -0
  447. package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +382 -27
  448. package/presets/mavis/mcp-ts/rules/ai-local-overlay.md +1 -1
  449. package/presets/mavis/mcp-ts/rules/code-review-mr.md +1 -0
  450. package/presets/mavis/mcp-ts/rules/preset-layering.md +4 -4
  451. package/presets/mavis/mcp-ts/rules/preset-pr-checklist.md +2 -1
  452. package/presets/mavis/mcp-ts/rules/preset-twin-sync.md +12 -5
  453. package/presets/mavis/mol/adapter-map.json +9 -1
  454. package/presets/mavis/mol/agents/build-verifier.md +4 -1
  455. package/presets/mavis/mol/agents/code-reviewer.md +1 -1
  456. package/presets/mavis/mol/agents/debugger.md +1 -1
  457. package/presets/mavis/mol/agents/feature-developer.md +1 -1
  458. package/presets/mavis/mol/agents/task-analyst.md +1 -1
  459. package/presets/mavis/mol/agents/task-router.md +2 -0
  460. package/presets/mavis/mol/commands/README.md +1 -0
  461. package/presets/mavis/mol/commands/rr-migrate-repositories.md +54 -0
  462. package/presets/mavis/mol/commands/task.md +4 -0
  463. package/presets/mavis/mol/hooks/chain-team-phases.sh +382 -27
  464. package/presets/mavis/mol/rules/ai-local-overlay.md +1 -1
  465. package/presets/mavis/mol/rules/code-review-mr.md +1 -0
  466. package/presets/mavis/mol/rules/preset-layering.md +4 -4
  467. package/presets/mavis/mol/rules/preset-pr-checklist.md +2 -1
  468. package/presets/mavis/mol/rules/preset-twin-sync.md +12 -5
  469. package/presets/mavis/next/adapter-map.json +9 -1
  470. package/presets/mavis/next/agents/build-verifier.md +6 -1
  471. package/presets/mavis/next/agents/code-reviewer.md +1 -1
  472. package/presets/mavis/next/agents/debugger.md +1 -1
  473. package/presets/mavis/next/agents/feature-developer.md +1 -1
  474. package/presets/mavis/next/agents/task-analyst.md +1 -1
  475. package/presets/mavis/next/agents/task-router.md +2 -0
  476. package/presets/mavis/next/commands/README.md +1 -0
  477. package/presets/mavis/next/commands/rr-migrate-repositories.md +54 -0
  478. package/presets/mavis/next/commands/task.md +4 -0
  479. package/presets/mavis/next/commands/ui-start.md +12 -4
  480. package/presets/mavis/next/commands/ui-stop.md +5 -2
  481. package/presets/mavis/next/hooks/chain-team-phases.sh +382 -27
  482. package/presets/mavis/next/rules/ai-local-overlay.md +2 -1
  483. package/presets/mavis/next/rules/code-review-mr.md +1 -0
  484. package/presets/mavis/next/rules/preset-layering.md +4 -4
  485. package/presets/mavis/next/rules/preset-pr-checklist.md +2 -1
  486. package/presets/mavis/next/rules/preset-twin-sync.md +12 -5
  487. package/presets/mavis/nuxt/adapter-map.json +9 -1
  488. package/presets/mavis/nuxt/agents/build-verifier.md +4 -1
  489. package/presets/mavis/nuxt/agents/code-reviewer.md +1 -1
  490. package/presets/mavis/nuxt/agents/debugger.md +1 -1
  491. package/presets/mavis/nuxt/agents/feature-developer.md +1 -1
  492. package/presets/mavis/nuxt/agents/task-analyst.md +1 -1
  493. package/presets/mavis/nuxt/agents/task-router.md +2 -0
  494. package/presets/mavis/nuxt/commands/README.md +1 -0
  495. package/presets/mavis/nuxt/commands/rr-migrate-repositories.md +54 -0
  496. package/presets/mavis/nuxt/commands/task.md +4 -0
  497. package/presets/mavis/nuxt/hooks/chain-team-phases.sh +382 -27
  498. package/presets/mavis/nuxt/rules/ai-local-overlay.md +1 -1
  499. package/presets/mavis/nuxt/rules/code-review-mr.md +1 -0
  500. package/presets/mavis/nuxt/rules/preset-layering.md +4 -4
  501. package/presets/mavis/nuxt/rules/preset-pr-checklist.md +2 -1
  502. package/presets/mavis/nuxt/rules/preset-twin-sync.md +12 -5
  503. package/presets/mavis/php-hexagonal/adapter-map.json +9 -1
  504. package/presets/mavis/php-hexagonal/agents/build-verifier.md +1 -1
  505. package/presets/mavis/php-hexagonal/agents/code-reviewer.md +1 -1
  506. package/presets/mavis/php-hexagonal/agents/debugger.md +1 -1
  507. package/presets/mavis/php-hexagonal/agents/feature-developer.md +1 -1
  508. package/presets/mavis/php-hexagonal/agents/task-analyst.md +1 -1
  509. package/presets/mavis/php-hexagonal/agents/task-router.md +2 -0
  510. package/presets/mavis/php-hexagonal/commands/README.md +1 -0
  511. package/presets/mavis/php-hexagonal/commands/rr-migrate-repositories.md +54 -0
  512. package/presets/mavis/php-hexagonal/commands/task.md +4 -0
  513. package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +382 -27
  514. package/presets/mavis/php-hexagonal/rules/ai-local-overlay.md +1 -1
  515. package/presets/mavis/php-hexagonal/rules/code-review-mr.md +1 -0
  516. package/presets/mavis/php-hexagonal/rules/preset-layering.md +4 -4
  517. package/presets/mavis/php-hexagonal/rules/preset-pr-checklist.md +2 -1
  518. package/presets/mavis/php-hexagonal/rules/preset-twin-sync.md +12 -5
  519. package/presets/mavis/php-laravel/adapter-map.json +9 -1
  520. package/presets/mavis/php-laravel/agents/build-verifier.md +1 -1
  521. package/presets/mavis/php-laravel/agents/code-reviewer.md +1 -1
  522. package/presets/mavis/php-laravel/agents/debugger.md +1 -1
  523. package/presets/mavis/php-laravel/agents/feature-developer.md +1 -1
  524. package/presets/mavis/php-laravel/agents/task-analyst.md +1 -1
  525. package/presets/mavis/php-laravel/agents/task-router.md +2 -0
  526. package/presets/mavis/php-laravel/commands/README.md +1 -0
  527. package/presets/mavis/php-laravel/commands/rr-migrate-repositories.md +54 -0
  528. package/presets/mavis/php-laravel/commands/task.md +4 -0
  529. package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +382 -27
  530. package/presets/mavis/php-laravel/rules/ai-local-overlay.md +1 -1
  531. package/presets/mavis/php-laravel/rules/code-review-mr.md +1 -0
  532. package/presets/mavis/php-laravel/rules/preset-layering.md +4 -4
  533. package/presets/mavis/php-laravel/rules/preset-pr-checklist.md +2 -1
  534. package/presets/mavis/php-laravel/rules/preset-twin-sync.md +12 -5
  535. package/presets/mavis/svelte/adapter-map.json +9 -1
  536. package/presets/mavis/svelte/agents/build-verifier.md +4 -1
  537. package/presets/mavis/svelte/agents/code-reviewer.md +1 -1
  538. package/presets/mavis/svelte/agents/debugger.md +1 -1
  539. package/presets/mavis/svelte/agents/feature-developer.md +1 -1
  540. package/presets/mavis/svelte/agents/task-analyst.md +1 -1
  541. package/presets/mavis/svelte/agents/task-router.md +2 -0
  542. package/presets/mavis/svelte/commands/README.md +1 -0
  543. package/presets/mavis/svelte/commands/rr-migrate-repositories.md +54 -0
  544. package/presets/mavis/svelte/commands/task.md +4 -0
  545. package/presets/mavis/svelte/hooks/chain-team-phases.sh +382 -27
  546. package/presets/mavis/svelte/rules/ai-local-overlay.md +1 -1
  547. package/presets/mavis/svelte/rules/code-review-mr.md +1 -0
  548. package/presets/mavis/svelte/rules/preset-layering.md +4 -4
  549. package/presets/mavis/svelte/rules/preset-pr-checklist.md +2 -1
  550. package/presets/mavis/svelte/rules/preset-twin-sync.md +12 -5
  551. package/presets/opencode/android-kotlin/adapter-map.json +9 -1
  552. package/presets/opencode/android-kotlin/agents/build-verifier.md +1 -1
  553. package/presets/opencode/android-kotlin/agents/code-reviewer.md +1 -1
  554. package/presets/opencode/android-kotlin/agents/debugger.md +1 -1
  555. package/presets/opencode/android-kotlin/agents/feature-developer.md +1 -1
  556. package/presets/opencode/android-kotlin/agents/task-analyst.md +1 -1
  557. package/presets/opencode/android-kotlin/agents/task-router.md +2 -0
  558. package/presets/opencode/android-kotlin/commands/README.md +1 -0
  559. package/presets/opencode/android-kotlin/commands/rr-migrate-repositories.md +62 -0
  560. package/presets/opencode/android-kotlin/commands/task.md +4 -0
  561. package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +382 -27
  562. package/presets/opencode/android-kotlin/rules/ai-local-overlay.md +1 -1
  563. package/presets/opencode/android-kotlin/rules/code-review-mr.md +1 -0
  564. package/presets/opencode/android-kotlin/rules/preset-layering.md +4 -4
  565. package/presets/opencode/android-kotlin/rules/preset-pr-checklist.md +2 -1
  566. package/presets/opencode/android-kotlin/rules/preset-twin-sync.md +12 -5
  567. package/presets/opencode/go/adapter-map.json +9 -1
  568. package/presets/opencode/go/agents/build-verifier.md +1 -1
  569. package/presets/opencode/go/agents/code-reviewer.md +1 -1
  570. package/presets/opencode/go/agents/debugger.md +1 -1
  571. package/presets/opencode/go/agents/feature-developer.md +1 -1
  572. package/presets/opencode/go/agents/task-analyst.md +1 -1
  573. package/presets/opencode/go/agents/task-router.md +2 -0
  574. package/presets/opencode/go/commands/README.md +1 -0
  575. package/presets/opencode/go/commands/rr-migrate-repositories.md +62 -0
  576. package/presets/opencode/go/commands/task.md +4 -0
  577. package/presets/opencode/go/hooks/chain-team-phases.sh +382 -27
  578. package/presets/opencode/go/rules/ai-local-overlay.md +1 -1
  579. package/presets/opencode/go/rules/code-review-mr.md +1 -0
  580. package/presets/opencode/go/rules/preset-layering.md +4 -4
  581. package/presets/opencode/go/rules/preset-pr-checklist.md +2 -1
  582. package/presets/opencode/go/rules/preset-twin-sync.md +12 -5
  583. package/presets/opencode/ios-swift/adapter-map.json +9 -1
  584. package/presets/opencode/ios-swift/agents/build-verifier.md +4 -1
  585. package/presets/opencode/ios-swift/agents/code-reviewer.md +1 -1
  586. package/presets/opencode/ios-swift/agents/debugger.md +1 -1
  587. package/presets/opencode/ios-swift/agents/feature-developer.md +1 -1
  588. package/presets/opencode/ios-swift/agents/task-analyst.md +1 -1
  589. package/presets/opencode/ios-swift/agents/task-router.md +2 -0
  590. package/presets/opencode/ios-swift/commands/README.md +1 -0
  591. package/presets/opencode/ios-swift/commands/rr-migrate-repositories.md +62 -0
  592. package/presets/opencode/ios-swift/commands/task.md +4 -0
  593. package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +382 -27
  594. package/presets/opencode/ios-swift/rules/ai-local-overlay.md +1 -1
  595. package/presets/opencode/ios-swift/rules/code-review-mr.md +1 -0
  596. package/presets/opencode/ios-swift/rules/preset-layering.md +4 -4
  597. package/presets/opencode/ios-swift/rules/preset-pr-checklist.md +2 -1
  598. package/presets/opencode/ios-swift/rules/preset-twin-sync.md +12 -5
  599. package/presets/opencode/java/adapter-map.json +9 -1
  600. package/presets/opencode/java/agents/build-verifier.md +1 -1
  601. package/presets/opencode/java/agents/code-reviewer.md +1 -1
  602. package/presets/opencode/java/agents/debugger.md +1 -1
  603. package/presets/opencode/java/agents/feature-developer.md +1 -1
  604. package/presets/opencode/java/agents/task-analyst.md +1 -1
  605. package/presets/opencode/java/agents/task-router.md +2 -0
  606. package/presets/opencode/java/commands/README.md +1 -0
  607. package/presets/opencode/java/commands/rr-migrate-repositories.md +62 -0
  608. package/presets/opencode/java/commands/task.md +4 -0
  609. package/presets/opencode/java/hooks/chain-team-phases.sh +382 -27
  610. package/presets/opencode/java/rules/ai-local-overlay.md +1 -1
  611. package/presets/opencode/java/rules/code-review-mr.md +1 -0
  612. package/presets/opencode/java/rules/preset-layering.md +4 -4
  613. package/presets/opencode/java/rules/preset-pr-checklist.md +2 -1
  614. package/presets/opencode/java/rules/preset-twin-sync.md +12 -5
  615. package/presets/opencode/mcp-ts/adapter-map.json +9 -1
  616. package/presets/opencode/mcp-ts/agents/build-verifier.md +1 -1
  617. package/presets/opencode/mcp-ts/agents/feature-developer.md +1 -1
  618. package/presets/opencode/mcp-ts/agents/task-analyst.md +1 -1
  619. package/presets/opencode/mcp-ts/agents/task-router.md +2 -0
  620. package/presets/opencode/mcp-ts/commands/README.md +1 -0
  621. package/presets/opencode/mcp-ts/commands/rr-migrate-repositories.md +62 -0
  622. package/presets/opencode/mcp-ts/commands/task.md +4 -0
  623. package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +382 -27
  624. package/presets/opencode/mcp-ts/rules/ai-local-overlay.md +1 -1
  625. package/presets/opencode/mcp-ts/rules/code-review-mr.md +1 -0
  626. package/presets/opencode/mcp-ts/rules/preset-layering.md +4 -4
  627. package/presets/opencode/mcp-ts/rules/preset-pr-checklist.md +2 -1
  628. package/presets/opencode/mcp-ts/rules/preset-twin-sync.md +12 -5
  629. package/presets/opencode/mol/adapter-map.json +9 -1
  630. package/presets/opencode/mol/agents/build-verifier.md +4 -1
  631. package/presets/opencode/mol/agents/code-reviewer.md +1 -1
  632. package/presets/opencode/mol/agents/debugger.md +1 -1
  633. package/presets/opencode/mol/agents/feature-developer.md +1 -1
  634. package/presets/opencode/mol/agents/task-analyst.md +1 -1
  635. package/presets/opencode/mol/agents/task-router.md +2 -0
  636. package/presets/opencode/mol/commands/README.md +1 -0
  637. package/presets/opencode/mol/commands/rr-migrate-repositories.md +62 -0
  638. package/presets/opencode/mol/commands/task.md +4 -0
  639. package/presets/opencode/mol/hooks/chain-team-phases.sh +382 -27
  640. package/presets/opencode/mol/rules/ai-local-overlay.md +1 -1
  641. package/presets/opencode/mol/rules/code-review-mr.md +1 -0
  642. package/presets/opencode/mol/rules/preset-layering.md +4 -4
  643. package/presets/opencode/mol/rules/preset-pr-checklist.md +2 -1
  644. package/presets/opencode/mol/rules/preset-twin-sync.md +12 -5
  645. package/presets/opencode/next/adapter-map.json +9 -1
  646. package/presets/opencode/next/agents/build-verifier.md +6 -1
  647. package/presets/opencode/next/agents/code-reviewer.md +1 -1
  648. package/presets/opencode/next/agents/debugger.md +1 -1
  649. package/presets/opencode/next/agents/feature-developer.md +1 -1
  650. package/presets/opencode/next/agents/task-analyst.md +1 -1
  651. package/presets/opencode/next/agents/task-router.md +2 -0
  652. package/presets/opencode/next/commands/README.md +1 -0
  653. package/presets/opencode/next/commands/rr-migrate-repositories.md +62 -0
  654. package/presets/opencode/next/commands/task.md +4 -0
  655. package/presets/opencode/next/commands/ui-start.md +12 -4
  656. package/presets/opencode/next/commands/ui-stop.md +5 -2
  657. package/presets/opencode/next/hooks/chain-team-phases.sh +382 -27
  658. package/presets/opencode/next/rules/ai-local-overlay.md +2 -1
  659. package/presets/opencode/next/rules/code-review-mr.md +1 -0
  660. package/presets/opencode/next/rules/preset-layering.md +4 -4
  661. package/presets/opencode/next/rules/preset-pr-checklist.md +2 -1
  662. package/presets/opencode/next/rules/preset-twin-sync.md +12 -5
  663. package/presets/opencode/nuxt/adapter-map.json +9 -1
  664. package/presets/opencode/nuxt/agents/build-verifier.md +4 -1
  665. package/presets/opencode/nuxt/agents/code-reviewer.md +1 -1
  666. package/presets/opencode/nuxt/agents/debugger.md +1 -1
  667. package/presets/opencode/nuxt/agents/feature-developer.md +1 -1
  668. package/presets/opencode/nuxt/agents/task-analyst.md +1 -1
  669. package/presets/opencode/nuxt/agents/task-router.md +2 -0
  670. package/presets/opencode/nuxt/commands/README.md +1 -0
  671. package/presets/opencode/nuxt/commands/rr-migrate-repositories.md +62 -0
  672. package/presets/opencode/nuxt/commands/task.md +4 -0
  673. package/presets/opencode/nuxt/hooks/chain-team-phases.sh +382 -27
  674. package/presets/opencode/nuxt/rules/ai-local-overlay.md +1 -1
  675. package/presets/opencode/nuxt/rules/code-review-mr.md +1 -0
  676. package/presets/opencode/nuxt/rules/preset-layering.md +4 -4
  677. package/presets/opencode/nuxt/rules/preset-pr-checklist.md +2 -1
  678. package/presets/opencode/nuxt/rules/preset-twin-sync.md +12 -5
  679. package/presets/opencode/php-hexagonal/adapter-map.json +9 -1
  680. package/presets/opencode/php-hexagonal/agents/build-verifier.md +1 -1
  681. package/presets/opencode/php-hexagonal/agents/code-reviewer.md +1 -1
  682. package/presets/opencode/php-hexagonal/agents/debugger.md +1 -1
  683. package/presets/opencode/php-hexagonal/agents/feature-developer.md +1 -1
  684. package/presets/opencode/php-hexagonal/agents/task-analyst.md +1 -1
  685. package/presets/opencode/php-hexagonal/agents/task-router.md +2 -0
  686. package/presets/opencode/php-hexagonal/commands/README.md +1 -0
  687. package/presets/opencode/php-hexagonal/commands/rr-migrate-repositories.md +62 -0
  688. package/presets/opencode/php-hexagonal/commands/task.md +4 -0
  689. package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +382 -27
  690. package/presets/opencode/php-hexagonal/rules/ai-local-overlay.md +1 -1
  691. package/presets/opencode/php-hexagonal/rules/code-review-mr.md +1 -0
  692. package/presets/opencode/php-hexagonal/rules/preset-layering.md +4 -4
  693. package/presets/opencode/php-hexagonal/rules/preset-pr-checklist.md +2 -1
  694. package/presets/opencode/php-hexagonal/rules/preset-twin-sync.md +12 -5
  695. package/presets/opencode/php-laravel/adapter-map.json +9 -1
  696. package/presets/opencode/php-laravel/agents/build-verifier.md +1 -1
  697. package/presets/opencode/php-laravel/agents/code-reviewer.md +1 -1
  698. package/presets/opencode/php-laravel/agents/debugger.md +1 -1
  699. package/presets/opencode/php-laravel/agents/feature-developer.md +1 -1
  700. package/presets/opencode/php-laravel/agents/task-analyst.md +1 -1
  701. package/presets/opencode/php-laravel/agents/task-router.md +2 -0
  702. package/presets/opencode/php-laravel/commands/README.md +1 -0
  703. package/presets/opencode/php-laravel/commands/rr-migrate-repositories.md +62 -0
  704. package/presets/opencode/php-laravel/commands/task.md +4 -0
  705. package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +382 -27
  706. package/presets/opencode/php-laravel/rules/ai-local-overlay.md +1 -1
  707. package/presets/opencode/php-laravel/rules/code-review-mr.md +1 -0
  708. package/presets/opencode/php-laravel/rules/preset-layering.md +4 -4
  709. package/presets/opencode/php-laravel/rules/preset-pr-checklist.md +2 -1
  710. package/presets/opencode/php-laravel/rules/preset-twin-sync.md +12 -5
  711. package/presets/opencode/plugins/task-status/README.md +15 -7
  712. package/presets/opencode/plugins/task-status/deepseek.ts +193 -0
  713. package/presets/opencode/plugins/task-status/details-data.ts +39 -2
  714. package/presets/opencode/plugins/task-status/prompt-text.ts +18 -8
  715. package/presets/opencode/plugins/task-status/task-view.ts +253 -63
  716. package/presets/opencode/plugins/task-status/tui.tsx +48 -11
  717. package/presets/opencode/svelte/adapter-map.json +9 -1
  718. package/presets/opencode/svelte/agents/build-verifier.md +4 -1
  719. package/presets/opencode/svelte/agents/code-reviewer.md +1 -1
  720. package/presets/opencode/svelte/agents/debugger.md +1 -1
  721. package/presets/opencode/svelte/agents/feature-developer.md +1 -1
  722. package/presets/opencode/svelte/agents/task-analyst.md +1 -1
  723. package/presets/opencode/svelte/agents/task-router.md +2 -0
  724. package/presets/opencode/svelte/commands/README.md +1 -0
  725. package/presets/opencode/svelte/commands/rr-migrate-repositories.md +62 -0
  726. package/presets/opencode/svelte/commands/task.md +4 -0
  727. package/presets/opencode/svelte/hooks/chain-team-phases.sh +382 -27
  728. package/presets/opencode/svelte/rules/ai-local-overlay.md +1 -1
  729. package/presets/opencode/svelte/rules/code-review-mr.md +1 -0
  730. package/presets/opencode/svelte/rules/preset-layering.md +4 -4
  731. package/presets/opencode/svelte/rules/preset-pr-checklist.md +2 -1
  732. package/presets/opencode/svelte/rules/preset-twin-sync.md +12 -5
  733. package/presets/zcode/android-kotlin/adapter-map.json +9 -1
  734. package/presets/zcode/android-kotlin/agents/build-verifier.md +1 -1
  735. package/presets/zcode/android-kotlin/agents/code-reviewer.md +1 -1
  736. package/presets/zcode/android-kotlin/agents/debugger.md +1 -1
  737. package/presets/zcode/android-kotlin/agents/feature-developer.md +1 -1
  738. package/presets/zcode/android-kotlin/agents/task-analyst.md +1 -1
  739. package/presets/zcode/android-kotlin/agents/task-router.md +2 -0
  740. package/presets/zcode/android-kotlin/commands/README.md +1 -0
  741. package/presets/zcode/android-kotlin/commands/rr-migrate-repositories.md +62 -0
  742. package/presets/zcode/android-kotlin/commands/task.md +4 -0
  743. package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +382 -27
  744. package/presets/zcode/android-kotlin/rules/ai-local-overlay.md +1 -1
  745. package/presets/zcode/android-kotlin/rules/code-review-mr.md +1 -0
  746. package/presets/zcode/android-kotlin/rules/preset-layering.md +4 -4
  747. package/presets/zcode/android-kotlin/rules/preset-pr-checklist.md +2 -1
  748. package/presets/zcode/android-kotlin/rules/preset-twin-sync.md +12 -5
  749. package/presets/zcode/go/adapter-map.json +9 -1
  750. package/presets/zcode/go/agents/build-verifier.md +1 -1
  751. package/presets/zcode/go/agents/code-reviewer.md +1 -1
  752. package/presets/zcode/go/agents/debugger.md +1 -1
  753. package/presets/zcode/go/agents/feature-developer.md +1 -1
  754. package/presets/zcode/go/agents/task-analyst.md +1 -1
  755. package/presets/zcode/go/agents/task-router.md +2 -0
  756. package/presets/zcode/go/commands/README.md +1 -0
  757. package/presets/zcode/go/commands/rr-migrate-repositories.md +62 -0
  758. package/presets/zcode/go/commands/task.md +4 -0
  759. package/presets/zcode/go/hooks/chain-team-phases.sh +382 -27
  760. package/presets/zcode/go/rules/ai-local-overlay.md +1 -1
  761. package/presets/zcode/go/rules/code-review-mr.md +1 -0
  762. package/presets/zcode/go/rules/preset-layering.md +4 -4
  763. package/presets/zcode/go/rules/preset-pr-checklist.md +2 -1
  764. package/presets/zcode/go/rules/preset-twin-sync.md +12 -5
  765. package/presets/zcode/ios-swift/adapter-map.json +9 -1
  766. package/presets/zcode/ios-swift/agents/build-verifier.md +4 -1
  767. package/presets/zcode/ios-swift/agents/code-reviewer.md +1 -1
  768. package/presets/zcode/ios-swift/agents/debugger.md +1 -1
  769. package/presets/zcode/ios-swift/agents/feature-developer.md +1 -1
  770. package/presets/zcode/ios-swift/agents/task-analyst.md +1 -1
  771. package/presets/zcode/ios-swift/agents/task-router.md +2 -0
  772. package/presets/zcode/ios-swift/commands/README.md +1 -0
  773. package/presets/zcode/ios-swift/commands/rr-migrate-repositories.md +62 -0
  774. package/presets/zcode/ios-swift/commands/task.md +4 -0
  775. package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +382 -27
  776. package/presets/zcode/ios-swift/rules/ai-local-overlay.md +1 -1
  777. package/presets/zcode/ios-swift/rules/code-review-mr.md +1 -0
  778. package/presets/zcode/ios-swift/rules/preset-layering.md +4 -4
  779. package/presets/zcode/ios-swift/rules/preset-pr-checklist.md +2 -1
  780. package/presets/zcode/ios-swift/rules/preset-twin-sync.md +12 -5
  781. package/presets/zcode/java/adapter-map.json +9 -1
  782. package/presets/zcode/java/agents/build-verifier.md +1 -1
  783. package/presets/zcode/java/agents/code-reviewer.md +1 -1
  784. package/presets/zcode/java/agents/debugger.md +1 -1
  785. package/presets/zcode/java/agents/feature-developer.md +1 -1
  786. package/presets/zcode/java/agents/task-analyst.md +1 -1
  787. package/presets/zcode/java/agents/task-router.md +2 -0
  788. package/presets/zcode/java/commands/README.md +1 -0
  789. package/presets/zcode/java/commands/rr-migrate-repositories.md +62 -0
  790. package/presets/zcode/java/commands/task.md +4 -0
  791. package/presets/zcode/java/hooks/chain-team-phases.sh +382 -27
  792. package/presets/zcode/java/rules/ai-local-overlay.md +1 -1
  793. package/presets/zcode/java/rules/code-review-mr.md +1 -0
  794. package/presets/zcode/java/rules/preset-layering.md +4 -4
  795. package/presets/zcode/java/rules/preset-pr-checklist.md +2 -1
  796. package/presets/zcode/java/rules/preset-twin-sync.md +12 -5
  797. package/presets/zcode/mcp-ts/adapter-map.json +9 -1
  798. package/presets/zcode/mcp-ts/agents/build-verifier.md +1 -1
  799. package/presets/zcode/mcp-ts/agents/feature-developer.md +1 -1
  800. package/presets/zcode/mcp-ts/agents/task-analyst.md +1 -1
  801. package/presets/zcode/mcp-ts/agents/task-router.md +2 -0
  802. package/presets/zcode/mcp-ts/commands/README.md +1 -0
  803. package/presets/zcode/mcp-ts/commands/rr-migrate-repositories.md +62 -0
  804. package/presets/zcode/mcp-ts/commands/task.md +4 -0
  805. package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +382 -27
  806. package/presets/zcode/mcp-ts/rules/ai-local-overlay.md +1 -1
  807. package/presets/zcode/mcp-ts/rules/code-review-mr.md +1 -0
  808. package/presets/zcode/mcp-ts/rules/preset-layering.md +4 -4
  809. package/presets/zcode/mcp-ts/rules/preset-pr-checklist.md +2 -1
  810. package/presets/zcode/mcp-ts/rules/preset-twin-sync.md +12 -5
  811. package/presets/zcode/mol/adapter-map.json +9 -1
  812. package/presets/zcode/mol/agents/build-verifier.md +4 -1
  813. package/presets/zcode/mol/agents/code-reviewer.md +1 -1
  814. package/presets/zcode/mol/agents/debugger.md +1 -1
  815. package/presets/zcode/mol/agents/feature-developer.md +1 -1
  816. package/presets/zcode/mol/agents/task-analyst.md +1 -1
  817. package/presets/zcode/mol/agents/task-router.md +2 -0
  818. package/presets/zcode/mol/commands/README.md +1 -0
  819. package/presets/zcode/mol/commands/rr-migrate-repositories.md +62 -0
  820. package/presets/zcode/mol/commands/task.md +4 -0
  821. package/presets/zcode/mol/hooks/chain-team-phases.sh +382 -27
  822. package/presets/zcode/mol/rules/ai-local-overlay.md +1 -1
  823. package/presets/zcode/mol/rules/code-review-mr.md +1 -0
  824. package/presets/zcode/mol/rules/preset-layering.md +4 -4
  825. package/presets/zcode/mol/rules/preset-pr-checklist.md +2 -1
  826. package/presets/zcode/mol/rules/preset-twin-sync.md +12 -5
  827. package/presets/zcode/next/adapter-map.json +9 -1
  828. package/presets/zcode/next/agents/build-verifier.md +6 -1
  829. package/presets/zcode/next/agents/code-reviewer.md +1 -1
  830. package/presets/zcode/next/agents/debugger.md +1 -1
  831. package/presets/zcode/next/agents/feature-developer.md +1 -1
  832. package/presets/zcode/next/agents/task-analyst.md +1 -1
  833. package/presets/zcode/next/agents/task-router.md +2 -0
  834. package/presets/zcode/next/commands/README.md +1 -0
  835. package/presets/zcode/next/commands/rr-migrate-repositories.md +62 -0
  836. package/presets/zcode/next/commands/task.md +4 -0
  837. package/presets/zcode/next/commands/ui-start.md +12 -4
  838. package/presets/zcode/next/commands/ui-stop.md +5 -2
  839. package/presets/zcode/next/hooks/chain-team-phases.sh +382 -27
  840. package/presets/zcode/next/rules/ai-local-overlay.md +2 -1
  841. package/presets/zcode/next/rules/code-review-mr.md +1 -0
  842. package/presets/zcode/next/rules/preset-layering.md +4 -4
  843. package/presets/zcode/next/rules/preset-pr-checklist.md +2 -1
  844. package/presets/zcode/next/rules/preset-twin-sync.md +12 -5
  845. package/presets/zcode/nuxt/adapter-map.json +9 -1
  846. package/presets/zcode/nuxt/agents/build-verifier.md +4 -1
  847. package/presets/zcode/nuxt/agents/code-reviewer.md +1 -1
  848. package/presets/zcode/nuxt/agents/debugger.md +1 -1
  849. package/presets/zcode/nuxt/agents/feature-developer.md +1 -1
  850. package/presets/zcode/nuxt/agents/task-analyst.md +1 -1
  851. package/presets/zcode/nuxt/agents/task-router.md +2 -0
  852. package/presets/zcode/nuxt/commands/README.md +1 -0
  853. package/presets/zcode/nuxt/commands/rr-migrate-repositories.md +62 -0
  854. package/presets/zcode/nuxt/commands/task.md +4 -0
  855. package/presets/zcode/nuxt/hooks/chain-team-phases.sh +382 -27
  856. package/presets/zcode/nuxt/rules/ai-local-overlay.md +1 -1
  857. package/presets/zcode/nuxt/rules/code-review-mr.md +1 -0
  858. package/presets/zcode/nuxt/rules/preset-layering.md +4 -4
  859. package/presets/zcode/nuxt/rules/preset-pr-checklist.md +2 -1
  860. package/presets/zcode/nuxt/rules/preset-twin-sync.md +12 -5
  861. package/presets/zcode/php-hexagonal/adapter-map.json +9 -1
  862. package/presets/zcode/php-hexagonal/agents/build-verifier.md +1 -1
  863. package/presets/zcode/php-hexagonal/agents/code-reviewer.md +1 -1
  864. package/presets/zcode/php-hexagonal/agents/debugger.md +1 -1
  865. package/presets/zcode/php-hexagonal/agents/feature-developer.md +1 -1
  866. package/presets/zcode/php-hexagonal/agents/task-analyst.md +1 -1
  867. package/presets/zcode/php-hexagonal/agents/task-router.md +2 -0
  868. package/presets/zcode/php-hexagonal/commands/README.md +1 -0
  869. package/presets/zcode/php-hexagonal/commands/rr-migrate-repositories.md +62 -0
  870. package/presets/zcode/php-hexagonal/commands/task.md +4 -0
  871. package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +382 -27
  872. package/presets/zcode/php-hexagonal/rules/ai-local-overlay.md +1 -1
  873. package/presets/zcode/php-hexagonal/rules/code-review-mr.md +1 -0
  874. package/presets/zcode/php-hexagonal/rules/preset-layering.md +4 -4
  875. package/presets/zcode/php-hexagonal/rules/preset-pr-checklist.md +2 -1
  876. package/presets/zcode/php-hexagonal/rules/preset-twin-sync.md +12 -5
  877. package/presets/zcode/php-laravel/adapter-map.json +9 -1
  878. package/presets/zcode/php-laravel/agents/build-verifier.md +1 -1
  879. package/presets/zcode/php-laravel/agents/code-reviewer.md +1 -1
  880. package/presets/zcode/php-laravel/agents/debugger.md +1 -1
  881. package/presets/zcode/php-laravel/agents/feature-developer.md +1 -1
  882. package/presets/zcode/php-laravel/agents/task-analyst.md +1 -1
  883. package/presets/zcode/php-laravel/agents/task-router.md +2 -0
  884. package/presets/zcode/php-laravel/commands/README.md +1 -0
  885. package/presets/zcode/php-laravel/commands/rr-migrate-repositories.md +62 -0
  886. package/presets/zcode/php-laravel/commands/task.md +4 -0
  887. package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +382 -27
  888. package/presets/zcode/php-laravel/rules/ai-local-overlay.md +1 -1
  889. package/presets/zcode/php-laravel/rules/code-review-mr.md +1 -0
  890. package/presets/zcode/php-laravel/rules/preset-layering.md +4 -4
  891. package/presets/zcode/php-laravel/rules/preset-pr-checklist.md +2 -1
  892. package/presets/zcode/php-laravel/rules/preset-twin-sync.md +12 -5
  893. package/presets/zcode/svelte/adapter-map.json +9 -1
  894. package/presets/zcode/svelte/agents/build-verifier.md +4 -1
  895. package/presets/zcode/svelte/agents/code-reviewer.md +1 -1
  896. package/presets/zcode/svelte/agents/debugger.md +1 -1
  897. package/presets/zcode/svelte/agents/feature-developer.md +1 -1
  898. package/presets/zcode/svelte/agents/task-analyst.md +1 -1
  899. package/presets/zcode/svelte/agents/task-router.md +2 -0
  900. package/presets/zcode/svelte/commands/README.md +1 -0
  901. package/presets/zcode/svelte/commands/rr-migrate-repositories.md +62 -0
  902. package/presets/zcode/svelte/commands/task.md +4 -0
  903. package/presets/zcode/svelte/hooks/chain-team-phases.sh +382 -27
  904. package/presets/zcode/svelte/rules/ai-local-overlay.md +1 -1
  905. package/presets/zcode/svelte/rules/code-review-mr.md +1 -0
  906. package/presets/zcode/svelte/rules/preset-layering.md +4 -4
  907. package/presets/zcode/svelte/rules/preset-pr-checklist.md +2 -1
  908. package/presets/zcode/svelte/rules/preset-twin-sync.md +12 -5
@@ -76,3 +76,4 @@ The verdict and the receipt are the same decision expressed twice — never let
76
76
  - Reserve a notes-only verdict for `nit`/informational items. Reporting a non-cosmetic fixable defect as a note converts it into unplanned out-of-band work and leaves it unrecorded in the run ledger.
77
77
  - A divergence between the frozen spec/design and the shipped code is a finding, never a note: cite the spec line and the code line in the same finding.
78
78
  - Before freezing a wire contract, confirm the stated behaviour against the repository's existing handler/decoder convention; a spec that contradicts the codebase convention is the same finding class.
79
+ - Every finding you leave `open` in the ledger carries `owner` and `due`, and `accepted`/`deferred` also carry a `followUp` task slug. `node .ai.local/scripts/team-db.mjs ledger-check` refuses the receipt otherwise and the chain hook relays its message verbatim: leaving a finding open is a contract with a person and a date, not a disposition word.
@@ -11,6 +11,7 @@ Complements `quality/anti-sycophancy-discipline.md` §11 and §17. Do **not** du
11
11
  3. Verify the claim against the codebase. Reviewers can be wrong (wrong file, stale API, YAGNI expansion).
12
12
  4. Push back with evidence when a suggestion adds unused abstraction or contradicts stack boundaries.
13
13
  5. Implement agreed items one at a time; keep tests green per item when the change is logic.
14
+ 6. An item you defer instead of fixing becomes a ledger row with `owner`, `due`, and a `followUp` task slug (`disposition: deferred`). `node .ai.local/scripts/team-db.mjs ledger-check` rejects the receipt without them — naming the person who picks it up is the substance, not paperwork.
14
15
 
15
16
  ## Forbidden
16
17
 
@@ -367,6 +367,50 @@ function artifactOutputIdFor(step, agent) {
367
367
  if (step?.artifactOutputIds && typeof step.artifactOutputIds[agent] === 'string') return step.artifactOutputIds[agent];
368
368
  return DEFAULT_ARTIFACT_OUTPUT_IDS[agent] || agent;
369
369
  }
370
+ /**
371
+ * P0-3 (AC-5): `review-ledger.md` belongs to the step that owns the `review`
372
+ * artifact, so only that step's receipt runs the ledger gate. A verifier or an
373
+ * implementer reads the same file but may not write a reviewer's row, so gating
374
+ * them would stall a step with no repair path. `changes_requested` is gated with
375
+ * `completed`: that review is the one that usually introduces the rows.
376
+ */
377
+ const LEDGER_GATE_OUTCOMES = new Set(['completed', 'changes_requested']);
378
+ function ownsReviewLedger(step, agent) {
379
+ if (agent === 'code-reviewer') return true;
380
+ return artifactOutputIdFor(step, agent) === 'review';
381
+ }
382
+ /**
383
+ * AC-4: the step's write-scope baseline is a fact the hook already has at
384
+ * activation, so it saves it there instead of leaving a repair nobody runs. A
385
+ * step with no `writeScopes` keeps the shipped `no-write-scopes` skip; a failed
386
+ * save is a note on stderr, never a failed receipt (a read-only step cannot fix
387
+ * its own audit input). The declared scopes are handed to the save as its seed,
388
+ * so a step armed on a clean tree still records the paths it may write — an
389
+ * `--allow-empty` baseline would satisfy the audit's exit code while attributing
390
+ * nothing. Create-once lives in `check-write-scope --save-baseline`: a re-save
391
+ * after the step wrote would erase its own attribution.
392
+ */
393
+ function saveWriteScopeBaseline(step) {
394
+ const stepId = step && typeof step.id === 'string' && step.id !== '' ? step.id : null;
395
+ const scopes = declaredScopes(step);
396
+ if (!stepId || scopes.length === 0) return;
397
+ const root = process.cwd();
398
+ const script = path.join(root, '.ai.local', 'scripts', 'check-write-scope.mjs');
399
+ if (!fs.existsSync(script)) {
400
+ process.stderr.write(`[chain-team-phases] ${slug}: no .ai.local/scripts/check-write-scope.mjs; step ${stepId} keeps no write-scope baseline.\n`);
401
+ return;
402
+ }
403
+ const { spawnSync } = require('child_process');
404
+ const result = spawnSync(
405
+ process.execPath,
406
+ [script, '--root', root, '--slug', slug, '--step', stepId, '--save-baseline', '--paths', scopes.join(',')],
407
+ { cwd: root, encoding: 'utf8', timeout: 20000 },
408
+ );
409
+ if (result && result.status === 0) return;
410
+ const reason = String((result && (result.stderr || result.stdout)) || '')
411
+ .split('\n').map((line) => line.trim()).filter(Boolean)[0] || `exit ${result ? result.status : 'unknown'}`;
412
+ process.stderr.write(`[chain-team-phases] ${slug}: write-scope baseline for step ${stepId} not saved (${reason}); the audit will skip that step.\n`);
413
+ }
370
414
  function activateAttempts(step, stepIndex, waveId = null, agentsOverride = null) {
371
415
  const agents = Array.isArray(agentsOverride) && agentsOverride.length > 0 ? agentsOverride : getStepAgents(step);
372
416
  const parallelGroupId = step.parallel && getStepAgents(step).length > 1 ? `${status.metricsRunId || slug}:step-${stepIndex}` : null;
@@ -380,6 +424,7 @@ function activateAttempts(step, stepIndex, waveId = null, agentsOverride = null)
380
424
  appendMetric({ type: 'attempt_started', at: now, attemptId, stepIndex, stepLabel: step.label || null, agent, role: roleFor(agent), attempt, parallelGroupId, waveId: waveId || null, source: 'hook', attributionConfidence: 'high' });
381
425
  }
382
426
  status.activeAttempts = active;
427
+ saveWriteScopeBaseline(step);
383
428
  }
384
429
  function resolvedAttempt() {
385
430
  const active = status.activeAttempts || {}; const entries = Object.entries(active);
@@ -834,6 +879,76 @@ function productionWriteListError(entry) {
834
879
  }
835
880
  }
836
881
 
882
+ // A2b: a `build-verifier` completion is evidence only when it names the tree it
883
+ // ran on. The report header (`tree: <sha> (+N dirty)`, `run-at: <ISO>`) is
884
+ // compared with the worktree at receipt time through the existing
885
+ // `gitSnapshot()`. A zero-input row is data: only a `zeroInputAllowlist` entry
886
+ // with a reason admits it.
887
+ const REPORT_TREE_RE = /^tree:[ \t]*([0-9a-f]{7,40})[ \t]*\(\+([0-9]+) dirty\)[ \t]*$/m;
888
+ const REPORT_RUN_AT_RE = /^run-at:[ \t]*(\S+)[ \t]*$/m;
889
+ const ZERO_INPUT_ROW_RE = /^[ \t]*[-*][ \t]+`([^`]+)`:[ \t]*checked:[ \t]*0[ \t]*$/gm;
890
+
891
+ function zeroInputAllowlist() {
892
+ const file = path.join(process.cwd(), '.ai.local', 'pipeline-gates.json');
893
+ let parsed = null;
894
+ try { parsed = JSON.parse(fs.readFileSync(file, 'utf8')); } catch { return []; }
895
+ const list = Array.isArray(parsed && parsed.zeroInputAllowlist) ? parsed.zeroInputAllowlist : [];
896
+ return list.filter((item) => item && typeof item.gate === 'string' && item.gate.trim() !== '' && typeof item.reason === 'string' && item.reason.trim() !== '');
897
+ }
898
+
899
+ function zeroInputGates(report) {
900
+ const gates = [];
901
+ ZERO_INPUT_ROW_RE.lastIndex = 0;
902
+ let match;
903
+ while ((match = ZERO_INPUT_ROW_RE.exec(report)) !== null) gates.push(match[1].trim());
904
+ return gates;
905
+ }
906
+
907
+ /**
908
+ * The report a verifier receipt is bound to. On pipeline completion the hook
909
+ * archives the cited body and repoints `authoritativePaths` at
910
+ * `archive/<date>/validation-report.md`; a later reconcile of the same receipt
911
+ * must read the archived copy, not treat the report as missing.
912
+ */
913
+ function verifierReportText(entry) {
914
+ try { return fs.readFileSync(path.join(taskDir, 'validation-report.md'), 'utf8'); } catch {}
915
+ const cited = Array.isArray(entry && entry.authoritativePaths) ? entry.authoritativePaths : [];
916
+ for (const value of cited) {
917
+ const relative = typeof value === 'string' ? value.trim().replace(/\\/g, '/') : '';
918
+ if (!/^archive\/\d{4}-\d{2}-\d{2}\/validation-report\.md$/.test(relative)) continue;
919
+ try { return fs.readFileSync(path.join(taskDir, relative), 'utf8'); } catch {}
920
+ }
921
+ return null;
922
+ }
923
+
924
+ function validateVerifierEvidence(entry) {
925
+ if (!entry || entry.producer !== 'build-verifier') return null;
926
+ const artifactId = entry.id || '(unnamed)';
927
+ const repair = `re-run the named gate on the current tree, then resume with: /task-continue ${slug}`;
928
+ const report = verifierReportText(entry);
929
+ if (report === null) {
930
+ return `[chain-team-phases] ${slug}: receipt "${artifactId}" is a build-verifier completion but validation-report.md is missing. Write it with the "tree: <sha> (+N dirty)" and "run-at: <ISO>" header from the run you are claiming, then ${repair}`;
931
+ }
932
+ const tree = report.match(REPORT_TREE_RE);
933
+ const runAt = report.match(REPORT_RUN_AT_RE);
934
+ if (!tree || !runAt || !Number.isFinite(Date.parse(runAt[1]))) {
935
+ return `[chain-team-phases] ${slug}: receipt "${artifactId}" has a validation-report.md without the required "tree: <sha> (+N dirty)" and "run-at: <ISO>" header lines. Nothing may follow the closing ")" on the tree line — put clarifications under "## Notes". Add the lines from the run you are claiming, then ${repair}`;
936
+ }
937
+ const snapshot = gitSnapshot();
938
+ if (snapshot && !snapshot.head.startsWith(tree[1])) {
939
+ return `[chain-team-phases] ${slug}: receipt "${artifactId}" names tree ${tree[1]} but HEAD is ${snapshot.head.slice(0, 12)}. The gate ran on another revision: ${repair}`;
940
+ }
941
+ if (snapshot && Number(tree[2]) !== snapshot.dirtyFiles) {
942
+ return `[chain-team-phases] ${slug}: receipt "${artifactId}" names (+${tree[2]} dirty) but the worktree carries ${snapshot.dirtyFiles} changed paths. ${repair}`;
943
+ }
944
+ const allowlist = zeroInputAllowlist();
945
+ const blocked = zeroInputGates(report).filter((gate) => !allowlist.some((item) => item.gate === gate));
946
+ if (blocked.length > 0) {
947
+ return `[chain-team-phases] ${slug}: receipt "${artifactId}" reports gate "${blocked[0]}" as checked: 0 without a zeroInputAllowlist entry. List it under zeroInputAllowlist in .ai.local/pipeline-gates.json with a reason, or fix the selection. Then ${repair}`;
948
+ }
949
+ return null;
950
+ }
951
+
837
952
  // A2: a `completed` receipt must cite evidence the harness can inspect. Order is
838
953
  // the message order — the first failing predicate wins, so the operator sees one
839
954
  // actionable line. `authoritativePaths[]` stays task-dir-relative; external
@@ -873,9 +988,91 @@ function validateCompletedArtifact(entry) {
873
988
  }
874
989
  const productionListError = productionWriteListError(entry);
875
990
  if (productionListError) return productionListError;
991
+ const evidenceError = validateVerifierEvidence(entry);
992
+ if (evidenceError) return evidenceError;
993
+ return null;
994
+ }
995
+
996
+ // P0-3: the reviewer's receipt is the moment the ledger is read, so an
997
+ // `open`/`accepted`/`deferred` row without an owner or a due date stops there.
998
+ // The shipped `ledger-check` owns the message text; this seam relays
999
+ // `failures[].reason` verbatim and holds no copy of its own. A missing script,
1000
+ // a task without a ledger, a timeout, or a child that returns no reason is a
1001
+ // skip — the gate never fails a receipt on its own, but a skip is never silent.
1002
+ function ledgerGateSkip(reason, repair) {
1003
+ process.stderr.write(`[chain-team-phases] ${slug}: ledger gate skipped — ${reason}; ${repair}\n`);
876
1004
  return null;
877
1005
  }
878
1006
 
1007
+ function ledgerCheckStall() {
1008
+ const runByHand = `run it by hand: node .ai.local/scripts/team-db.mjs ledger-check --slug ${slug}`;
1009
+ try {
1010
+ const script = path.join(process.cwd(), '.ai.local', 'scripts', 'team-db.mjs');
1011
+ if (!fs.existsSync(script)) {
1012
+ return ledgerGateSkip(
1013
+ '.ai.local/scripts/team-db.mjs is not installed',
1014
+ 'run "npx @bonesofspring/ai-rules init update" (preset repo: "yarn fix:generated") so the shipped ledger-check lands',
1015
+ );
1016
+ }
1017
+ if (!fs.existsSync(path.join(taskDir, 'review-ledger.md'))) {
1018
+ return ledgerGateSkip(
1019
+ `the task has no review-ledger.md at .ai.local/team/tasks/${slug}/review-ledger.md`,
1020
+ 'write the canonical table when you owe rows, or ignore this line if the task produced none',
1021
+ );
1022
+ }
1023
+ const { spawnSync } = require('child_process');
1024
+ const result = spawnSync(
1025
+ process.execPath,
1026
+ ['.ai.local/scripts/team-db.mjs', 'ledger-check', '--json', '--slug', slug],
1027
+ { cwd: process.cwd(), encoding: 'utf8', timeout: 5000, killSignal: 'SIGKILL', stdio: ['ignore', 'pipe', 'pipe'] },
1028
+ );
1029
+ if (result.error) {
1030
+ return ledgerGateSkip(
1031
+ `ledger-check could not start (${result.error.message})`,
1032
+ `check that Node can run .ai.local/scripts/team-db.mjs, then ${runByHand}`,
1033
+ );
1034
+ }
1035
+ if (result.status === 0) return null;
1036
+ if (result.status === null && result.signal) {
1037
+ return ledgerGateSkip(
1038
+ `ledger-check was killed by ${result.signal} after the 5000 ms budget`,
1039
+ `check the ledger by hand, then ${runByHand}`,
1040
+ );
1041
+ }
1042
+ let reasons = [];
1043
+ try {
1044
+ const payload = JSON.parse(String(result.stdout || '').trim() || '{}');
1045
+ const failures = Array.isArray(payload.failures) ? payload.failures : [];
1046
+ reasons = failures
1047
+ .map((failure) => (failure && typeof failure.reason === 'string' ? failure.reason.trim() : ''))
1048
+ .filter(Boolean);
1049
+ } catch {
1050
+ reasons = [];
1051
+ }
1052
+ if (reasons.length === 0) {
1053
+ // No machine-readable reason: relay the child's own first stderr line
1054
+ // rather than invent one. A child that says nothing is a documented skip.
1055
+ const raw = String(result.stderr || '')
1056
+ .split('\n')
1057
+ .map((line) => line.trim())
1058
+ .filter(Boolean)[0];
1059
+ if (!raw) {
1060
+ return ledgerGateSkip(
1061
+ `ledger-check exited ${result.status} with no reason on stdout or stderr`,
1062
+ runByHand,
1063
+ );
1064
+ }
1065
+ return `[chain-team-phases] ${slug}: review-ledger.md fails ledger-check: ${raw}. Then resume with: /task-continue ${slug}`;
1066
+ }
1067
+ return `[chain-team-phases] ${slug}: review-ledger.md fails ledger-check — ${reasons.join(' | ')}. Fix the rows, then resume with: /task-continue ${slug}`;
1068
+ } catch (error) {
1069
+ return ledgerGateSkip(
1070
+ `the gate itself threw (${error && error.message ? error.message : String(error)})`,
1071
+ runByHand,
1072
+ );
1073
+ }
1074
+ }
1075
+
879
1076
  function readBoundReceiptOutcome(agent, step, resolved) {
880
1077
  if (!agent || !resolved) return { outcome: null, receiptRequired: false };
881
1078
  const manifestPath = path.join(taskDir, 'artifact-manifest.json');
@@ -950,6 +1147,10 @@ function readBoundReceiptOutcome(agent, step, resolved) {
950
1147
  const stallMessage = validateCompletedArtifact(owned[0]);
951
1148
  if (stallMessage) return { outcome: null, receiptRequired: true, stallMessage };
952
1149
  }
1150
+ if (LEDGER_GATE_OUTCOMES.has(outcome) && ownsReviewLedger(step, agent)) {
1151
+ const ledgerStallMessage = ledgerCheckStall();
1152
+ if (ledgerStallMessage) return { outcome: null, receiptRequired: true, stallMessage: ledgerStallMessage };
1153
+ }
953
1154
  return { outcome, receiptRequired: true };
954
1155
  } catch {
955
1156
  return { outcome: null, receiptRequired: false };
@@ -1025,33 +1226,89 @@ function gitSnapshot() {
1025
1226
  }
1026
1227
 
1027
1228
  /**
1028
- * Seed the evidence file when the verifier finishes without an explicit
1029
- * `verification.mjs record`: the snapshot plus a hash of `validation-report.md`.
1030
- * An existing file is never refreshed — its binding must keep pointing at the
1031
- * tree the commands actually ran on.
1229
+ * The report the gate reads: the live body, else the newest archived copy. The
1230
+ * manifest close archives `validation-report.md` under `archive/<date>/`, so a
1231
+ * refresh that read the task root alone would erase the hash the gate still
1232
+ * accepts and hand every later freshness check back to `worktreeHash`.
1233
+ */
1234
+ function evidenceReportText(dir) {
1235
+ try {
1236
+ return { path: 'validation-report.md', text: fs.readFileSync(path.join(dir, 'validation-report.md'), 'utf8') };
1237
+ } catch {}
1238
+ let dates = [];
1239
+ try { dates = fs.readdirSync(path.join(dir, 'archive')).filter((name) => /^\d{4}-\d{2}-\d{2}$/.test(name)).sort(); } catch { return null; }
1240
+ for (let index = dates.length - 1; index >= 0; index -= 1) {
1241
+ const relative = 'archive/' + dates[index] + '/validation-report.md';
1242
+ try { return { path: relative, text: fs.readFileSync(path.join(dir, relative), 'utf8') }; } catch {}
1243
+ }
1244
+ return null;
1245
+ }
1246
+
1247
+ /**
1248
+ * `verification.mjs` takes `${file}.lock` for this file; the hook's
1249
+ * read-modify-write takes the same one, so a concurrent `record` append is not
1250
+ * dropped by the refresh. A lock that cannot be taken is a note, never a failed
1251
+ * receipt.
1252
+ */
1253
+ function withVerificationLock(file, run) {
1254
+ const lockPath = file + '.lock';
1255
+ let held = false;
1256
+ for (let attempt = 0; attempt < 200 && !held; attempt += 1) {
1257
+ try {
1258
+ const fd = fs.openSync(lockPath, 'wx');
1259
+ fs.writeSync(fd, `${process.pid}:${Date.now()}`);
1260
+ fs.closeSync(fd);
1261
+ held = true;
1262
+ } catch (error) {
1263
+ if (error && error.code !== 'EEXIST') return run();
1264
+ let stale = false;
1265
+ try { stale = Date.now() - fs.statSync(lockPath).mtimeMs > 30000; } catch {}
1266
+ if (!stale) break;
1267
+ try { fs.unlinkSync(lockPath); } catch {}
1268
+ }
1269
+ }
1270
+ if (!held) process.stderr.write(`[chain-team-phases] ${slug}: verification.json is locked by another writer; refreshing without the lock.\n`);
1271
+ try {
1272
+ return run();
1273
+ } finally {
1274
+ if (held) { try { fs.unlinkSync(lockPath); } catch {} }
1275
+ }
1276
+ }
1277
+
1278
+ /**
1279
+ * Bind the evidence file to the tree the verifier's commands actually ran on.
1280
+ * Every verifier receipt refreshes it: a retried verifier must not inherit the
1281
+ * attempt-1 tree, because the report gate reads the current one. What the
1282
+ * verifier recorded (`commands[]`, the gate status) is kept — the hook owns the
1283
+ * tree, the verifier owns what ran.
1032
1284
  */
1033
1285
  function ensureVerificationSnapshot(dir, agent) {
1034
- const file = path.join(dir, 'verification.json');
1035
- if (fs.existsSync(file)) return;
1036
1286
  const snapshot = gitSnapshot();
1037
1287
  if (!snapshot) return;
1038
- const reportPath = path.join(dir, 'validation-report.md');
1039
- let report = null;
1040
- try {
1041
- const text = fs.readFileSync(reportPath);
1042
- report = { path: 'validation-report.md', sha256: crypto.createHash('sha256').update(text).digest('hex') };
1043
- } catch {}
1044
- const verification = {
1045
- schemaVersion: 1,
1046
- task: path.basename(dir),
1047
- snapshot,
1048
- report,
1049
- commands: [],
1050
- gate: { status: 'snapshot-only', recordedBy: agent || null, checkedAt: now },
1051
- };
1052
- const temporary = `${file}.${process.pid}.tmp`;
1053
- fs.writeFileSync(temporary, JSON.stringify(verification, null, 2) + '\n');
1054
- fs.renameSync(temporary, file);
1288
+ const file = path.join(dir, 'verification.json');
1289
+ const found = evidenceReportText(dir);
1290
+ const report = found === null ? null : { path: found.path, sha256: crypto.createHash('sha256').update(found.text).digest('hex') };
1291
+ withVerificationLock(file, () => {
1292
+ let previous = null;
1293
+ try { previous = JSON.parse(fs.readFileSync(file, 'utf8')); } catch {}
1294
+ const previousGate = previous && previous.gate && typeof previous.gate === 'object' ? previous.gate : {};
1295
+ const verification = {
1296
+ schemaVersion: 1,
1297
+ task: path.basename(dir),
1298
+ snapshot,
1299
+ report,
1300
+ commands: previous && Array.isArray(previous.commands) ? previous.commands : [],
1301
+ gate: {
1302
+ ...previousGate,
1303
+ status: typeof previousGate.status === 'string' ? previousGate.status : 'snapshot-only',
1304
+ recordedBy: agent || previousGate.recordedBy || null,
1305
+ checkedAt: now,
1306
+ },
1307
+ };
1308
+ const temporary = `${file}.${process.pid}.tmp`;
1309
+ fs.writeFileSync(temporary, JSON.stringify(verification, null, 2) + '\n');
1310
+ fs.renameSync(temporary, file);
1311
+ });
1055
1312
  appendMetric({ type: 'verification_recorded', at: now, kind: 'snapshot-only', agent: agent || null, head: snapshot.head, worktreeHash: snapshot.worktreeHash, source: 'hook', attributionConfidence: 'high' });
1056
1313
  }
1057
1314
 
@@ -1064,9 +1321,19 @@ function verificationFreshness(dir) {
1064
1321
  if (!snapshot || typeof snapshot.head !== 'string') return { present: true, fresh: false, reasons: ['no-snapshot'] };
1065
1322
  const current = gitSnapshot();
1066
1323
  if (!current) return { present: true, fresh: false, reasons: ['no-git'] };
1324
+ // Judge the report the gate judges: its `tree:` header, not the wider worktree
1325
+ // hash. A later edit inside the same report generation moved the hash while the
1326
+ // gate still accepted the report, so the same fresh evidence warned twice.
1327
+ const found = evidenceReportText(dir);
1328
+ const header = found === null ? null : found.text.match(REPORT_TREE_RE);
1067
1329
  const reasons = [];
1068
- if (current.head !== snapshot.head) reasons.push('head-changed');
1069
- if (current.worktreeHash !== snapshot.worktreeHash) reasons.push('worktree-changed');
1330
+ if (header) {
1331
+ if (!current.head.startsWith(header[1])) reasons.push('head-changed');
1332
+ if (Number(header[2]) !== current.dirtyFiles) reasons.push('worktree-changed');
1333
+ } else {
1334
+ if (current.head !== snapshot.head) reasons.push('head-changed');
1335
+ if (current.worktreeHash !== snapshot.worktreeHash) reasons.push('worktree-changed');
1336
+ }
1070
1337
  return { present: true, fresh: reasons.length === 0, reasons };
1071
1338
  }
1072
1339
 
@@ -2232,6 +2499,15 @@ if (hookInput.action === 'bootstrap') {
2232
2499
  }
2233
2500
  const first = firstResolved.step;
2234
2501
  const firstAgents = getStepAgents(first);
2502
+ // A handoff that names no agent cannot name an owned output id either: the
2503
+ // producer would receive `undefined` as its artifact id and stall on a receipt
2504
+ // the hook never accepts. Refuse before anything is armed or written.
2505
+ if (firstAgents.length === 0 || firstAgents.some((agent) => typeof agent !== 'string' || agent.trim() === '')) {
2506
+ const reason = `bootstrap cannot hand over step ${firstResolved.index} ("${first.id || 'step-' + firstResolved.index}"): it declares no resolvable agent, so the owned output id is undefined. Declare steps[].agent (or steps[].artifactOutputId) in pipeline.json with the task-router, then re-run bootstrap.`;
2507
+ process.stderr.write(`[chain-team-phases] ${slug}: ${reason}\n`);
2508
+ process.stdout.write(JSON.stringify({ ok: false, action: 'bootstrap', pipelineIndex: firstResolved.index, reason }));
2509
+ process.exit(0);
2510
+ }
2235
2511
  let metrics = null;
2236
2512
  try { metrics = JSON.parse(fs.readFileSync(METRICS_PATH, 'utf8')); } catch {}
2237
2513
  const hasAttempt = Boolean(
@@ -2257,7 +2533,18 @@ if (hookInput.action === 'bootstrap') {
2257
2533
  awaitingHumanGate: false,
2258
2534
  });
2259
2535
  process.stdout.write(
2260
- JSON.stringify({ ok: true, action: 'bootstrap', pipelineIndex: firstResolved.index, agents: firstAgents, attemptStarted: !hasAttempt }),
2536
+ JSON.stringify({
2537
+ ok: true,
2538
+ action: 'bootstrap',
2539
+ pipelineIndex: firstResolved.index,
2540
+ agents: firstAgents,
2541
+ attemptStarted: !hasAttempt,
2542
+ // Same builder as the advance path: the producer must learn the id and the
2543
+ // attemptId from the hook, not reconstruct them (AC-1). A parallel step has
2544
+ // one attempt per agent, so the single-agent builder would hand the second
2545
+ // producer nothing to act on.
2546
+ followup_message: first.parallel && firstAgents.length > 1 ? handoffForParallelStep(first) : handoffForAgent(firstAgents[0], first.scope, first),
2547
+ }),
2261
2548
  );
2262
2549
  process.exit(0);
2263
2550
  }
@@ -2509,6 +2796,10 @@ if (status.state === 'awaiting_artifact_receipt') {
2509
2796
  emitArtifactStall(artifactStallMessage, !wasWaitingForReceipt);
2510
2797
  process.exit(0);
2511
2798
  }
2799
+ // Snapshot before `finishActiveAttempt` writes `lastCompletedAttempt`: the
2800
+ // repositories intake gate judges a task at its first receipt, so a folder whose
2801
+ // first step already completed is never re-judged.
2802
+ const hadPriorCompletion = Boolean(status.lastCompletedAttempt);
2512
2803
  let finishedAttempt = finishActiveAttempt();
2513
2804
  // The just-finished attempt's metric is already written; a pause now blocks
2514
2805
  // every handoff, including the unattributable-stop repair path below.
@@ -2536,7 +2827,7 @@ if (!finishedAttempt && activeAttemptCountBeforeFinish > 0) {
2536
2827
  }
2537
2828
  }
2538
2829
  endHumanGateIfResumed();
2539
- if (steps.length === 0 || pipeline.autoChain === false) {
2830
+ if (steps.length === 0) {
2540
2831
  writeStatus({});
2541
2832
  process.stdout.write('{}');
2542
2833
  process.exit(0);
@@ -2583,6 +2874,70 @@ const waveIndexes = activeWave
2583
2874
  ? [idx]
2584
2875
  : (isGraphMode() && finishedAttempt ? [completedStepIndex] : null));
2585
2876
 
2877
+ /**
2878
+ * Intake invariant: a task records which repositories it touches — or says that
2879
+ * it does not know. Judged on the first receipt of a task: the router's, or the
2880
+ * first step's when a pipeline runs without one. A task that already completed a
2881
+ * step predates the invariant and is never re-judged.
2882
+ * `intakeExemption: { approvedBy, reason, at }` is the recorded escape hatch; a
2883
+ * bare boolean does not count, so an exemption always names who approved it. The
2884
+ * shape mirrors `check-task-repositories.mjs`, which audits the same field after
2885
+ * the fact.
2886
+ */
2887
+ const REPOSITORY_INFERENCES = new Set(['evidence-paths', 'repo-scope-only', 'unknown', 'ambiguous']);
2888
+ const EXEMPTION_DATE = /^\d{4}-\d{2}-\d{2}$/;
2889
+ function repositoriesIntakeViolation(record) {
2890
+ if (!record) return 'has no `repositories` array';
2891
+ const ids = record.repositories;
2892
+ const inference = record.repositoriesInference;
2893
+ if (!Array.isArray(ids)) return 'carries no `repositories` array';
2894
+ if (ids.some((id) => typeof id !== 'string' || id.trim() === '')) return 'carries a `repositories` entry that is not a non-empty registry id';
2895
+ if (ids.length === 0) {
2896
+ return inference === 'unknown' ? null : 'carries `repositories: []` without `"repositoriesInference": "unknown"`';
2897
+ }
2898
+ if (inference !== undefined && !REPOSITORY_INFERENCES.has(inference)) return `carries an unknown \`repositoriesInference\` value "${inference}"`;
2899
+ if (inference === 'unknown') return 'lists repositories beside `"repositoriesInference": "unknown"`';
2900
+ let known = null;
2901
+ try {
2902
+ const registry = JSON.parse(fs.readFileSync(path.join(TEAM_ROOT, 'repositories.json'), 'utf8'));
2903
+ known = new Set((Array.isArray(registry.repositories) ? registry.repositories : []).map((row) => row && row.id).filter((id) => typeof id === 'string'));
2904
+ } catch { known = null; }
2905
+ if (known && known.size > 0) {
2906
+ const unknownIds = ids.filter((id) => !known.has(id));
2907
+ if (unknownIds.length > 0) return `names ${unknownIds.join(', ')} — not in .ai.local/team/repositories.json`;
2908
+ }
2909
+ return null;
2910
+ }
2911
+ function repositoriesIntakeExemption(record) {
2912
+ const entry = record && record.intakeExemption;
2913
+ if (!entry || typeof entry !== 'object') return null;
2914
+ const approvedBy = typeof entry.approvedBy === 'string' ? entry.approvedBy.trim() : '';
2915
+ const reason = typeof entry.reason === 'string' ? entry.reason.trim() : '';
2916
+ const at = typeof entry.at === 'string' ? entry.at.trim() : '';
2917
+ if (approvedBy === '' || reason.length < 10 || !EXEMPTION_DATE.test(at)) return null;
2918
+ return { approvedBy, reason, at };
2919
+ }
2920
+ const repositoriesGateApplies = Boolean(finishedAttempt)
2921
+ && (completedAgent === 'task-router' || (!hadPriorCompletion && completedStepIndex === 0));
2922
+ if (repositoriesGateApplies) {
2923
+ const violation = repositoriesIntakeViolation(pipeline);
2924
+ if (violation) {
2925
+ const exemption = repositoriesIntakeExemption(pipeline);
2926
+ if (!exemption) {
2927
+ appendMetric({ type: 'intake_repositories_blocked', at: now, stepIndex: completedStepIndex, agent: completedAgent, violation, source: 'hook', attributionConfidence: 'high' });
2928
+ writeStatus({ state: 'blocked', phase: 'blocked', currentAgent: 'task-router' });
2929
+ out(`pipeline.json for "${slug}" ${violation}. Intake stays open until the repositories are recorded: set "repositories" to the ids in .ai.local/team/repositories.json with "repositoriesInference": "evidence-paths" (or "repo-scope-only"), or "repositories": [] with "repositoriesInference": "unknown" when the request names none. Rewrite pipeline.json through the task-router, then resume via /task-continue ${slug}. A task that predates the invariant carries "intakeExemption": { "approvedBy": "<human>", "reason": "<why, 10+ characters>", "at": "YYYY-MM-DD" } — a bare boolean is not accepted.`);
2930
+ process.exit(0);
2931
+ }
2932
+ appendMetric({ type: 'intake_repositories_exempted', at: now, stepIndex: completedStepIndex, agent: completedAgent, violation, approvedBy: exemption.approvedBy, reason: exemption.reason, exemptedAt: exemption.at, source: 'hook', attributionConfidence: 'high' });
2933
+ }
2934
+ }
2935
+ if (pipeline.autoChain === false) {
2936
+ writeStatus({});
2937
+ process.stdout.write('{}');
2938
+ process.exit(0);
2939
+ }
2940
+
2586
2941
 
2587
2942
  if (waveIndexes) {
2588
2943
  const waveAgents = waveIndexes.flatMap((i) => getStepAgents(steps[i]));
@@ -10,7 +10,7 @@ See @rules/README.md for mapping and loading strategy.
10
10
 
11
11
  - One topic per file; path scope — frontmatter `paths:`.
12
12
  - **Session-start rules** (no `paths:`) — 3–10: `android-app-core`, `boundaries`, `code-quality`, `ai-local-overlay`.
13
- - **Local overlay (session-start):** `ai-local-overlay` has no `paths:` and counts in the 3–10 budget. On every turn, run `list-ai-local.mjs` from the host hooks directory (`.cursor`, `.claude`, `.mavis`, or `.opencode`) with the paths this step will touch, apply the printed `.ai.local/rules/*.md` and `.ai.local/conventions.md`, and acknowledge `Using .ai.local: <rule-name>`. Guide: `docs/LOCAL-OVERLAY.md`.
13
+ - **Local overlay (session-start):** `ai-local-overlay` has no `paths:` and counts in the 3–10 budget. On every turn, run `list-ai-local.mjs` from the host hooks directory (`.cursor`, `.claude`, `.mavis`, `.opencode`, or `.zcode`) with the paths this step will touch, apply the printed `.ai.local/rules/*.md` and `.ai.local/conventions.md`, and acknowledge `Using .ai.local: <rule-name>`. Guide: `docs/LOCAL-OVERLAY.md`.
14
14
  - Requestable / paths: orchestrator, intake, feature-delivery, code-review, post-change-build, gradle-tooling, reference-features, security-android, technical-retro, domain globs.
15
15
  - Slash commands — `commands/`; skills — `skills/`; subagents — `agents/`.
16
16
 
@@ -61,7 +61,7 @@ Before you run the project gate and write the terminal validation receipt, self-
61
61
 
62
62
  Record a `## Self-review` block in `validation-report.md` (goal/AC coverage, evidence, alignment/drift). Optional loop (see the requestable `self-review-and-context-hygiene` contract). In-task self-learning loop: run `node .ai.local/scripts/run.mjs` at the pre-receipt self-review when the engine exists; capture one wrong-turn with `node .ai.local/scripts/signals.mjs --append '<json>'` and inspect read-only with `node .ai.local/scripts/run.mjs --status`. Keep the loop deterministic: it runs no model-driven pass — rule text is template-derived from the validated signature; a model-driven pass is not part of the loop, and if one is ever added it must be default-off and may write only to the staged band. Ratchet: no self-review / context-health pass / re-anchor ceremony for `bounded`/`spike` tasks (or the `light` profile).
63
63
 
64
- A self-review defect that changes the output appends one `review-ledger.md` row (`source: self`, `fair: yes`, `disposition: fixed`) before the receipt. Do not start implementation when `goal.md` is missing. Ledger rows go under the canonical header `| id | at | source | summary | fair | disposition | evidence | signature |`; after appending, run `node .ai.local/scripts/team-db.mjs ledger-check --slug <slug>` and fix any header it rejects.
64
+ A self-review defect that changes the output appends one `review-ledger.md` row (`source: self`, `fair: yes`, `disposition: fixed`) before the receipt. Do not start implementation when `goal.md` is missing. Ledger rows go under the canonical header `| id | at | source | summary | fair | disposition | owner | due | followUp | evidence | signature |`; a row written on or after 2026-11-22 that stays `open`, `accepted`, or `deferred` needs an `owner` that is a person and not a placeholder plus a `due` as YYYY-MM-DD, `accepted` and `deferred` also need a `followUp` naming an existing task slug. A row is legacy — never failed, counted in `legacyRows` — when it has no usable `at`, which is the one date git cannot supply, or when its `at` is before that date; neither clause reads the header. The header only decides a dated row: a post-cutoff row under a stale header still fails, so move the table to the canonical header. After appending, run `node .ai.local/scripts/team-db.mjs ledger-check --slug <slug>` and fix what it rejects.
65
65
 
66
66
  ## Output
67
67
 
@@ -66,7 +66,7 @@ Before you emit the terminal review receipt, self-audit the review artifact: eve
66
66
 
67
67
  Record a `## Self-review` block in `review.md` (goal/AC coverage, evidence, alignment/drift). Optional loop (see the requestable `self-review-and-context-hygiene` contract). In-task self-learning loop: run `node .ai.local/scripts/run.mjs` at the pre-receipt self-review when the engine exists; capture one wrong-turn with `node .ai.local/scripts/signals.mjs --append '<json>'` and inspect read-only with `node .ai.local/scripts/run.mjs --status`. Keep the loop deterministic: it runs no model-driven pass — rule text is template-derived from the validated signature; a model-driven pass is not part of the loop, and if one is ever added it must be default-off and may write only to the staged band. Ratchet: no self-review / context-health pass / re-anchor ceremony for `bounded`/`spike` tasks (or the `light` profile).
68
68
 
69
- A self-review defect that changes the output appends one `review-ledger.md` row (`source: self`, `fair: yes`, `disposition: fixed`) before the receipt. Do not start implementation when `goal.md` is missing. Append each finding to `review-ledger.md` (`disposition: open`) before the receipt. Ledger rows go under the canonical header `| id | at | source | summary | fair | disposition | evidence | signature |`; after appending, run `node .ai.local/scripts/team-db.mjs ledger-check --slug <slug>` and fix any header it rejects.
69
+ A self-review defect that changes the output appends one `review-ledger.md` row (`source: self`, `fair: yes`, `disposition: fixed`) before the receipt. Do not start implementation when `goal.md` is missing. Append each finding to `review-ledger.md` (`disposition: open`) before the receipt. Ledger rows go under the canonical header `| id | at | source | summary | fair | disposition | owner | due | followUp | evidence | signature |`; a row written on or after 2026-11-22 that stays `open`, `accepted`, or `deferred` needs an `owner` that is a person and not a placeholder plus a `due` as YYYY-MM-DD, `accepted` and `deferred` also need a `followUp` naming an existing task slug. A row is legacy — never failed, counted in `legacyRows` — when it has no usable `at`, which is the one date git cannot supply, or when its `at` is before that date; neither clause reads the header. The header only decides a dated row: a post-cutoff row under a stale header still fails, so move the table to the canonical header. After appending, run `node .ai.local/scripts/team-db.mjs ledger-check --slug <slug>` and fix what it rejects.
70
70
 
71
71
  ## Review artifact
72
72
 
@@ -101,7 +101,7 @@ Before you set `fixApplied: true` and emit the terminal receipt, self-audit the
101
101
 
102
102
  Record a `## Self-review` block in `debug-report.md` (goal/AC coverage, evidence, alignment/drift). Optional loop (see the requestable `self-review-and-context-hygiene` contract). In-task self-learning loop: run `node .ai.local/scripts/run.mjs` at the pre-receipt self-review when the engine exists; capture one wrong-turn with `node .ai.local/scripts/signals.mjs --append '<json>'` and inspect read-only with `node .ai.local/scripts/run.mjs --status`. Keep the loop deterministic: it runs no model-driven pass — rule text is template-derived from the validated signature; a model-driven pass is not part of the loop, and if one is ever added it must be default-off and may write only to the staged band. Ratchet: no self-review / context-health pass / re-anchor ceremony for `bounded`/`spike` tasks (or the `light` profile).
103
103
 
104
- A self-review defect that changes the output appends one `review-ledger.md` row (`source: self`, `fair: yes`, `disposition: fixed`) before the receipt. Do not start implementation when `goal.md` is missing. Ledger rows go under the canonical header `| id | at | source | summary | fair | disposition | evidence | signature |`; after appending, run `node .ai.local/scripts/team-db.mjs ledger-check --slug <slug>` and fix any header it rejects.
104
+ A self-review defect that changes the output appends one `review-ledger.md` row (`source: self`, `fair: yes`, `disposition: fixed`) before the receipt. Do not start implementation when `goal.md` is missing. Ledger rows go under the canonical header `| id | at | source | summary | fair | disposition | owner | due | followUp | evidence | signature |`; a row written on or after 2026-11-22 that stays `open`, `accepted`, or `deferred` needs an `owner` that is a person and not a placeholder plus a `due` as YYYY-MM-DD, `accepted` and `deferred` also need a `followUp` naming an existing task slug. A row is legacy — never failed, counted in `legacyRows` — when it has no usable `at`, which is the one date git cannot supply, or when its `at` is before that date; neither clause reads the header. The header only decides a dated row: a post-cutoff row under a stale header still fails, so move the table to the canonical header. After appending, run `node .ai.local/scripts/team-db.mjs ledger-check --slug <slug>` and fix what it rejects.
105
105
 
106
106
  ## MCP usage
107
107
 
@@ -103,7 +103,7 @@ Before you emit the terminal implementation receipt (per wave for multi-wave wor
103
103
 
104
104
  Record a `## Self-review` block in `implementation.md` (goal/AC coverage, evidence, alignment/drift). Optional loop (see the requestable `self-review-and-context-hygiene` contract). In-task self-learning loop: run `node .ai.local/scripts/run.mjs` at the pre-receipt self-review when the engine exists; capture one wrong-turn with `node .ai.local/scripts/signals.mjs --append '<json>'` and inspect read-only with `node .ai.local/scripts/run.mjs --status`. Keep the loop deterministic: it runs no model-driven pass — rule text is template-derived from the validated signature; a model-driven pass is not part of the loop, and if one is ever added it must be default-off and may write only to the staged band. Ratchet: no self-review / context-health pass / re-anchor ceremony for `bounded`/`spike` tasks (or the `light` profile).
105
105
 
106
- A self-review defect that changes the output appends one `review-ledger.md` row (`source: self`, `fair: yes`, `disposition: fixed`) before the receipt. Do not start implementation when `goal.md` is missing. Ledger rows go under the canonical header `| id | at | source | summary | fair | disposition | evidence | signature |`; after appending, run `node .ai.local/scripts/team-db.mjs ledger-check --slug <slug>` and fix any header it rejects.
106
+ A self-review defect that changes the output appends one `review-ledger.md` row (`source: self`, `fair: yes`, `disposition: fixed`) before the receipt. Do not start implementation when `goal.md` is missing. Ledger rows go under the canonical header `| id | at | source | summary | fair | disposition | owner | due | followUp | evidence | signature |`; a row written on or after 2026-11-22 that stays `open`, `accepted`, or `deferred` needs an `owner` that is a person and not a placeholder plus a `due` as YYYY-MM-DD, `accepted` and `deferred` also need a `followUp` naming an existing task slug. A row is legacy — never failed, counted in `legacyRows` — when it has no usable `at`, which is the one date git cannot supply, or when its `at` is before that date; neither clause reads the header. The header only decides a dated row: a post-cutoff row under a stale header still fails, so move the table to the canonical header. After appending, run `node .ai.local/scripts/team-db.mjs ledger-check --slug <slug>` and fix what it rejects.
107
107
 
108
108
  ## UX design (behavioral)
109
109
 
@@ -63,7 +63,7 @@ Before you emit the terminal analysis receipt, self-audit the goal frame and dec
63
63
 
64
64
  Record a `## Self-review` block in `brief.md` (goal/AC coverage, evidence, alignment/drift). Optional loop (see the requestable `self-review-and-context-hygiene` contract). In-task self-learning loop: run `node .ai.local/scripts/run.mjs` at the pre-receipt self-review when the engine exists; capture one wrong-turn with `node .ai.local/scripts/signals.mjs --append '<json>'` and inspect read-only with `node .ai.local/scripts/run.mjs --status`. Keep the loop deterministic: it runs no model-driven pass — rule text is template-derived from the validated signature; a model-driven pass is not part of the loop, and if one is ever added it must be default-off and may write only to the staged band. Ratchet: no self-review / context-health pass / re-anchor ceremony for `bounded`/`spike` tasks (or the `light` profile).
65
65
 
66
- A self-review defect that changes the output appends one `review-ledger.md` row (`source: self`, `fair: yes`, `disposition: fixed`) before the receipt. Do not start implementation when `goal.md` is missing. Ledger rows go under the canonical header `| id | at | source | summary | fair | disposition | evidence | signature |`; after appending, run `node .ai.local/scripts/team-db.mjs ledger-check --slug <slug>` and fix any header it rejects.
66
+ A self-review defect that changes the output appends one `review-ledger.md` row (`source: self`, `fair: yes`, `disposition: fixed`) before the receipt. Do not start implementation when `goal.md` is missing. Ledger rows go under the canonical header `| id | at | source | summary | fair | disposition | owner | due | followUp | evidence | signature |`; a row written on or after 2026-11-22 that stays `open`, `accepted`, or `deferred` needs an `owner` that is a person and not a placeholder plus a `due` as YYYY-MM-DD, `accepted` and `deferred` also need a `followUp` naming an existing task slug. A row is legacy — never failed, counted in `legacyRows` — when it has no usable `at`, which is the one date git cannot supply, or when its `at` is before that date; neither clause reads the header. The header only decides a dated row: a post-cutoff row under a stale header still fails, so move the table to the canonical header. After appending, run `node .ai.local/scripts/team-db.mjs ledger-check --slug <slug>` and fix what it rejects.
67
67
 
68
68
  ## Clarification cycle
69
69
 
@@ -171,6 +171,8 @@ Do **not** add a dedicated `spec-author` agent for `docs/specs/**`. Do not requi
171
171
 
172
172
  **specMode (optional `pipeline.json` field):** `none` for spike/research; `generate` for `spec-gen` / `/spec-start`; `consume` default when INDEX exists. Echo top-level `specMode`. Brief `## Spec mode` wins on conflict.
173
173
 
174
+ **repositories (mandatory `pipeline.json` field):** echo `"repositories": [<ids>]` and `"repositoriesInference": "evidence-paths" | "repo-scope-only" | "unknown" | "ambiguous"` immediately after `specMode`, before `summary`; the ids come from `.ai.local/team/repositories.json` and are never defaulted to the workspace repository. Then record the same list as link rows through `node .ai.local/scripts/team-db.mjs repositories apply --file -` — one `{"links": [{taskSlug, repositoryId, source: "intake", inference: "evidence-paths"}]}` envelope per touched repository (the verb takes the envelope, never a bare row). When the request names no repository, write `"repositories": []` with `"unknown"` and one `{"attributions": [{taskSlug, verdict: "unknown", evidence: ""}]}` envelope; `yarn check:task-repositories` fails a folder without the field.
175
+
174
176
  Do **not** add a pipeline step for `spec-discovery`. Instruct analyst to load that skill only when the user/AC asks research-before-spec.
175
177
 
176
178
  ## Runtime initialization
@@ -11,6 +11,7 @@ Slash commands are copied to `.claude/commands/` on `ai-rules init claude --pres
11
11
  | `/technical-retro [slug]` | Retro; with slug — “Agent work” block |
12
12
  | `update.md` | Reinstall each installed tool with the preset recorded at init |
13
13
  | `migrate-tasks.md` | Create or reconcile `.ai.local/team/team.db`; writes only the delta |
14
+ | `rr-migrate-repositories.md` | Scan repositories on disk, add the missing ones to the local registry, and project the file into `team.db` |
14
15
 
15
16
  ## `/task` examples
16
17