@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
@@ -845,6 +845,74 @@ SELECT
845
845
  FROM tasks t;
846
846
  `;
847
847
 
848
+ /**
849
+ * Migration 8: a finding that stays open carries a name and a date. Three
850
+ * nullable TEXT columns, so a version-7 file migrates in place and historical
851
+ * rows insert NULL — no backfill and no row rewrite.
852
+ */
853
+ export const LEDGER_OWNER_SQL = SQL`ALTER TABLE review_ledger ADD COLUMN owner TEXT;
854
+
855
+ ALTER TABLE review_ledger ADD COLUMN due TEXT;
856
+
857
+ ALTER TABLE review_ledger ADD COLUMN follow_up TEXT;
858
+ `;
859
+
860
+ /**
861
+ * Migration 9: the repository registry projection. Two tables; `status` is
862
+ * validated on write rather than by a `CHECK`, so a hand-edited file still
863
+ * projects its row. `task_slug` carries no foreign key on purpose: a link may
864
+ * name a folder that is not projected yet, and `tasks` rows are pruned while
865
+ * the file keeps naming them.
866
+ */
867
+ export const REPOSITORIES_SQL = SQL`CREATE TABLE repositories (
868
+ id TEXT PRIMARY KEY,
869
+ name TEXT NOT NULL,
870
+ locator TEXT NOT NULL,
871
+ description TEXT,
872
+ labels_json TEXT,
873
+ status TEXT NOT NULL,
874
+ revision INTEGER NOT NULL CHECK (revision >= 1),
875
+ created_at TEXT NOT NULL,
876
+ updated_at TEXT NOT NULL,
877
+ content_hash TEXT NOT NULL,
878
+ parse_error TEXT,
879
+ projected_at TEXT NOT NULL,
880
+ first_seen_at TEXT NOT NULL,
881
+ last_seen_at TEXT NOT NULL,
882
+ absent_at TEXT
883
+ ) STRICT;
884
+
885
+ CREATE TABLE task_repositories (
886
+ task_slug TEXT NOT NULL,
887
+ repository_id TEXT NOT NULL REFERENCES repositories(id) ON DELETE CASCADE,
888
+ added_at TEXT NOT NULL,
889
+ source TEXT NOT NULL,
890
+ inference TEXT NOT NULL,
891
+ evidence TEXT NOT NULL,
892
+ content_hash TEXT NOT NULL,
893
+ projected_at TEXT NOT NULL,
894
+ PRIMARY KEY (task_slug, repository_id)
895
+ ) STRICT;
896
+
897
+ CREATE INDEX idx_repositories_absent ON repositories(absent_at);
898
+ CREATE INDEX idx_repositories_status_name ON repositories(status, name COLLATE NOCASE);
899
+ CREATE INDEX idx_task_repositories_repository ON task_repositories(repository_id);
900
+ `;
901
+
902
+ /**
903
+ * Migration 10: one verdict per task that resolved to no repository, so the
904
+ * task detail can tell "not recorded" from "attribution ambiguous" without a
905
+ * file read in a route. `evidence`, `recordedAt` and `source` stay in the file
906
+ * because no operation serves them.
907
+ */
908
+ export const REPOSITORY_ATTRIBUTIONS_SQL = SQL`CREATE TABLE task_repository_attributions (
909
+ task_slug TEXT PRIMARY KEY,
910
+ verdict TEXT NOT NULL,
911
+ content_hash TEXT NOT NULL,
912
+ projected_at TEXT NOT NULL
913
+ ) STRICT;
914
+ `;
915
+
848
916
  const sha256 = (value) => crypto.createHash('sha256').update(value).digest('hex');
849
917
  /**
850
918
  * Ordered, immutable migrations. The literal checksum is verified before any
@@ -893,6 +961,24 @@ export const MIGRATIONS = [
893
961
  sql: BEHAVIOR_RESEARCH_SQL,
894
962
  checksum: '5a64fd028118ef7b3831006a13e5ca9ac6bd17ee5ce3dfa5441d7946cf4694e0',
895
963
  },
964
+ {
965
+ version: 8,
966
+ name: '0008-ledger-owner',
967
+ sql: LEDGER_OWNER_SQL,
968
+ checksum: '31279ac1f6ba980e10d79fef8aa97226d4afcb4cee0bdf8fbc3f1d0d286f2349',
969
+ },
970
+ {
971
+ version: 9,
972
+ name: '0009-repositories',
973
+ sql: REPOSITORIES_SQL,
974
+ checksum: 'bffba731a590f8d59bb8f59c99316742570aba6b2ea524b0346cd92c1f90d25d',
975
+ },
976
+ {
977
+ version: 10,
978
+ name: '0010-repository-attributions',
979
+ sql: REPOSITORY_ATTRIBUTIONS_SQL,
980
+ checksum: '4677b2b62b5b9c8cb571f5706abac97487175c8251facdab6b42bf2371f2720e',
981
+ },
896
982
  ];
897
983
 
898
984
  /** Highest migration version shipped by this module. */
@@ -1209,6 +1295,25 @@ export function computeSchemaFingerprint(db) {
1209
1295
  return digest.digest('hex');
1210
1296
  }
1211
1297
 
1298
+ let expectedFingerprintCache = null;
1299
+
1300
+ /**
1301
+ * The fingerprint the code's own migration chain produces, computed once in a
1302
+ * scratch in-memory database. A store whose DDL equals it carries no foreign
1303
+ * change, whatever `schema_meta.fingerprint` last recorded.
1304
+ */
1305
+ export function expectedSchemaFingerprint(sqlite) {
1306
+ if (expectedFingerprintCache) return expectedFingerprintCache;
1307
+ const scratch = new sqlite.DatabaseSync(':memory:');
1308
+ try {
1309
+ applyMigrations(scratch, MIGRATIONS);
1310
+ expectedFingerprintCache = computeSchemaFingerprint(scratch);
1311
+ } finally {
1312
+ scratch.close();
1313
+ }
1314
+ return expectedFingerprintCache;
1315
+ }
1316
+
1212
1317
  export function integrityCheck(db) {
1213
1318
  const row = db.prepare('PRAGMA integrity_check').get();
1214
1319
  const value = row ? Object.values(row)[0] : null;
@@ -1350,8 +1455,14 @@ export async function readNewerSchemaModule() {
1350
1455
  * Open, migrate, verify and return a connection handle.
1351
1456
  *
1352
1457
  * `rebuild` always moves the file aside and recreates it. `noRebuild` turns a
1353
- * fingerprint mismatch into `E_SCHEMA_MISMATCH` instead of a rebuild. Read-only
1354
- * opens never migrate or rebuild; they fail with a named schema code.
1458
+ * fingerprint mismatch into `E_SCHEMA_MISMATCH` instead of a rebuild, with one
1459
+ * exception: a record that lags a DDL the chain produces is a stale record, not
1460
+ * drift, so it is overwritten in place and every row is kept. A record that
1461
+ * disagrees with a DDL the chain does not produce rebuilds with a
1462
+ * `.mismatch-<stamp>` copy, or fails under `noRebuild`/read-only. A file that
1463
+ * carries no fingerprint record at all is stamped with the DDL it opened with,
1464
+ * without a comparison. Read-only opens never migrate or rebuild; they fail with
1465
+ * a named schema code.
1355
1466
  */
1356
1467
  export function openTeamDb(options = {}) {
1357
1468
  const sqlite = loadSqlite(options.env ?? process.env);
@@ -1418,6 +1529,10 @@ export function openTeamDb(options = {}) {
1418
1529
  }
1419
1530
  assertNoDrift(listAppliedMigrations(db), MIGRATIONS);
1420
1531
 
1532
+ // The stored fingerprint describes the DDL of the file as opened; a
1533
+ // mismatch is resolved below against the DDL the code's chain produces.
1534
+ const storedFingerprint = readSchemaMeta(db, 'fingerprint');
1535
+
1421
1536
  if (!readOnly) {
1422
1537
  if (current < SCHEMA_VERSION) applyMigrations(db, MIGRATIONS);
1423
1538
  // FTS5 is created once with the database; re-issuing the virtual-table
@@ -1436,28 +1551,42 @@ export function openTeamDb(options = {}) {
1436
1551
 
1437
1552
  const searchMode = readSearchMode(db);
1438
1553
  const fingerprint = computeSchemaFingerprint(db);
1439
- const stored = readSchemaMeta(db, 'fingerprint');
1440
- if (stored && stored !== fingerprint) {
1441
- if (readOnly || noRebuild) {
1554
+ if (storedFingerprint && storedFingerprint !== fingerprint) {
1555
+ // When the DDL is exactly what the code's own chain produces, the stored
1556
+ // value is a stale record, not drift: an older store migrated in place,
1557
+ // or a migration was interrupted before the new fingerprint landed.
1558
+ // Refresh it and keep every row; only a DDL the chain does not produce
1559
+ // is foreign drift, and only that moves the file aside.
1560
+ if (fingerprint === expectedSchemaFingerprint(sqlite)) {
1561
+ if (!readOnly) writeSchemaMeta(db, 'fingerprint', fingerprint);
1562
+ else {
1563
+ teamDbFail(
1564
+ 'E_SCHEMA_MISMATCH',
1565
+ `the stored schema fingerprint ${storedFingerprint} is stale for the current DDL ${fingerprint}; a read-only open cannot record it — run "team-db.mjs sync"`,
1566
+ 2,
1567
+ );
1568
+ }
1569
+ } else if (readOnly || noRebuild) {
1442
1570
  teamDbFail(
1443
1571
  'E_SCHEMA_MISMATCH',
1444
- `schema fingerprint ${fingerprint} does not match the stored ${stored}; run "team-db.mjs sync"`,
1572
+ `schema fingerprint ${fingerprint} does not match the stored ${storedFingerprint}; run "team-db.mjs sync"`,
1445
1573
  2,
1446
1574
  );
1447
- }
1448
- mismatchCount += 1;
1449
- if (mismatchCount > 1) {
1575
+ } else {
1576
+ mismatchCount += 1;
1577
+ if (mismatchCount > 1) {
1578
+ db.close();
1579
+ teamDbFail('E_SCHEMA_REBUILD_FAILED', `${dbPath} still mismatches after a rebuild`, 2);
1580
+ }
1450
1581
  db.close();
1451
- teamDbFail('E_SCHEMA_REBUILD_FAILED', `${dbPath} still mismatches after a rebuild`, 2);
1582
+ moveDatabaseAside(dbPath, 'mismatch');
1583
+ rebuilt = true;
1584
+ continue;
1452
1585
  }
1453
- db.close();
1454
- moveDatabaseAside(dbPath, 'mismatch');
1455
- rebuilt = true;
1456
- continue;
1457
1586
  }
1458
1587
 
1459
1588
  if (!readOnly) {
1460
- if (!stored) writeSchemaMeta(db, 'fingerprint', fingerprint);
1589
+ if (!storedFingerprint) writeSchemaMeta(db, 'fingerprint', fingerprint);
1461
1590
  if (!readSchemaMeta(db, 'sqlite_version')) writeSchemaMeta(db, 'sqlite_version', sqliteVersion(db));
1462
1591
  if (!readSchemaMeta(db, 'created_at')) writeSchemaMeta(db, 'created_at', new Date().toISOString());
1463
1592
  chmodDatabaseFiles(dbPath);
@@ -173,8 +173,12 @@ export const linkIdOf = (itemId, taskSlug) => `${itemId}--${taskSlug}`;
173
173
  export const sequenceFilePath = (teamRoot) => path.join(trackerPaths(teamRoot).root, 'sequence.json');
174
174
  const idMigrationFilePath = (teamRoot) => path.join(trackerPaths(teamRoot).root, 'id-migration.json');
175
175
 
176
- /** The monotonic item-id sequence; max(existing) covers a lost sequence file. */
177
- const nextItemId = (teamRoot) => {
176
+ /**
177
+ * The monotonic item-id sequence; max(existing) covers a lost sequence file.
178
+ * Peek reserves without consuming: the caller commits only after the item passes
179
+ * validation, so a rejected payload never burns an id.
180
+ */
181
+ const peekItemId = (teamRoot) => {
178
182
  const current = listItemIds(teamRoot).reduce((max, id) => Math.max(max, id), 0);
179
183
  let reserved = 0;
180
184
  try {
@@ -183,9 +187,11 @@ const nextItemId = (teamRoot) => {
183
187
  } catch {
184
188
  /* a missing or unreadable sequence falls back to the file maximum */
185
189
  }
186
- const nextId = Math.max(current + 1, reserved, 1);
187
- writeAtomic(sequenceFilePath(teamRoot), `${JSON.stringify({ schemaVersion: 1, nextId: nextId + 1 }, null, 2)}\n`);
188
- return nextId;
190
+ return Math.max(current + 1, reserved, 1);
191
+ };
192
+
193
+ const commitItemId = (teamRoot, id) => {
194
+ writeAtomic(sequenceFilePath(teamRoot), `${JSON.stringify({ schemaVersion: 1, nextId: id + 1 }, null, 2)}\n`);
189
195
  };
190
196
 
191
197
  /** Both directories are created on first write (`mkdir -p` inside the CLI). */
@@ -963,7 +969,7 @@ export function addTrackerItem(teamRoot, payload, options = {}) {
963
969
  if (!isRecord(payload)) reject('E_SCHEMA', 'tracker add payload must be an object');
964
970
  return withTrackerLock(teamRoot, () => {
965
971
  const items = readAllItems(teamRoot);
966
- const id = nextItemId(teamRoot);
972
+ const id = peekItemId(teamRoot);
967
973
  const now = nowIso();
968
974
  const createdAt = payload.createdAt ?? now;
969
975
  const item = {
@@ -991,6 +997,7 @@ export function addTrackerItem(teamRoot, payload, options = {}) {
991
997
  validateItemIdentity(item, id);
992
998
  validateItemGraph(item, items);
993
999
  validateTransition(null, item);
1000
+ commitItemId(teamRoot, id);
994
1001
  writeItemFile(teamRoot, item);
995
1002
  return item;
996
1003
  });
@@ -1031,8 +1038,12 @@ export function setTrackerItem(teamRoot, id, payload, options = {}) {
1031
1038
  type = 'deps-changed';
1032
1039
  }
1033
1040
  next.history = capHistory([...(existing.history ?? []), { at: now, type, actor, detail: null }], MAX_ITEM_HISTORY);
1034
- if (next.status === 'cancelled' || next.status === 'superseded') {
1035
- expireEntriesForItem(teamRoot, id, next.status === 'cancelled' ? 'item-cancelled' : 'item-superseded', actor);
1041
+ // A terminal item closes its open requests in the same transaction: `done`
1042
+ // is derived from the task row and never stored, so a completed item would
1043
+ // otherwise leave a `claimed` entry that `prune` can never retire.
1044
+ const terminalDetail = { cancelled: 'item-cancelled', superseded: 'item-superseded', completed: 'item-completed' }[next.status];
1045
+ if (terminalDetail !== undefined && next.status !== existing.status) {
1046
+ expireEntriesForItem(teamRoot, id, terminalDetail, actor);
1036
1047
  }
1037
1048
  writeItemFile(teamRoot, next);
1038
1049
  return next;
@@ -1626,10 +1637,18 @@ export function drainTracker(teamRoot, { claim = false, actor = 'operator' } = {
1626
1637
  export function pruneTrackerEntries(teamRoot, { olderThanDays = DEFAULT_PRUNE_DAYS } = {}) {
1627
1638
  return withTrackerLock(teamRoot, () => {
1628
1639
  const cutoff = Date.now() - olderThanDays * 24 * 60 * 60 * 1000;
1640
+ const taskStates = readTaskStates(teamRoot);
1629
1641
  let pruned = 0;
1630
1642
  for (const [entryId, entry] of readAllEntries(teamRoot)) {
1631
- if (entry.status !== 'cancelled' && entry.status !== 'expired') continue;
1632
- if (!entry.finishedAt || Date.parse(entry.finishedAt) >= cutoff) continue;
1643
+ // `done` is derived from the task row and never stored: a completed item's
1644
+ // entry stays `claimed`, so the stored vocabulary alone cannot retire it.
1645
+ const taskSlug = entry.taskSlug ?? `tracker-${entry.itemId}`;
1646
+ const effective = effectiveEntryStatus(entry, taskStates.get(taskSlug) ?? null);
1647
+ if (!['cancelled', 'expired', 'done'].includes(effective)) continue;
1648
+ // A derived-done entry has no finish time of its own; its last known
1649
+ // activity is the oldest evidence of when the request left the queue.
1650
+ const endedAt = entry.finishedAt ?? entry.claimedAt ?? entry.requestedAt;
1651
+ if (!endedAt || Date.parse(endedAt) >= cutoff) continue;
1633
1652
  fs.rmSync(entryFilePath(teamRoot, entryId), { force: true });
1634
1653
  pruned += 1;
1635
1654
  }
@@ -25,6 +25,11 @@
25
25
  * jobs enable|disable <id> [--root <team-dir>] [--json]
26
26
  * jobs reconcile [--root <team-dir>] [--json]
27
27
  * jobs run --id <id> [--root <team-dir>] [--json]
28
+ * repositories list|project [--root <team-dir>] [--json] [--quiet]
29
+ * repositories apply --file <path|-> [--dry-run] [--root <team-dir>] [--json]
30
+ * repositories put --file <path|-> [--dry-run] [--root <team-dir>] [--json]
31
+ * repositories delete <id> [--force] [--revision <n>] [--root <team-dir>]
32
+ * [--json] the repository registry and its projection
28
33
  * schedule [--root <team-dir>] [--once] [--interval-ms <n>] [--grace-ms <n>]
29
34
  * [--drain-ms <n>] [--json] [--quiet] the scheduler timer
30
35
  * tracker add|set|show|list|ready|validate|import|enqueue|cancel|drain|recover|prune
@@ -69,11 +74,14 @@ import {
69
74
  import {
70
75
  deleteTaskProjection,
71
76
  describeSyncResult,
77
+ LEDGER_HEADER_ROW,
72
78
  listTaskDirectories,
73
79
  parseReviewLedgerMarkdown,
80
+ runRepositoriesCommand,
74
81
  searchProjection,
75
82
  syncProjection,
76
83
  syncTrackerProjection,
84
+ validateLedgerRows,
77
85
  } from './team-db-project.mjs';
78
86
  import {
79
87
  isLeaseFresh,
@@ -104,6 +112,10 @@ const USAGE = `usage:
104
112
  team-db.mjs jobs enable|disable <id> [--root <team-dir>] [--json]
