@bonesofspring/ai-rules 0.2.36 → 0.2.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (851) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +23 -2
  3. package/bin/cli.js +106 -1
  4. package/bin/lib/engine-scripts.js +22 -0
  5. package/bin/lib/fs-utils.js +78 -11
  6. package/bin/lib/merged-config.js +30 -16
  7. package/bin/lib/seed-ai-local-team.js +160 -12
  8. package/bin/opencode-install.js +37 -52
  9. package/docs/OPENCODE.md +4 -4
  10. package/docs/specs/INDEX.md +5 -2
  11. package/package.json +7 -1
  12. package/presets/_shared/ai-local/scripts/derive-gate-signals.mjs +173 -0
  13. package/presets/_shared/ai-local/scripts/efficacy-oracle.mjs +576 -0
  14. package/presets/_shared/ai-local/scripts/lock.mjs +118 -0
  15. package/presets/_shared/ai-local/scripts/rule-improver.mjs +795 -0
  16. package/presets/_shared/ai-local/scripts/run.mjs +309 -0
  17. package/presets/_shared/ai-local/scripts/signals.mjs +256 -0
  18. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +1 -1
  19. package/presets/_shared/core/quality/self-review-and-context-hygiene.md +8 -7
  20. package/presets/_shared/hooks/README.md +142 -0
  21. package/presets/_shared/hooks/chain-team-phases.sh.tmpl +1377 -0
  22. package/presets/_shared/hooks/check-preset-update.mjs +227 -0
  23. package/presets/claude/android-kotlin/CLAUDE.md +1 -1
  24. package/presets/claude/android-kotlin/MCP.md +2 -2
  25. package/presets/claude/android-kotlin/REPO_AGENTS.md +14 -0
  26. package/presets/claude/android-kotlin/agents/build-verifier.md +1 -1
  27. package/presets/claude/android-kotlin/agents/code-reviewer.md +1 -1
  28. package/presets/claude/android-kotlin/agents/debugger.md +1 -1
  29. package/presets/claude/android-kotlin/agents/feature-developer.md +1 -1
  30. package/presets/claude/android-kotlin/agents/task-analyst.md +1 -1
  31. package/presets/claude/android-kotlin/commands/README.md +1 -0
  32. package/presets/claude/android-kotlin/commands/task-continue.md +9 -0
  33. package/presets/claude/android-kotlin/commands/technical-retro.md +8 -0
  34. package/presets/claude/android-kotlin/commands/update.md +39 -0
  35. package/presets/claude/android-kotlin/hooks/README.md +1 -0
  36. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +278 -28
  37. package/presets/claude/android-kotlin/hooks/check-preset-update.mjs +227 -0
  38. package/presets/claude/android-kotlin/hooks/examples/README.md +1 -1
  39. package/presets/claude/android-kotlin/mcp.json +1 -1
  40. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +7 -154
  41. package/presets/claude/android-kotlin/settings.json +14 -1
  42. package/presets/claude/android-kotlin/skills/technical-retro/SKILL.md +2 -0
  43. package/presets/claude/android-kotlin/team/README.md +2 -6
  44. package/presets/claude/android-kotlin/team/fixtures/artifact-manifest.example.json +1 -0
  45. package/presets/claude/go/CLAUDE.md +1 -1
  46. package/presets/claude/go/MCP.md +2 -2
  47. package/presets/claude/go/REPO_AGENTS.md +14 -0
  48. package/presets/claude/go/agents/build-verifier.md +1 -1
  49. package/presets/claude/go/agents/code-reviewer.md +1 -1
  50. package/presets/claude/go/agents/debugger.md +1 -1
  51. package/presets/claude/go/agents/feature-developer.md +1 -1
  52. package/presets/claude/go/agents/task-analyst.md +1 -1
  53. package/presets/claude/go/commands/README.md +1 -0
  54. package/presets/claude/go/commands/task-continue.md +9 -0
  55. package/presets/claude/go/commands/technical-retro.md +8 -0
  56. package/presets/claude/go/commands/update.md +39 -0
  57. package/presets/claude/go/hooks/README.md +1 -0
  58. package/presets/claude/go/hooks/chain-team-phases.sh +290 -34
  59. package/presets/claude/go/hooks/check-preset-update.mjs +227 -0
  60. package/presets/claude/go/hooks/examples/README.md +1 -1
  61. package/presets/claude/go/mcp.json +1 -1
  62. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +7 -12
  63. package/presets/claude/go/settings.json +14 -1
  64. package/presets/claude/go/skills/technical-retro/SKILL.md +2 -0
  65. package/presets/claude/go/team/README.md +2 -6
  66. package/presets/claude/ios-swift/CLAUDE.md +1 -1
  67. package/presets/claude/ios-swift/MCP.md +2 -2
  68. package/presets/claude/ios-swift/REPO_AGENTS.md +14 -0
  69. package/presets/claude/ios-swift/agents/build-verifier.md +1 -1
  70. package/presets/claude/ios-swift/agents/code-reviewer.md +1 -1
  71. package/presets/claude/ios-swift/agents/debugger.md +1 -1
  72. package/presets/claude/ios-swift/agents/feature-developer.md +1 -1
  73. package/presets/claude/ios-swift/agents/task-analyst.md +1 -1
  74. package/presets/claude/ios-swift/commands/README.md +1 -0
  75. package/presets/claude/ios-swift/commands/task-continue.md +9 -0
  76. package/presets/claude/ios-swift/commands/technical-retro.md +8 -0
  77. package/presets/claude/ios-swift/commands/update.md +39 -0
  78. package/presets/claude/ios-swift/hooks/README.md +1 -0
  79. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +285 -35
  80. package/presets/claude/ios-swift/hooks/check-preset-update.mjs +227 -0
  81. package/presets/claude/ios-swift/hooks/examples/README.md +1 -1
  82. package/presets/claude/ios-swift/mcp.json +1 -1
  83. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +7 -154
  84. package/presets/claude/ios-swift/settings.json +14 -1
  85. package/presets/claude/ios-swift/skills/technical-retro/SKILL.md +2 -0
  86. package/presets/claude/ios-swift/team/README.md +2 -6
  87. package/presets/claude/ios-swift/team/fixtures/artifact-manifest.example.json +1 -0
  88. package/presets/claude/java/CLAUDE.md +2 -2
  89. package/presets/claude/java/REPO_AGENTS.md +14 -0
  90. package/presets/claude/java/agents/build-verifier.md +1 -1
  91. package/presets/claude/java/agents/code-reviewer.md +1 -1
  92. package/presets/claude/java/agents/debugger.md +1 -1
  93. package/presets/claude/java/agents/feature-developer.md +1 -1
  94. package/presets/claude/java/agents/task-analyst.md +1 -1
  95. package/presets/claude/java/commands/README.md +1 -0
  96. package/presets/claude/java/commands/task-continue.md +9 -0
  97. package/presets/claude/java/commands/technical-retro.md +8 -0
  98. package/presets/claude/java/commands/update.md +39 -0
  99. package/presets/claude/java/hooks/README.md +1 -0
  100. package/presets/claude/java/hooks/chain-team-phases.sh +290 -34
  101. package/presets/claude/java/hooks/check-preset-update.mjs +227 -0
  102. package/presets/claude/java/hooks/examples/README.md +1 -1
  103. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +7 -29
  104. package/presets/claude/java/settings.json +14 -1
  105. package/presets/claude/java/skills/technical-retro/SKILL.md +2 -0
  106. package/presets/claude/java/team/README.md +2 -6
  107. package/presets/claude/mcp-ts/CLAUDE.md +1 -1
  108. package/presets/claude/mcp-ts/REPO_AGENTS.md +14 -0
  109. package/presets/claude/mcp-ts/agents/build-verifier.md +1 -1
  110. package/presets/claude/mcp-ts/agents/feature-developer.md +1 -1
  111. package/presets/claude/mcp-ts/agents/task-analyst.md +1 -1
  112. package/presets/claude/mcp-ts/commands/README.md +1 -0
  113. package/presets/claude/mcp-ts/commands/task-continue.md +9 -0
  114. package/presets/claude/mcp-ts/commands/technical-retro.md +8 -0
  115. package/presets/claude/mcp-ts/commands/update.md +39 -0
  116. package/presets/claude/mcp-ts/hooks/README.md +1 -0
  117. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +289 -31
  118. package/presets/claude/mcp-ts/hooks/check-preset-update.mjs +227 -0
  119. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +7 -15
  120. package/presets/claude/mcp-ts/settings.json +14 -1
  121. package/presets/claude/mcp-ts/team/README.md +2 -6
  122. package/presets/claude/next/CLAUDE.md +2 -1
  123. package/presets/claude/next/MCP.md +2 -2
  124. package/presets/claude/next/REPO_AGENTS.md +15 -1
  125. package/presets/claude/next/agents/build-verifier.md +1 -1
  126. package/presets/claude/next/agents/code-reviewer.md +1 -1
  127. package/presets/claude/next/agents/debugger.md +1 -1
  128. package/presets/claude/next/agents/feature-developer.md +1 -1
  129. package/presets/claude/next/agents/task-analyst.md +1 -1
  130. package/presets/claude/next/agents/task-router.md +1 -1
  131. package/presets/claude/next/commands/README.md +1 -0
  132. package/presets/claude/next/commands/task-continue.md +9 -0
  133. package/presets/claude/next/commands/technical-retro.md +8 -0
  134. package/presets/claude/next/commands/update.md +39 -0
  135. package/presets/claude/next/hooks/README.md +1 -0
  136. package/presets/claude/next/hooks/chain-team-phases.sh +209 -24
  137. package/presets/claude/next/hooks/check-preset-update.mjs +227 -0
  138. package/presets/claude/next/hooks/examples/README.md +1 -1
  139. package/presets/claude/next/mcp.json +1 -1
  140. package/presets/claude/next/rules/anti-hallucination/react-next-anti-hallucination.md +21 -18
  141. package/presets/claude/next/rules/stack/next-app-router.md +27 -0
  142. package/presets/claude/next/rules/stack/next-static-export.md +16 -0
  143. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +7 -227
  144. package/presets/claude/next/rules/tooling-and-review/security-next.md +16 -2
  145. package/presets/claude/next/rules/ui-and-accessibility/component-catalog-gate.md +13 -0
  146. package/presets/claude/next/rules/ui-and-accessibility/forms-validation.md +12 -0
  147. package/presets/claude/next/settings.json +13 -0
  148. package/presets/claude/next/skills/technical-retro/SKILL.md +2 -0
  149. package/presets/claude/next/team/README.md +2 -6
  150. package/presets/claude/next/team/fixtures/artifact-manifest.example.json +1 -0
  151. package/presets/claude/next/team/fixtures/feature-light.json +2 -1
  152. package/presets/claude/next/team/fixtures/feature-ui-standard.json +24 -0
  153. package/presets/claude/nuxt/CLAUDE.md +2 -1
  154. package/presets/claude/nuxt/MCP.md +2 -2
  155. package/presets/claude/nuxt/REPO_AGENTS.md +14 -0
  156. package/presets/claude/nuxt/agents/build-verifier.md +1 -1
  157. package/presets/claude/nuxt/agents/code-reviewer.md +1 -1
  158. package/presets/claude/nuxt/agents/debugger.md +1 -1
  159. package/presets/claude/nuxt/agents/feature-developer.md +1 -1
  160. package/presets/claude/nuxt/agents/task-analyst.md +1 -1
  161. package/presets/claude/nuxt/commands/README.md +1 -0
  162. package/presets/claude/nuxt/commands/task-continue.md +9 -0
  163. package/presets/claude/nuxt/commands/technical-retro.md +8 -0
  164. package/presets/claude/nuxt/commands/update.md +39 -0
  165. package/presets/claude/nuxt/hooks/README.md +1 -0
  166. package/presets/claude/nuxt/hooks/chain-team-phases.sh +255 -25
  167. package/presets/claude/nuxt/hooks/check-preset-update.mjs +227 -0
  168. package/presets/claude/nuxt/hooks/examples/README.md +1 -1
  169. package/presets/claude/nuxt/mcp.json +1 -1
  170. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +7 -224
  171. package/presets/claude/nuxt/settings.json +13 -0
  172. package/presets/claude/nuxt/skills/technical-retro/SKILL.md +2 -0
  173. package/presets/claude/nuxt/team/README.md +2 -6
  174. package/presets/claude/nuxt/team/fixtures/artifact-manifest.example.json +1 -0
  175. package/presets/claude/php-hexagonal/CLAUDE.md +2 -2
  176. package/presets/claude/php-hexagonal/REPO_AGENTS.md +14 -0
  177. package/presets/claude/php-hexagonal/agents/build-verifier.md +1 -1
  178. package/presets/claude/php-hexagonal/agents/code-reviewer.md +1 -1
  179. package/presets/claude/php-hexagonal/agents/debugger.md +1 -1
  180. package/presets/claude/php-hexagonal/agents/feature-developer.md +1 -1
  181. package/presets/claude/php-hexagonal/agents/task-analyst.md +1 -1
  182. package/presets/claude/php-hexagonal/commands/README.md +1 -0
  183. package/presets/claude/php-hexagonal/commands/task-continue.md +9 -0
  184. package/presets/claude/php-hexagonal/commands/technical-retro.md +8 -0
  185. package/presets/claude/php-hexagonal/commands/update.md +39 -0
  186. package/presets/claude/php-hexagonal/hooks/README.md +1 -0
  187. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +290 -34
  188. package/presets/claude/php-hexagonal/hooks/check-preset-update.mjs +227 -0
  189. package/presets/claude/php-hexagonal/hooks/examples/README.md +1 -1
  190. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +7 -29
  191. package/presets/claude/php-hexagonal/settings.json +14 -1
  192. package/presets/claude/php-hexagonal/skills/technical-retro/SKILL.md +2 -0
  193. package/presets/claude/php-hexagonal/team/README.md +2 -6
  194. package/presets/claude/php-laravel/CLAUDE.md +1 -1
  195. package/presets/claude/php-laravel/REPO_AGENTS.md +14 -0
  196. package/presets/claude/php-laravel/agents/build-verifier.md +1 -1
  197. package/presets/claude/php-laravel/agents/code-reviewer.md +1 -1
  198. package/presets/claude/php-laravel/agents/debugger.md +1 -1
  199. package/presets/claude/php-laravel/agents/feature-developer.md +1 -1
  200. package/presets/claude/php-laravel/agents/task-analyst.md +1 -1
  201. package/presets/claude/php-laravel/commands/README.md +1 -0
  202. package/presets/claude/php-laravel/commands/task-continue.md +9 -0
  203. package/presets/claude/php-laravel/commands/technical-retro.md +8 -0
  204. package/presets/claude/php-laravel/commands/update.md +39 -0
  205. package/presets/claude/php-laravel/hooks/README.md +1 -0
  206. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +290 -34
  207. package/presets/claude/php-laravel/hooks/check-preset-update.mjs +227 -0
  208. package/presets/claude/php-laravel/hooks/examples/README.md +1 -1
  209. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +7 -30
  210. package/presets/claude/php-laravel/settings.json +14 -1
  211. package/presets/claude/php-laravel/skills/technical-retro/SKILL.md +2 -0
  212. package/presets/claude/php-laravel/team/README.md +2 -6
  213. package/presets/claude/svelte/CLAUDE.md +2 -1
  214. package/presets/claude/svelte/MCP.md +2 -2
  215. package/presets/claude/svelte/REPO_AGENTS.md +14 -0
  216. package/presets/claude/svelte/agents/build-verifier.md +1 -1
  217. package/presets/claude/svelte/agents/code-reviewer.md +1 -1
  218. package/presets/claude/svelte/agents/debugger.md +1 -1
  219. package/presets/claude/svelte/agents/feature-developer.md +1 -1
  220. package/presets/claude/svelte/agents/task-analyst.md +1 -1
  221. package/presets/claude/svelte/commands/README.md +1 -0
  222. package/presets/claude/svelte/commands/task-continue.md +9 -0
  223. package/presets/claude/svelte/commands/technical-retro.md +8 -0
  224. package/presets/claude/svelte/commands/update.md +39 -0
  225. package/presets/claude/svelte/hooks/README.md +1 -0
  226. package/presets/claude/svelte/hooks/chain-team-phases.sh +255 -25
  227. package/presets/claude/svelte/hooks/check-preset-update.mjs +227 -0
  228. package/presets/claude/svelte/hooks/examples/README.md +1 -1
  229. package/presets/claude/svelte/mcp.json +1 -1
  230. package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +7 -224
  231. package/presets/claude/svelte/settings.json +13 -0
  232. package/presets/claude/svelte/skills/technical-retro/SKILL.md +2 -0
  233. package/presets/claude/svelte/team/README.md +2 -6
  234. package/presets/claude/svelte/team/fixtures/artifact-manifest.example.json +1 -0
  235. package/presets/cursor/android-kotlin/AGENTS.md +1 -0
  236. package/presets/cursor/android-kotlin/MCP.md +2 -2
  237. package/presets/cursor/android-kotlin/REPO_AGENTS.md +14 -0
  238. package/presets/cursor/android-kotlin/agents/build-verifier.md +1 -1
  239. package/presets/cursor/android-kotlin/agents/code-reviewer.md +1 -1
  240. package/presets/cursor/android-kotlin/agents/debugger.md +1 -1
  241. package/presets/cursor/android-kotlin/agents/feature-developer.md +1 -1
  242. package/presets/cursor/android-kotlin/agents/task-analyst.md +1 -1
  243. package/presets/cursor/android-kotlin/commands/README.md +1 -0
  244. package/presets/cursor/android-kotlin/commands/task-continue.md +9 -0
  245. package/presets/cursor/android-kotlin/commands/technical-retro.md +8 -0
  246. package/presets/cursor/android-kotlin/commands/update.md +39 -0
  247. package/presets/cursor/android-kotlin/hooks/README.md +5 -1
  248. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +257 -25
  249. package/presets/cursor/android-kotlin/hooks/check-preset-update.mjs +227 -0
  250. package/presets/cursor/android-kotlin/hooks/examples/README.md +1 -1
  251. package/presets/cursor/android-kotlin/hooks.json +6 -0
  252. package/presets/cursor/android-kotlin/mcp.json +1 -1
  253. package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +1 -1
  254. package/presets/cursor/android-kotlin/skills/technical-retro/SKILL.md +2 -0
  255. package/presets/cursor/android-kotlin/team/README.md +2 -0
  256. package/presets/cursor/android-kotlin/team/fixtures/artifact-manifest.example.json +1 -0
  257. package/presets/cursor/go/MCP.md +2 -2
  258. package/presets/cursor/go/REPO_AGENTS.md +14 -0
  259. package/presets/cursor/go/agents/build-verifier.md +1 -1
  260. package/presets/cursor/go/agents/code-reviewer.md +1 -1
  261. package/presets/cursor/go/agents/debugger.md +1 -1
  262. package/presets/cursor/go/agents/feature-developer.md +1 -1
  263. package/presets/cursor/go/agents/task-analyst.md +1 -1
  264. package/presets/cursor/go/commands/README.md +1 -0
  265. package/presets/cursor/go/commands/task-continue.md +9 -0
  266. package/presets/cursor/go/commands/technical-retro.md +8 -0
  267. package/presets/cursor/go/commands/update.md +39 -0
  268. package/presets/cursor/go/hooks/README.md +5 -1
  269. package/presets/cursor/go/hooks/chain-team-phases.sh +282 -26
  270. package/presets/cursor/go/hooks/check-preset-update.mjs +227 -0
  271. package/presets/cursor/go/hooks/examples/README.md +1 -1
  272. package/presets/cursor/go/hooks.json +6 -0
  273. package/presets/cursor/go/mcp.json +1 -1
  274. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +1 -1
  275. package/presets/cursor/go/skills/technical-retro/SKILL.md +2 -0
  276. package/presets/cursor/go/team/README.md +2 -0
  277. package/presets/cursor/ios-swift/AGENTS.md +1 -0
  278. package/presets/cursor/ios-swift/MCP.md +2 -2
  279. package/presets/cursor/ios-swift/REPO_AGENTS.md +14 -0
  280. package/presets/cursor/ios-swift/agents/build-verifier.md +1 -1
  281. package/presets/cursor/ios-swift/agents/code-reviewer.md +1 -1
  282. package/presets/cursor/ios-swift/agents/debugger.md +1 -1
  283. package/presets/cursor/ios-swift/agents/feature-developer.md +1 -1
  284. package/presets/cursor/ios-swift/agents/task-analyst.md +1 -1
  285. package/presets/cursor/ios-swift/commands/README.md +1 -0
  286. package/presets/cursor/ios-swift/commands/task-continue.md +9 -0
  287. package/presets/cursor/ios-swift/commands/technical-retro.md +8 -0
  288. package/presets/cursor/ios-swift/commands/update.md +39 -0
  289. package/presets/cursor/ios-swift/hooks/README.md +5 -1
  290. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +257 -25
  291. package/presets/cursor/ios-swift/hooks/check-preset-update.mjs +227 -0
  292. package/presets/cursor/ios-swift/hooks/examples/README.md +1 -1
  293. package/presets/cursor/ios-swift/hooks.json +6 -0
  294. package/presets/cursor/ios-swift/mcp.json +1 -1
  295. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +1 -1
  296. package/presets/cursor/ios-swift/skills/technical-retro/SKILL.md +2 -0
  297. package/presets/cursor/ios-swift/team/README.md +2 -0
  298. package/presets/cursor/ios-swift/team/fixtures/artifact-manifest.example.json +1 -0
  299. package/presets/cursor/java/AGENTS.md +1 -1
  300. package/presets/cursor/java/REPO_AGENTS.md +14 -0
  301. package/presets/cursor/java/agents/build-verifier.md +1 -1
  302. package/presets/cursor/java/agents/code-reviewer.md +1 -1
  303. package/presets/cursor/java/agents/debugger.md +1 -1
  304. package/presets/cursor/java/agents/feature-developer.md +1 -1
  305. package/presets/cursor/java/agents/task-analyst.md +1 -1
  306. package/presets/cursor/java/commands/README.md +1 -0
  307. package/presets/cursor/java/commands/task-continue.md +9 -0
  308. package/presets/cursor/java/commands/technical-retro.md +8 -0
  309. package/presets/cursor/java/commands/update.md +39 -0
  310. package/presets/cursor/java/hooks/README.md +5 -1
  311. package/presets/cursor/java/hooks/chain-team-phases.sh +282 -26
  312. package/presets/cursor/java/hooks/check-preset-update.mjs +227 -0
  313. package/presets/cursor/java/hooks/examples/README.md +1 -1
  314. package/presets/cursor/java/hooks.json +6 -0
  315. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +1 -1
  316. package/presets/cursor/java/skills/technical-retro/SKILL.md +2 -0
  317. package/presets/cursor/java/team/README.md +2 -0
  318. package/presets/cursor/mcp-ts/REPO_AGENTS.md +14 -0
  319. package/presets/cursor/mcp-ts/agents/build-verifier.md +1 -1
  320. package/presets/cursor/mcp-ts/agents/feature-developer.md +1 -1
  321. package/presets/cursor/mcp-ts/agents/task-analyst.md +1 -1
  322. package/presets/cursor/mcp-ts/commands/README.md +1 -0
  323. package/presets/cursor/mcp-ts/commands/task-continue.md +9 -0
  324. package/presets/cursor/mcp-ts/commands/technical-retro.md +8 -0
  325. package/presets/cursor/mcp-ts/commands/update.md +39 -0
  326. package/presets/cursor/mcp-ts/hooks/README.md +5 -1
  327. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +286 -28
  328. package/presets/cursor/mcp-ts/hooks/check-preset-update.mjs +227 -0
  329. package/presets/cursor/mcp-ts/hooks.json +6 -0
  330. package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +1 -1
  331. package/presets/cursor/mcp-ts/team/README.md +2 -0
  332. package/presets/cursor/next/AGENTS.md +1 -0
  333. package/presets/cursor/next/MCP.md +2 -2
  334. package/presets/cursor/next/REPO_AGENTS.md +15 -1
  335. package/presets/cursor/next/agents/build-verifier.md +1 -1
  336. package/presets/cursor/next/agents/code-reviewer.md +1 -1
  337. package/presets/cursor/next/agents/debugger.md +1 -1
  338. package/presets/cursor/next/agents/feature-developer.md +1 -1
  339. package/presets/cursor/next/agents/task-analyst.md +1 -1
  340. package/presets/cursor/next/agents/task-router.md +1 -1
  341. package/presets/cursor/next/commands/README.md +1 -0
  342. package/presets/cursor/next/commands/task-continue.md +9 -0
  343. package/presets/cursor/next/commands/technical-retro.md +8 -0
  344. package/presets/cursor/next/commands/update.md +39 -0
  345. package/presets/cursor/next/hooks/README.md +6 -0
  346. package/presets/cursor/next/hooks/chain-team-phases.sh +206 -23
  347. package/presets/cursor/next/hooks/check-preset-update.mjs +227 -0
  348. package/presets/cursor/next/hooks/examples/README.md +1 -1
  349. package/presets/cursor/next/hooks.json +6 -0
  350. package/presets/cursor/next/mcp.json +1 -1
  351. package/presets/cursor/next/rules/README.md +3 -1
  352. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +1 -1
  353. package/presets/cursor/next/rules/component-catalog-gate.mdc +13 -0
  354. package/presets/cursor/next/rules/forms-validation.mdc +12 -0
  355. package/presets/cursor/next/rules/next-app-router.mdc +27 -0
  356. package/presets/cursor/next/rules/next-static-export.mdc +16 -0
  357. package/presets/cursor/next/rules/react-next-anti-hallucination.mdc +21 -18
  358. package/presets/cursor/next/rules/security-next.mdc +16 -2
  359. package/presets/cursor/next/skills/technical-retro/SKILL.md +2 -0
  360. package/presets/cursor/next/team/README.md +2 -0
  361. package/presets/cursor/next/team/fixtures/artifact-manifest.example.json +1 -0
  362. package/presets/cursor/next/team/fixtures/feature-light.json +2 -1
  363. package/presets/cursor/next/team/fixtures/feature-ui-standard.json +24 -0
  364. package/presets/cursor/nuxt/AGENTS.md +1 -0
  365. package/presets/cursor/nuxt/MCP.md +2 -2
  366. package/presets/cursor/nuxt/REPO_AGENTS.md +14 -0
  367. package/presets/cursor/nuxt/agents/build-verifier.md +1 -1
  368. package/presets/cursor/nuxt/agents/code-reviewer.md +1 -1
  369. package/presets/cursor/nuxt/agents/debugger.md +1 -1
  370. package/presets/cursor/nuxt/agents/feature-developer.md +1 -1
  371. package/presets/cursor/nuxt/agents/task-analyst.md +1 -1
  372. package/presets/cursor/nuxt/commands/README.md +1 -0
  373. package/presets/cursor/nuxt/commands/task-continue.md +9 -0
  374. package/presets/cursor/nuxt/commands/technical-retro.md +8 -0
  375. package/presets/cursor/nuxt/commands/update.md +39 -0
  376. package/presets/cursor/nuxt/hooks/README.md +4 -0
  377. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +252 -24
  378. package/presets/cursor/nuxt/hooks/check-preset-update.mjs +227 -0
  379. package/presets/cursor/nuxt/hooks/examples/README.md +1 -1
  380. package/presets/cursor/nuxt/hooks.json +6 -0
  381. package/presets/cursor/nuxt/mcp.json +1 -1
  382. package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +1 -1
  383. package/presets/cursor/nuxt/skills/technical-retro/SKILL.md +2 -0
  384. package/presets/cursor/nuxt/team/README.md +2 -0
  385. package/presets/cursor/nuxt/team/fixtures/artifact-manifest.example.json +1 -0
  386. package/presets/cursor/php-hexagonal/AGENTS.md +1 -1
  387. package/presets/cursor/php-hexagonal/REPO_AGENTS.md +14 -0
  388. package/presets/cursor/php-hexagonal/agents/build-verifier.md +1 -1
  389. package/presets/cursor/php-hexagonal/agents/code-reviewer.md +1 -1
  390. package/presets/cursor/php-hexagonal/agents/debugger.md +1 -1
  391. package/presets/cursor/php-hexagonal/agents/feature-developer.md +1 -1
  392. package/presets/cursor/php-hexagonal/agents/task-analyst.md +1 -1
  393. package/presets/cursor/php-hexagonal/commands/README.md +1 -0
  394. package/presets/cursor/php-hexagonal/commands/task-continue.md +9 -0
  395. package/presets/cursor/php-hexagonal/commands/technical-retro.md +8 -0
  396. package/presets/cursor/php-hexagonal/commands/update.md +39 -0
  397. package/presets/cursor/php-hexagonal/hooks/README.md +5 -1
  398. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +282 -26
  399. package/presets/cursor/php-hexagonal/hooks/check-preset-update.mjs +227 -0
  400. package/presets/cursor/php-hexagonal/hooks/examples/README.md +1 -1
  401. package/presets/cursor/php-hexagonal/hooks.json +6 -0
  402. package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +1 -1
  403. package/presets/cursor/php-hexagonal/skills/technical-retro/SKILL.md +2 -0
  404. package/presets/cursor/php-hexagonal/team/README.md +2 -0
  405. package/presets/cursor/php-laravel/AGENTS.md +1 -1
  406. package/presets/cursor/php-laravel/REPO_AGENTS.md +14 -0
  407. package/presets/cursor/php-laravel/agents/build-verifier.md +1 -1
  408. package/presets/cursor/php-laravel/agents/code-reviewer.md +1 -1
  409. package/presets/cursor/php-laravel/agents/debugger.md +1 -1
  410. package/presets/cursor/php-laravel/agents/feature-developer.md +1 -1
  411. package/presets/cursor/php-laravel/agents/task-analyst.md +1 -1
  412. package/presets/cursor/php-laravel/commands/README.md +1 -0
  413. package/presets/cursor/php-laravel/commands/task-continue.md +9 -0
  414. package/presets/cursor/php-laravel/commands/technical-retro.md +8 -0
  415. package/presets/cursor/php-laravel/commands/update.md +39 -0
  416. package/presets/cursor/php-laravel/hooks/README.md +5 -1
  417. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +282 -26
  418. package/presets/cursor/php-laravel/hooks/check-preset-update.mjs +227 -0
  419. package/presets/cursor/php-laravel/hooks/examples/README.md +1 -1
  420. package/presets/cursor/php-laravel/hooks.json +6 -0
  421. package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +1 -1
  422. package/presets/cursor/php-laravel/skills/technical-retro/SKILL.md +2 -0
  423. package/presets/cursor/php-laravel/team/README.md +2 -0
  424. package/presets/cursor/svelte/AGENTS.md +1 -0
  425. package/presets/cursor/svelte/MCP.md +2 -2
  426. package/presets/cursor/svelte/REPO_AGENTS.md +14 -0
  427. package/presets/cursor/svelte/agents/build-verifier.md +1 -1
  428. package/presets/cursor/svelte/agents/code-reviewer.md +1 -1
  429. package/presets/cursor/svelte/agents/debugger.md +1 -1
  430. package/presets/cursor/svelte/agents/feature-developer.md +1 -1
  431. package/presets/cursor/svelte/agents/task-analyst.md +1 -1
  432. package/presets/cursor/svelte/commands/README.md +1 -0
  433. package/presets/cursor/svelte/commands/task-continue.md +9 -0
  434. package/presets/cursor/svelte/commands/technical-retro.md +8 -0
  435. package/presets/cursor/svelte/commands/update.md +39 -0
  436. package/presets/cursor/svelte/hooks/README.md +4 -0
  437. package/presets/cursor/svelte/hooks/chain-team-phases.sh +252 -24
  438. package/presets/cursor/svelte/hooks/check-preset-update.mjs +227 -0
  439. package/presets/cursor/svelte/hooks/examples/README.md +1 -1
  440. package/presets/cursor/svelte/hooks.json +6 -0
  441. package/presets/cursor/svelte/mcp.json +1 -1
  442. package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +1 -1
  443. package/presets/cursor/svelte/skills/technical-retro/SKILL.md +2 -0
  444. package/presets/cursor/svelte/team/README.md +2 -0
  445. package/presets/cursor/svelte/team/fixtures/artifact-manifest.example.json +1 -0
  446. package/presets/mavis/android-kotlin/MAVIS.md +1 -0
  447. package/presets/mavis/android-kotlin/MCP.md +2 -2
  448. package/presets/mavis/android-kotlin/REPO_AGENTS.md +14 -0
  449. package/presets/mavis/android-kotlin/adapter-map.json +17 -1
  450. package/presets/mavis/android-kotlin/agents/build-verifier.md +1 -1
  451. package/presets/mavis/android-kotlin/agents/code-reviewer.md +1 -1
  452. package/presets/mavis/android-kotlin/agents/debugger.md +1 -1
  453. package/presets/mavis/android-kotlin/agents/feature-developer.md +1 -1
  454. package/presets/mavis/android-kotlin/agents/task-analyst.md +1 -1
  455. package/presets/mavis/android-kotlin/commands/README.md +1 -0
  456. package/presets/mavis/android-kotlin/commands/task-continue.md +9 -0
  457. package/presets/mavis/android-kotlin/commands/technical-retro.md +8 -0
  458. package/presets/mavis/android-kotlin/commands/update.md +34 -0
  459. package/presets/mavis/android-kotlin/hooks/README.md +3 -0
  460. package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +257 -25
  461. package/presets/mavis/android-kotlin/hooks/check-preset-update.mjs +227 -0
  462. package/presets/mavis/android-kotlin/mcp.json +1 -1
  463. package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +1 -1
  464. package/presets/mavis/android-kotlin/skills/technical-retro/SKILL.md +2 -0
  465. package/presets/mavis/android-kotlin/team/README.md +2 -0
  466. package/presets/mavis/android-kotlin/team/fixtures/artifact-manifest.example.json +1 -0
  467. package/presets/mavis/go/MCP.md +2 -2
  468. package/presets/mavis/go/REPO_AGENTS.md +14 -0
  469. package/presets/mavis/go/adapter-map.json +17 -1
  470. package/presets/mavis/go/agents/build-verifier.md +1 -1
  471. package/presets/mavis/go/agents/code-reviewer.md +1 -1
  472. package/presets/mavis/go/agents/debugger.md +1 -1
  473. package/presets/mavis/go/agents/feature-developer.md +1 -1
  474. package/presets/mavis/go/agents/task-analyst.md +1 -1
  475. package/presets/mavis/go/commands/README.md +1 -0
  476. package/presets/mavis/go/commands/task-continue.md +9 -0
  477. package/presets/mavis/go/commands/technical-retro.md +8 -0
  478. package/presets/mavis/go/commands/update.md +34 -0
  479. package/presets/mavis/go/hooks/README.md +3 -0
  480. package/presets/mavis/go/hooks/chain-team-phases.sh +282 -26
  481. package/presets/mavis/go/hooks/check-preset-update.mjs +227 -0
  482. package/presets/mavis/go/mcp.json +1 -1
  483. package/presets/mavis/go/rules/agent-team-orchestrator.md +1 -1
  484. package/presets/mavis/go/skills/technical-retro/SKILL.md +2 -0
  485. package/presets/mavis/go/team/README.md +2 -0
  486. package/presets/mavis/ios-swift/MAVIS.md +1 -0
  487. package/presets/mavis/ios-swift/MCP.md +2 -2
  488. package/presets/mavis/ios-swift/REPO_AGENTS.md +14 -0
  489. package/presets/mavis/ios-swift/adapter-map.json +17 -1
  490. package/presets/mavis/ios-swift/agents/build-verifier.md +1 -1
  491. package/presets/mavis/ios-swift/agents/code-reviewer.md +1 -1
  492. package/presets/mavis/ios-swift/agents/debugger.md +1 -1
  493. package/presets/mavis/ios-swift/agents/feature-developer.md +1 -1
  494. package/presets/mavis/ios-swift/agents/task-analyst.md +1 -1
  495. package/presets/mavis/ios-swift/commands/README.md +1 -0
  496. package/presets/mavis/ios-swift/commands/task-continue.md +9 -0
  497. package/presets/mavis/ios-swift/commands/technical-retro.md +8 -0
  498. package/presets/mavis/ios-swift/commands/update.md +34 -0
  499. package/presets/mavis/ios-swift/hooks/README.md +3 -0
  500. package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +257 -25
  501. package/presets/mavis/ios-swift/hooks/check-preset-update.mjs +227 -0
  502. package/presets/mavis/ios-swift/mcp.json +1 -1
  503. package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +1 -1
  504. package/presets/mavis/ios-swift/skills/technical-retro/SKILL.md +2 -0
  505. package/presets/mavis/ios-swift/team/README.md +2 -0
  506. package/presets/mavis/ios-swift/team/fixtures/artifact-manifest.example.json +1 -0
  507. package/presets/mavis/java/REPO_AGENTS.md +14 -0
  508. package/presets/mavis/java/adapter-map.json +17 -1
  509. package/presets/mavis/java/agents/build-verifier.md +1 -1
  510. package/presets/mavis/java/agents/code-reviewer.md +1 -1
  511. package/presets/mavis/java/agents/debugger.md +1 -1
  512. package/presets/mavis/java/agents/feature-developer.md +1 -1
  513. package/presets/mavis/java/agents/task-analyst.md +1 -1
  514. package/presets/mavis/java/commands/README.md +1 -0
  515. package/presets/mavis/java/commands/task-continue.md +9 -0
  516. package/presets/mavis/java/commands/technical-retro.md +8 -0
  517. package/presets/mavis/java/commands/update.md +34 -0
  518. package/presets/mavis/java/hooks/README.md +3 -0
  519. package/presets/mavis/java/hooks/chain-team-phases.sh +282 -26
  520. package/presets/mavis/java/hooks/check-preset-update.mjs +227 -0
  521. package/presets/mavis/java/rules/agent-team-orchestrator.md +1 -1
  522. package/presets/mavis/java/skills/technical-retro/SKILL.md +2 -0
  523. package/presets/mavis/java/team/README.md +2 -0
  524. package/presets/mavis/mcp-ts/REPO_AGENTS.md +14 -0
  525. package/presets/mavis/mcp-ts/adapter-map.json +17 -1
  526. package/presets/mavis/mcp-ts/agents/build-verifier.md +1 -1
  527. package/presets/mavis/mcp-ts/agents/feature-developer.md +1 -1
  528. package/presets/mavis/mcp-ts/agents/task-analyst.md +1 -1
  529. package/presets/mavis/mcp-ts/commands/README.md +1 -0
  530. package/presets/mavis/mcp-ts/commands/task-continue.md +9 -0
  531. package/presets/mavis/mcp-ts/commands/technical-retro.md +8 -0
  532. package/presets/mavis/mcp-ts/commands/update.md +34 -0
  533. package/presets/mavis/mcp-ts/hooks/README.md +3 -0
  534. package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +286 -28
  535. package/presets/mavis/mcp-ts/hooks/check-preset-update.mjs +227 -0
  536. package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +1 -1
  537. package/presets/mavis/mcp-ts/team/README.md +2 -0
  538. package/presets/mavis/next/MAVIS.md +1 -0
  539. package/presets/mavis/next/MCP.md +2 -2
  540. package/presets/mavis/next/REPO_AGENTS.md +15 -1
  541. package/presets/mavis/next/adapter-map.json +25 -1
  542. package/presets/mavis/next/agents/build-verifier.md +1 -1
  543. package/presets/mavis/next/agents/code-reviewer.md +1 -1
  544. package/presets/mavis/next/agents/debugger.md +1 -1
  545. package/presets/mavis/next/agents/feature-developer.md +1 -1
  546. package/presets/mavis/next/agents/task-analyst.md +1 -1
  547. package/presets/mavis/next/agents/task-router.md +1 -1
  548. package/presets/mavis/next/commands/README.md +1 -0
  549. package/presets/mavis/next/commands/task-continue.md +9 -0
  550. package/presets/mavis/next/commands/technical-retro.md +8 -0
  551. package/presets/mavis/next/commands/update.md +34 -0
  552. package/presets/mavis/next/hooks/README.md +3 -0
  553. package/presets/mavis/next/hooks/chain-team-phases.sh +206 -23
  554. package/presets/mavis/next/hooks/check-preset-update.mjs +227 -0
  555. package/presets/mavis/next/mcp.json +1 -1
  556. package/presets/mavis/next/rules/agent-team-orchestrator.md +1 -1
  557. package/presets/mavis/next/rules/component-catalog-gate.md +13 -0
  558. package/presets/mavis/next/rules/forms-validation.md +12 -0
  559. package/presets/mavis/next/rules/next-app-router.md +27 -0
  560. package/presets/mavis/next/rules/next-static-export.md +16 -0
  561. package/presets/mavis/next/rules/react-next-anti-hallucination.md +20 -18
  562. package/presets/mavis/next/rules/security-next.md +13 -0
  563. package/presets/mavis/next/skills/technical-retro/SKILL.md +2 -0
  564. package/presets/mavis/next/team/README.md +2 -0
  565. package/presets/mavis/next/team/fixtures/artifact-manifest.example.json +1 -0
  566. package/presets/mavis/next/team/fixtures/feature-light.json +2 -1
  567. package/presets/mavis/next/team/fixtures/feature-ui-standard.json +24 -0
  568. package/presets/mavis/nuxt/MAVIS.md +1 -0
  569. package/presets/mavis/nuxt/MCP.md +2 -2
  570. package/presets/mavis/nuxt/REPO_AGENTS.md +14 -0
  571. package/presets/mavis/nuxt/adapter-map.json +17 -1
  572. package/presets/mavis/nuxt/agents/build-verifier.md +1 -1
  573. package/presets/mavis/nuxt/agents/code-reviewer.md +1 -1
  574. package/presets/mavis/nuxt/agents/debugger.md +1 -1
  575. package/presets/mavis/nuxt/agents/feature-developer.md +1 -1
  576. package/presets/mavis/nuxt/agents/task-analyst.md +1 -1
  577. package/presets/mavis/nuxt/commands/README.md +1 -0
  578. package/presets/mavis/nuxt/commands/task-continue.md +9 -0
  579. package/presets/mavis/nuxt/commands/technical-retro.md +8 -0
  580. package/presets/mavis/nuxt/commands/update.md +34 -0
  581. package/presets/mavis/nuxt/hooks/README.md +3 -0
  582. package/presets/mavis/nuxt/hooks/chain-team-phases.sh +252 -24
  583. package/presets/mavis/nuxt/hooks/check-preset-update.mjs +227 -0
  584. package/presets/mavis/nuxt/mcp.json +1 -1
  585. package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +1 -1
  586. package/presets/mavis/nuxt/skills/technical-retro/SKILL.md +2 -0
  587. package/presets/mavis/nuxt/team/README.md +2 -0
  588. package/presets/mavis/nuxt/team/fixtures/artifact-manifest.example.json +1 -0
  589. package/presets/mavis/php-hexagonal/REPO_AGENTS.md +14 -0
  590. package/presets/mavis/php-hexagonal/adapter-map.json +17 -1
  591. package/presets/mavis/php-hexagonal/agents/build-verifier.md +1 -1
  592. package/presets/mavis/php-hexagonal/agents/code-reviewer.md +1 -1
  593. package/presets/mavis/php-hexagonal/agents/debugger.md +1 -1
  594. package/presets/mavis/php-hexagonal/agents/feature-developer.md +1 -1
  595. package/presets/mavis/php-hexagonal/agents/task-analyst.md +1 -1
  596. package/presets/mavis/php-hexagonal/commands/README.md +1 -0
  597. package/presets/mavis/php-hexagonal/commands/task-continue.md +9 -0
  598. package/presets/mavis/php-hexagonal/commands/technical-retro.md +8 -0
  599. package/presets/mavis/php-hexagonal/commands/update.md +34 -0
  600. package/presets/mavis/php-hexagonal/hooks/README.md +3 -0
  601. package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +282 -26
  602. package/presets/mavis/php-hexagonal/hooks/check-preset-update.mjs +227 -0
  603. package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +1 -1
  604. package/presets/mavis/php-hexagonal/skills/technical-retro/SKILL.md +2 -0
  605. package/presets/mavis/php-hexagonal/team/README.md +2 -0
  606. package/presets/mavis/php-laravel/REPO_AGENTS.md +14 -0
  607. package/presets/mavis/php-laravel/adapter-map.json +17 -1
  608. package/presets/mavis/php-laravel/agents/build-verifier.md +1 -1
  609. package/presets/mavis/php-laravel/agents/code-reviewer.md +1 -1
  610. package/presets/mavis/php-laravel/agents/debugger.md +1 -1
  611. package/presets/mavis/php-laravel/agents/feature-developer.md +1 -1
  612. package/presets/mavis/php-laravel/agents/task-analyst.md +1 -1
  613. package/presets/mavis/php-laravel/commands/README.md +1 -0
  614. package/presets/mavis/php-laravel/commands/task-continue.md +9 -0
  615. package/presets/mavis/php-laravel/commands/technical-retro.md +8 -0
  616. package/presets/mavis/php-laravel/commands/update.md +34 -0
  617. package/presets/mavis/php-laravel/hooks/README.md +3 -0
  618. package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +282 -26
  619. package/presets/mavis/php-laravel/hooks/check-preset-update.mjs +227 -0
  620. package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +1 -1
  621. package/presets/mavis/php-laravel/skills/technical-retro/SKILL.md +2 -0
  622. package/presets/mavis/php-laravel/team/README.md +2 -0
  623. package/presets/mavis/svelte/MAVIS.md +1 -0
  624. package/presets/mavis/svelte/MCP.md +2 -2
  625. package/presets/mavis/svelte/REPO_AGENTS.md +14 -0
  626. package/presets/mavis/svelte/adapter-map.json +17 -1
  627. package/presets/mavis/svelte/agents/build-verifier.md +1 -1
  628. package/presets/mavis/svelte/agents/code-reviewer.md +1 -1
  629. package/presets/mavis/svelte/agents/debugger.md +1 -1
  630. package/presets/mavis/svelte/agents/feature-developer.md +1 -1
  631. package/presets/mavis/svelte/agents/task-analyst.md +1 -1
  632. package/presets/mavis/svelte/commands/README.md +1 -0
  633. package/presets/mavis/svelte/commands/task-continue.md +9 -0
  634. package/presets/mavis/svelte/commands/technical-retro.md +8 -0
  635. package/presets/mavis/svelte/commands/update.md +34 -0
  636. package/presets/mavis/svelte/hooks/README.md +3 -0
  637. package/presets/mavis/svelte/hooks/chain-team-phases.sh +252 -24
  638. package/presets/mavis/svelte/hooks/check-preset-update.mjs +227 -0
  639. package/presets/mavis/svelte/mcp.json +1 -1
  640. package/presets/mavis/svelte/rules/agent-team-orchestrator.md +1 -1
  641. package/presets/mavis/svelte/skills/technical-retro/SKILL.md +2 -0
  642. package/presets/mavis/svelte/team/README.md +2 -0
  643. package/presets/mavis/svelte/team/fixtures/artifact-manifest.example.json +1 -0
  644. package/presets/opencode/android-kotlin/MCP.md +2 -2
  645. package/presets/opencode/android-kotlin/OPENCODE.md +15 -6
  646. package/presets/opencode/android-kotlin/REPO_AGENTS.md +14 -0
  647. package/presets/opencode/android-kotlin/adapter-map.json +17 -1
  648. package/presets/opencode/android-kotlin/agents/build-verifier.md +1 -1
  649. package/presets/opencode/android-kotlin/agents/code-reviewer.md +1 -1
  650. package/presets/opencode/android-kotlin/agents/debugger.md +1 -1
  651. package/presets/opencode/android-kotlin/agents/feature-developer.md +1 -1
  652. package/presets/opencode/android-kotlin/agents/task-analyst.md +1 -1
  653. package/presets/opencode/android-kotlin/commands/README.md +1 -0
  654. package/presets/opencode/android-kotlin/commands/task-continue.md +9 -0
  655. package/presets/opencode/android-kotlin/commands/technical-retro.md +8 -0
  656. package/presets/opencode/android-kotlin/commands/update.md +42 -0
  657. package/presets/opencode/android-kotlin/hooks/README.md +3 -0
  658. package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +257 -25
  659. package/presets/opencode/android-kotlin/hooks/check-preset-update.mjs +227 -0
  660. package/presets/opencode/android-kotlin/opencode.json +3 -13
  661. package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +1 -1
  662. package/presets/opencode/android-kotlin/skills/technical-retro/SKILL.md +2 -0
  663. package/presets/opencode/android-kotlin/team/README.md +2 -0
  664. package/presets/opencode/android-kotlin/team/fixtures/artifact-manifest.example.json +1 -0
  665. package/presets/opencode/go/MCP.md +2 -2
  666. package/presets/opencode/go/OPENCODE.md +14 -6
  667. package/presets/opencode/go/REPO_AGENTS.md +14 -0
  668. package/presets/opencode/go/adapter-map.json +17 -1
  669. package/presets/opencode/go/agents/build-verifier.md +1 -1
  670. package/presets/opencode/go/agents/code-reviewer.md +1 -1
  671. package/presets/opencode/go/agents/debugger.md +1 -1
  672. package/presets/opencode/go/agents/feature-developer.md +1 -1
  673. package/presets/opencode/go/agents/task-analyst.md +1 -1
  674. package/presets/opencode/go/commands/README.md +1 -0
  675. package/presets/opencode/go/commands/task-continue.md +9 -0
  676. package/presets/opencode/go/commands/technical-retro.md +8 -0
  677. package/presets/opencode/go/commands/update.md +42 -0
  678. package/presets/opencode/go/hooks/README.md +3 -0
  679. package/presets/opencode/go/hooks/chain-team-phases.sh +282 -26
  680. package/presets/opencode/go/hooks/check-preset-update.mjs +227 -0
  681. package/presets/opencode/go/opencode.json +3 -13
  682. package/presets/opencode/go/rules/agent-team-orchestrator.md +1 -1
  683. package/presets/opencode/go/skills/technical-retro/SKILL.md +2 -0
  684. package/presets/opencode/go/team/README.md +2 -0
  685. package/presets/opencode/ios-swift/MCP.md +2 -2
  686. package/presets/opencode/ios-swift/OPENCODE.md +15 -6
  687. package/presets/opencode/ios-swift/REPO_AGENTS.md +14 -0
  688. package/presets/opencode/ios-swift/adapter-map.json +17 -1
  689. package/presets/opencode/ios-swift/agents/build-verifier.md +1 -1
  690. package/presets/opencode/ios-swift/agents/code-reviewer.md +1 -1
  691. package/presets/opencode/ios-swift/agents/debugger.md +1 -1
  692. package/presets/opencode/ios-swift/agents/feature-developer.md +1 -1
  693. package/presets/opencode/ios-swift/agents/task-analyst.md +1 -1
  694. package/presets/opencode/ios-swift/commands/README.md +1 -0
  695. package/presets/opencode/ios-swift/commands/task-continue.md +9 -0
  696. package/presets/opencode/ios-swift/commands/technical-retro.md +8 -0
  697. package/presets/opencode/ios-swift/commands/update.md +42 -0
  698. package/presets/opencode/ios-swift/hooks/README.md +3 -0
  699. package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +257 -25
  700. package/presets/opencode/ios-swift/hooks/check-preset-update.mjs +227 -0
  701. package/presets/opencode/ios-swift/opencode.json +3 -13
  702. package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +1 -1
  703. package/presets/opencode/ios-swift/skills/technical-retro/SKILL.md +2 -0
  704. package/presets/opencode/ios-swift/team/README.md +2 -0
  705. package/presets/opencode/ios-swift/team/fixtures/artifact-manifest.example.json +1 -0
  706. package/presets/opencode/java/OPENCODE.md +14 -6
  707. package/presets/opencode/java/REPO_AGENTS.md +14 -0
  708. package/presets/opencode/java/adapter-map.json +17 -1
  709. package/presets/opencode/java/agents/build-verifier.md +1 -1
  710. package/presets/opencode/java/agents/code-reviewer.md +1 -1
  711. package/presets/opencode/java/agents/debugger.md +1 -1
  712. package/presets/opencode/java/agents/feature-developer.md +1 -1
  713. package/presets/opencode/java/agents/task-analyst.md +1 -1
  714. package/presets/opencode/java/commands/README.md +1 -0
  715. package/presets/opencode/java/commands/task-continue.md +9 -0
  716. package/presets/opencode/java/commands/technical-retro.md +8 -0
  717. package/presets/opencode/java/commands/update.md +42 -0
  718. package/presets/opencode/java/hooks/README.md +3 -0
  719. package/presets/opencode/java/hooks/chain-team-phases.sh +282 -26
  720. package/presets/opencode/java/hooks/check-preset-update.mjs +227 -0
  721. package/presets/opencode/java/opencode.json +2 -12
  722. package/presets/opencode/java/rules/agent-team-orchestrator.md +1 -1
  723. package/presets/opencode/java/skills/technical-retro/SKILL.md +2 -0
  724. package/presets/opencode/java/team/README.md +2 -0
  725. package/presets/opencode/mcp-ts/OPENCODE.md +14 -6
  726. package/presets/opencode/mcp-ts/REPO_AGENTS.md +14 -0
  727. package/presets/opencode/mcp-ts/adapter-map.json +17 -1
  728. package/presets/opencode/mcp-ts/agents/build-verifier.md +1 -1
  729. package/presets/opencode/mcp-ts/agents/feature-developer.md +1 -1
  730. package/presets/opencode/mcp-ts/agents/task-analyst.md +1 -1
  731. package/presets/opencode/mcp-ts/commands/README.md +1 -0
  732. package/presets/opencode/mcp-ts/commands/task-continue.md +9 -0
  733. package/presets/opencode/mcp-ts/commands/technical-retro.md +8 -0
  734. package/presets/opencode/mcp-ts/commands/update.md +42 -0
  735. package/presets/opencode/mcp-ts/hooks/README.md +3 -0
  736. package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +286 -28
  737. package/presets/opencode/mcp-ts/hooks/check-preset-update.mjs +227 -0
  738. package/presets/opencode/mcp-ts/opencode.json +2 -12
  739. package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +1 -1
  740. package/presets/opencode/mcp-ts/team/README.md +2 -0
  741. package/presets/opencode/next/MCP.md +2 -2
  742. package/presets/opencode/next/OPENCODE.md +15 -6
  743. package/presets/opencode/next/REPO_AGENTS.md +15 -1
  744. package/presets/opencode/next/adapter-map.json +25 -1
  745. package/presets/opencode/next/agents/build-verifier.md +1 -1
  746. package/presets/opencode/next/agents/code-reviewer.md +1 -1
  747. package/presets/opencode/next/agents/debugger.md +1 -1
  748. package/presets/opencode/next/agents/feature-developer.md +1 -1
  749. package/presets/opencode/next/agents/task-analyst.md +1 -1
  750. package/presets/opencode/next/agents/task-router.md +1 -1
  751. package/presets/opencode/next/commands/README.md +1 -0
  752. package/presets/opencode/next/commands/task-continue.md +9 -0
  753. package/presets/opencode/next/commands/technical-retro.md +8 -0
  754. package/presets/opencode/next/commands/update.md +42 -0
  755. package/presets/opencode/next/hooks/README.md +3 -0
  756. package/presets/opencode/next/hooks/chain-team-phases.sh +206 -23
  757. package/presets/opencode/next/hooks/check-preset-update.mjs +227 -0
  758. package/presets/opencode/next/opencode.json +3 -13
  759. package/presets/opencode/next/rules/agent-team-orchestrator.md +1 -1
  760. package/presets/opencode/next/rules/component-catalog-gate.md +13 -0
  761. package/presets/opencode/next/rules/forms-validation.md +12 -0
  762. package/presets/opencode/next/rules/next-app-router.md +27 -0
  763. package/presets/opencode/next/rules/next-static-export.md +16 -0
  764. package/presets/opencode/next/rules/react-next-anti-hallucination.md +20 -18
  765. package/presets/opencode/next/rules/security-next.md +13 -0
  766. package/presets/opencode/next/skills/technical-retro/SKILL.md +2 -0
  767. package/presets/opencode/next/team/README.md +2 -0
  768. package/presets/opencode/next/team/fixtures/artifact-manifest.example.json +1 -0
  769. package/presets/opencode/next/team/fixtures/feature-light.json +2 -1
  770. package/presets/opencode/next/team/fixtures/feature-ui-standard.json +24 -0
  771. package/presets/opencode/nuxt/MCP.md +2 -2
  772. package/presets/opencode/nuxt/OPENCODE.md +15 -6
  773. package/presets/opencode/nuxt/REPO_AGENTS.md +14 -0
  774. package/presets/opencode/nuxt/adapter-map.json +17 -1
  775. package/presets/opencode/nuxt/agents/build-verifier.md +1 -1
  776. package/presets/opencode/nuxt/agents/code-reviewer.md +1 -1
  777. package/presets/opencode/nuxt/agents/debugger.md +1 -1
  778. package/presets/opencode/nuxt/agents/feature-developer.md +1 -1
  779. package/presets/opencode/nuxt/agents/task-analyst.md +1 -1
  780. package/presets/opencode/nuxt/commands/README.md +1 -0
  781. package/presets/opencode/nuxt/commands/task-continue.md +9 -0
  782. package/presets/opencode/nuxt/commands/technical-retro.md +8 -0
  783. package/presets/opencode/nuxt/commands/update.md +42 -0
  784. package/presets/opencode/nuxt/hooks/README.md +3 -0
  785. package/presets/opencode/nuxt/hooks/chain-team-phases.sh +252 -24
  786. package/presets/opencode/nuxt/hooks/check-preset-update.mjs +227 -0
  787. package/presets/opencode/nuxt/opencode.json +3 -13
  788. package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +1 -1
  789. package/presets/opencode/nuxt/skills/technical-retro/SKILL.md +2 -0
  790. package/presets/opencode/nuxt/team/README.md +2 -0
  791. package/presets/opencode/nuxt/team/fixtures/artifact-manifest.example.json +1 -0
  792. package/presets/opencode/php-hexagonal/OPENCODE.md +14 -6
  793. package/presets/opencode/php-hexagonal/REPO_AGENTS.md +14 -0
  794. package/presets/opencode/php-hexagonal/adapter-map.json +17 -1
  795. package/presets/opencode/php-hexagonal/agents/build-verifier.md +1 -1
  796. package/presets/opencode/php-hexagonal/agents/code-reviewer.md +1 -1
  797. package/presets/opencode/php-hexagonal/agents/debugger.md +1 -1
  798. package/presets/opencode/php-hexagonal/agents/feature-developer.md +1 -1
  799. package/presets/opencode/php-hexagonal/agents/task-analyst.md +1 -1
  800. package/presets/opencode/php-hexagonal/commands/README.md +1 -0
  801. package/presets/opencode/php-hexagonal/commands/task-continue.md +9 -0
  802. package/presets/opencode/php-hexagonal/commands/technical-retro.md +8 -0
  803. package/presets/opencode/php-hexagonal/commands/update.md +42 -0
  804. package/presets/opencode/php-hexagonal/hooks/README.md +3 -0
  805. package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +282 -26
  806. package/presets/opencode/php-hexagonal/hooks/check-preset-update.mjs +227 -0
  807. package/presets/opencode/php-hexagonal/opencode.json +2 -12
  808. package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +1 -1
  809. package/presets/opencode/php-hexagonal/skills/technical-retro/SKILL.md +2 -0
  810. package/presets/opencode/php-hexagonal/team/README.md +2 -0
  811. package/presets/opencode/php-laravel/OPENCODE.md +14 -6
  812. package/presets/opencode/php-laravel/REPO_AGENTS.md +14 -0
  813. package/presets/opencode/php-laravel/adapter-map.json +17 -1
  814. package/presets/opencode/php-laravel/agents/build-verifier.md +1 -1
  815. package/presets/opencode/php-laravel/agents/code-reviewer.md +1 -1
  816. package/presets/opencode/php-laravel/agents/debugger.md +1 -1
  817. package/presets/opencode/php-laravel/agents/feature-developer.md +1 -1
  818. package/presets/opencode/php-laravel/agents/task-analyst.md +1 -1
  819. package/presets/opencode/php-laravel/commands/README.md +1 -0
  820. package/presets/opencode/php-laravel/commands/task-continue.md +9 -0
  821. package/presets/opencode/php-laravel/commands/technical-retro.md +8 -0
  822. package/presets/opencode/php-laravel/commands/update.md +42 -0
  823. package/presets/opencode/php-laravel/hooks/README.md +3 -0
  824. package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +282 -26
  825. package/presets/opencode/php-laravel/hooks/check-preset-update.mjs +227 -0
  826. package/presets/opencode/php-laravel/opencode.json +2 -12
  827. package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +1 -1
  828. package/presets/opencode/php-laravel/skills/technical-retro/SKILL.md +2 -0
  829. package/presets/opencode/php-laravel/team/README.md +2 -0
  830. package/presets/opencode/svelte/MCP.md +2 -2
  831. package/presets/opencode/svelte/OPENCODE.md +15 -6
  832. package/presets/opencode/svelte/REPO_AGENTS.md +14 -0
  833. package/presets/opencode/svelte/adapter-map.json +17 -1
  834. package/presets/opencode/svelte/agents/build-verifier.md +1 -1
  835. package/presets/opencode/svelte/agents/code-reviewer.md +1 -1
  836. package/presets/opencode/svelte/agents/debugger.md +1 -1
  837. package/presets/opencode/svelte/agents/feature-developer.md +1 -1
  838. package/presets/opencode/svelte/agents/task-analyst.md +1 -1
  839. package/presets/opencode/svelte/commands/README.md +1 -0
  840. package/presets/opencode/svelte/commands/task-continue.md +9 -0
  841. package/presets/opencode/svelte/commands/technical-retro.md +8 -0
  842. package/presets/opencode/svelte/commands/update.md +42 -0
  843. package/presets/opencode/svelte/hooks/README.md +3 -0
  844. package/presets/opencode/svelte/hooks/chain-team-phases.sh +252 -24
  845. package/presets/opencode/svelte/hooks/check-preset-update.mjs +227 -0
  846. package/presets/opencode/svelte/opencode.json +3 -13
  847. package/presets/opencode/svelte/rules/agent-team-orchestrator.md +1 -1
  848. package/presets/opencode/svelte/skills/technical-retro/SKILL.md +2 -0
  849. package/presets/opencode/svelte/team/README.md +2 -0
  850. package/presets/opencode/svelte/team/fixtures/artifact-manifest.example.json +1 -0
  851. package/scripts/check-product-specs.sh +115 -9
