@bonesofspring/ai-rules 0.2.33 → 0.2.34

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 (396) hide show
  1. package/docs/PRESET-CONTRIBUTION.md +2 -2
  2. package/package.json +4 -1
  3. package/presets/_shared/README.md +1 -1
  4. package/presets/_shared/core/agent-team/agent-artifact-contracts.md +22 -0
  5. package/presets/_shared/core/agent-team/agent-task-metrics.md +12 -1
  6. package/presets/_shared/core/agent-team/agent-team-intake.md +1 -1
  7. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +18 -4
  8. package/presets/_shared/core/agent-team/plan-graph.md +28 -0
  9. package/presets/_shared/core/agent-team/task-classification.md +2 -0
  10. package/presets/claude/android-kotlin/agents/task-analyst.md +1 -1
  11. package/presets/claude/android-kotlin/agents/task-router.md +10 -0
  12. package/presets/claude/android-kotlin/commands/task-continue.md +1 -1
  13. package/presets/claude/android-kotlin/commands/task.md +1 -1
  14. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +369 -16
  15. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-intake.md +1 -1
  16. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
  17. package/presets/claude/android-kotlin/team/README.md +4 -1
  18. package/presets/claude/go/agents/task-analyst.md +1 -1
  19. package/presets/claude/go/agents/task-router.md +10 -0
  20. package/presets/claude/go/commands/task-continue.md +1 -1
  21. package/presets/claude/go/commands/task.md +1 -1
  22. package/presets/claude/go/hooks/chain-team-phases.sh +367 -16
  23. package/presets/claude/go/rules/tooling-and-review/agent-team-intake.md +1 -1
  24. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
  25. package/presets/claude/go/team/README.md +4 -1
  26. package/presets/claude/ios-swift/agents/task-analyst.md +1 -1
  27. package/presets/claude/ios-swift/agents/task-router.md +10 -0
  28. package/presets/claude/ios-swift/commands/task-continue.md +1 -1
  29. package/presets/claude/ios-swift/commands/task.md +1 -1
  30. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +369 -16
  31. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-intake.md +1 -1
  32. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
  33. package/presets/claude/ios-swift/team/README.md +4 -1
  34. package/presets/claude/java/agents/task-analyst.md +1 -1
  35. package/presets/claude/java/agents/task-router.md +10 -0
  36. package/presets/claude/java/commands/task-continue.md +1 -1
  37. package/presets/claude/java/commands/task.md +1 -1
  38. package/presets/claude/java/hooks/chain-team-phases.sh +367 -16
  39. package/presets/claude/java/rules/tooling-and-review/agent-team-intake.md +1 -1
  40. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
  41. package/presets/claude/java/team/README.md +4 -1
  42. package/presets/claude/mcp-ts/agents/task-analyst.md +1 -1
  43. package/presets/claude/mcp-ts/agents/task-router.md +10 -0
  44. package/presets/claude/mcp-ts/commands/task-continue.md +1 -1
  45. package/presets/claude/mcp-ts/commands/task.md +1 -1
  46. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +367 -16
  47. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-intake.md +1 -1
  48. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
  49. package/presets/claude/mcp-ts/team/README.md +4 -1
  50. package/presets/claude/next/agents/task-analyst.md +1 -1
  51. package/presets/claude/next/agents/task-router.md +10 -0
  52. package/presets/claude/next/commands/task-continue.md +1 -1
  53. package/presets/claude/next/commands/task.md +1 -1
  54. package/presets/claude/next/hooks/chain-team-phases.sh +369 -16
  55. package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +1 -1
  56. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
  57. package/presets/claude/next/team/README.md +4 -1
  58. package/presets/claude/next/team/fixtures/artifact-manifest.example.json +1 -1
  59. package/presets/claude/next/team/fixtures/feature-parallel.json +84 -0
  60. package/presets/claude/nuxt/agents/task-analyst.md +1 -1
  61. package/presets/claude/nuxt/agents/task-router.md +10 -0
  62. package/presets/claude/nuxt/commands/task-continue.md +1 -1
  63. package/presets/claude/nuxt/commands/task.md +1 -1
  64. package/presets/claude/nuxt/hooks/chain-team-phases.sh +369 -16
  65. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-intake.md +1 -1
  66. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
  67. package/presets/claude/nuxt/team/README.md +4 -1
  68. package/presets/claude/nuxt/team/fixtures/artifact-manifest.example.json +1 -1
  69. package/presets/claude/php-hexagonal/agents/task-analyst.md +1 -1
  70. package/presets/claude/php-hexagonal/agents/task-router.md +10 -0
  71. package/presets/claude/php-hexagonal/commands/task-continue.md +1 -1
  72. package/presets/claude/php-hexagonal/commands/task.md +1 -1
  73. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +367 -16
  74. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-intake.md +1 -1
  75. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
  76. package/presets/claude/php-hexagonal/team/README.md +4 -1
  77. package/presets/claude/php-laravel/agents/task-analyst.md +1 -1
  78. package/presets/claude/php-laravel/agents/task-router.md +10 -0
  79. package/presets/claude/php-laravel/commands/task-continue.md +1 -1
  80. package/presets/claude/php-laravel/commands/task.md +1 -1
  81. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +367 -16
  82. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-intake.md +1 -1
  83. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
  84. package/presets/claude/php-laravel/team/README.md +4 -1
  85. package/presets/claude/svelte/agents/task-analyst.md +1 -1
  86. package/presets/claude/svelte/agents/task-router.md +10 -0
  87. package/presets/claude/svelte/commands/task-continue.md +1 -1
  88. package/presets/claude/svelte/commands/task.md +1 -1
  89. package/presets/claude/svelte/hooks/chain-team-phases.sh +369 -16
  90. package/presets/claude/svelte/rules/tooling-and-review/agent-team-intake.md +1 -1
  91. package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
  92. package/presets/claude/svelte/team/README.md +4 -1
  93. package/presets/claude/svelte/team/fixtures/artifact-manifest.example.json +1 -1
  94. package/presets/cursor/android-kotlin/agents/task-analyst.md +1 -1
  95. package/presets/cursor/android-kotlin/agents/task-router.md +10 -0
  96. package/presets/cursor/android-kotlin/commands/task-continue.md +1 -1
  97. package/presets/cursor/android-kotlin/commands/task.md +1 -1
  98. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +369 -16
  99. package/presets/cursor/android-kotlin/rules/agent-team-intake.mdc +1 -1
  100. package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +12 -1
  101. package/presets/cursor/android-kotlin/team/README.md +4 -1
  102. package/presets/cursor/go/agents/task-analyst.md +1 -1
  103. package/presets/cursor/go/agents/task-router.md +10 -0
  104. package/presets/cursor/go/commands/task-continue.md +1 -1
  105. package/presets/cursor/go/commands/task.md +1 -1
  106. package/presets/cursor/go/hooks/chain-team-phases.sh +367 -16
  107. package/presets/cursor/go/rules/agent-team-intake.mdc +1 -1
  108. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +12 -1
  109. package/presets/cursor/go/team/README.md +4 -1
  110. package/presets/cursor/ios-swift/agents/task-analyst.md +1 -1
  111. package/presets/cursor/ios-swift/agents/task-router.md +10 -0
  112. package/presets/cursor/ios-swift/commands/task-continue.md +1 -1
  113. package/presets/cursor/ios-swift/commands/task.md +1 -1
  114. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +369 -16
  115. package/presets/cursor/ios-swift/rules/agent-team-intake.mdc +1 -1
  116. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +12 -1
  117. package/presets/cursor/ios-swift/team/README.md +4 -1
  118. package/presets/cursor/java/agents/task-analyst.md +1 -1
  119. package/presets/cursor/java/agents/task-router.md +10 -0
  120. package/presets/cursor/java/commands/task-continue.md +1 -1
  121. package/presets/cursor/java/commands/task.md +1 -1
  122. package/presets/cursor/java/hooks/chain-team-phases.sh +367 -16
  123. package/presets/cursor/java/rules/agent-team-intake.mdc +1 -1
  124. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +12 -1
  125. package/presets/cursor/java/team/README.md +4 -1
  126. package/presets/cursor/mcp-ts/agents/task-analyst.md +1 -1
  127. package/presets/cursor/mcp-ts/agents/task-router.md +10 -0
  128. package/presets/cursor/mcp-ts/commands/task-continue.md +1 -1
  129. package/presets/cursor/mcp-ts/commands/task.md +1 -1
  130. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +367 -16
  131. package/presets/cursor/mcp-ts/rules/agent-team-intake.mdc +1 -1
  132. package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +12 -1
  133. package/presets/cursor/mcp-ts/team/README.md +4 -1
  134. package/presets/cursor/next/agents/task-analyst.md +1 -1
  135. package/presets/cursor/next/agents/task-router.md +10 -0
  136. package/presets/cursor/next/commands/task-continue.md +1 -1
  137. package/presets/cursor/next/commands/task.md +1 -1
  138. package/presets/cursor/next/hooks/chain-team-phases.sh +369 -16
  139. package/presets/cursor/next/rules/agent-team-intake.mdc +1 -1
  140. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +12 -1
  141. package/presets/cursor/next/team/README.md +4 -1
  142. package/presets/cursor/next/team/fixtures/artifact-manifest.example.json +1 -1
  143. package/presets/cursor/next/team/fixtures/feature-parallel.json +84 -0
  144. package/presets/cursor/nuxt/agents/task-analyst.md +1 -1
  145. package/presets/cursor/nuxt/agents/task-router.md +10 -0
  146. package/presets/cursor/nuxt/commands/task-continue.md +1 -1
  147. package/presets/cursor/nuxt/commands/task.md +1 -1
  148. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +369 -16
  149. package/presets/cursor/nuxt/rules/agent-team-intake.mdc +1 -1
  150. package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +12 -1
  151. package/presets/cursor/nuxt/team/README.md +4 -1
  152. package/presets/cursor/nuxt/team/fixtures/artifact-manifest.example.json +1 -1
  153. package/presets/cursor/php-hexagonal/agents/task-analyst.md +1 -1
  154. package/presets/cursor/php-hexagonal/agents/task-router.md +10 -0
  155. package/presets/cursor/php-hexagonal/commands/task-continue.md +1 -1
  156. package/presets/cursor/php-hexagonal/commands/task.md +1 -1
  157. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +367 -16
  158. package/presets/cursor/php-hexagonal/rules/agent-team-intake.mdc +1 -1
  159. package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +12 -1
  160. package/presets/cursor/php-hexagonal/team/README.md +4 -1
  161. package/presets/cursor/php-laravel/agents/task-analyst.md +1 -1
  162. package/presets/cursor/php-laravel/agents/task-router.md +10 -0
  163. package/presets/cursor/php-laravel/commands/task-continue.md +1 -1
  164. package/presets/cursor/php-laravel/commands/task.md +1 -1
  165. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +367 -16
  166. package/presets/cursor/php-laravel/rules/agent-team-intake.mdc +1 -1
  167. package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +12 -1
  168. package/presets/cursor/php-laravel/team/README.md +4 -1
  169. package/presets/cursor/svelte/agents/task-analyst.md +1 -1
  170. package/presets/cursor/svelte/agents/task-router.md +10 -0
  171. package/presets/cursor/svelte/commands/task-continue.md +1 -1
  172. package/presets/cursor/svelte/commands/task.md +1 -1
  173. package/presets/cursor/svelte/hooks/chain-team-phases.sh +369 -16
  174. package/presets/cursor/svelte/rules/agent-team-intake.mdc +1 -1
  175. package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +12 -1
  176. package/presets/cursor/svelte/team/README.md +4 -1
  177. package/presets/cursor/svelte/team/fixtures/artifact-manifest.example.json +1 -1
  178. package/presets/mavis/android-kotlin/adapter-map.json +1 -1
  179. package/presets/mavis/android-kotlin/agents/task-analyst.md +1 -1
  180. package/presets/mavis/android-kotlin/agents/task-router.md +10 -0
  181. package/presets/mavis/android-kotlin/commands/task-continue.md +1 -1
  182. package/presets/mavis/android-kotlin/commands/task.md +1 -1
  183. package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +369 -16
  184. package/presets/mavis/android-kotlin/rules/agent-team-intake.md +1 -1
  185. package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +18 -4
  186. package/presets/mavis/android-kotlin/team/README.md +4 -1
  187. package/presets/mavis/go/adapter-map.json +1 -1
  188. package/presets/mavis/go/agents/task-analyst.md +1 -1
  189. package/presets/mavis/go/agents/task-router.md +10 -0
  190. package/presets/mavis/go/commands/task-continue.md +1 -1
  191. package/presets/mavis/go/commands/task.md +1 -1
  192. package/presets/mavis/go/hooks/chain-team-phases.sh +367 -16
  193. package/presets/mavis/go/rules/agent-team-intake.md +1 -1
  194. package/presets/mavis/go/rules/agent-team-orchestrator.md +18 -4
  195. package/presets/mavis/go/team/README.md +4 -1
  196. package/presets/mavis/ios-swift/adapter-map.json +1 -1
  197. package/presets/mavis/ios-swift/agents/task-analyst.md +1 -1
  198. package/presets/mavis/ios-swift/agents/task-router.md +10 -0
  199. package/presets/mavis/ios-swift/commands/task-continue.md +1 -1
  200. package/presets/mavis/ios-swift/commands/task.md +1 -1
  201. package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +369 -16
  202. package/presets/mavis/ios-swift/rules/agent-team-intake.md +1 -1
  203. package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +18 -4
  204. package/presets/mavis/ios-swift/team/README.md +4 -1
  205. package/presets/mavis/java/adapter-map.json +1 -1
  206. package/presets/mavis/java/agents/task-analyst.md +1 -1
  207. package/presets/mavis/java/agents/task-router.md +10 -0
  208. package/presets/mavis/java/commands/task-continue.md +1 -1
  209. package/presets/mavis/java/commands/task.md +1 -1
  210. package/presets/mavis/java/hooks/chain-team-phases.sh +367 -16
  211. package/presets/mavis/java/rules/agent-team-intake.md +1 -1
  212. package/presets/mavis/java/rules/agent-team-orchestrator.md +18 -4
  213. package/presets/mavis/java/team/README.md +4 -1
  214. package/presets/mavis/mcp-ts/adapter-map.json +1 -1
  215. package/presets/mavis/mcp-ts/agents/task-analyst.md +1 -1
  216. package/presets/mavis/mcp-ts/agents/task-router.md +10 -0
  217. package/presets/mavis/mcp-ts/commands/task-continue.md +1 -1
  218. package/presets/mavis/mcp-ts/commands/task.md +1 -1
  219. package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +367 -16
  220. package/presets/mavis/mcp-ts/rules/agent-team-intake.md +1 -1
  221. package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +18 -4
  222. package/presets/mavis/mcp-ts/team/README.md +4 -1
  223. package/presets/mavis/next/adapter-map.json +9 -1
  224. package/presets/mavis/next/agents/task-analyst.md +1 -1
  225. package/presets/mavis/next/agents/task-router.md +10 -0
  226. package/presets/mavis/next/commands/task-continue.md +1 -1
  227. package/presets/mavis/next/commands/task.md +1 -1
  228. package/presets/mavis/next/hooks/chain-team-phases.sh +369 -16
  229. package/presets/mavis/next/rules/agent-team-intake.md +1 -1
  230. package/presets/mavis/next/rules/agent-team-orchestrator.md +18 -4
  231. package/presets/mavis/next/team/README.md +4 -1
  232. package/presets/mavis/next/team/fixtures/artifact-manifest.example.json +1 -1
  233. package/presets/mavis/next/team/fixtures/feature-parallel.json +84 -0
  234. package/presets/mavis/nuxt/adapter-map.json +1 -1
  235. package/presets/mavis/nuxt/agents/task-analyst.md +1 -1
  236. package/presets/mavis/nuxt/agents/task-router.md +10 -0
  237. package/presets/mavis/nuxt/commands/task-continue.md +1 -1
  238. package/presets/mavis/nuxt/commands/task.md +1 -1
  239. package/presets/mavis/nuxt/hooks/chain-team-phases.sh +369 -16
  240. package/presets/mavis/nuxt/rules/agent-team-intake.md +1 -1
  241. package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +18 -4
  242. package/presets/mavis/nuxt/team/README.md +4 -1
  243. package/presets/mavis/nuxt/team/fixtures/artifact-manifest.example.json +1 -1
  244. package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
  245. package/presets/mavis/php-hexagonal/agents/task-analyst.md +1 -1
  246. package/presets/mavis/php-hexagonal/agents/task-router.md +10 -0
  247. package/presets/mavis/php-hexagonal/commands/task-continue.md +1 -1
  248. package/presets/mavis/php-hexagonal/commands/task.md +1 -1
  249. package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +367 -16
  250. package/presets/mavis/php-hexagonal/rules/agent-team-intake.md +1 -1
  251. package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +18 -4
  252. package/presets/mavis/php-hexagonal/team/README.md +4 -1
  253. package/presets/mavis/php-laravel/adapter-map.json +1 -1
  254. package/presets/mavis/php-laravel/agents/task-analyst.md +1 -1
  255. package/presets/mavis/php-laravel/agents/task-router.md +10 -0
  256. package/presets/mavis/php-laravel/commands/task-continue.md +1 -1
  257. package/presets/mavis/php-laravel/commands/task.md +1 -1
  258. package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +367 -16
  259. package/presets/mavis/php-laravel/rules/agent-team-intake.md +1 -1
  260. package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +18 -4
  261. package/presets/mavis/php-laravel/team/README.md +4 -1
  262. package/presets/mavis/svelte/adapter-map.json +1 -1
  263. package/presets/mavis/svelte/agents/task-analyst.md +1 -1
  264. package/presets/mavis/svelte/agents/task-router.md +10 -0
  265. package/presets/mavis/svelte/commands/task-continue.md +1 -1
  266. package/presets/mavis/svelte/commands/task.md +1 -1
  267. package/presets/mavis/svelte/hooks/chain-team-phases.sh +369 -16
  268. package/presets/mavis/svelte/rules/agent-team-intake.md +1 -1
  269. package/presets/mavis/svelte/rules/agent-team-orchestrator.md +18 -4
  270. package/presets/mavis/svelte/team/README.md +4 -1
  271. package/presets/mavis/svelte/team/fixtures/artifact-manifest.example.json +1 -1
  272. package/presets/opencode/android-kotlin/adapter-map.json +1 -1
  273. package/presets/opencode/android-kotlin/agents/task-analyst.md +1 -1
  274. package/presets/opencode/android-kotlin/agents/task-router.md +10 -0
  275. package/presets/opencode/android-kotlin/commands/task-continue.md +1 -1
  276. package/presets/opencode/android-kotlin/commands/task.md +1 -1
  277. package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +369 -16
  278. package/presets/opencode/android-kotlin/rules/agent-team-intake.md +1 -1
  279. package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +18 -4
  280. package/presets/opencode/android-kotlin/team/README.md +4 -1
  281. package/presets/opencode/go/adapter-map.json +1 -1
  282. package/presets/opencode/go/agents/task-analyst.md +1 -1
  283. package/presets/opencode/go/agents/task-router.md +10 -0
  284. package/presets/opencode/go/commands/task-continue.md +1 -1
  285. package/presets/opencode/go/commands/task.md +1 -1
  286. package/presets/opencode/go/hooks/chain-team-phases.sh +367 -16
  287. package/presets/opencode/go/rules/agent-team-intake.md +1 -1
  288. package/presets/opencode/go/rules/agent-team-orchestrator.md +18 -4
  289. package/presets/opencode/go/team/README.md +4 -1
  290. package/presets/opencode/ios-swift/adapter-map.json +1 -1
  291. package/presets/opencode/ios-swift/agents/task-analyst.md +1 -1
  292. package/presets/opencode/ios-swift/agents/task-router.md +10 -0
  293. package/presets/opencode/ios-swift/commands/task-continue.md +1 -1
  294. package/presets/opencode/ios-swift/commands/task.md +1 -1
  295. package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +369 -16
  296. package/presets/opencode/ios-swift/rules/agent-team-intake.md +1 -1
  297. package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +18 -4
  298. package/presets/opencode/ios-swift/team/README.md +4 -1
  299. package/presets/opencode/java/adapter-map.json +1 -1
  300. package/presets/opencode/java/agents/task-analyst.md +1 -1
  301. package/presets/opencode/java/agents/task-router.md +10 -0
  302. package/presets/opencode/java/commands/task-continue.md +1 -1
  303. package/presets/opencode/java/commands/task.md +1 -1
  304. package/presets/opencode/java/hooks/chain-team-phases.sh +367 -16
  305. package/presets/opencode/java/rules/agent-team-intake.md +1 -1
  306. package/presets/opencode/java/rules/agent-team-orchestrator.md +18 -4
  307. package/presets/opencode/java/team/README.md +4 -1
  308. package/presets/opencode/mcp-ts/adapter-map.json +1 -1
  309. package/presets/opencode/mcp-ts/agents/task-analyst.md +1 -1
  310. package/presets/opencode/mcp-ts/agents/task-router.md +10 -0
  311. package/presets/opencode/mcp-ts/commands/task-continue.md +1 -1
  312. package/presets/opencode/mcp-ts/commands/task.md +1 -1
  313. package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +367 -16
  314. package/presets/opencode/mcp-ts/rules/agent-team-intake.md +1 -1
  315. package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +18 -4
  316. package/presets/opencode/mcp-ts/team/README.md +4 -1
  317. package/presets/opencode/next/adapter-map.json +9 -1
  318. package/presets/opencode/next/agents/task-analyst.md +1 -1
  319. package/presets/opencode/next/agents/task-router.md +10 -0
  320. package/presets/opencode/next/commands/task-continue.md +1 -1
  321. package/presets/opencode/next/commands/task.md +1 -1
  322. package/presets/opencode/next/hooks/chain-team-phases.sh +369 -16
  323. package/presets/opencode/next/rules/agent-team-intake.md +1 -1
  324. package/presets/opencode/next/rules/agent-team-orchestrator.md +18 -4
  325. package/presets/opencode/next/team/README.md +4 -1
  326. package/presets/opencode/next/team/fixtures/artifact-manifest.example.json +1 -1
  327. package/presets/opencode/next/team/fixtures/feature-parallel.json +84 -0
  328. package/presets/opencode/nuxt/adapter-map.json +1 -1
  329. package/presets/opencode/nuxt/agents/task-analyst.md +1 -1
  330. package/presets/opencode/nuxt/agents/task-router.md +10 -0
  331. package/presets/opencode/nuxt/commands/task-continue.md +1 -1
  332. package/presets/opencode/nuxt/commands/task.md +1 -1
  333. package/presets/opencode/nuxt/hooks/chain-team-phases.sh +369 -16
  334. package/presets/opencode/nuxt/rules/agent-team-intake.md +1 -1
  335. package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +18 -4
  336. package/presets/opencode/nuxt/team/README.md +4 -1
  337. package/presets/opencode/nuxt/team/fixtures/artifact-manifest.example.json +1 -1
  338. package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
  339. package/presets/opencode/php-hexagonal/agents/task-analyst.md +1 -1
  340. package/presets/opencode/php-hexagonal/agents/task-router.md +10 -0
  341. package/presets/opencode/php-hexagonal/commands/task-continue.md +1 -1
  342. package/presets/opencode/php-hexagonal/commands/task.md +1 -1
  343. package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +367 -16
  344. package/presets/opencode/php-hexagonal/rules/agent-team-intake.md +1 -1
  345. package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +18 -4
  346. package/presets/opencode/php-hexagonal/team/README.md +4 -1
  347. package/presets/opencode/php-laravel/adapter-map.json +1 -1
  348. package/presets/opencode/php-laravel/agents/task-analyst.md +1 -1
  349. package/presets/opencode/php-laravel/agents/task-router.md +10 -0
  350. package/presets/opencode/php-laravel/commands/task-continue.md +1 -1
  351. package/presets/opencode/php-laravel/commands/task.md +1 -1
  352. package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +367 -16
  353. package/presets/opencode/php-laravel/rules/agent-team-intake.md +1 -1
  354. package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +18 -4
  355. package/presets/opencode/php-laravel/team/README.md +4 -1
  356. package/presets/opencode/svelte/adapter-map.json +1 -1
  357. package/presets/opencode/svelte/agents/task-analyst.md +1 -1
  358. package/presets/opencode/svelte/agents/task-router.md +10 -0
  359. package/presets/opencode/svelte/commands/task-continue.md +1 -1
  360. package/presets/opencode/svelte/commands/task.md +1 -1
  361. package/presets/opencode/svelte/hooks/chain-team-phases.sh +369 -16
  362. package/presets/opencode/svelte/rules/agent-team-intake.md +1 -1
  363. package/presets/opencode/svelte/rules/agent-team-orchestrator.md +18 -4
  364. package/presets/opencode/svelte/team/README.md +4 -1
  365. package/presets/opencode/svelte/team/fixtures/artifact-manifest.example.json +1 -1
  366. package/scripts/_lib/agent-write-scopes.json +27 -0
  367. package/scripts/check-parallel-plan.sh +353 -0
  368. package/scripts/check-preset-prompt-persistence.sh +51 -24
  369. package/scripts/check-preset-structure.sh +2 -0
  370. package/scripts/check-step-graph-contract.sh +123 -0
  371. package/scripts/fixtures/cli-golden/claude/next.json +10 -9
  372. package/scripts/fixtures/cli-golden/cursor/next.json +10 -9
  373. package/scripts/fixtures/cli-golden/mavis/android-kotlin.json +8 -8
  374. package/scripts/fixtures/cli-golden/mavis/go.json +8 -8
  375. package/scripts/fixtures/cli-golden/mavis/ios-swift.json +8 -8
  376. package/scripts/fixtures/cli-golden/mavis/java.json +8 -8
  377. package/scripts/fixtures/cli-golden/mavis/mcp-ts.json +8 -8
  378. package/scripts/fixtures/cli-golden/mavis/next.json +10 -9
  379. package/scripts/fixtures/cli-golden/mavis/nuxt.json +9 -9
  380. package/scripts/fixtures/cli-golden/mavis/php-hexagonal.json +8 -8
  381. package/scripts/fixtures/cli-golden/mavis/php-laravel.json +8 -8
  382. package/scripts/fixtures/cli-golden/mavis/svelte.json +9 -9
  383. package/scripts/fixtures/cli-golden/opencode/android-kotlin.json +8 -8
  384. package/scripts/fixtures/cli-golden/opencode/go.json +8 -8
  385. package/scripts/fixtures/cli-golden/opencode/ios-swift.json +8 -8
  386. package/scripts/fixtures/cli-golden/opencode/java.json +8 -8
  387. package/scripts/fixtures/cli-golden/opencode/mcp-ts.json +8 -8
  388. package/scripts/fixtures/cli-golden/opencode/next.json +10 -9
  389. package/scripts/fixtures/cli-golden/opencode/nuxt.json +9 -9
  390. package/scripts/fixtures/cli-golden/opencode/php-hexagonal.json +8 -8
  391. package/scripts/fixtures/cli-golden/opencode/php-laravel.json +8 -8
  392. package/scripts/fixtures/cli-golden/opencode/svelte.json +9 -9
  393. package/scripts/test-agent-task-metrics-hooks.mjs +167 -0
  394. package/scripts/test-chain-team-phases-coverage.mjs +129 -0
  395. package/scripts/test-parallel-plan-fixtures.mjs +173 -0
  396. package/scripts/test-preset-prompt-persistence-fixtures.mjs +58 -1