105
113
  team-db.mjs jobs reconcile [--root <team-dir>] [--json]
106
114
  team-db.mjs jobs run --id <id> [--root <team-dir>] [--json]
115
+ team-db.mjs repositories list|project [--root <team-dir>] [--json] [--quiet]
116
+ team-db.mjs repositories apply --file <path|-> [--dry-run] [--root <team-dir>] [--json]
117
+ team-db.mjs repositories put --file <path|-> [--dry-run] [--root <team-dir>] [--json]
118
+ team-db.mjs repositories delete <id> [--force] [--revision <n>] [--root <team-dir>] [--json]
107
119
  team-db.mjs schedule [--root <team-dir>] [--once] [--interval-ms <n>]
108
120
  [--grace-ms <n>] [--drain-ms <n>] [--json] [--quiet]
109
121
  team-db.mjs tracker add --file <path|-> [--root <team-dir>] [--json] [--quiet]
@@ -138,6 +150,7 @@ const VALUE_FLAGS = new Set([
138
150
  'link',
139
151
  'run',
140
152
  'limit',
153
+ 'revision',
141
154
  ]);
142
155
  const BOOLEAN_FLAGS = new Set([
143
156
  'quiet',
@@ -156,8 +169,9 @@ const BOOLEAN_FLAGS = new Set([
156
169
  'once',
157
170
  'ready',
158
171
  'claim',
172
+ 'force',
159
173
  ]);
160
- const COMMANDS = new Set(['init', 'check', 'search', 'sync', 'delete', 'migrate-tasks', 'ledger-check', 'serve', 'jobs', 'schedule', 'tracker', 'task-run']);
174
+ const COMMANDS = new Set(['init', 'check', 'search', 'sync', 'delete', 'migrate-tasks', 'ledger-check', 'serve', 'jobs', 'schedule', 'tracker', 'task-run', 'repositories']);
161
175
  const ALLOWED_FLAGS = {
162
176
  init: new Set(['root', 'rebuild']),
163
177
  check: new Set(['root']),
@@ -171,6 +185,7 @@ const ALLOWED_FLAGS = {
171
185
  schedule: new Set(['root', 'json', 'quiet', 'once', 'interval-ms', 'grace-ms', 'drain-ms']),
172
186
  tracker: new Set(['root', 'json', 'quiet', 'file', 'dry-run', 'older-than', 'status', 'ready', 'claim']),
173
187
  'task-run': new Set(['root', 'json', 'task', 'item', 'link', 'run']),
188
+ repositories: new Set(['root', 'json', 'quiet', 'file', 'dry-run', 'force', 'revision']),
174
189
  };
175
190
 
176
191
  const JOBS_POSITIONALS = new Set([
@@ -205,10 +220,13 @@ const TRACKER_POSITIONALS = new Set([
205
220
 
206
221
  const TASK_RUN_POSITIONALS = new Set(['start', 'stop', 'supervise', 'list', 'show', 'status', 'ensure']);
207
222
 
223
+ const REPOSITORIES_POSITIONALS = new Set(['list', 'project', 'apply', 'put', 'delete']);
224
+
208
225
  const POSITIONAL_VERBS = {
209
226
  jobs: JOBS_POSITIONALS,
210
227
  tracker: TRACKER_POSITIONALS,
211
228
  'task-run': TASK_RUN_POSITIONALS,
229
+ repositories: REPOSITORIES_POSITIONALS,
212
230
  };
213
231
 
214
232
  const parseArgs = (argv) => {
@@ -495,19 +513,22 @@ const runMigrateTasks = (flags) => {
495
513
  };
496
514
 
497
515
  const LEDGER_FILE = 'review-ledger.md';
498
- const LEDGER_HEADER_HINT =
499
- 'the canonical header is | id | at | source | summary | fair | disposition | evidence | signature |';
516
+ const LEDGER_HEADER_HINT = `the canonical header is ${LEDGER_HEADER_ROW}`;
500
517
 
501
518
  /**
502
519
  * Validate the review-ledger tables of one task or of every task. A table the
503
520
  * parser cannot map is what makes the projection drop a task's ledger rows, so
504
521
  * the check runs before a producer appends a row, not after the UI asks for it.
522
+ * The owner contract (`validateLedgerRows`) is the second half: one source for
523
+ * the message text the chain hook relays verbatim.
505
524
  */
506
525
  const runLedgerCheck = (flags) => {
507
526
  const teamRoot = teamRootFrom(flags);
508
527
  const slugs = flags.slug ? [flags.slug] : listTaskDirectories(teamRoot);
509
528
  const failures = [];
510
529
  let checked = 0;
530
+ let legacyRows = 0;
531
+ let undatedRows = 0;
511
532
  for (const slug of slugs) {
512
533
  const file = path.join(teamRoot, 'tasks', slug, LEDGER_FILE);
513
534
  if (!fs.existsSync(file)) continue;
@@ -520,16 +541,26 @@ const runLedgerCheck = (flags) => {
520
541
  for (const reason of parsed.errors ?? []) {
521
542
  failures.push({ path: `${slug}/${LEDGER_FILE}`, reason });
522
543
  }
544
+ const verdict = validateLedgerRows(parsed.rows, { teamRoot, taskSlug: slug });
545
+ legacyRows += verdict.legacyRows;
546
+ undatedRows += verdict.undatedRows;
547
+ for (const reason of verdict.failures) {
548
+ failures.push({ path: `${slug}/${LEDGER_FILE}`, reason });
549
+ }
523
550
  }
524
551
  if (flags.json) {
525
- process.stdout.write(`${JSON.stringify({ ok: failures.length === 0, checked, failures })}\n`);
552
+ process.stdout.write(
553
+ `${JSON.stringify({ ok: failures.length === 0, checked, legacyRows, undatedRows, failures })}\n`,
554
+ );
526
555
  return failures.length === 0 ? 0 : 1;
527
556
  }
528
557
  for (const failure of failures) {
529
558
  process.stderr.write(`${failure.path}: ${failure.reason}\n`);
530
559
  }
531
560
  if (failures.length > 0) process.stderr.write(`ledger-check: ${LEDGER_HEADER_HINT}\n`);
532
- process.stdout.write(`ledger-check: checked=${checked} failed=${failures.length}\n`);
561
+ process.stdout.write(
562
+ `ledger-check: checked=${checked} failed=${failures.length} legacyRows=${legacyRows} undatedRows=${undatedRows}\n`,
563
+ );
533
564
  return failures.length === 0 ? 0 : 1;
534
565
  };
535
566
 
@@ -559,6 +590,34 @@ const runJobs = (flags, positionals) => {
559
590
  }
560
591
  };
561
592
 
593
+ const runRepositories = (flags, positionals) => {
594
+ const [subcommand = 'list', positionalId] = positionals;
595
+ try {
596
+ const result = runRepositoriesCommand(subcommand, positionalId ? [positionalId] : [], {
597
+ root: flags.root,
598
+ json: Boolean(flags.json),
599
+ quiet: Boolean(flags.quiet),
600
+ file: flags.file,
601
+ dryRun: Boolean(flags['dry-run']),
602
+ force: Boolean(flags.force),
603
+ revision: flags.revision === undefined ? undefined : Number(flags.revision),
604
+ });
605
+ if (result.output) process.stdout.write(result.output);
606
+ return result.exitCode;
607
+ } catch (error) {
608
+ const code = error instanceof TeamDbError ? error.code : 'E_INTERNAL';
609
+ const exitCode = error instanceof TeamDbError ? error.exitCode : 2;
610
+ const failure = { ok: false, code, message: error.message };
611
+ if (error instanceof TeamDbError && typeof error.parameter === 'string') failure.parameter = error.parameter;
612
+ // The delete guard names the linked-task count; the API lifts it into
613
+ // `details.linkedTasks` without parsing prose.
614
+ if (error && Number.isInteger(error.linkedTasks)) failure.linkedTasks = error.linkedTasks;
615
+ if (flags.json) process.stdout.write(`${JSON.stringify(failure)}\n`);
616
+ process.stderr.write(`${error.message}\n`);
617
+ return exitCode;
618
+ }
619
+ };
620
+
562
621
  const runTaskRunner = async (flags, positionals) => {
563
622
  const [subcommand = 'status'] = positionals;
564
623
  try {
@@ -724,6 +783,7 @@ export async function runCli(argv) {
724
783
  if (command === 'ledger-check') return runLedgerCheck(flags);
725
784
  if (command === 'serve') return runServe(flags);
726
785
  if (command === 'jobs') return runJobs(flags, positionals);
786
+ if (command === 'repositories') return runRepositories(flags, positionals);
727
787
  if (command === 'tracker') return runTracker(flags, positionals);
728
788
  if (command === 'task-run') return runTaskRunner(flags, positionals);
729
789
  if (command === 'schedule') return runSchedule(flags);
@@ -74,7 +74,7 @@ Line counts are maxima for prose, not targets. Evidence tables and finding rows
74
74
  | `brief.md` | 80 | goal, AC, scope/non-goals, risks, test plan |
75
75
  | `decomposition.md` | 60 | only when >3 work packages |
76
76
  | `implementation.md` | 80 | gate table, changed files, deviations |
77
- | `validation-report.md` | 40 | command, exit, timestamp, tree |
77
+ | `validation-report.md` | 40 | `tree: <sha> (+N dirty)` + `run-at: <ISO>` header, command, exit, timestamp |
78
78
  | `review.md` | 100 | verdict, findings, evidence |
79
79
  | `mockup-review.md` | 80 | verdict, frozen values, corrections |
80
80
  | `figma-contract.json` | 300 | changed nodes only; tokens and geometry, no per-state dumps |
@@ -228,17 +228,22 @@ Append-only `.ai.local/team/tasks/<slug>/review-ledger.md`.
228
228
  | source | `self` \| `code-reviewer` \| `user` \| `other-agent` |
229
229
  | summary | one line |
230
230
  | fair | `yes` \| `no` \| empty until close |
231
- | disposition | `fixed` \| `rejected` \| `open` |
231
+ | disposition | `fixed` \| `rejected` \| `open` \| `accepted` \| `deferred` |
232
+ | owner | who owns an `open`/`accepted`/`deferred` row: a person (`team-lead`, `@handle`), never `-`, `tbd`, `n/a`, `team`, `unowned` |
233
+ | due | `YYYY-MM-DD` on or after the check date, for `open`/`accepted`/`deferred` |
234
+ | followUp | `open`: empty or one task slug; `accepted`/`deferred`: required — `<slug>` or `blocked-on: <slug>` |
232
235
  | evidence | path or command |
233
236
  | signature | `kind:issue` using `correction` \| `retry` \| `waste` \| `reversal` \| `dead-end` |
234
237
 
235
238
  The producer appends a row when a self-review defect changes the output (`source: self`, `fair: yes`, `fixed`). `code-reviewer` appends each finding (`disposition: open`). The orchestrator appends a user or other-agent objection from `prompt-log.md` or `/task-continue`. `fixed` ⇒ `fair: yes`. `rejected` ⇒ `fair: no` and the row cites the rebuttal. `open` at outcome time ⇒ `fair: yes`.
236
239
 
240
+ A row written on or after `2026-11-22` that stays `open`, `accepted`, or `deferred` carries `owner` and `due`; `accepted` and `deferred` also carry `followUp`, one slug that resolves to `.ai.local/team/tasks/<slug>/`. The cutoff is a fixed date, never a moving window, and file mtime is never consulted. A row is legacy (`legacyRows`, `undatedRows`) when it has no usable `at` — 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.
241
+
237
242
  Write the header exactly as the table above spells it:
238
243
 
239
244
  ```markdown
240
- | id | at | source | summary | fair | disposition | evidence | signature |
241
- |---|---|---|---|---|---|---|---|
245
+ | id | at | source | summary | fair | disposition | owner | due | followUp | evidence | signature |
246
+ |---|---|---|---|---|---|---|---|---|---|---|
242
247
  ```
243
248
 
244
249
  A table the projection cannot map is dropped from the database, so a producer that appends a row runs the gate: `node .ai.local/scripts/team-db.mjs ledger-check --slug <slug>`. Exit 0 means every task ledger parses; a non-zero exit names the file and the header it rejected. The parser also reads the legacy headers `seq`/`date`/`origin`/`finding`, `Date`/`Source`/`Finding`/`Fair`, and the sectioned `ID`/`Severity`/`Finding`/`Status` roll-up — a new table uses the canonical header.
@@ -30,6 +30,7 @@ When a requirement freezes how an external payload, command parameter, or nullab
30
30
 
31
31
  - **Definition of done** — the conditions under which the task (or a work package) is complete.
32
32
  - **Named evaluation oracle** — the concrete mechanism that decides pass/fail: a structural gate, a reviewer parity check, a test suite, or an explicit human approval. Name it; do not leave "looks good" as the oracle.
33
+ - **Oracle on real data.** When the oracle is a shipped validator that will run over existing data (ledger, registry, manifest, migration), the brief states its **expected output on the real corpus** — the counters, not only "it passes" — and runs the current predicate before the gate. A rule change whose semantics are first exercised in review has no oracle, only an opinion.
33
34
  - The oracle is per task class: mechanical work → the repo gate script; prose/contract work → the named reviewer plus the structural gate.
34
35
  - **Re-anchor target.** The goal frame is the anchor a drifted run returns to (`quality/self-review-and-context-hygiene`): on a detected drift, re-read the goal frame + the current plan, then repair the drift before re-running the affected gate.
35
36
 
@@ -7,14 +7,14 @@ Rules for **preset authors** (`packages/ai-rules/presets/**`). Not always-on in
7
7
  | Layer | Where | What to put |
8
8
  |-------|-------|-------------|
9
9
  | **Core** | `presets/_shared/core/**` | Stack-agnostic prose + checklists; no frontmatter; no paths `app/**`, `Features/**`, Playwright, xcodebuild |
10
- | **Stack** | `presets/{cursor\|claude\|mavis\|opencode}/<stack>/` | Domain/tooling, stack always-on set (3–10), stack examples in **Stack notes** |
11
- | **Platform** | Cursor `.mdc` / Claude `.md` / Mavis `.md` / OpenCode `.md` | Frontmatter (`alwaysApply`/`globs` vs `paths:` vs OpenCode `mode`/`permission`), platform-only (`BUGBOT.md`, `CLAUDE.md`) |
10
+ | **Stack** | `presets/{cursor\|claude\|mavis\|opencode\|zcode}/<stack>/` | Domain/tooling, stack always-on set (3–10), stack examples in **Stack notes** |
11
+ | **Platform** | Cursor `.mdc` / Claude `.md` / Mavis `.md` / OpenCode `.md` / ZCode `.md` | Frontmatter (`alwaysApply`/`globs` vs `paths:` vs OpenCode `mode`/`permission`), platform-only (`BUGBOT.md`, `CLAUDE.md`) |
12
12
 
13
13
  ## Where to put a new rule
14
14
 
15
15
  1. Shared principles for all stacks → **core** + adapters with `<!-- shared-core: … -->`.
16
- 2. Only one of the installable stacks (`next` / `nuxt` / `svelte` / `ios-swift` / `android-kotlin` / `go` / `java` / `mcp-ts` / `php-hexagonal` / `php-laravel`) → **stack-specific** (not in `_shared`).
17
- 3. Only Cursor, Claude, Mavis, or OpenCode packaging → platform artifact / frontmatter; do not duplicate semantics.
16
+ 2. Only one of the installable stacks (`next` / `nuxt` / `svelte` / `mol` / `ios-swift` / `android-kotlin` / `go` / `java` / `mcp-ts` / `php-hexagonal` / `php-laravel`) → **stack-specific** (not in `_shared`).
17
+ 3. Only Cursor, Claude, Mavis, OpenCode, or ZCode packaging → platform artifact / frontmatter; do not duplicate semantics.
18
18
 
19
19
  ## SoT
20
20
 
@@ -11,12 +11,13 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
11
11
  - [ ] **Twin:** Cursor change → run `generate-claude.mjs --stack <stack>` and commit the Claude twin **same PR** (**FAIL** if missing or stale on next, nuxt, svelte, ios-swift, android-kotlin, go, java, mcp-ts, php-hexagonal, and php-laravel — see `preset-twin-sync`)
12
12
  - [ ] **Mavis derive:** mapped `cursor/<stack>/` change → `mavis/<stack>/` + `adapter-map.json` **same PR** when the stack is in `releasedStacks` (run `generate-mavis.mjs --stack <stack>` + `check-mavis-adapter-map.mjs`; see `preset-twin-sync` § Mavis derivation)
13
13
  - [ ] **OpenCode derive:** mapped `cursor/<stack>/` change → `opencode/<stack>/` + `adapter-map.json` **same PR** when the stack is in `releasedStacks` (run `generate-opencode.mjs --stack <stack>` + `check-opencode-adapter-map.mjs`; see `preset-twin-sync` § OpenCode derivation)
14
+ - [ ] **ZCode derive:** mapped `cursor/<stack>/` change → `zcode/<stack>/` + `adapter-map.json` **same PR** when the stack is in `releasedStacks` (run `generate-zcode.mjs --stack <stack>` + `check-zcode-adapter-map.mjs`; see `preset-twin-sync` § ZCode derivation)
14
15
  - [ ] **Mapping:** `claude/<stack>/rules/README.md` mapping table is current
15
16
  - [ ] **Token budget:** Cursor `alwaysApply` and Claude session-start both **3–10** (extra slots reserved for `ai-local-overlay`); body sum ≤4000; meta rules not always-on
16
17
  - [ ] **Local overlay coverage:** every installable stack ships `ai-local-overlay.mdc` (Cursor) and `ai-local-overlay.md` (Claude) with `MANDATORY` + acknowledgement format + `docs/LOCAL-OVERLAY.md` pointer; Claude twin listed in `claude/<stack>/rules/README.md` mapping table. Run `packages/ai-rules/scripts/check-local-overlay.sh`.
17
18
  - [ ] **Leakage:** no foreign stack agent stems / handoff strings (`preset-no-cross-stack-leakage`)
18
19
  - [ ] **Hook-only lifecycle:** `status.json` / `metrics.json` writes happen only inside `hooks/`; agents read but never rewrite lifecycle fields. Run `packages/ai-rules/scripts/check-hook-only-lifecycle.sh`.
19
- - [ ] **Chain fork:** the byte-wise MD5 uniqueness of `chain-team-phases.sh` holds pairwise among every stack under `presets/cursor/` × Cursor/Claude platforms, and each released Mavis/OpenCode stack hook must also differ from the Cursor and Claude twins of the same stack. Run `packages/ai-rules/scripts/check-chain-hook-coverage.sh` and `packages/ai-rules/scripts/test-chain-team-phases-coverage.mjs`.
20
+ - [ ] **Chain fork:** the byte-wise MD5 uniqueness of `chain-team-phases.sh` holds pairwise among every stack under `presets/cursor/` × Cursor/Claude platforms, and each released Mavis/OpenCode/ZCode stack hook must also differ from the Cursor and Claude twins of the same stack. Run `packages/ai-rules/scripts/check-chain-hook-coverage.sh` and `packages/ai-rules/scripts/test-chain-team-phases-coverage.mjs`.
20
21
  - [ ] **Twin depth:** domain ≥15 lines; thin aliases documented
21
22
  - [ ] **README:** stack `rules/README.md` core→stack mapping / catalog updated if stems added
22
23
  - [ ] **CHANGELOG / package README:** note when public preset paths or install surface change
@@ -9,21 +9,22 @@ Cursor `.mdc` is the **SoT per stack**; every other platform tree is derived in
9
9
  | **Claude twin** | `cursor/<stack>/rules/*.mdc` | `generate-claude.mjs --stack <stack>`; destination row **required** in `claude/<stack>/rules/README.md` |
10
10
  | **Mavis** | `cursor/<stack>/**` | `generate-mavis.mjs --stack <stack>`; manifest `adapter-map.json` required |
11
11
  | **OpenCode** | `cursor/<stack>/**` | `generate-opencode.mjs --stack <stack>`; manifest `adapter-map.json` required |
12
+ | **ZCode** | `cursor/<stack>/**` | `generate-zcode.mjs --stack <stack>`; manifest `adapter-map.json` required |
12
13
 
13
- Every stack directory under `packages/ai-rules/presets/cursor/` is a twin source; do not hardcode the stack count. Mavis and OpenCode are **platform adapters**, not Claude-style topic twins; never derive OpenCode from Claude.
14
+ Every stack directory under `packages/ai-rules/presets/cursor/` is a twin source; do not hardcode the stack count. Mavis, OpenCode, and ZCode are **platform adapters**, not Claude-style topic twins; never derive one of them from Claude.
14
15
 
15
16
  ```text
16
- _shared/core → cursor/<stack> → { claude/<stack>, mavis/<stack>, opencode/<stack> }
17
+ _shared/core → cursor/<stack> → { claude/<stack>, mavis/<stack>, opencode/<stack>, zcode/<stack> }
17
18
  ```
18
19
 
19
- Validate: `check-mavis-adapter-map.mjs`, `check-opencode-adapter-map.mjs`, `check-shared-core-drift.sh`.
20
+ Validate: `check-mavis-adapter-map.mjs`, `check-opencode-adapter-map.mjs`, `check-zcode-adapter-map.mjs`, `check-shared-core-drift.sh`.
20
21
 
21
22
  ## Same-PR checklist
22
23
 
23
24
  1. Edit the Cursor rule first (body + frontmatter).
24
25
  2. Add or update the Claude README mapping row when the stem/path changed, then run `generate-claude.mjs --stack <stack>`.
25
26
  3. Core changed → sync every `<!-- shared-core: … -->` consumer (`sync-shared-core-embeds.sh`).
26
- 4. Cursor source changed → run `yarn fix:generated` to regenerate Claude, Mavis, and OpenCode and recapture required CLI goldens.
27
+ 4. Cursor source changed → run `yarn fix:generated` to regenerate Claude, Mavis, OpenCode, and ZCode and recapture required CLI goldens.
27
28
 
28
29
  ## Twin depth
29
30
 
@@ -34,6 +35,12 @@ Validate: `check-mavis-adapter-map.mjs`, `check-opencode-adapter-map.mjs`, `chec
34
35
  ## Severity (structure gates)
35
36
 
36
37
  - Missing or stale generated Claude twin for a changed Cursor rule → **FAIL** (every stack under `presets/cursor/`; mapping table required).
37
- - `cursor/<stack>` mapped source changed without mavis / opencode regeneration, or with `adapter-map.json` `sourceRevision` drift → **FAIL**.
38
+ - `cursor/<stack>` mapped source changed without mavis / opencode / zcode regeneration, or with `adapter-map.json` `sourceRevision` drift → **FAIL**.
39
+
40
+ ## Generated vs hand-maintained
41
+
42
+ - Mavis, OpenCode, and ZCode trees are deleted and derived from Cursor on each `fix:generated`.
43
+ - Claude **rules**, `team/upstream`, and the hooks `generateClaudeStack` emits are derived. Claude **agents, commands, skills, `CLAUDE.md`, and `settings.json`** stay hand-maintained twins. Parity is the ratchet in `check-claude-agent-parity.mjs` and `check-preset-twin-drift.mjs`, not a byte copy.
44
+ - `compact-shell-output.mjs` is Cursor-only: it returns Cursor `updated_input`. OpenCode compacts with `.opencode/plugins/output-guard/`. Claude `PreToolUse` returns `permissionDecision` only. Mavis and ZCode omit the hook because they have no registration schema.
38
45
 
39
46
  Dogfood: sync packages → root `.cursor/` after Cursor SoT changes (never the reverse): `sync-dogfood-cursor.sh`.
@@ -13,7 +13,7 @@ multi-wave work). It ratchets down for bounded/spike tasks (see § Ratchet).
13
13
  (c) **alignment / drift** — the result still serves the framed goal and does not exceed the framed scope.
14
14
  - Record a `## Self-review` block in the artifact the producer owns.
15
15
  - A self-review defect that changes the output appends one `review-ledger.md` row (`source: self`, `fair: yes`, `disposition: fixed`) before the receipt. Schema: **agent-artifact-contracts** § Review ledger.
16
- - 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. Schema: **agent-artifact-contracts** § Review ledger.
16
+ - 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. Schema: **agent-artifact-contracts** § Review ledger.
17
17
  - Do not start implementation when `goal.md` is missing.
18
18
 
19
19
  ## Boundary vs existing gates (do not re-implement)
@@ -22,10 +22,34 @@ Feature work has three phases. The phase decides who may run a project gate: `li
22
22
  ## Gate (in order)
23
23
 
24
24
  1. **IDENTIFY** the command that would falsify the claim (test, lint, type-check, or the preset-structure script named in the task).
25
- 2. **RUN** it now. Do not reuse a previous agent's "it passed" as proof.
26
- 3. **READ** the full output and the exit code.
27
- 4. **VERIFY** the output matches the claim (count failures; do not skim).
28
- 5. **THEN claim** — name the command and the result. If it failed, report the actual state.
25
+ 2. **NAME THE TREE** the command will run on: `git rev-parse HEAD` plus the dirty count from `git status --porcelain=v1 -- . ':(exclude).ai.local'`. A result that names no tree is not evidence.
26
+ 3. **RUN** it now. Do not reuse a previous agent's "it passed" as proof.
27
+ 4. **READ** the full output and the exit code.
28
+ 5. **VERIFY** the output matches the claim (count failures; do not skim).
29
+ 6. **PROVE IT CAN FAIL** — a gate counts only when it has been seen red: a negative fixture, or a stated falsifier plus the input that would trip it.
30
+ 7. **THEN claim** — name the command, the result, and the tree. If it failed, report the actual state.
31
+ 8. **RE-RUN WHEN THE TREE MOVED** — a later commit or a changed dirty count invalidates the report; re-run the named gate on the current tree.
32
+
33
+ ## Report header
34
+
35
+ `validation-report.md` opens with these two lines, before the gate table (40-line budget unchanged):
36
+
37
+ ```text
38
+ tree: <sha> (+N dirty)
39
+ run-at: <ISO>
40
+ ```
41
+
42
+ `<sha>` is `git rev-parse HEAD` or a unique abbreviation; `N` is the `git status --porcelain=v1 -- . ':(exclude).ai.local'` line count. The exclude keeps the report's own write out of `N`, so a fresh report never goes stale on arrival. **Nothing follows the closing `)` on either line** — both anchors are `$`-terminated, so a clarification such as `(+511 dirty excluding .ai.local)` obeys the sentence above and still stalls the receipt; put every qualification under `## Notes`. The hook rejects a `build-verifier` receipt whose report is missing either line, whose `<sha>` no longer prefixes `HEAD`, or whose `N` no longer matches the worktree. The repair is named, never a silent pass: re-run the named gate on the current tree, then resume with `/task-continue <slug>`.
43
+
44
+ ## Zero-input gates
45
+
46
+ A gate that selects zero inputs must print `checked: 0` and exit non-zero: a pass that ran and found nothing is indistinguishable from a skipped pass. An intentional empty selection is data, not prose — list it in `.ai.local/pipeline-gates.json`:
47
+
48
+ ```json
49
+ { "zeroInputAllowlist": [{ "gate": "<gate id>", "reason": "<why zero inputs is correct>", "owner": "<who>" }] }
50
+ ```
51
+
52
+ Record the row as `` - `<gate>`: checked: 0 ``. The hook rejects a `build-verifier` receipt carrying an unallowlisted zero-input row; an entry without a non-empty `reason` allowlists nothing. The shipped `check-verification` audit reports the same row and exits non-zero on a scan that selected zero tasks unless `check-verification` is allowlisted.
29
53
 
30
54
  ## Forbidden
31
55