@@ -156,7 +156,21 @@ function mutateMetrics(mutator) {
156
156
  try { metrics = JSON.parse(fs.readFileSync(METRICS_PATH, 'utf8')); } catch {
157
157
  const runId = status.metricsRunId || `${slug}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
158
158
  status.metricsRunId = runId;
159
- metrics = { schemaVersion: 1, task: { runId, slug, preset: 'ai-rules', stack: STACK, platform: PLATFORM, intent: status.intent || 'unknown', profile: 'unknown' }, events: [] };
159
+ // Resolve profile from pipeline.json (preferred) or status.json, falling back to 'unknown'.
160
+ // The router/agent must never write profile into status.json — pipeline.json is the SoT.
161
+ let profile = 'unknown';
162
+ try {
163
+ if (fs.existsSync(pipelinePath)) {
164
+ const pipe = JSON.parse(fs.readFileSync(pipelinePath, 'utf8'));
165
+ if (pipe && (pipe.profile === 'light' || pipe.profile === 'standard' || pipe.profile === 'full')) {
166
+ profile = pipe.profile;
167
+ }
168
+ }
169
+ } catch {}
170
+ if (profile === 'unknown' && (status.profile === 'light' || status.profile === 'standard' || status.profile === 'full')) {
171
+ profile = status.profile;
172
+ }
173
+ metrics = { schemaVersion: 1, task: { runId, slug, preset: 'ai-rules', stack: STACK, platform: PLATFORM, intent: status.intent || 'unknown', profile }, events: [] };
160
174
  metrics.events.push({ eventId: `${runId}:task_started`, type: 'task_started', at: now, source: 'hook', attributionConfidence: 'high' });
161
175
  }
162
176
  mutator(metrics);
@@ -227,21 +241,119 @@ function resolvedAttempt() {
227
241
  const active = status.activeAttempts || {}; const entries = Object.entries(active);
228
242
  const stableAttemptId = hookInput.attemptId;
229
243
  if (stableAttemptId) {
230
- return active[stableAttemptId] ? { attemptId: stableAttemptId, entry: active[stableAttemptId], confidence: 'high' } : null;
244
+ return active[stableAttemptId]
245
+ ? { attemptId: stableAttemptId, entry: active[stableAttemptId], confidence: 'high' }
246
+ : null;
231
247
  }
232
248
  if (entries.length === 1) return { attemptId: entries[0][0], entry: entries[0][1], confidence: 'high' };
233
249
  try { const receipts = JSON.parse(fs.readFileSync(path.join(taskDir, '.metrics-receipts.json'), 'utf8')); const receipt = Array.isArray(receipts) ? receipts.find((item) => active[item.attemptId]) : null; if (receipt) return { attemptId: receipt.attemptId, entry: active[receipt.attemptId], confidence: 'fallback', source: 'agent' }; } catch {}
234
250
  return null;
235
251
  }
252
+ let artifactStallMessage = null;
253
+
254
+ // A1: seed the manifest a modern pipeline expects instead of advancing without
255
+ // one. Exclusive publish via hard link so a producer that wrote the file in the
256
+ // meantime is never overwritten; returns null on success (or when the file
257
+ // appeared) and the fs error otherwise.
258
+ function writeSkeletonManifest(manifestPath) {
259
+ const temporary = `${manifestPath}.${process.pid}.${Date.now()}.seed`;
260
+ const body = JSON.stringify({ schemaVersion: 1, slug, artifacts: [] }, null, 2) + '\n';
261
+ let descriptor = null;
262
+ try {
263
+ descriptor = fs.openSync(temporary, 'wx');
264
+ try { fs.writeSync(descriptor, body); try { fs.fsyncSync(descriptor); } catch {} } finally { fs.closeSync(descriptor); descriptor = null; }
265
+ fs.linkSync(temporary, manifestPath);
266
+ fs.unlinkSync(temporary);
267
+ return null;
268
+ } catch (error) {
269
+ if (descriptor !== null) { try { fs.closeSync(descriptor); } catch {} }
270
+ try { fs.unlinkSync(temporary); } catch {}
271
+ if (error && error.code === 'EEXIST' && fs.existsSync(manifestPath)) return null;
272
+ return String(error && error.message ? error.message : error);
273
+ }
274
+ }
275
+
276
+ // A2: a `completed` receipt must cite evidence the harness can inspect. Order is
277
+ // the message order — the first failing predicate wins, so the operator sees one
278
+ // actionable line. `authoritativePaths[]` stays task-dir-relative; external
279
+ // references belong in `evidencePaths[]`.
280
+ function validateCompletedArtifact(entry) {
281
+ const artifactId = entry && entry.id ? entry.id : '(unnamed)';
282
+ const entryStatus = entry && entry.status;
283
+ if (entryStatus !== 'completed') {
284
+ return `[chain-team-phases] ${slug}: receipt "${artifactId}" has receipt.outcome "completed" but entry status "${entryStatus}". Make entry.status and receipt.outcome agree, then resume with: /task-continue ${slug}`;
285
+ }
286
+ const authoritativePaths = entry && Array.isArray(entry.authoritativePaths) ? entry.authoritativePaths : [];
287
+ if (authoritativePaths.length === 0) {
288
+ return `[chain-team-phases] ${slug}: receipt "${artifactId}" is "completed" but authoritativePaths[] is empty. Record at least one file you produced under .ai.local/team/tasks/${slug}/, then resume with: /task-continue ${slug}`;
289
+ }
290
+ for (const cited of authoritativePaths) {
291
+ const value = typeof cited === 'string' ? cited.trim() : '';
292
+ const resolvedPath = value ? path.resolve(taskDir, value) : taskDir;
293
+ const relative = path.relative(taskDir, resolvedPath);
294
+ const escapes = !value || path.isAbsolute(value) || relative === '' || relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative);
295
+ if (escapes) {
296
+ return `[chain-team-phases] ${slug}: receipt "${artifactId}" cites "${value}", which resolves outside .ai.local/team/tasks/${slug}/ (relative: "${relative}"). Cite a task-relative path; keep external references in evidencePaths[]. Then resume with: /task-continue ${slug}`;
297
+ }
298
+ let stat = null;
299
+ try { stat = fs.statSync(resolvedPath); } catch {}
300
+ if (!stat || !stat.isFile()) {
301
+ return `[chain-team-phases] ${slug}: receipt "${artifactId}" cites "${value}" but no such file exists under .ai.local/team/tasks/${slug}/. Write the file, then resume with: /task-continue ${slug}`;
302
+ }
303
+ if (/\.md[c]?$/i.test(value)) {
304
+ let content = '';
305
+ try { content = fs.readFileSync(resolvedPath, 'utf8'); } catch {}
306
+ if (!/\S/.test(content)) {
307
+ return `[chain-team-phases] ${slug}: receipt "${artifactId}" is "completed" but authoritative path "${value}" has no non-whitespace content. Produce the artifact, then resume with: /task-continue ${slug}`;
308
+ }
309
+ }
310
+ }
311
+ return null;
312
+ }
313
+
236
314
  function readBoundReceiptOutcome(agent, step, resolved) {
237
315
  if (!agent || !resolved) return { outcome: null, receiptRequired: false };
238
316
  const manifestPath = path.join(taskDir, 'artifact-manifest.json');
239
- if (!fs.existsSync(manifestPath)) return { outcome: null, receiptRequired: false };
317
+ const expectedOutputId = artifactOutputIdFor(step, agent);
318
+ if (!fs.existsSync(manifestPath)) {
319
+ // A1: absent manifest + a parsed modern pipeline denies silent advancement.
320
+ // Legacy/step-less pipelines keep their previous behaviour (legacyFlow owns them).
321
+ if (!(Array.isArray(steps) && steps.length > 0)) return { outcome: null, receiptRequired: false };
322
+ const seeded = writeSkeletonManifest(manifestPath);
323
+ const stepIndex = typeof resolved.entry.stepIndex === 'number' ? resolved.entry.stepIndex : 0;
324
+ if (seeded) {
325
+ return { outcome: null, receiptRequired: true, stallMessage: `[chain-team-phases] ${slug}: artifact-manifest.json is missing and the skeleton could not be written (${seeded}). Create .ai.local/team/tasks/${slug}/artifact-manifest.json with {schemaVersion:1, slug, artifacts:[]}, add the receipt for artifactOutputId "${expectedOutputId}", then resume with: /task-continue ${slug}` };
326
+ }
327
+ return { outcome: null, receiptRequired: true, stallMessage: `[chain-team-phases] ${slug}: no artifact-manifest.json for step ${stepIndex} (${agent}). Wrote a skeleton {schemaVersion:1, slug, artifacts:[]}. Expected artifactOutputId "${expectedOutputId}". Write the artifact and its receipt, then resume with: /task-continue ${slug}` };
328
+ }
240
329
  try {
241
330
  const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
331
+ // Guard: the schema key is `artifacts` (see agent-artifact-contracts.md). A top-level
332
+ // `entries` key is a silent bug — producer wrote to a wrong field, hook would not
333
+ // see the receipt, and the step hangs in `awaiting_artifact_receipt`. Warn loudly.
334
+ if (manifest && typeof manifest === 'object' && !Array.isArray(manifest.artifacts) && Array.isArray(manifest.entries)) {
335
+ process.stderr.write(`WARNING: ${manifestPath} has top-level "entries" but no "artifacts" array; reading only "artifacts" per schema. The producer likely upserted into the wrong key. See agent-artifact-contracts.md (Schema field name).` + '\n');
336
+ } else if (manifest && typeof manifest === 'object' && Array.isArray(manifest.entries) && Array.isArray(manifest.artifacts)) {
337
+ process.stderr.write(`WARNING: ${manifestPath} has both "artifacts" and "entries" keys; reading only "artifacts" per schema. Foreign "entries" content is ignored.` + '\n');
338
+ }
242
339
  const artifacts = Array.isArray(manifest.artifacts) ? manifest.artifacts : [];
243
- const expectedOutputId = artifactOutputIdFor(step, agent);
244
340
  const attemptStartedAt = Date.parse(resolved.entry.startedAt);
341
+ // Pre-scan: warn on the silent-bug classes the filter below would otherwise drop.
342
+ // A receipt with a non-matching attemptId is dropped silently; without this warning,
343
+ // the step hangs in `awaiting_artifact_receipt` with no signal of why. Same for
344
+ // receipts whose terminal timestamp is older than the active attempt (stale retry).
345
+ const activeIds = new Set(Object.keys(status.activeAttempts || {}));
346
+ for (const entry of artifacts) {
347
+ if (!entry || entry.producer !== agent || !entry.receipt || typeof entry.receipt.outcome !== 'string') continue;
348
+ const rid = entry.receipt.attemptId;
349
+ if (typeof rid === 'string' && rid !== resolved.attemptId && !activeIds.has(rid)) {
350
+ process.stderr.write(`WARNING: ${manifestPath} receipt for producer "${agent}" id "${entry.id}" carries attemptId "${rid}" that does not match the active attempt "${resolved.attemptId}". The receipt is being dropped; step will hang in \`awaiting_artifact_receipt\` unless the producer retries. Common cause: agent reused an attemptId from a prior failed attempt. See agent-artifact-contracts.md (Receipt binding).` + '\n');
351
+ }
352
+ const terminalAt = Date.parse(entry.timestamps?.completedAt || entry.timestamps?.updatedAt || '');
353
+ if (Number.isFinite(attemptStartedAt) && Number.isFinite(terminalAt) && terminalAt < attemptStartedAt) {
354
+ process.stderr.write(`WARNING: ${manifestPath} receipt for producer "${agent}" id "${entry.id}" has timestamps.completedAt older than the active attempt's startedAt. Likely a stale receipt from a previous attempt; it is being dropped. See agent-artifact-contracts.md (Receipt binding).` + '\n');
355
+ }
356
+ }
245
357
  const owned = artifacts