@@ -95,7 +95,7 @@ Sync marker (after frontmatter in platform files):
95
95
 
96
96
  **Lineage stems (reference):** `architecture/feature-delivery-workflow`, `architecture/reference-features.template`, `agent-team/agent-team-orchestrator`.
97
97
 
98
- **Prompt-persistence contract (always-on behavior):** every task persists the user's **verbatim** original prompt at `.ai.local/team/tasks/<slug>/prompt.md` (write-if-absent) — written by the `/task` **Slug** bootstrap and, for non-`/task` work requests, by `agent-team-intake`. It rides existing bodies (`agent-team-orchestrator` + `agent-team-intake` rules, `commands/task.md` + `commands/task-continue.md`) and adds **no** always-on rule. Register the path on the manifest `routing` entry — never in `artifacts[]` bodies (`core/agent-team/agent-artifact-contracts.md` § Prompt artifact). Enforced by `scripts/check-preset-prompt-persistence.sh` (wired into `check-preset-structure.sh`).
98
+ **Prompt-persistence contract (always-on behavior):** every task persists the user's **verbatim** original prompt at `.ai.local/team/tasks/<slug>/prompt.md` (write-if-absent) — written by the `/task` **Slug** bootstrap and, for non-`/task` work requests, by `agent-team-intake`. Every **subsequent user-authored** prompt for the same slug (a new message while the slug is active, `/task-continue` arguments, human-gate feedback, a clarification answer) is appended verbatim by the orchestrator only to the **append-only** `.ai.local/team/tasks/<slug>/prompt-log.md` ledger — `seq` = current max + 1, created on the first follow-up (absence is valid), never rewritten or duplicated; machine-generated hook `followup_message` and empty/argument-less invocations are excluded. It rides existing bodies (`agent-team-orchestrator` + `agent-team-intake` rules, `commands/task.md` + `commands/task-continue.md`) and adds **no** always-on rule. Register both paths on the manifest `routing` entry — never in `artifacts[]` bodies (`core/agent-team/agent-artifact-contracts.md` § Prompt artifact / § Prompt log). Enforced by `scripts/check-preset-prompt-persistence.sh` (wired into `check-preset-structure.sh`).
99
99
 
