@bonesofspring/ai-rules 0.2.87 → 0.2.90

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 (462) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +9 -1
  3. package/bin/lib/engine-scripts.js +7 -0
  4. package/bin/lib/seed-ai-local-team.js +40 -0
  5. package/bin/opencode-install.js +11 -10
  6. package/docs/OPENCODE.md +8 -4
  7. package/docs/openapi/team-db.v1.json +2 -2
  8. package/package.json +1 -1
  9. package/presets/_shared/ai-local/env.example +54 -0
  10. package/presets/_shared/ai-local/scripts/aggregate-agent-task-metrics.mjs +34 -5
  11. package/presets/_shared/ai-local/scripts/check-task-repositories.mjs +25 -22
  12. package/presets/_shared/ai-local/scripts/process-lease.mjs +3 -2
  13. package/presets/_shared/ai-local/scripts/processes.mjs +52 -20
  14. package/presets/_shared/ai-local/scripts/run.mjs +38 -6
  15. package/presets/_shared/ai-local/scripts/settings.mjs +246 -0
  16. package/presets/_shared/ai-local/scripts/task-worktree.mjs +364 -0
  17. package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +2 -2
  18. package/presets/_shared/ai-local/scripts/team-db-project.mjs +87 -14
  19. package/presets/_shared/ai-local/scripts/team-db-schema.mjs +102 -12
  20. package/presets/_shared/ai-local/scripts/team-db-tracker.mjs +35 -0
  21. package/presets/_shared/ai-local/scripts/tracker-planned-drain.mjs +10 -1
  22. package/presets/_shared/ai-local/scripts/verification.mjs +106 -11
  23. package/presets/_shared/core/agent-team/agent-task-metrics.md +10 -2
  24. package/presets/_shared/core/agent-team/agent-team-intake.md +2 -0
  25. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +2 -2
  26. package/presets/_shared/core/meta/preset-writing-style.md +8 -0
  27. package/presets/_shared/hooks/chain-team-phases.sh.tmpl +541 -61
  28. package/presets/_shared/hooks/guard-shell-command.mjs.tmpl +733 -9
  29. package/presets/_shared/hooks/prompt-autoroute.mjs.tmpl +153 -0
  30. package/presets/claude/android-kotlin/CLAUDE.md +2 -4
  31. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +541 -61
  32. package/presets/claude/android-kotlin/hooks/guard-shell-command.mjs +733 -9
  33. package/presets/claude/android-kotlin/hooks/prompt-autoroute.mjs +153 -0
  34. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-intake.md +2 -0
  35. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +2 -2
  36. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-writing-style.md +8 -0
  37. package/presets/claude/android-kotlin/settings.json +15 -5
  38. package/presets/claude/go/CLAUDE.md +2 -4
  39. package/presets/claude/go/hooks/chain-team-phases.sh +541 -61
  40. package/presets/claude/go/hooks/guard-shell-command.mjs +733 -9
  41. package/presets/claude/go/hooks/prompt-autoroute.mjs +153 -0
  42. package/presets/claude/go/rules/tooling-and-review/agent-team-intake.md +2 -0
  43. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +2 -2
  44. package/presets/claude/go/rules/tooling-and-review/preset-writing-style.md +8 -0
  45. package/presets/claude/go/settings.json +15 -5
  46. package/presets/claude/ios-swift/CLAUDE.md +2 -4
  47. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +541 -61
  48. package/presets/claude/ios-swift/hooks/guard-shell-command.mjs +733 -9
  49. package/presets/claude/ios-swift/hooks/prompt-autoroute.mjs +153 -0
  50. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-intake.md +2 -0
  51. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +2 -2
  52. package/presets/claude/ios-swift/rules/tooling-and-review/preset-writing-style.md +8 -0
  53. package/presets/claude/ios-swift/settings.json +15 -5
  54. package/presets/claude/java/CLAUDE.md +2 -4
  55. package/presets/claude/java/hooks/chain-team-phases.sh +541 -61
  56. package/presets/claude/java/hooks/guard-shell-command.mjs +733 -9
  57. package/presets/claude/java/hooks/prompt-autoroute.mjs +153 -0
  58. package/presets/claude/java/rules/tooling-and-review/agent-team-intake.md +2 -0
  59. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +2 -2
  60. package/presets/claude/java/rules/tooling-and-review/preset-writing-style.md +8 -0
  61. package/presets/claude/java/settings.json +15 -5
  62. package/presets/claude/mcp-ts/CLAUDE.md +2 -4
  63. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +541 -61
  64. package/presets/claude/mcp-ts/hooks/guard-shell-command.mjs +733 -9
  65. package/presets/claude/mcp-ts/hooks/prompt-autoroute.mjs +153 -0
  66. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-intake.md +2 -0
  67. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +2 -2
  68. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-writing-style.md +8 -0
  69. package/presets/claude/mcp-ts/settings.json +15 -5
  70. package/presets/claude/mol/CLAUDE.md +2 -4
  71. package/presets/claude/mol/agents/feature-developer.md +1 -1
  72. package/presets/claude/mol/ai-local/rules-library/commit-hygiene.md +1 -1
  73. package/presets/claude/mol/commands/task-evil.md +8 -0
  74. package/presets/claude/mol/hooks/chain-team-phases.sh +541 -61
  75. package/presets/claude/mol/hooks/guard-shell-command.mjs +733 -9
  76. package/presets/claude/mol/hooks/prompt-autoroute.mjs +153 -0
  77. package/presets/claude/mol/rules/tooling-and-review/agent-team-intake.md +2 -0
  78. package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +2 -2
  79. package/presets/claude/mol/rules/tooling-and-review/preset-writing-style.md +8 -0
  80. package/presets/claude/mol/settings.json +15 -4
  81. package/presets/claude/next/CLAUDE.md +2 -4
  82. package/presets/claude/next/REPO_AGENTS.md +2 -0
  83. package/presets/claude/next/agents/feature-developer.md +1 -1
  84. package/presets/claude/next/agents/task-analyst.md +1 -7
  85. package/presets/claude/next/agents/task-router.md +1 -1
  86. package/presets/claude/next/ai-local/rules-library/commit-hygiene.md +1 -1
  87. package/presets/claude/next/commands/spec-start.md +3 -4
  88. package/presets/claude/next/commands/task-continue.md +9 -8
  89. package/presets/claude/next/commands/task-evil.md +8 -0
  90. package/presets/claude/next/commands/task.md +1 -1
  91. package/presets/claude/next/hooks/chain-team-phases.sh +541 -61
  92. package/presets/claude/next/hooks/guard-shell-command.mjs +733 -9
  93. package/presets/claude/next/hooks/prompt-autoroute.mjs +153 -0
  94. package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +2 -0
  95. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +2 -2
  96. package/presets/claude/next/rules/tooling-and-review/preset-writing-style.md +8 -0
  97. package/presets/claude/next/settings.json +15 -4
  98. package/presets/claude/next/team/README.md +1 -1
  99. package/presets/claude/nuxt/CLAUDE.md +2 -4
  100. package/presets/claude/nuxt/hooks/chain-team-phases.sh +541 -61
  101. package/presets/claude/nuxt/hooks/guard-shell-command.mjs +733 -9
  102. package/presets/claude/nuxt/hooks/prompt-autoroute.mjs +153 -0
  103. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-intake.md +2 -0
  104. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +2 -2
  105. package/presets/claude/nuxt/rules/tooling-and-review/preset-writing-style.md +8 -0
  106. package/presets/claude/nuxt/settings.json +15 -4
  107. package/presets/claude/php-hexagonal/CLAUDE.md +2 -4
  108. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +541 -61
  109. package/presets/claude/php-hexagonal/hooks/guard-shell-command.mjs +733 -9
  110. package/presets/claude/php-hexagonal/hooks/prompt-autoroute.mjs +153 -0
  111. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-intake.md +2 -0
  112. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +2 -2
  113. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-writing-style.md +8 -0
  114. package/presets/claude/php-hexagonal/settings.json +15 -5
  115. package/presets/claude/php-laravel/CLAUDE.md +2 -4
  116. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +541 -61
  117. package/presets/claude/php-laravel/hooks/guard-shell-command.mjs +733 -9
  118. package/presets/claude/php-laravel/hooks/prompt-autoroute.mjs +153 -0
  119. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-intake.md +2 -0
  120. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +2 -2
  121. package/presets/claude/php-laravel/rules/tooling-and-review/preset-writing-style.md +8 -0
  122. package/presets/claude/php-laravel/settings.json +15 -5
  123. package/presets/claude/svelte/CLAUDE.md +2 -4
  124. package/presets/claude/svelte/hooks/chain-team-phases.sh +541 -61
  125. package/presets/claude/svelte/hooks/guard-shell-command.mjs +733 -9
  126. package/presets/claude/svelte/hooks/prompt-autoroute.mjs +153 -0
  127. package/presets/claude/svelte/rules/tooling-and-review/agent-team-intake.md +2 -0
  128. package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +2 -2
  129. package/presets/claude/svelte/rules/tooling-and-review/preset-writing-style.md +8 -0
  130. package/presets/claude/svelte/settings.json +15 -4
  131. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +541 -61
  132. package/presets/cursor/android-kotlin/hooks/guard-shell-command.mjs +733 -9
  133. package/presets/cursor/android-kotlin/rules/agent-team-intake.mdc +2 -0
  134. package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +1 -1
  135. package/presets/cursor/android-kotlin/rules/preset-writing-style.mdc +8 -0
  136. package/presets/cursor/go/hooks/chain-team-phases.sh +541 -61
  137. package/presets/cursor/go/hooks/guard-shell-command.mjs +733 -9
  138. package/presets/cursor/go/rules/agent-team-intake.mdc +2 -0
  139. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +1 -1
  140. package/presets/cursor/go/rules/preset-writing-style.mdc +8 -0
  141. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +541 -61
  142. package/presets/cursor/ios-swift/hooks/guard-shell-command.mjs +733 -9
  143. package/presets/cursor/ios-swift/rules/agent-team-intake.mdc +2 -0
  144. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +1 -1
  145. package/presets/cursor/ios-swift/rules/preset-writing-style.mdc +8 -0
  146. package/presets/cursor/java/hooks/chain-team-phases.sh +541 -61
  147. package/presets/cursor/java/hooks/guard-shell-command.mjs +733 -9
  148. package/presets/cursor/java/rules/agent-team-intake.mdc +2 -0
  149. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +1 -1
  150. package/presets/cursor/java/rules/preset-writing-style.mdc +8 -0
  151. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +541 -61
  152. package/presets/cursor/mcp-ts/hooks/guard-shell-command.mjs +733 -9
  153. package/presets/cursor/mcp-ts/rules/agent-team-intake.mdc +2 -0
  154. package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +1 -1
  155. package/presets/cursor/mcp-ts/rules/preset-writing-style.mdc +8 -0
  156. package/presets/cursor/mol/agents/feature-developer.md +1 -1
  157. package/presets/cursor/mol/ai-local/rules-library/commit-hygiene.md +1 -1
  158. package/presets/cursor/mol/commands/task-evil.md +8 -0
  159. package/presets/cursor/mol/hooks/chain-team-phases.sh +541 -61
  160. package/presets/cursor/mol/hooks/guard-shell-command.mjs +733 -9
  161. package/presets/cursor/mol/rules/agent-team-intake.mdc +2 -0
  162. package/presets/cursor/mol/rules/agent-team-orchestrator.mdc +1 -1
  163. package/presets/cursor/mol/rules/preset-writing-style.mdc +8 -0
  164. package/presets/cursor/next/REPO_AGENTS.md +2 -0
  165. package/presets/cursor/next/agents/feature-developer.md +1 -1
  166. package/presets/cursor/next/agents/task-analyst.md +1 -7
  167. package/presets/cursor/next/agents/task-router.md +1 -1
  168. package/presets/cursor/next/ai-local/rules-library/commit-hygiene.md +1 -1
  169. package/presets/cursor/next/commands/spec-start.md +3 -4
  170. package/presets/cursor/next/commands/task-continue.md +9 -8
  171. package/presets/cursor/next/commands/task-evil.md +8 -0
  172. package/presets/cursor/next/commands/task.md +1 -1
  173. package/presets/cursor/next/hooks/chain-team-phases.sh +541 -61
  174. package/presets/cursor/next/hooks/guard-shell-command.mjs +733 -9
  175. package/presets/cursor/next/rules/agent-team-intake.mdc +2 -0
  176. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +2 -2
  177. package/presets/cursor/next/rules/preset-writing-style.mdc +8 -0
  178. package/presets/cursor/next/team/README.md +1 -1
  179. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +541 -61
  180. package/presets/cursor/nuxt/hooks/guard-shell-command.mjs +733 -9
  181. package/presets/cursor/nuxt/rules/agent-team-intake.mdc +2 -0
  182. package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +1 -1
  183. package/presets/cursor/nuxt/rules/preset-writing-style.mdc +8 -0
  184. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +541 -61
  185. package/presets/cursor/php-hexagonal/hooks/guard-shell-command.mjs +733 -9
  186. package/presets/cursor/php-hexagonal/rules/agent-team-intake.mdc +2 -0
  187. package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +1 -1
  188. package/presets/cursor/php-hexagonal/rules/preset-writing-style.mdc +8 -0
  189. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +541 -61
  190. package/presets/cursor/php-laravel/hooks/guard-shell-command.mjs +733 -9
  191. package/presets/cursor/php-laravel/rules/agent-team-intake.mdc +2 -0
  192. package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +1 -1
  193. package/presets/cursor/php-laravel/rules/preset-writing-style.mdc +8 -0
  194. package/presets/cursor/svelte/hooks/chain-team-phases.sh +541 -61
  195. package/presets/cursor/svelte/hooks/guard-shell-command.mjs +733 -9
  196. package/presets/cursor/svelte/rules/agent-team-intake.mdc +2 -0
  197. package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +1 -1
  198. package/presets/cursor/svelte/rules/preset-writing-style.mdc +8 -0
  199. package/presets/mavis/android-kotlin/MAVIS.md +1 -1
  200. package/presets/mavis/android-kotlin/adapter-map.json +1 -1
  201. package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +541 -61
  202. package/presets/mavis/android-kotlin/rules/agent-team-intake.md +2 -0
  203. package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +2 -2
  204. package/presets/mavis/android-kotlin/rules/preset-writing-style.md +8 -0
  205. package/presets/mavis/go/MAVIS.md +1 -1
  206. package/presets/mavis/go/adapter-map.json +1 -1
  207. package/presets/mavis/go/hooks/chain-team-phases.sh +541 -61
  208. package/presets/mavis/go/rules/agent-team-intake.md +2 -0
  209. package/presets/mavis/go/rules/agent-team-orchestrator.md +2 -2
  210. package/presets/mavis/go/rules/preset-writing-style.md +8 -0
  211. package/presets/mavis/ios-swift/MAVIS.md +1 -1
  212. package/presets/mavis/ios-swift/adapter-map.json +1 -1
  213. package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +541 -61
  214. package/presets/mavis/ios-swift/rules/agent-team-intake.md +2 -0
  215. package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +2 -2
  216. package/presets/mavis/ios-swift/rules/preset-writing-style.md +8 -0
  217. package/presets/mavis/java/MAVIS.md +1 -1
  218. package/presets/mavis/java/adapter-map.json +1 -1
  219. package/presets/mavis/java/hooks/chain-team-phases.sh +541 -61
  220. package/presets/mavis/java/rules/agent-team-intake.md +2 -0
  221. package/presets/mavis/java/rules/agent-team-orchestrator.md +2 -2
  222. package/presets/mavis/java/rules/preset-writing-style.md +8 -0
  223. package/presets/mavis/mcp-ts/MAVIS.md +1 -1
  224. package/presets/mavis/mcp-ts/adapter-map.json +1 -1
  225. package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +541 -61
  226. package/presets/mavis/mcp-ts/rules/agent-team-intake.md +2 -0
  227. package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +2 -2
  228. package/presets/mavis/mcp-ts/rules/preset-writing-style.md +8 -0
  229. package/presets/mavis/mol/MAVIS.md +1 -1
  230. package/presets/mavis/mol/adapter-map.json +1 -1
  231. package/presets/mavis/mol/agents/feature-developer.md +1 -1
  232. package/presets/mavis/mol/ai-local/rules-library/commit-hygiene.md +1 -1
  233. package/presets/mavis/mol/commands/task-evil.md +8 -0
  234. package/presets/mavis/mol/hooks/chain-team-phases.sh +541 -61
  235. package/presets/mavis/mol/native-skills/task-evil/SKILL.md +8 -0
  236. package/presets/mavis/mol/rules/agent-team-intake.md +2 -0
  237. package/presets/mavis/mol/rules/agent-team-orchestrator.md +2 -2
  238. package/presets/mavis/mol/rules/preset-writing-style.md +8 -0
  239. package/presets/mavis/next/MAVIS.md +1 -1
  240. package/presets/mavis/next/REPO_AGENTS.md +2 -0
  241. package/presets/mavis/next/adapter-map.json +1 -1
  242. package/presets/mavis/next/agents/feature-developer.md +1 -1
  243. package/presets/mavis/next/agents/task-analyst.md +1 -7
  244. package/presets/mavis/next/agents/task-router.md +1 -1
  245. package/presets/mavis/next/ai-local/rules-library/commit-hygiene.md +1 -1
  246. package/presets/mavis/next/commands/spec-start.md +3 -4
  247. package/presets/mavis/next/commands/task-continue.md +9 -8
  248. package/presets/mavis/next/commands/task-evil.md +8 -0
  249. package/presets/mavis/next/commands/task.md +1 -1
  250. package/presets/mavis/next/hooks/chain-team-phases.sh +541 -61
  251. package/presets/mavis/next/native-skills/spec-start/SKILL.md +3 -4
  252. package/presets/mavis/next/native-skills/task/SKILL.md +1 -1
  253. package/presets/mavis/next/native-skills/task-continue/SKILL.md +9 -8
  254. package/presets/mavis/next/native-skills/task-evil/SKILL.md +8 -0
  255. package/presets/mavis/next/rules/agent-team-intake.md +2 -0
  256. package/presets/mavis/next/rules/agent-team-orchestrator.md +2 -2
  257. package/presets/mavis/next/rules/preset-writing-style.md +8 -0
  258. package/presets/mavis/next/team/README.md +1 -1
  259. package/presets/mavis/nuxt/MAVIS.md +1 -1
  260. package/presets/mavis/nuxt/adapter-map.json +1 -1
  261. package/presets/mavis/nuxt/hooks/chain-team-phases.sh +541 -61
  262. package/presets/mavis/nuxt/rules/agent-team-intake.md +2 -0
  263. package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +2 -2
  264. package/presets/mavis/nuxt/rules/preset-writing-style.md +8 -0
  265. package/presets/mavis/php-hexagonal/MAVIS.md +1 -1
  266. package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
  267. package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +541 -61
  268. package/presets/mavis/php-hexagonal/rules/agent-team-intake.md +2 -0
  269. package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +2 -2
  270. package/presets/mavis/php-hexagonal/rules/preset-writing-style.md +8 -0
  271. package/presets/mavis/php-laravel/MAVIS.md +1 -1
  272. package/presets/mavis/php-laravel/adapter-map.json +1 -1
  273. package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +541 -61
  274. package/presets/mavis/php-laravel/rules/agent-team-intake.md +2 -0
  275. package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +2 -2
  276. package/presets/mavis/php-laravel/rules/preset-writing-style.md +8 -0
  277. package/presets/mavis/svelte/MAVIS.md +1 -1
  278. package/presets/mavis/svelte/adapter-map.json +1 -1
  279. package/presets/mavis/svelte/hooks/chain-team-phases.sh +541 -61
  280. package/presets/mavis/svelte/rules/agent-team-intake.md +2 -0
  281. package/presets/mavis/svelte/rules/agent-team-orchestrator.md +2 -2
  282. package/presets/mavis/svelte/rules/preset-writing-style.md +8 -0
  283. package/presets/opencode/android-kotlin/adapter-map.json +1 -1
  284. package/presets/opencode/android-kotlin/hooks/README.md +6 -5
  285. package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +541 -61
  286. package/presets/opencode/android-kotlin/hooks/guard-shell-command.mjs +733 -9
  287. package/presets/opencode/android-kotlin/opencode.json +4 -4
  288. package/presets/opencode/android-kotlin/rules/agent-team-intake.md +2 -0
  289. package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +2 -2
  290. package/presets/opencode/android-kotlin/rules/preset-writing-style.md +8 -0
  291. package/presets/opencode/go/adapter-map.json +1 -1
  292. package/presets/opencode/go/hooks/README.md +6 -5
  293. package/presets/opencode/go/hooks/chain-team-phases.sh +541 -61
  294. package/presets/opencode/go/hooks/guard-shell-command.mjs +733 -9
  295. package/presets/opencode/go/opencode.json +4 -4
  296. package/presets/opencode/go/rules/agent-team-intake.md +2 -0
  297. package/presets/opencode/go/rules/agent-team-orchestrator.md +2 -2
  298. package/presets/opencode/go/rules/preset-writing-style.md +8 -0
  299. package/presets/opencode/ios-swift/adapter-map.json +1 -1
  300. package/presets/opencode/ios-swift/hooks/README.md +6 -5
  301. package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +541 -61
  302. package/presets/opencode/ios-swift/hooks/guard-shell-command.mjs +733 -9
  303. package/presets/opencode/ios-swift/opencode.json +4 -4
  304. package/presets/opencode/ios-swift/rules/agent-team-intake.md +2 -0
  305. package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +2 -2
  306. package/presets/opencode/ios-swift/rules/preset-writing-style.md +8 -0
  307. package/presets/opencode/java/adapter-map.json +1 -1
  308. package/presets/opencode/java/hooks/README.md +6 -5
  309. package/presets/opencode/java/hooks/chain-team-phases.sh +541 -61
  310. package/presets/opencode/java/hooks/guard-shell-command.mjs +733 -9
  311. package/presets/opencode/java/opencode.json +4 -4
  312. package/presets/opencode/java/rules/agent-team-intake.md +2 -0
  313. package/presets/opencode/java/rules/agent-team-orchestrator.md +2 -2
  314. package/presets/opencode/java/rules/preset-writing-style.md +8 -0
  315. package/presets/opencode/mcp-ts/adapter-map.json +1 -1
  316. package/presets/opencode/mcp-ts/hooks/README.md +6 -5
  317. package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +541 -61
  318. package/presets/opencode/mcp-ts/hooks/guard-shell-command.mjs +733 -9
  319. package/presets/opencode/mcp-ts/opencode.json +4 -4
  320. package/presets/opencode/mcp-ts/rules/agent-team-intake.md +2 -0
  321. package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +2 -2
  322. package/presets/opencode/mcp-ts/rules/preset-writing-style.md +8 -0
  323. package/presets/opencode/mol/adapter-map.json +1 -1
  324. package/presets/opencode/mol/agents/feature-developer.md +1 -1
  325. package/presets/opencode/mol/ai-local/rules-library/commit-hygiene.md +1 -1
  326. package/presets/opencode/mol/commands/task-evil.md +8 -0
  327. package/presets/opencode/mol/hooks/README.md +6 -5
  328. package/presets/opencode/mol/hooks/chain-team-phases.sh +541 -61
  329. package/presets/opencode/mol/hooks/guard-shell-command.mjs +733 -9
  330. package/presets/opencode/mol/opencode.json +4 -4
  331. package/presets/opencode/mol/rules/agent-team-intake.md +2 -0
  332. package/presets/opencode/mol/rules/agent-team-orchestrator.md +2 -2
  333. package/presets/opencode/mol/rules/preset-writing-style.md +8 -0
  334. package/presets/opencode/next/REPO_AGENTS.md +2 -0
  335. package/presets/opencode/next/adapter-map.json +1 -1
  336. package/presets/opencode/next/agents/feature-developer.md +1 -1
  337. package/presets/opencode/next/agents/task-analyst.md +1 -7
  338. package/presets/opencode/next/agents/task-router.md +1 -1
  339. package/presets/opencode/next/ai-local/rules-library/commit-hygiene.md +1 -1
  340. package/presets/opencode/next/commands/spec-start.md +3 -4
  341. package/presets/opencode/next/commands/task-continue.md +9 -8
  342. package/presets/opencode/next/commands/task-evil.md +8 -0
  343. package/presets/opencode/next/commands/task.md +1 -1
  344. package/presets/opencode/next/hooks/README.md +6 -5
  345. package/presets/opencode/next/hooks/chain-team-phases.sh +541 -61
  346. package/presets/opencode/next/hooks/guard-shell-command.mjs +733 -9
  347. package/presets/opencode/next/opencode.json +4 -4
  348. package/presets/opencode/next/rules/agent-team-intake.md +2 -0
  349. package/presets/opencode/next/rules/agent-team-orchestrator.md +2 -2
  350. package/presets/opencode/next/rules/preset-writing-style.md +8 -0
  351. package/presets/opencode/next/team/README.md +1 -1
  352. package/presets/opencode/nuxt/adapter-map.json +1 -1
  353. package/presets/opencode/nuxt/hooks/README.md +6 -5
  354. package/presets/opencode/nuxt/hooks/chain-team-phases.sh +541 -61
  355. package/presets/opencode/nuxt/hooks/guard-shell-command.mjs +733 -9
  356. package/presets/opencode/nuxt/opencode.json +4 -4
  357. package/presets/opencode/nuxt/rules/agent-team-intake.md +2 -0
  358. package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +2 -2
  359. package/presets/opencode/nuxt/rules/preset-writing-style.md +8 -0
  360. package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
  361. package/presets/opencode/php-hexagonal/hooks/README.md +6 -5
  362. package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +541 -61
  363. package/presets/opencode/php-hexagonal/hooks/guard-shell-command.mjs +733 -9
  364. package/presets/opencode/php-hexagonal/opencode.json +4 -4
  365. package/presets/opencode/php-hexagonal/rules/agent-team-intake.md +2 -0
  366. package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +2 -2
  367. package/presets/opencode/php-hexagonal/rules/preset-writing-style.md +8 -0
  368. package/presets/opencode/php-laravel/adapter-map.json +1 -1
  369. package/presets/opencode/php-laravel/hooks/README.md +6 -5
  370. package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +541 -61
  371. package/presets/opencode/php-laravel/hooks/guard-shell-command.mjs +733 -9
  372. package/presets/opencode/php-laravel/opencode.json +4 -4
  373. package/presets/opencode/php-laravel/rules/agent-team-intake.md +2 -0
  374. package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +2 -2
  375. package/presets/opencode/php-laravel/rules/preset-writing-style.md +8 -0
  376. package/presets/opencode/plugins/settings-guard/README.md +25 -0
  377. package/presets/opencode/plugins/settings-guard/index.ts +114 -0
  378. package/presets/opencode/plugins/settings-guard/package.json +9 -0
  379. package/presets/opencode/plugins/settings-guard/policy.mjs +85 -0
  380. package/presets/opencode/plugins/settings-guard/prompt-face.mjs +153 -0
  381. package/presets/opencode/plugins/task-status/README.md +9 -4
  382. package/presets/opencode/plugins/task-status/eta.ts +20 -7
  383. package/presets/opencode/plugins/task-status/index.ts +14 -1
  384. package/presets/opencode/plugins/task-status/task-view.ts +160 -5
  385. package/presets/opencode/plugins/task-status/timing.ts +244 -0
  386. package/presets/opencode/plugins/task-status/types.ts +6 -0
  387. package/presets/opencode/svelte/adapter-map.json +1 -1
  388. package/presets/opencode/svelte/hooks/README.md +6 -5
  389. package/presets/opencode/svelte/hooks/chain-team-phases.sh +541 -61
  390. package/presets/opencode/svelte/hooks/guard-shell-command.mjs +733 -9
  391. package/presets/opencode/svelte/opencode.json +4 -4
  392. package/presets/opencode/svelte/rules/agent-team-intake.md +2 -0
  393. package/presets/opencode/svelte/rules/agent-team-orchestrator.md +2 -2
  394. package/presets/opencode/svelte/rules/preset-writing-style.md +8 -0
  395. package/presets/zcode/android-kotlin/adapter-map.json +1 -1
  396. package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +541 -61
  397. package/presets/zcode/android-kotlin/rules/agent-team-intake.md +2 -0
  398. package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +2 -2
  399. package/presets/zcode/android-kotlin/rules/preset-writing-style.md +8 -0
  400. package/presets/zcode/go/adapter-map.json +1 -1
  401. package/presets/zcode/go/hooks/chain-team-phases.sh +541 -61
  402. package/presets/zcode/go/rules/agent-team-intake.md +2 -0
  403. package/presets/zcode/go/rules/agent-team-orchestrator.md +2 -2
  404. package/presets/zcode/go/rules/preset-writing-style.md +8 -0
  405. package/presets/zcode/ios-swift/adapter-map.json +1 -1
  406. package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +541 -61
  407. package/presets/zcode/ios-swift/rules/agent-team-intake.md +2 -0
  408. package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +2 -2
  409. package/presets/zcode/ios-swift/rules/preset-writing-style.md +8 -0
  410. package/presets/zcode/java/adapter-map.json +1 -1
  411. package/presets/zcode/java/hooks/chain-team-phases.sh +541 -61
  412. package/presets/zcode/java/rules/agent-team-intake.md +2 -0
  413. package/presets/zcode/java/rules/agent-team-orchestrator.md +2 -2
  414. package/presets/zcode/java/rules/preset-writing-style.md +8 -0
  415. package/presets/zcode/mcp-ts/adapter-map.json +1 -1
  416. package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +541 -61
  417. package/presets/zcode/mcp-ts/rules/agent-team-intake.md +2 -0
  418. package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +2 -2
  419. package/presets/zcode/mcp-ts/rules/preset-writing-style.md +8 -0
  420. package/presets/zcode/mol/adapter-map.json +1 -1
  421. package/presets/zcode/mol/agents/feature-developer.md +1 -1
  422. package/presets/zcode/mol/ai-local/rules-library/commit-hygiene.md +1 -1
  423. package/presets/zcode/mol/commands/task-evil.md +8 -0
  424. package/presets/zcode/mol/hooks/chain-team-phases.sh +541 -61
  425. package/presets/zcode/mol/rules/agent-team-intake.md +2 -0
  426. package/presets/zcode/mol/rules/agent-team-orchestrator.md +2 -2
  427. package/presets/zcode/mol/rules/preset-writing-style.md +8 -0
  428. package/presets/zcode/next/REPO_AGENTS.md +2 -0
  429. package/presets/zcode/next/adapter-map.json +1 -1
  430. package/presets/zcode/next/agents/feature-developer.md +1 -1
  431. package/presets/zcode/next/agents/task-analyst.md +1 -7
  432. package/presets/zcode/next/agents/task-router.md +1 -1
  433. package/presets/zcode/next/ai-local/rules-library/commit-hygiene.md +1 -1
  434. package/presets/zcode/next/commands/spec-start.md +3 -4
  435. package/presets/zcode/next/commands/task-continue.md +9 -8
  436. package/presets/zcode/next/commands/task-evil.md +8 -0
  437. package/presets/zcode/next/commands/task.md +1 -1
  438. package/presets/zcode/next/hooks/chain-team-phases.sh +541 -61
  439. package/presets/zcode/next/rules/agent-team-intake.md +2 -0
  440. package/presets/zcode/next/rules/agent-team-orchestrator.md +2 -2
  441. package/presets/zcode/next/rules/preset-writing-style.md +8 -0
  442. package/presets/zcode/next/team/README.md +1 -1
  443. package/presets/zcode/nuxt/adapter-map.json +1 -1
  444. package/presets/zcode/nuxt/hooks/chain-team-phases.sh +541 -61
  445. package/presets/zcode/nuxt/rules/agent-team-intake.md +2 -0
  446. package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +2 -2
  447. package/presets/zcode/nuxt/rules/preset-writing-style.md +8 -0
  448. package/presets/zcode/php-hexagonal/adapter-map.json +1 -1
  449. package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +541 -61
  450. package/presets/zcode/php-hexagonal/rules/agent-team-intake.md +2 -0
  451. package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +2 -2
  452. package/presets/zcode/php-hexagonal/rules/preset-writing-style.md +8 -0
  453. package/presets/zcode/php-laravel/adapter-map.json +1 -1
  454. package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +541 -61
  455. package/presets/zcode/php-laravel/rules/agent-team-intake.md +2 -0
  456. package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +2 -2
  457. package/presets/zcode/php-laravel/rules/preset-writing-style.md +8 -0
  458. package/presets/zcode/svelte/adapter-map.json +1 -1
  459. package/presets/zcode/svelte/hooks/chain-team-phases.sh +541 -61
  460. package/presets/zcode/svelte/rules/agent-team-intake.md +2 -0
  461. package/presets/zcode/svelte/rules/agent-team-orchestrator.md +2 -2
  462. package/presets/zcode/svelte/rules/preset-writing-style.md +8 -0