246
358
  .filter((entry) => {
247
359
  if (!entry || entry.producer !== agent || !entry.receipt || typeof entry.receipt.outcome !== 'string') return false;
@@ -256,19 +368,33 @@ function readBoundReceiptOutcome(agent, step, resolved) {
256
368
  const tb = Date.parse(b.timestamps?.completedAt || b.timestamps?.updatedAt || 0) || 0;
257
369
  return tb - ta;
258
370
  });
259
- return { outcome: owned[0]?.receipt?.outcome || null, receiptRequired: true };
371
+ // Bonus: warn if the active attempt's receipts all lack attemptId in a non-parallel step.
372
+ // The orchestrator always provides attemptId, so a missing one means the agent dropped it
373
+ // (model output, JSON.stringify omission, etc.). boundByOutput still binds the receipt by
374
+ // expectedOutputId, so this is not fatal — but it is a contract violation worth flagging.
375
+ if (owned.length > 0 && owned[0].receipt.attemptId == null && !(step && step.parallel && Array.isArray(getStepAgents(step)) && getStepAgents(step).length > 1)) {
376
+ process.stderr.write(`WARNING: ${manifestPath} receipt for producer "${agent}" id "${owned[0].id}" lacks entry.receipt.attemptId on a non-parallel step. The receipt is bound by output-id fallback; the agent should always include the attemptId the orchestrator provides. See agent-artifact-contracts.md (Receipt binding).` + '\n');
377
+ }
378
+ const outcome = owned[0]?.receipt?.outcome || null;
379
+ if (outcome === 'completed') {
380
+ const stallMessage = validateCompletedArtifact(owned[0]);
381
+ if (stallMessage) return { outcome: null, receiptRequired: true, stallMessage };
382
+ }
383
+ return { outcome, receiptRequired: true };
260
384
  } catch {
261
385
  return { outcome: null, receiptRequired: false };
262
386
  }