100
100
  **Native-language policy (always-on behavior):** development, reasoning, and every artifact stay **English**; every user-facing interaction (clarifying questions, plan/human-gate prompts, `/task-continue`, status answers, summaries, escalations) is written in the user's **native language**. The language is resolved once (`.ai.local/conventions.md` `## Language` — nearest `.ai.local` wins — else inferred from the prompt language, mixed → dominant, else English) and persisted per task as an additive `language: <BCP-47>` line in the `prompt.md` header (+ a `.memlog.md` `event:`; never `status.json` / `metrics.json` / an `artifacts[]` body). The detailed rule is a **requestable** EMBED stem (`core/agent-team/language-policy.md`); the essential clause rides existing always-on bodies (`ai-local-overlay`, the stack `<stack>-app-core`, root `REPO_AGENTS.md` → `AGENTS.md`) and adds **no** new always-on slot. Enforced by `scripts/check-preset-language-policy.sh` (wired into `check-preset-structure.sh`). Runtime output language is **orthogonal** to preset prose language — the prose stays English (`docs/PRESET-ENGLISH-STYLE.md`).
101
101
 
@@ -351,7 +351,7 @@ Load these when editing files under `packages/ai-rules/presets/**`, `.cursor/**`
351
351
  | `scripts/check-preset-twin-map.sh` / `yarn check:preset-twin-map` | **FAIL** if Cursor `.mdc` missing from Claude mapping table, twin file missing, or orphan topic `.md` (excl. `**/README.md`). Stacks: `next`, `nuxt`, `svelte`, `ios-swift`, `android-kotlin`, `go`, `java`, `mcp-ts`, `php-hexagonal`, `php-laravel`. |