@@ -17,4 +17,6 @@ When the user message looks like a **work request** (implement, add, fix, refact
17
17
  6. **Reuse the dialogue language already resolved on this turn** (always-on `ai-local-overlay` / **language-policy**). A question and a message without a slash command still resolve before you speak. When this request writes `prompt.md`, persist that tag once in the header (`language: <BCP-47>`) + a `.memlog.md` `event:` line. Development, reasoning, and artifacts stay English. The setting wins over a mid-task prompt switch (surface it once, never ask). See **language-policy**.
18
18
  7. **Project the intake write.** After `prompt.md` is written for an inline (non-`/task`) work request, run `node .ai.local/scripts/team-db.mjs sync --slug <slug> --deadline-ms 4500` once, so the new task row and its prompt reach the database. A projection failure is reported to the user, never blocks the request; the next full sync remains the convergence path. Do not run a full sync from intake.
19
19
 
20
+ On Cursor, Mavis, OpenCode and ZCode — the hosts without a verified prompt hook — run a request that is not already `/task` or `/task-continue` as `/task` when `node .ai.local/scripts/settings.mjs get AI_RULES_AUTOROUTE_UNCHAINED_PROMPTS` prints `true` and the live-slug count (every `.ai.local/team/tasks/*/status.json` whose `state` is not one of `completed`, `blocked`, `changes_requested`, `validation_failed`) is below the `node .ai.local/scripts/settings.mjs get AI_RULES_MAX_PARALLEL_TASKS` cap (`4` by default; `0` = unlimited). A prompt that names an existing slug or is a resume intent (`continue` / `resume` / `продолжай` family, `.ai.local/rules/task-resume.md`) routes to `/task-continue <slug>` regardless of the cap. <!-- i18n-keep: E4 -->
21
+
20
22
  Exceptions: user explicitly says “no pipeline”, “just do it”, or continues an active slug.
@@ -249,7 +249,7 @@ Use Task tool or `/agent-name`. Pass: slug, artifact paths, step `scope` if set.
249
249
  4. Parallel steps: apply the step-level `model` to **each** agent in the array (or omit → each agent’s own frontmatter).
250
250
  5. The tier never changes the step order, gates, receipts, or retry policy.
251
251
 
252
- After each agent completes, verify its terminal manifest receipt, then let the orchestration runtime/hook reconcile `status.json` (`completed`, a blocking outcome, or `awaiting_approval`) from that receipt. Do not ask the agent to mutate shared lifecycle fields, and do not invoke the next specialist until the hook has written the handoff / updated `status.json`.
252
+ After each agent completes, verify its terminal manifest receipt, then let the orchestration runtime/hook reconcile `status.json` (`completed`, a blocking outcome, or `awaiting_approval`) from that receipt. **MUST: pass `TEAM_TASK_SLUG=<slug>` on every hook call** — `TEAM_TASK_SLUG=<slug> bash <host-hooks>/chain-team-phases.sh` (or the host's hook path). With more than one live slug, an omitted env is a hook refusal (`active-task-pointer-ambiguous`, `ok:false`), never a silent reroute: re-run with the env set. The OpenCode task-status plugin pins each tab in `.ai.local/team/.session-leases/<session>.json` and injects `AI_RULES_SESSION_ID` on `shell.env`, so a later hook call in that tab resolves through the lease when `TEAM_TASK_SLUG` is omitted. `active-task.json` is the live-slug list, not a tab binding. Do not ask the agent to mutate shared lifecycle fields, and do not invoke the next specialist until the hook has written the handoff / updated `status.json`.
253
253
 
254
254
  ## Legacy mode
255
255
 
@@ -34,6 +34,14 @@ Write for two readers at once: an **agent** loading one file out of context, and
34
34
  - No scenario storytelling, rhetorical questions, or meta-narration ("this section explains…").
35
35
  - No duplicated rule text across stems — link instead.
36
36
 
37
+ ## Shell guards
38
+
39
+ A write or execute guard allowlists the benign shapes and answers `ask` on anything it cannot classify. `allow` on an unknown shape is a defect.
40
+
41
+ - Name the bypass class — abbreviations, aliases, quoting, shell wrappers, config-injection options (`-c`, `--exec`, `--receive-pack`), value-consumption mismatch — not a list of spellings.
42
+ - Probe each shape with the flag on, the flag off, a sentinel, and an unreadable config. Quote the tool output. A green gate set is not that evidence.
43
+ - Compare every probed shape with the previous answer. A shape that asked before and allows now is a blocker.
44
+
37
45
  ## Size
38
46
 
39
47
  - Shortest form that still changes behavior: if a bullet fits as a clause, make it a clause.
@@ -38,6 +38,8 @@ A research fact **MUST** be written to `.ai.local/team/tasks/<slug>/analysis.md`
38
38
 
39
39
  For **every** work request — with or without `/task` — persist the user's **verbatim** prompt to `.ai.local/team/tasks/<slug>/prompt.md` (write-if-absent; never overwrite on resume). Append each **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) verbatim to `.ai.local/team/tasks/<slug>/prompt-log.md` (`seq` = max + 1; never rewrite or duplicate an entry; never touch `prompt.md`). Never persist machine-generated hook messages or empty/argument-less invocations; pure questions and trivial one-liners are not work requests. Details: the `agent-team-intake` and `agent-team-orchestrator` rules.
40
40
 
41
+ On Cursor, Mavis, OpenCode and ZCode — the hosts without a verified prompt hook — run a request that is not already `/task` or `/task-continue` as `/task` when `node .ai.local/scripts/settings.mjs get AI_RULES_AUTOROUTE_UNCHAINED_PROMPTS` prints `true` and the live-slug count (every `.ai.local/team/tasks/*/status.json` whose `state` is not one of `completed`, `blocked`, `changes_requested`, `validation_failed`) is below the `node .ai.local/scripts/settings.mjs get AI_RULES_MAX_PARALLEL_TASKS` cap (`4` by default; `0` = unlimited). A prompt that names an existing slug or is a resume intent (`continue` / `resume` / `продолжай` family, `.ai.local/rules/task-resume.md`) routes to `/task-continue <slug>` regardless of the cap. <!-- i18n-keep: E4 -->
42
+
41
43
  ## Commands (test / lint / build)
42
44
 
43
45
  Working directory for app scripts: **`app/`**. Detect the package manager from lockfile / `packageManager` (`package-manager` rule).
@@ -166,6 +166,6 @@ Shipped browser split: Playwright MCP for e2e specs/selectors; Chrome DevTools M
166
166
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for `brief.md`, `decomposition.md`, current scope, and applicable prior findings.
167
167
  - **Owned outputs:** `implementation.md` plus changed implementation/test paths; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `implementation`) and preserve all foreign items in `manifest.artifacts[]`.
168
168
  - **`implementation.md` budget:** ≤80 prose lines. Keep the gate table, changed files, and deviations; no work-package narrative and no diff restatement. Evidence tables do not count toward the cap.
169
- - **Commit hygiene:** never run `git commit` / `git push`. At the end of the turn return a `## Human commits` block: files touched + a proposed commit message, split by area (source / artifacts / docs) with the owning slug/ticket in the subject. See the consumer `commit-hygiene` local rule.
169
+ - **Commit hygiene:** do not run `git commit` / `git push` unless `.ai.local/.env` sets `AI_RULES_ALLOW_GIT_WRITES=true`. At the end of the turn return a `## Human commits` block: files touched + a proposed commit message, split by area (source / artifacts / docs) with the owning slug/ticket in the subject. See the consumer `commit-hygiene` local rule.
170
170
  - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
171
171
  - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
@@ -174,13 +174,7 @@ rev: 1 — record each replan as `decision: replan rev N → N+1` in `.memlog.md
174
174
 
175
175
  ### Runtime state
176
176
 
177
- The orchestration runtime/hook owns `status.json`; the analyst does not create or mutate lifecycle fields.
178
-
179
- Also write `.ai.local/team/active-task.json`:
180
-
181
- ```json
182
- { "slug": "<slug>" }
183
- ```
177
+ The orchestration runtime/hook owns `status.json`; the analyst does not create or mutate lifecycle fields. `active-task.json` is a UI projection rebuilt by `team-db sync` — do not write it.
184
178
 
185
179
  ## Slug naming
186
180
 
@@ -221,7 +221,7 @@ When the task description or `brief.md` carries `Autonomy: auto`:
221
221
 
222
222
  ## Output
223
223
 
224
- Write `.ai.local/team/tasks/<slug>/pipeline.json` and initialize the routing entry in `artifact-manifest.json`; set `.ai.local/team/active-task.json`. The orchestration runtime creates and owns `status.json`.
224
+ Write `.ai.local/team/tasks/<slug>/pipeline.json` and initialize the routing entry in `artifact-manifest.json`. The orchestration runtime creates and owns `status.json`.
225
225
 
226
226
  ## Handoff to orchestrator
227
227
 
@@ -6,7 +6,7 @@ glob: always
6
6
 
7
7
  When committing or preparing a commit, acknowledge: `Using .ai.local: commit-hygiene(, …)*`.
8
8
 
9
- Agents do not run `git commit`/`git push`. This rule constrains the **human commit step** and the agent's end-of-turn commit guidance.
9
+ Agents do not run `git commit`/`git push` unless `.ai.local/.env` sets `AI_RULES_ALLOW_GIT_WRITES=true`. This rule constrains the **human commit step** and the agent's end-of-turn commit guidance. `init` lists `.env` in `.ai.local/.gitignore` and leaves `.env.example` tracked. Committing `.ai.local/.env` is an explicit opt-in: remove that line, then add the file. A committed `true` enables git writes on every clone.
10
10
 
11
11
  ## Rules
12
12
 
@@ -12,10 +12,9 @@ Routes intent **`spec-gen`** (or bootstrap) → **task-analyst** in **author mod
12
12
  1. Extract description from arguments after `/spec-start` (domain, page/feature ids, sources).
13
13
  2. Generate a **slug** (kebab-case, ≤48 chars), e.g. `spec-<domain>-<id>`.
14
14
  3. Ensure `.ai.local/team/tasks/<slug>/` exists (Write artifacts; not Shell mkdir).
15
- 4. Write `.ai.local/team/active-task.json` → `{ "slug": "<slug>" }`.
16
- 5. Write minimal `pipeline.json`: task-analyst → (optional stop) → feature-developer only if user asked implement-after. **No separate spec-author agent.**
17
- 6. Invoke **task-analyst** with: author mode; load **`product-specs`** + **`product-specs-authoring`** + skill **`spec-authoring`**; Bootstrap if `docs/specs/` absent, else Generate. Optional: if arguments/AC ask research-before-spec, also load skill **`spec-discovery`** (not default).
18
- 7. Wait for analyst. **Do not** invoke feature-developer until human gate passes.
15
+ 4. Write minimal `pipeline.json`: task-analyst → (optional stop) → feature-developer only if user asked implement-after. **No separate spec-author agent.**
16
+ 5. Invoke **task-analyst** with: author mode; load **`product-specs`** + **`product-specs-authoring`** + skill **`spec-authoring`**; Bootstrap if `docs/specs/` absent, else Generate. Optional: if arguments/AC ask research-before-spec, also load skill **`spec-discovery`** (not default).
17
+ 6. Wait for analyst. **Do not** invoke feature-developer until human gate passes.
19
18
 
20
19
  ## Human gate
21
20
 
@@ -10,6 +10,7 @@ Resume the pipeline from `pipeline.json`.
10
10
  ## Arguments
11
11
 
12
12
  `<slug>` — task identifier.
13
+ `--all` — repo-level resume: clears the repo-global sentinels and every per-slug sentinel.
13
14
 
14
15
  ## Preconditions
15
16
 
@@ -18,13 +19,12 @@ Resume the pipeline from `pipeline.json`.
18
19
  - `awaitingHumanGate: true` or `state: awaiting_approval`, **or**
19
20
  - `state: changes_requested` (after review), **or**
20
21
  - `state: blocked` (a producer's terminal `blocked` receipt and the owner has resolved the blockers), **or**
21
- - `state: paused` (the `.ai.local/STOP` / `.ai.local/ESTOP` sentinel is gone), **or**
22
+ - `state: paused` (the per-slug sentinel `.ai.local/team/tasks/<slug>/STOP` is gone; a repo-global `.ai.local/STOP` / `.ai.local/ESTOP` is removed only by `--all`), **or**
22
23
  - the task was interrupted and must resume from `pipelineIndex`.
23
24
 
24
25
  ## Algorithm
25
26
 
26
- 1. Write `.ai.local/team/active-task.json` → `{ "slug": "<slug>" }`.
27
- 2. **Human gate resume** (`awaitingHumanGate` / `awaiting_approval`):
27
+ 1. **Human gate resume** (`awaitingHumanGate` / `awaiting_approval`):
28
28
  1. **Do not** manually increment `pipelineIndex` or invent `currentAgent` first.
29
29
  2. Close the gate + activate the next attempt via the **installed** hook (single authority for ledger + status):
30
30
 
@@ -34,9 +34,9 @@ printf '%s\n' '{"status":"completed","action":"end_human_gate","activateNext":tr
34
34
 
35
35
  3. Re-read `status.json` (and the hook `followup_message`).
36
36
  4. Invoke the subagent named in `status.currentAgent` / followup — do **not** advance the pipeline a second time.
37
- 3. **Review `changes_requested`** (not a human gate): if `currentAgent` is **`mockup-reviewer`**, this is the FAIL-only mockup gate — do **not** retry `feature-developer`. Read `mockup-review.md` and resume via the human-gate path (`end_human_gate` / `activateNext`). Otherwise: set `currentAgent` to `feature-developer` (same index / find developer in steps), `state: in_progress`, then invoke developer. Do **not** call `end_human_gate` unless `activeHumanGateEventId` is set.
38
- 4. **`blocked` + `currentAgent: mockup-reviewer`** (`BLOCKED_MCP`): skip-forward via the same `end_human_gate`/`activateNext` path (explicit «proceed without MCP»). Do not invent DS claims. This exception keeps precedence: `resume_blocked` refuses this state and names the skip-forward.
39
- 5. **`state: blocked`** (every other producer): re-arm the blocked step through the **installed** hook — it activates attempt N+1 and is the **single authority** for the ledger:
37
+ 2. **Review `changes_requested`** (not a human gate): if `currentAgent` is **`mockup-reviewer`**, this is the FAIL-only mockup gate — do **not** retry `feature-developer`. Read `mockup-review.md` and resume via the human-gate path (`end_human_gate` / `activateNext`). Otherwise: set `currentAgent` to `feature-developer` (same index / find developer in steps), `state: in_progress`, then invoke developer. Do **not** call `end_human_gate` unless `activeHumanGateEventId` is set.
38
+ 3. **`blocked` + `currentAgent: mockup-reviewer`** (`BLOCKED_MCP`): skip-forward via the same `end_human_gate`/`activateNext` path (explicit «proceed without MCP»). Do not invent DS claims. This exception keeps precedence: `resume_blocked` refuses this state and names the skip-forward.
39
+ 4. **`state: blocked`** (every other producer): re-arm the blocked step through the **installed** hook — it activates attempt N+1 and is the **single authority** for the ledger:
40
40
  1. **Do not** manually increment `pipelineIndex` or hand-write `status.json` fields.
41
41
 
42
42
  ```bash
@@ -46,8 +46,9 @@ printf '%s\n' '{"action":"resume_blocked"}' | TEAM_TASK_SLUG=<slug> bash .cursor
46
46
  2. `ok:false` with a `reason` (`is not blocked`, `pipeline.json`, `graph mode`, `already has an active attempt`) means nothing was armed: re-read `status.json` and act on the reason. A refusal carries no `followup_message` — never re-invoke a producer on it.
47
47
  3. `ok:true` arms attempt N+1 on the same step: re-read `status.json`, then invoke the subagent named in `status.currentAgent` with the hook `followup_message`. Do **not** open the gate yourself: the retried receipt opens it (`awaiting_approval`) when the step has `after:<agent>` in `humanGates`, and advances the chain otherwise.
48
48
  4. Fallback only for an installed hook that predates the action (the call answers `{}`): run `{"status":"completed","action":"bootstrap"}` then `{"status":"completed"}`. The second run opens the gate or advances; the retried producer is not ledgered, so record it in `.memlog.md`.
49
- 6. **Other resume**: restore `pipelineIndex` / `currentAgent` from status and invoke that agent.
50
- 7. **Paused** (`state: paused`, sentinel removed): if `awaitingHumanGate` is still true, use the human-gate resume path above. Otherwise close the pause through the installed hook with `{"status":"completed"}` and no `action`, then re-read `status.json` and the hook `followup_message`; do not advance by hand.
49
+ 5. **Other resume**: restore `pipelineIndex` / `currentAgent` from status and invoke that agent.
50
+ 6. **Paused** (`state: paused`, sentinel removed): resume is slug-scoped — remove **only** this slug's sentinel, `.ai.local/team/tasks/<slug>/STOP` (never ask the user to delete it by hand). Never remove the repo-global `.ai.local/STOP` / `.ai.local/ESTOP` on a per-slug resume: they pause every slug and only `--all` clears them. If `awaitingHumanGate` is still true, use the human-gate resume path above. Otherwise close the pause through the installed hook with `{"status":"completed"}` and no `action`, then re-read `status.json` and the hook `followup_message`; do not advance by hand.
51
+ 7. **`--all` (repo-level resume)**: remove `.ai.local/STOP`, `.ai.local/ESTOP`, and every per-slug `.ai.local/team/tasks/<slug>/STOP`, appending one `.memlog.md` line per slug resumed (`event: operator pause cleared by resume intent (<slug>)`). Then resume each affected slug through its own `/task-continue <slug>` flow.
51
52
  8. After the invoked agent completes, `chain-team-phases.sh` on `subagentStop` continues the chain when `autoChain: true`.
52
53
 
53
54
  ## Checkpoint & resume
@@ -18,6 +18,14 @@ Load `anti-hallucination-contract` before asserting code, APIs, schemas, tool be
18
18
 
19
19
  Everything after `/task-evil` is the task description in natural language.
20
20
 
21
+ ## Start precondition
22
+
23
+ Before the first task action:
24
+
25
+ 1. Write the marker `.ai.local/team/.task-evil` (create `.ai.local/team/` if needed). If it cannot be written, write `blocked.md` and stop: the shell guard cannot tell an autonomous run apart without it.
26
+ 2. Run `node .ai.local/scripts/settings.mjs get AI_RULES_ALLOW_GIT_WRITES`. If it prints `true`, write `blocked.md` naming the flag, remove the marker, and stop: an autonomous run cannot start while `AI_RULES_ALLOW_GIT_WRITES=true`.
27
+ 3. Remove `.ai.local/team/.task-evil` when the run ends (completed or blocked). A stale marker keeps git writes gated, which is the safe direction.
28
+
21
29
  ## Procedure
22
30
 
23
31
  1. **Slug** — kebab-case from the description (≤48 characters). Create `.ai.local/team/tasks/<slug>/` via **Write** (placeholder `pipeline.json` or empty marker), `prompt.md` (verbatim, write-if-absent), `goal.md` (Goal, User value, Success criteria, Non-goals, Derived from `prompt.md`), `autonomy.md` (the contract below), and `decisions.md` (the table header below). The runtime/hook owns `status.json`; do not create it with Shell.
@@ -39,7 +39,7 @@ Examples:
39
39
  4. **Intent retro** — if `intent === "retro"`, run `/technical-retro` and **stop**.
40
40
  5. **Confirm plan** — **stop** and ask the user to confirm the plan and the `goal.md` fields before any specialist runs. Wait for explicit approval before invoking `steps[0]`. A change to the plan at this point is a named `planRevision` (see Plan contract), not a silent edit. Record the confirmation verbatim in `prompt-log.md`.
41
41
  6. **Start** — after confirmation:
42
- - confirm `pipeline.json` and `active-task.json`;
42
+ - confirm `pipeline.json`; `active-task.json` is a UI projection rebuilt by `team-db sync` — do not write it;
43
43
  - **do not** write lifecycle fields in `status.json` / `metrics.json` yourself — orchestration runtime/hook owns them (see **agent-artifact-contracts**). If `status.json` is missing, only minimal bootstrap is allowed (`slug`, `intent`, `pipelineIndex: 0`, `currentAgent: steps[0]`, `state: in_progress`) — **do not** increment `pipelineIndex` manually;
44
44
  - invoke subagent for `pipeline.steps[0].agent` (slug, artifact paths, scope).
45
45
  7. **After each agent** — wait for hook handoff / reconciliation terminal receipt → `status.state`; do not start the next step until `status.json` reflects handoff (or until there is a `followup_message` from the hook). A Task call that returns a session handle has only **started** the agent: keep the step open until it reports back.