263
387
  }
264
388
  function reconcileStatusFromManifest(agent, step, resolved) {
265
389
  const terminal = new Set(['completed', 'blocked', 'changes_requested', 'validation_failed']);
266
- const { outcome, receiptRequired } = readBoundReceiptOutcome(agent, step, resolved);
390
+ artifactStallMessage = null;
391
+ const { outcome, receiptRequired, stallMessage } = readBoundReceiptOutcome(agent, step, resolved);
267
392
  if (terminal.has(outcome)) {
268
393
  status.state = outcome;
269
394
  return outcome;
270
395
  }
271
396
  if (receiptRequired) {
397
+ artifactStallMessage = stallMessage || null;
272
398
  status.state = 'awaiting_artifact_receipt';
273
399
  status.phase = 'blocked';
274
400
  return status.state;
@@ -289,6 +415,34 @@ function finishActiveAttempt(forced) {
289
415
  appendMetric({ type: 'attempt_finished', at: now, attemptId: resolved.attemptId, outcome, durationMs: Number.isFinite(durationMs) && durationMs >= 0 ? durationMs : null, retryAfterFix: status.retryAfterFix || null, source: resolved.source || 'hook', attributionConfidence: resolved.confidence });
290
416
  const active = { ...(status.activeAttempts || {}) }; delete active[resolved.attemptId]; status.activeAttempts = active; status.lastCompletedAttempt = { attemptId: resolved.attemptId, completedAt: now }; return { ...resolved, outcome };
291
417
  }
418
+ function missingConsumerArtifacts() {
419
+ const file = path.join(process.cwd(), '.ai.local', 'pipeline-gates.json');
420
+ if (!fs.existsSync(file)) return [];
421
+ let parsed;
422
+ try { parsed = JSON.parse(fs.readFileSync(file, 'utf8')); } catch { return []; }
423
+ const required = Array.isArray(parsed && parsed.requireArtifacts) ? parsed.requireArtifacts : [];
424
+ const ids = required.filter((id) => typeof id === 'string' && /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(id));
425
+ if (ids.length === 0) return [];
426
+ let manifest = { artifacts: [] };
427
+ try { manifest = JSON.parse(fs.readFileSync(path.join(taskDir, 'artifact-manifest.json'), 'utf8')); } catch {}
428
+ const done = new Set(
429
+ (manifest.artifacts || [])
430
+ .filter((artifact) => artifact && artifact.status === 'completed' && ids.includes(artifact.id))
431
+ .map((artifact) => artifact.id),
432
+ );
433
+ return ids.filter((id) => !done.has(id));
434
+ }
435
+ function completePipeline(statusPatch) {
436
+ const missing = missingConsumerArtifacts();
437
+ if (missing.length > 0) {
438
+ writeStatus({ ...statusPatch, phase: 'blocked', state: 'blocked', currentAgent: null, awaitingHumanGate: false });
439
+ out(`Pipeline blocked for "${slug}": .ai.local/pipeline-gates.json requireArtifacts missing completed receipt(s): ${missing.join(', ')}.`);
440
+ process.exit(0);
441
+ }
442
+ writeStatus(statusPatch);
443
+ out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
444
+ process.exit(0);
445
+ }
292
446
  function beginHumanGate() { const eventId = `${status.metricsRunId || slug}:gate:${Date.now()}`; appendMetric({ eventId, type: 'human_gate_started', at: now, source: 'hook', attributionConfidence: 'high' }); status.activeHumanGateEventId = eventId; }
293
447
  function endHumanGateIfResumed() {
294
448
  if (!status.activeHumanGateEventId || status.awaitingHumanGate || status.state === 'awaiting_approval') return;
@@ -327,6 +481,15 @@ function out(message) {
327
481
  process.stdout.write(JSON.stringify({ followup_message: message }));
328
482
  }
329
483
 
484
+ // The stall text always reaches stderr so a second, different rejection is never
485
+ // silent; `out()` fires only when the stop enters the stall, so the follow-up
486
+ // message cannot loop.
487
+ function emitArtifactStall(message, announce) {
488
+ if (message) process.stderr.write(message + '\n');
489
+ if (message && announce) out(message);
490
+ else process.stdout.write('{}');
491
+ }
492
+
330
493
  function readArtifact(name) {
331
494
  const p = path.join(taskDir, name);
332
495
  if (!fs.existsSync(p)) return '';
@@ -626,11 +789,11 @@ const AGENT_HANDOFF = {
626
789
 
627
790
  const REVIEW_AGENTS = new Set([
628
791
  'code-reviewer',
792
+ 'accessibility-reviewer',
629
793
  'security-reviewer',
630
794
  'api-contract-reviewer',
631
795
  ]);
632
796
 
633
-
634
797
  function metricsHandoff(agent) {
635
798
  const matches = Object.entries(status.activeAttempts || {}).filter(([, entry]) => entry.agent === agent);
636
799
  if (matches.length === 1) {
@@ -788,9 +951,7 @@ if (hookInput.action === 'end_human_gate') {
788
951
  if (pendingStepIndexes().length === 0) {
789
952
  status.state = 'completed';
790
953
  completeTaskMetrics();
791
- writeStatus({ pipelineIndex: resumeSteps.length, phase: 'done', state: 'completed', currentAgent: null, awaitingHumanGate: false });
792
- out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
793
- process.exit(0);
954
+ completePipeline({ pipelineIndex: resumeSteps.length, phase: 'done', state: 'completed', currentAgent: null, awaitingHumanGate: false });
794
955
  }
795
956
  out(noProgressNotice());
796
957
  process.exit(0);
@@ -816,15 +977,13 @@ if (hookInput.action === 'end_human_gate') {
816
977
  // pipeline instead of leaving it in_progress forever.
817
978
  status.state = 'completed';
818
979
  completeTaskMetrics();
819
- writeStatus({
980
+ completePipeline({
820
981
  pipelineIndex: resumeSteps.length,
821
982
  phase: 'done',
822
983
  state: 'completed',
823
984
  currentAgent: null,
824
985
  awaitingHumanGate: false,
825
986
  });
826
- out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
827
- process.exit(0);
828
987
  }
829
988
  }
830
989
  // A2 (retro §8): if gate closes the final human gate of the pipeline
@@ -904,10 +1063,11 @@ const completingAgentHint = (() => {
904
1063
  return getStepAgents(initialStep)[0];
905
1064
  })();
906
1065
  const reconcilingAttempt = resolvedAttempt();
1066
+ const wasWaitingForReceipt = status.state === 'awaiting_artifact_receipt';
907
1067
  reconcileStatusFromManifest(completingAgentHint, initialStep, reconcilingAttempt);
908
1068
  if (status.state === 'awaiting_artifact_receipt') {
909
1069
  writeStatus({});
910
- process.stdout.write('{}');
1070
+ emitArtifactStall(artifactStallMessage, !wasWaitingForReceipt);
911
1071
  process.exit(0);
912
1072
  }
913
1073
  let finishedAttempt = finishActiveAttempt();
@@ -917,6 +1077,11 @@ if (!finishedAttempt && activeAttemptCountBeforeFinish > 0) {
917
1077
  if (repaired) {
918
1078
  appendMetric({ type: 'parallel_attribution_repair', at: now, attemptIds: [repaired.attemptId], source: 'hook', attributionConfidence: 'fallback' });
919
1079
  reconcileStatusFromManifest(repaired.entry.agent, steps[repaired.entry.stepIndex], repaired);
1080
+ if (status.state === 'awaiting_artifact_receipt') {
1081
+ writeStatus({});
1082
+ emitArtifactStall(artifactStallMessage, true);
1083
+ process.exit(0);
1084
+ }
920
1085
  finishedAttempt = finishActiveAttempt(repaired);
921
1086
  } else {
922
1087
  writeStatus({});
@@ -973,6 +1138,7 @@ const waveIndexes = activeWave
973
1138
  ? [idx]
974
1139
  : (isGraphMode() && finishedAttempt ? [completedStepIndex] : null));
975
1140
 
1141
+
976
1142
  if (waveIndexes) {
977
1143
  const waveAgents = waveIndexes.flatMap((i) => getStepAgents(steps[i]));
978
1144
  const done = [...(status.parallelCompleted || [])];
@@ -1025,6 +1191,20 @@ if (waveIndexes) {
1025
1191
  }
1026
1192
 
1027
1193
  const retryReviewer = waveAgents.find((agent) => outcomes[agent]?.outcome === 'changes_requested');
1194
+ if (retryReviewer === 'mockup-reviewer') {
1195
+ beginHumanGate();
1196
+ writeStatus({
1197
+ awaitingHumanGate: true,
1198
+ state: 'awaiting_approval',
1199
+ currentAgent: 'mockup-reviewer',
1200
+ parallelCompleted: [],
1201
+ parallelOutcomes: {},
1202
+ waveSteps: [],
1203
+ waveId: null,
1204
+ });
1205
+ out(`Mockup review FAIL for slug "${slug}". Read mockup-review.md. Resume only via /task-continue. Do not retry feature-developer.`);
1206
+ process.exit(0);
1207
+ }
1028
1208
  if (retryReviewer) {
1029
1209
  if (isGraphMode()) {
1030
1210
  const reviewerStepIndex = waveIndexes.find((i) => getStepAgents(steps[i]).includes(retryReviewer));
@@ -1108,9 +1288,7 @@ if (waveIndexes) {
1108
1288
  }
1109
1289
  if (pendingStepIndexes().length === 0) {
1110
1290
  completeTaskMetrics();
1111
- writeStatus({ pipelineIndex: steps.length, phase: 'done', state: 'completed', currentAgent: null, awaitingHumanGate: false });
1112
- out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
1113
- process.exit(0);
1291
+ completePipeline({ pipelineIndex: steps.length, phase: 'done', state: 'completed', currentAgent: null, awaitingHumanGate: false });
1114
1292
  }
1115
1293
  out(noProgressNotice());
1116
1294
  process.exit(0);
@@ -1131,6 +1309,17 @@ if (status.state === 'blocked') {
1131
1309
  process.exit(0);
1132
1310
  }
1133
1311
 
1312
+ if (status.state === 'changes_requested' && (completedAgent === 'mockup-reviewer' || status.currentAgent === 'mockup-reviewer')) {
1313
+ beginHumanGate();
1314
+ writeStatus({
1315
+ awaitingHumanGate: true,
1316
+ state: 'awaiting_approval',
1317
+ currentAgent: 'mockup-reviewer',
1318
+ });
1319
+ out(`Mockup review FAIL for slug "${slug}". Read mockup-review.md. Resume only via /task-continue. Do not retry feature-developer.`);
1320
+ process.exit(0);
1321
+ }
1322
+
1134
1323
  if (status.state === 'changes_requested') {
1135
1324
  const reviewer = status.currentAgent || finishedAttempt?.entry?.agent;
1136
1325
  if (!reviewer) {
@@ -1191,9 +1380,7 @@ if (status.state === 'completed' && status.retryAfterFix) {
1191
1380
  }
1192
1381
 
1193
1382
  if (!currentStep) {
1194
- writeStatus({ phase: 'done', state: 'completed', currentAgent: null });
1195
- out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
1196
- process.exit(0);
1383
+ completePipeline({ phase: 'done', state: 'completed', currentAgent: null });
1197
1384
  }
1198
1385
 
1199
1386
  if (hasGateAfterStep(currentStep, pipeline.humanGates)) {
@@ -1215,9 +1402,7 @@ if (isGraphMode()) {
1215
1402
  if (dispatchReadyWave()) process.exit(0);
1216
1403
  if (pendingStepIndexes().length === 0) {
1217
1404
  completeTaskMetrics();
1218
- writeStatus({ pipelineIndex: steps.length, phase: 'done', state: 'completed', currentAgent: null, awaitingHumanGate: false });
1219
- out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
1220
- process.exit(0);
1405
+ completePipeline({ pipelineIndex: steps.length, phase: 'done', state: 'completed', currentAgent: null, awaitingHumanGate: false });
1221
1406
  }
1222
1407
  out(noProgressNotice());
1223
1408
  process.exit(0);
@@ -1226,15 +1411,13 @@ if (isGraphMode()) {
1226
1411
  const next = findNextExecutableStep(steps, idx + 1, taskDir);
1227
1412
  if (!next) {
1228
1413
  completeTaskMetrics();
1229
- writeStatus({
1414
+ completePipeline({
1230
1415
  pipelineIndex: steps.length,
1231
1416
  phase: 'done',
1232
1417
  state: 'completed',
1233
1418
  currentAgent: null,
1234
1419
  awaitingHumanGate: false,
1235
1420
  });
1236
- out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
1237
- process.exit(0);
1238
1421
  }
1239
1422
 
1240
1423
  const { step: nextStep, index: nextIdx } = next;
@@ -1256,3 +1439,76 @@ if (nextStep.parallel && nextAgents.length > 1) {
1256
1439
  out(handoffForAgent(nextAgents[0], nextStep.scope, nextStep));
1257
1440
  }
1258
1441
  NODE
1442
+
1443
+ # --- In-task self-learning postflight ----------------------------------------
1444
+ # One loop run per completed stop, as a second process: capture must not depend
1445
+ # on an agent remembering to run it. The child's stdout is forwarded to stderr
1446
+ # so the hook's own stdout contract (the JSON above) is untouched; `|| true`
1447
+ # plus an unconditional exit 0 keep a loop failure from failing the task; and
1448
+ # `--strict` is never passed — a gate must not live in a hook.
1449
+ INPUT="$input" node <<'POSTFLIGHT' || true
1450
+ const fs = require('fs');
1451
+ const path = require('path');
1452
+ const { spawnSync } = require('child_process');
1453
+
1454
+ let input;
1455
+ try {
1456
+ input = JSON.parse(process.env.INPUT || '');
1457
+ } catch {
1458
+ process.exit(0);
1459
+ }
1460
+ if (!input || input.status !== 'completed') {
1461
+ process.exit(0);
1462
+ }
1463
+
1464
+ // Ratchet: off for `light` pipelines and `spike` intents. A policy skip is
1465
+ // silent on purpose — a warning on every light receipt would make the
1466
+ // containment warnings below unreadable.
1467
+ let pipeline = null;
1468
+ try {
1469
+ const teamRoot = path.join(process.cwd(), '.ai.local', 'team');
1470
+ const active = JSON.parse(fs.readFileSync(path.join(teamRoot, 'active-task.json'), 'utf8'));
1471
+ const pipelineSlug = typeof active.slug === 'string' ? active.slug : '';
1472
+ // Same pattern as `SLUG_RE` at the top of this file: `tasks/<slug>` is
1473
+ // re-derived from `active-task.json` here too, so an unchecked slug could
1474
+ // escape the tree on this path exactly as it could there.
1475
+ const POSTFLIGHT_SLUG_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
1476
+ if (pipelineSlug.length <= 48 && POSTFLIGHT_SLUG_RE.test(pipelineSlug)) {
1477
+ pipeline = JSON.parse(fs.readFileSync(path.join(teamRoot, 'tasks', pipelineSlug, 'pipeline.json'), 'utf8'));
1478
+ }
1479
+ } catch {
1480
+ pipeline = null;
1481
+ }
1482
+ if (pipeline && (pipeline.profile === 'light' || pipeline.intent === 'spike')) {
1483
+ process.exit(0);
1484
+ }
1485
+
1486
+ if (!fs.existsSync(path.join(process.cwd(), '.ai.local', 'scripts', 'run.mjs'))) {
1487
+ process.stderr.write(
1488
+ 'WARNING: self-learning loop skipped: .ai.local/scripts/run.mjs is missing (install it with `npx @bonesofspring/ai-rules init <tool> --preset <stack>`)\n',
1489
+ );
1490
+ process.exit(0);
1491
+ }
1492
+
1493
+ // Relative argv[1] + `cwd` keeps `run.mjs`'s own entry guard (pathToFileURL
1494
+ // comparison) satisfied even when the project path traverses a symlink.
1495
+ // SIGKILL, not the SIGTERM default: a child that ignores SIGTERM would hold the
1496
+ // hook for its whole runtime while the warning below still reported 15 s.
1497
+ const result = spawnSync(process.execPath, ['.ai.local/scripts/run.mjs'], {
1498
+ cwd: process.cwd(),
1499
+ encoding: 'utf8',
1500
+ timeout: 15000,
1501
+ killSignal: 'SIGKILL',
1502
+ });
1503
+ if (result.stdout) process.stderr.write(result.stdout);
1504
+ if (result.stderr) process.stderr.write(result.stderr);
1505
+ if (result.error) {
1506
+ const timedOut = result.error.code === 'ETIMEDOUT';
1507
+ process.stderr.write(
1508
+ `WARNING: self-learning loop ${timedOut ? 'timed out after 15s' : `failed: ${result.error.message}`}\n`,
1509
+ );
1510
+ } else if (result.status !== 0) {
1511
+ process.stderr.write(`WARNING: self-learning loop exited ${result.status}\n`);
1512
+ }
1513
+ process.exit(0);
1514
+ POSTFLIGHT