352
352
  | `scripts/check-preset-token-budget.sh` / `yarn check:preset-token-budget` | **FAIL** if Cursor `alwaysApply: true` or Claude no-`paths:` (excl. README) count is outside **3–5**, `preset-*` always-on, or intended body sum > **200**. Stacks include `nuxt`, `svelte`. |
353
353
  | `scripts/check-preset-leakage.sh` / `yarn check:preset-leakage` | **FAIL** on forbidden stems in `hooks/**/*.sh` (recursive), wrong-stack agent filenames, or **positive** (non-negation) agent body mentions; **FAIL** if chain scripts are byte-identical across stacks. Explicit **negation** of forbidden stems in agent bodies is **suppressed** (INFO summary count only — not a merge blocker). Non-negation mentions in `build-verifier` → **WARN only**. |
354
- | `scripts/check-preset-prompt-persistence.sh` / `yarn check:preset-structure` | **FAIL** if the persist-the-original-prompt contract (`prompt.md` on the `routing` entry) is missing from any platform × stack command (`task.md` + `task-continue.md`), orchestrator, or intake body, or the core `agent-artifact-contracts` anchor (`## Prompt artifact`) is gone; **refuses vacuous PASS** when the iteration set is empty. Wired into `check-preset-structure.sh` next to `goal-contract`; fixture `test-preset-prompt-persistence-fixtures.mjs`. |
354
+ | `scripts/check-preset-prompt-persistence.sh` / `yarn check:preset-structure` | **FAIL** if the prompt-persistence contract (`prompt.md` + the append-only `prompt-log.md` ledger, both on the `routing` entry) is missing from any platform × stack command (`task.md` + `task-continue.md`), orchestrator, or intake body, or a core `agent-artifact-contracts` anchor (`## Prompt artifact` / `## Prompt log`) is gone; **refuses vacuous PASS** when the iteration set is empty. Wired into `check-preset-structure.sh` next to `goal-contract`; fixture `test-preset-prompt-persistence-fixtures.mjs`. |
355
355
  | `scripts/check-preset-language-policy.sh` / `yarn check:preset-structure` | **FAIL** if the native-language policy is absent: the core `_shared/core/agent-team/language-policy.md` tokens, the `language-policy` consumer + `<!-- shared-core -->` marker, the Cursor `globs:`/`alwaysApply: false` + Claude `paths:` shape, the `## Language` setting home (with a BCP-47 marker) in `ai-local/conventions.md`, the always-on anchors (`ai-local-overlay` + `<app-core>` `native language`; `REPO_AGENTS.md` `native language`), or the `language:` persistence token in `commands/task.md`; **refuses vacuous PASS** when the iteration set is empty. Wired into `check-preset-structure.sh` next to `goal-contract` / `prompt-persistence`; fixture `test-preset-language-policy-fixtures.mjs`. |
356
356
  | `scripts/check-preset-self-review-contract.sh` / `yarn check:preset-structure` | **FAIL** if the producer-side self-review / context-hygiene contract is absent: the core `_shared/core/quality/self-review-and-context-hygiene.md` tokens (G0 non-vacuous guard), the `<!-- shared-core: quality/self-review-and-context-hygiene.md -->` marker on `task-analyst` / `feature-developer` / `build-verifier` (×10) and on `debugger` / `code-reviewer` where present (skip-if-absent → `mcp-ts`), the `Self-review` + `re-anchor` tokens on every orchestrator rule, `Self-review` in `team/README.md` + `commands/task.md`, and leakage-free core + docs; **refuses vacuous PASS** when the iteration set is empty. Wired into `check-preset-structure.sh` next to `goal-contract`; fixture `test-preset-self-review-contract-fixtures.mjs`. |
357
357
  | `scripts/check-preset-structure.sh` / `yarn check:preset-structure` | Orchestrator: twin-map + token-budget + leakage + shared-core drift (**all hard**; drift via `AI_RULES_DRIFT_FAIL=1`). Does **not** run rule-eval. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonesofspring/ai-rules",
3
- "version": "0.2.33",
3
+ "version": "0.2.34",
4
4
  "description": "Presets of Cursor, Claude, Mavis, and OpenCode rules/commands for Revy Ross personal use",
5
5
  "license": "MIT",
6
6
  "author": "Revy Ross",
@@ -31,6 +31,9 @@
31
31
  ],
32
32
  "scripts": {
33
33
  "check:preset-structure": "bash scripts/check-preset-structure.sh",
34
+ "check:parallel-plan": "bash scripts/check-parallel-plan.sh",
35
+ "check:step-graph-contract": "bash scripts/check-step-graph-contract.sh",
36
+ "test:parallel-plan-fixtures": "node scripts/test-parallel-plan-fixtures.mjs",
34
37
  "check:claude-agent-blocks": "node scripts/check-claude-agent-blocks.mjs",
35
38
  "check:preset-twin-map": "bash scripts/check-preset-twin-map.sh",
36
39
  "check:preset-token-budget": "bash scripts/check-preset-token-budget.sh",
@@ -20,7 +20,7 @@ Meta-rules: `core/meta/preset-*.md` (e.g. `preset-goals`). Guide: [`docs/PRESET-
20
20
 
21
21
  `/task` templates live in each stack’s `team/` and seed **`.ai.local/team/`** — not this folder.
22
22
 
23
- Every task persists the user’s **verbatim** original prompt at `.ai.local/team/tasks/<slug>/prompt.md` (write-if-absent). The contract lives in `core/agent-team/` (orchestrator + intake rules and `agent-artifact-contracts.md` § Prompt artifact); the path is registered on the `routing` manifest entry — never in `artifacts[]` bodies.
23
+ Every task persists the user’s **verbatim** original prompt at `.ai.local/team/tasks/<slug>/prompt.md` (write-if-absent), and every **subsequent user-authored** prompt is appended verbatim to the **append-only** `.ai.local/team/tasks/<slug>/prompt-log.md` ledger (orchestrator-only, `seq` = max + 1, created on first follow-up; hook `followup_message` excluded). The contract lives in `core/agent-team/` (orchestrator + intake rules and `agent-artifact-contracts.md` § Prompt artifact / § Prompt log); both paths are registered on the `routing` manifest entry — never in `artifacts[]` bodies.
24
24
 
25
25
  Every user-facing interaction runs in the user's **native language** — resolved from the `.ai.local/conventions.md` `## Language` setting (nearest `.ai.local` wins; else the prompt language, mixed → dominant, else English) and persisted per task as an additive `language: <BCP-47>` line in the `prompt.md` header (+ a `.memlog.md` `event:`) — while development, reasoning, and all artifacts stay **English**. The detailed contract is the requestable EMBED stem `core/agent-team/language-policy.md`; the essential clause rides the always-on `ai-local-overlay`, `<stack>-app-core`, and root `REPO_AGENTS.md` → `AGENTS.md` surfaces (no new always-on slot).
26
26
 
@@ -63,6 +63,7 @@ Unknown fields are ignored in schema v1 for forward compatibility. Producers mus
63
63
  5. `authoritativePaths` points to current files, not globs and not historical alternatives. Mark an old entry `superseded` before replacing its authority.
64
64
  6. Every applicable acceptance criterion and decomposition task ID is traceable to at least one terminal entry.
65
65
  7. The manifest contains no prompts, secrets, report bodies, model claims, durations, or remote telemetry.
66
+ 8. Parallel schedulability is a plan-time property: a step declares `writeScopes[]` (see **plan-graph** § Conflict model), producers in one wave carry distinct `artifactOutputIds`, and no scope names `status.json`, `metrics.json`, `artifact-manifest.json`, or `.metrics-receipts.json` — those are hook/orchestrator-only. Uniqueness of the manifest entry `id` **is** the C3 conflict clause: colliding output IDs are a plan error, not a runtime race.
66
67
 
67
68
  ## Completion receipts
68
69
 
@@ -87,6 +88,7 @@ A producer finishes its step by upserting only its owned artifact entry and term
87
88
  - On `subagentStop`, the hook reconciles the completing producer's attempt-bound or assigned-output receipt and maps `completed` / `blocked` / `changes_requested` / `validation_failed` onto `status.state` before metrics terminal events and retry/advance logic. Tasks without a readable manifest retain the host-completion fallback. Parent orchestrators must not start the next step until reconciliation lands.
88
89
  - A producer never edits another producer's receipt. Corrections create a new owned entry or supersede an earlier entry owned by the same producer.
89
90
  - Parallel producers need distinct entry IDs. Their parent/orchestrator serializes manifest merges; agents must not use the shared manifest as a concurrency lock.
91
+ - Re-dispatch after a retry is **slot-filtered**: only unsatisfied `(stepIndex, agent)` slots are re-invoked. A satisfied sibling keeps its entry and its terminal metric and is never re-run; the hook resolves the producer through the step graph when one exists.
90
92
 
91
93
  ## Figma contract artifact
92
94
 
@@ -125,6 +127,26 @@ Every task persists the **verbatim original user prompt** — whether or not `/t
125
127
 
126
128
  **Dialogue language (`language: <BCP-47>`):** the header also carries the task's resolved user-facing language (see **language-policy**). It is resolved once at task start (`.ai.local` `## Language` → prompt language → English; mixed → dominant; nearest `.ai.local` wins) and reused by every later step and `/task-continue`. A later correction is an append-only `.memlog.md` `event:` line — the fenced verbatim block stays frozen. The value never lives in `status.json`, `metrics.json`, or an `artifacts[]` body (see Context index conventions 7 and the hook-only lifecycle contract).
127
129
 
130
+ ## Prompt log
131
+
132
+ The **frozen original** stays in `prompt.md`. Every **subsequent user-authored** prompt for the same slug is appended, verbatim, to an append-only ledger:
133
+
134
+ | Property | Value |
135
+ |----------|-------|
136
+ | Path | `.ai.local/team/tasks/<slug>/prompt-log.md` |
137
+ | Writer / owner | the **orchestrator (parent/manager)** only — never a subagent, never the hook |
138
+ | Format | one numbered entry per prompt (`## <seq>` heading + additive header `seq`/`source`/`command`/`capturedAt`, then the user's words **verbatim** inside a fenced `text` block) |
139
+ | Written | **append-only**: `seq` = current max + 1; created on the first follow-up; existing entries are never rewritten, renumbered, or duplicated |
140
+ | Absence | valid — a single-prompt task has **no** `prompt-log.md` |
141
+ | Manifest registration | the **path** is added to the **existing `routing`** entry `authoritativePaths` (next to `prompt.md`) — the manifest carries **no** prompt body (`artifacts[]` stays body-free, see Context index conventions 7) |
142
+ | Consumers | any later agent/human reconstructing what was asked at each point; documented here so the artifact is discoverable, not orphan |
143
+
144
+ **Trigger points (orchestrator writes):** a new user-authored message while the slug is active; the **arguments** of `/task-continue <slug>` when present; human-gate feedback; a clarification answer.
145
+
146
+ **Excluded (never written):** machine-generated hook `followup_message` output; router/agent output; empty or argument-less invocations (a bare `/task-continue <slug>` carries no new user words).
147
+
148
+ **Verbatim + language:** each entry preserves the user's actual words and their original language (never translated); the frozen `language: <BCP-47>` header on `prompt.md` is unchanged. The ledger is a task-folder artifact subject to the no-local-paths discipline — any redaction is an explicit owner decision, never silent. It stays outside `status.json` / `metrics.json` (see the hook-only lifecycle contract).
149
+
128
150
  ## Default producer → entry map
129
151
 
130
152
  | Producer | Default entry `id` | Typical authoritative paths |
@@ -16,7 +16,7 @@ Each pipeline run owns `<team>/tasks/<slug>/metrics.json`:
16
16
 
17
17
  `events` is append-only. A task is one `runId`; a subtask is one invocation of `pipeline.steps[i]`. Every invocation has an `attemptId`, including each member of a parallel step. Events inherit the immutable task dimensions rather than duplicating them.
18
18
 
19
- Allowed event types are `task_started`, `attempt_started`, `attempt_finished`, `retry_scheduled`, `attempt_skipped`, `human_gate_started`, `human_gate_ended`, `pipeline_parse_error`, and `task_completed`.
19
+ Allowed event types are `task_started`, `attempt_started`, `attempt_finished`, `retry_scheduled`, `attempt_skipped`, `human_gate_started`, `human_gate_ended`, `pipeline_parse_error`, `task_completed`, and the parallel events `parallel_wave_started`, `step_joined`, `parallel_attribution_repair`, `parallel_conflict_deferred`.
20
20
 
21
21
  Outcome values, with their actual emission site:
22
22
 
@@ -41,3 +41,14 @@ The hook never writes `cancelled`; the previous version of this doc listed it, b
41
41
  6. Writers use a per-task lock and temporary-file rename for both ledger and status updates so concurrent completions do not lose events or state. Aggregation reports missing ledgers, malformed JSON, duplicate attempt IDs, unterminated attempts, unmatched terminals, and duplicate terminals as separate incomplete-data categories; none count as a successful task.
42
42
 
43
43
  Only allowlisted identifiers and timestamps belong in events. Use `source` (`router`, `hook`, `agent`) and `attributionConfidence` (`high`, `fallback`, `unknown`) to expose incomplete collection rather than invent precision.
44
+
45
+ ## Parallel waves
46
+
47
+ A **wave** is the scheduling unit: one `parallel: true` step, or (in graph mode) the topological set of ready steps the hook dispatches together.
48
+
49
+ - `parallelGroupId` keeps its `${runId}:step-<n>` format. A multi-step wave additionally carries the additive `waveId = ${runId}:wave-<firstStepIndex>`; for a single-step wave `waveId === parallelGroupId`.
50
+ - `parallel_wave_started` opens a wave (`waveId`, `stepIndexes[]`, `agents[]`, `attributionConfidence: "high"`).
51
+ - `step_joined` records the slots that satisfied the wave barrier (`stepIndex`, `slotKeys[]`, `attemptIds[]`); the persistent satisfaction ledger is `status.json.joinedSlots`.
52
+ - `parallel_attribution_repair` marks a stop the payload could not attribute that a fallback rule bound (`attemptIds[]`, `attributionConfidence: "fallback"`).
53
+ - `parallel_conflict_deferred` marks a ready step the hook deferred because the ready set was not conflict-free or a member lacked declared scopes (`stepIndex`, `deferredStepIndexes[]`, `reason`). The hook defers and logs; it never blocks and never stalls.
54
+ - Attribution always prefers the active attempt or an explicit receipt; `currentAgent` is only a third disambiguator and is always marked `fallback`.
@@ -6,7 +6,7 @@ When the user message looks like a **work request** (implement, add, fix, refact
6
6
  2. Do not jump straight to coding without router + pipeline when scope is non-trivial.
7
7
  3. Pure questions (“how does X work”, “explain”) — prefer agent **`codebase-analyzer`** (explain-as-is); trivial one-liners may be answered inline. Do not open `/task`.
8
8
  4. A work request now runs the planning workflow — **goal frame → requirements → information-sufficiency → decompose** (dependency graph / epics); see **task-framing** and **plan-graph**.
9
- 5. Every **work request** — with or without `/task`, and even when the user says “no pipeline” / “just do it” — persists the **verbatim** original prompt at `.ai.local/team/tasks/<slug>/prompt.md`. Prefer `/task` (its **Slug** step writes it). If handling inline without `/task`, first create the slug dir and write `prompt.md` (write-if-absent), then proceed. Pure questions and trivial one-liners are not work requests → no file.
9
+ 5. Every **work request** — with or without `/task`, and even when the user says “no pipeline” / “just do it” — persists the **verbatim** original prompt at `.ai.local/team/tasks/<slug>/prompt.md`. Prefer `/task` (its **Slug** step writes it). If handling inline without `/task`, first create the slug dir and write `prompt.md` (write-if-absent), then proceed. Pure questions and trivial one-liners are not work requests → no file. On an inline follow-up for an existing slug (no `/task`) where the user authors new text, append it verbatim to `.ai.local/team/tasks/<slug>/prompt-log.md` (`seq` = max + 1; create on first append; exclude machine-generated and empty/argument-less invocations).
10
10
  6. **Resolve the dialogue language before you speak to the user.** Read the `## Language` section of `.ai.local/conventions.md` (nearest `.ai.local` first); else infer from the prompt language; else English (mixed → dominant). Persist it once in the `prompt.md` header (`language: <BCP-47>`) + a `.memlog.md` `event:` line, and reuse it for the whole task. Development, reasoning, and artifacts stay English. The setting wins over a mid-task prompt switch (surface it once, never ask). See **language-policy**.
11
11
 
12
12
  Exceptions: user explicitly says “no pipeline”, “just do it”, or continues an active slug.
@@ -95,7 +95,7 @@ Existing pipelines without `routingDecision` remain valid; routers emit it for n
95
95
 
96
96
  For local metrics policy and the `metrics.json` ledger, see **agent-task-metrics**. The orchestration runtime records `task_started` and one `attempt_started` before each invocation; the hook records host-clock terminal and human-gate events. Keep active attempt identities in `status.json.activeAttempts` so parallel completions can be bound safely.
97
97
 
98
- Do not calculate durations in agents. For parallel steps, never attribute a stop using `currentAgent` alone: use a stable runtime identity, the sole active attempt, or an explicit receipt marked with fallback confidence.
98
+ Do not calculate durations in agents. For parallel steps, never attribute a stop using `currentAgent` alone: use a stable runtime identity, the sole active attempt, or an explicit receipt marked with fallback confidence. An unattributable stop with in-flight attempts never returns bare `{}` — the hook repairs the binding (payload agent → sole unrecorded slot → `currentAgent`) with `attributionConfidence: "fallback"`, or emits a deterministic resume handoff. See **agent-task-metrics** § Parallel waves.
99
99
 
100
100
  ## Artifact context index and receipts
101
101
 
@@ -146,7 +146,14 @@ Each producing agent runs a **pre-receipt self-review** of its own output — go
146
146
  | `activeAttempts` | Transient timing bridge keyed by `attemptId` |
147
147
  | `lastCompletedAttempt` | Diagnostic pointer to the latest finished attempt |
148
148
  | `parallelCompleted` | Agents that have stopped in the current parallel step |
149
- | `parallelOutcomes` | Per-agent `{ outcome, attemptId, confidence }` for the current parallel join; cleared when the step advances or retries |
149
+ | `parallelOutcomes` | Per-agent `{ outcome, attemptId, confidence }` for the current parallel join; cleared when the step/wave advances, retained across a retry of the same step |
150
+ | `joinedSlots` | Persistent satisfaction ledger `"<stepIndex>:<agent>" → { agent, stepIndex, attemptId, outcome }`; the ready-queue history (graph mode) |
151
+ | `waveSteps` | Step indexes of the in-flight wave; cleared on wave completion |
152
+ | `waveId` | `<runId>:wave-<firstStepIndex>` for the in-flight wave |
153
+ | `graphMode` | Cached `steps.some(s => Array.isArray(s.dependsOn))` |
154
+ | `blockedSteps` | Steps that ended `blocked`, excluded from the ready set until a human-approved retry |
155
+
156
+ Additional states: `blocked` — a step (or a parallel producer) cannot proceed; in graph mode independent ready steps still dispatch, and a fully-gated run emits a deterministic notice (no stall).
150
157
 
151
158
  | state | Meaning |
152
159
  |-------|---------|
@@ -166,7 +173,11 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
166
173
  |-------|-----|
167
174
  | `skipIf` | `debugger.fixed` / `ci-investigator.resolved` — hook skips step when artifact says fix applied |
168
175
  | `parallel: true` | `agent` is array — invoke **all** agents in one parent turn; each appends to `parallelCompleted` |
169
- | `scope` | e.g. `unit-in-dev`, `e2e-only`, `preset-artifacts-only` — passed to developer/qa |
176
+ | `id` | Stable step handle; the recommended value is the decomposition task ID when 1:1. Unique vs other ids and `taskIds`. |
177
+ | `dependsOn` | Step `id`s / `taskIds` that must be satisfied before dispatch. Optional; **any** occurrence switches the hook to graph mode. |
178
+ | `taskIds` | Decomposition task IDs the step realizes — the shared vocabulary with `decomposition.md` and a `dependsOn` alias. |
179
+ | `writeScopes` | Declared write surface for conflict analysis (see **plan-graph** § Conflict model). |
180
+ | `scope` | e.g. `unit-in-dev`, `e2e-only` — passed to developer/qa |
170
181
  | `model` | `cheap` \| `standard` \| `strong` — optional tier override |
171
182
 
172
183
  ## Rules (strict)
@@ -180,12 +191,15 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
180
191
  7. On `validation_failed` from `build-verifier`: hook sets `retryAfterFix: build-verifier` → developer → build-verifier.
181
192
  8. When all steps complete, suggest `/technical-retro <slug>`.
182
193
  9. If `autoChain: false` in pipeline, do not rely on hook — manual step only.
183
- 10. **Persist the verbatim original prompt.** Every `/task` and every routed work request writes the user's raw prompt to `.ai.local/team/tasks/<slug>/prompt.md` during slug bootstrap (write-if-absent; never overwrite on resume). It is not a manifest `artifacts[]` body — register the path on the `routing` entry. See **agent-artifact-contracts** § Prompt artifact.
194
+ 10. **Persist the verbatim original prompt.** Every `/task` and every routed work request writes the user's raw prompt to `.ai.local/team/tasks/<slug>/prompt.md` during slug bootstrap (write-if-absent; never overwrite on resume). It is not a manifest `artifacts[]` body — register the path on the `routing` entry. See **agent-artifact-contracts** § Prompt artifact. Also append every **subsequent user-authored** prompt for the same slug — a new user message while the slug is active, `/task-continue` arguments, human-gate feedback, a clarification answer — to the append-only `.ai.local/team/tasks/<slug>/prompt-log.md` (`seq` = max + 1; never rewrite or duplicate an entry; never log machine-generated hook `followup_message` or empty/argument-less invocations). Register its path on the `routing` entry. See **agent-artifact-contracts** § Prompt log.
184
195
  11. **Answer the user in the resolved dialogue language for the whole task.** Resolve once at task start (`.ai.local` `## Language` → prompt language → English) and pass it to every step; `/task-continue` keeps it. Never ask the user to pick a language. Development, reasoning, and artifacts stay English. See **language-policy**.
196
+ 12. **Invoke the ready set, and never advance before reconciliation.** In graph mode the hook computes the ready queue; invoke exactly the handoff's agent list (a wave in one assistant turn, multiple Task calls) and do not start any next step from your own reasoning until the hook records the join and emits the next handoff. The wave is the join unit; `status.joinedSlots` is the satisfaction ledger.
197
+ 13. **Only a proven conflict-free set is `parallel: true`.** Disjoint declared `writeScopes`, distinct agents, distinct `artifactOutputIds`, no shared lifecycle file; `mockup-reviewer` is never parallel (its FAIL gate is serial). See **plan-graph** § Conflict model.
185
198
 
186
199
  ## Team artifact I/O (Cursor Shell sandbox)
187
200
 
188
201
  - **Persist the original prompt.** For **every** task — `/task` or a routed work request — write the user's **verbatim** prompt to `.ai.local/team/tasks/<slug>/prompt.md` during slug bootstrap (write-if-absent; never overwrite on resume). The header is additive provenance only; the fenced text block holds the user's words unchanged. It is not a manifest `artifacts[]` body — the path lives on the `routing` entry. See **agent-artifact-contracts** § Prompt artifact.
202
+ - **Append follow-up prompts.** When a user-authored prompt arrives for an active slug (new message, `/task-continue` args, gate feedback, clarification), append it verbatim to `.ai.local/team/tasks/<slug>/prompt-log.md` — `seq` = current max + 1, create on first append, never rewrite or duplicate an entry, never touch `prompt.md`. Exclude hook `followup_message` and empty/argument-less invocations. Not a manifest `artifacts[]` body — the path lives on the `routing` entry. See **agent-artifact-contracts** § Prompt log.
189
203
  - **Answer in the resolved dialogue language.** Resolve once at task start (`.ai.local` `## Language` → prompt language → English; mixed → dominant; nearest `.ai.local` wins) and reuse it for every user-facing message and `/task-continue`. Record the tag in the `prompt.md` header (`language: <BCP-47>`) + a `.memlog.md` `event:` line; a later correction is an append-only memlog event. Development, reasoning, and artifacts stay **English**. See **language-policy**.
190
204
  - Create/update team task dirs with the **Write** tool (parents are created automatically). Do **not** bootstrap slug dirs with Shell `mkdir -p` — default sandbox returns `Operation not permitted` (worse on macOS Desktop/Documents with TCC).
191
205
  - If Shell must touch team paths and fails with EPERM, retry with `required_permissions: ["all"]`. Prefer Write for artifacts.
@@ -13,6 +13,34 @@ For each task record:
13
13
 
14
14
  Express the graph as a diagram plus an explicit edge list (`T2←T1`, …) so a reader can verify it without re-deriving.
15
15
 
16
+ ## Pipeline step graph (scheduling view)
17
+
18
+ `decomposition.md` records the planning DAG; `pipeline.json` `steps[]` records the same graph in the *scheduling* view so the `chain-team-phases` hook can derive a ready queue.
19
+
20
+ - **`steps[].id`** — stable step handle (recommended: the decomposition task ID when 1:1).
21
+ - **`steps[].taskIds[]`** — decomposition task IDs the step realizes: the shared vocabulary with this graph, and a `dependsOn` alias.
22
+ - **`steps[].dependsOn[]`** — step `id`s or `taskIds` members that must be satisfied before dispatch. Optional and additive: while **no** step declares it the hook keeps the legacy linear `pipelineIndex + 1` behavior; any occurrence switches the hook to **graph mode**.
23
+ - **`steps[].writeScopes[]`** — the declared write surface (see § Conflict model).
24
+ - **Ready queue** — the ready set is the topological next wave: steps whose `dependsOn` are all satisfied, not satisfied themselves, not in flight, not skipped, not blocked. The hook recomputes it on every stop and drains it.
25
+ - **Wave** — the join unit. A single `parallel: true` step is a one-step wave, so existing behavior is preserved.
26
+
27
+ ## Conflict model
28
+
29
+ A **unit** is one `(stepIndex, agent)` slot. Two units are **conflict-free** iff all six clauses hold; a **wave** is conflict-free iff every pair of its units is. Only a proven conflict-free set may carry `parallel: true`.
30
+
31
+ | # | Clause |
32
+ |---|---|
33
+ | C1 | Disjoint declared write scopes — `overlap(writeScopes(u₁), writeScopes(u₂))` is false. |
34
+ | C2 | Distinct agents — same agent means the same prompt and default outputs. |
35
+ | C3 | Distinct artifact outputs — `artifactOutputIdFor(step, agent)` differs: one manifest entry `id` per producer. |
36
+ | C4 | No same-platform twin / generated collision — no two units write the same path, and no unit writes both a source and its generated target in one wave. |
37
+ | C5 | No producer→consumer read-after-write — a producer→consumer artifact edge is a **dependency**, never a parallel edge. |
38
+ | C6 | No shared mutable lifecycle state — `status.json`, `metrics.json`, `artifact-manifest.json`, `.metrics-receipts.json` are hook/orchestrator-only and never a scope. |
39
+
40
+ **`writeScopes[]` grammar:** normalized repo-relative POSIX paths, no leading `/`, no `..`, no globs (`*`, `?`, `[`), `<slug>` the only placeholder; a trailing `/` denotes the subtree. `overlap(a, b)` = equal after trailing-slash normalization, or one is a path-prefix of the other.
41
+
42
+ **Authority & validation:** `steps[].writeScopes[]` is authoritative at schedule time; `scripts/_lib/agent-write-scopes.json` is the conservative fallback for legacy steps (an `unknown` scope conflicts with everything). The validator is `check-parallel-plan.sh`; the router sets `parallel: true` only for a proven conflict-free set and **never** places `mockup-reviewer` in a parallel group (its FAIL-only gate is serial).
43
+
16
44
  ## Epics / stages
17
45
 
18
46
  For a large flow, group tasks into **epics / stages**, each with a table:
@@ -14,6 +14,8 @@ Ratchet **up** if bounded work reveals architectural scope. Do not ratchet **dow
14
14
 
15
15
  Epics/stages, the context budget + checkpoint/resume paths, and the iterative-refinement loop are **no-ops for bounded/spike** classes — they ratchet up only for architectural work (see **plan-graph** for dependency graph + staging and **context-and-iteration** for budget/checkpoint/refinement).
16
16
 
17
+ Only the **architectural** class may emit a `pipeline.json` step graph (`steps[].id` / `dependsOn[]` / `writeScopes[]`); bounded and spike pipelines stay linear. A step graph is conflict-checked against **plan-graph** § Conflict model before any step is marked `parallel: true`.
18
+
17
19
  ## Clarification
18
20
 
19
21
  Prefer **one** unblocking question per message when a single decision unblocks DoR. Never more than **3** questions per iteration (existing analyst cap).
@@ -42,7 +42,7 @@ Before decomposing: state the **goal frame** (goal, user value, success criteria
42
42
 
43
43
  <!-- shared-core: agent-team/plan-graph.md -->
44
44
 
45
- Decompose as a **dependency graph**: each task carries `dependsOn[]`, the edges form a **DAG** with a critical path and parallelizable groups. Large flows are staged into **Epics / stages** with **exit criteria** (ratchet: bounded tasks stay flat). Plan revision is a named, auditable operation (`decision: replan rev N → N+1` in `.memlog.md`, then re-gate).
45
+ Decompose as a **dependency graph**: each task carries `dependsOn[]`, the edges form a **DAG** with a critical path and parallelizable groups. Large flows are staged into **Epics / stages** with **exit criteria** (ratchet: bounded tasks stay flat). Plan revision is a named, auditable operation (`decision: replan rev N → N+1` in `.memlog.md`, then re-gate). Parallelizable groups are **proven conflict-free** before the router may mark them `parallel: true` — disjoint declared `writeScopes`, distinct agents and `artifactOutputIds`, and no producer→consumer edge. Keep task IDs stable so `steps[].taskIds` / `steps[].dependsOn[]` reuse this vocabulary (see **plan-graph** § Conflict model).
46
46
 
47
47
  ## Context budget & iterative refinement
48
48
 
@@ -110,6 +110,16 @@ Keep top-level `profile` and emit this top-level object in every new `pipeline.j
110
110
  - Add **tech-writer** when docs/changelog requested.
111
111
 
112
112
 
113
+ ## Parallel step graph (emission rule)
114
+
115
+ A pipeline may carry a step graph. Emit it only for the **architectural** class with more than one independent work package; bounded/spike pipelines stay linear.
116
+
117
+ - Give steps `id` (the decomposition task ID when 1:1), `taskIds` (the analyst's decomposition task IDs), `dependsOn` (step IDs or `taskIds` that must finish first), and `writeScopes` (repo-relative paths the step may write, `<slug>` the only placeholder).
118
+ - Set `parallel: true` (with an `agent` array) **only** for a set proven conflict-free: disjoint declared `writeScopes`, distinct agents, distinct `artifactOutputIds`, none of `status.json` / `metrics.json` / `artifact-manifest.json` / `.metrics-receipts.json` in any scope.
119
+ - A producer → consumer artifact pair is a `dependsOn` edge, never a parallel group.
120
+ - **Never** put `mockup-reviewer` in a parallel group — its FAIL gate is serial.
121
+ - Reference fixture: `team/fixtures/feature-parallel.json` (graph + one `parallel: true` step).
122
+
113
123
  ## Model tiers (`steps[].model`)
114
124
 
115
125
  Optional: `"model": "cheap" | "standard" | "strong"`. Same policy as **cursor/next** `task-router.md`:
@@ -39,7 +39,7 @@ printf '%s\n' '{"status":"completed","action":"end_human_gate","activateNext":tr
39
39
 
40
40
  ## Checkpoint & resume
41
41
 
42
- Resume from the on-disk checkpoint, not from chat: read `.ai.local/team/tasks/<slug>/artifact-manifest.json` (authoritative paths per producer) and `.memlog.md` (`## <date>` + `event:` entries), skip completed waves, and continue at the first stage whose exit criteria are unmet. Record produced paths on the `implementation` manifest entry as you go. Do **not** overwrite or duplicate `.ai.local/team/tasks/<slug>/prompt.md` — it records the original ask (write-if-absent).
42
+ Resume from the on-disk checkpoint, not from chat: read `.ai.local/team/tasks/<slug>/artifact-manifest.json` (authoritative paths per producer) and `.memlog.md` (`## <date>` + `event:` entries), skip completed waves, and continue at the first stage whose exit criteria are unmet. Record produced paths on the `implementation` manifest entry as you go. Do **not** overwrite or duplicate `.ai.local/team/tasks/<slug>/prompt.md` — it records the original ask (write-if-absent). Append the `/task-continue` arguments (when present) and any gate feedback verbatim to `.ai.local/team/tasks/<slug>/prompt-log.md` (`seq` = max + 1; skip when the invocation carries no new user words).
43
43
 
44
44
  Plan revision during execution is a named, auditable operation: an evaluation oracle failing twice, a scope/requirement change, or a newly discovered dependency triggers `decision: replan rev N → N+1` in `.memlog.md`, an edit to `decomposition.md` (+ optional `planRevision`), and a **re-run of the affected gate**.
45
45
 
@@ -27,7 +27,7 @@ Examples:
27
27
 
28
28
  ## Algorithm
29
29
 
30
- 1. **Slug** — kebab-case from the description (≤48 characters). Create `.ai.local/team/tasks/<slug>/` by writing a file (Write / Edit); the runtime/hook owns `status.json` — do **not** rely on Shell `mkdir` as the only way to create the directory. Also write the user's **verbatim** prompt to `.ai.local/team/tasks/<slug>/prompt.md` (write-if-absent; never overwrite on resume; not a manifest `artifacts[]` body).
30
+ 1. **Slug** — kebab-case from the description (≤48 characters). Create `.ai.local/team/tasks/<slug>/` by writing a file (Write / Edit); the runtime/hook owns `status.json` — do **not** rely on Shell `mkdir` as the only way to create the directory. Also write the user's **verbatim** prompt to `.ai.local/team/tasks/<slug>/prompt.md` (write-if-absent; never overwrite on resume; not a manifest `artifacts[]` body). Do **not** create the follow-up ledger `prompt-log.md` here; it is created on the first subsequent user-authored prompt (see **agent-artifact-contracts** § Prompt log).
31
31
  2. **Router** — invoke subagent **task-router** with the task description and slug path.
32
32
  3. **Plan** — show the user the table from `pipeline.json`: intent, steps, skipped, humanGates.
33
33
  4. **Intent retro** — if `intent === "retro"`, run `/technical-retro` and **stop**.