@bonesofspring/ai-rules 0.2.42 → 0.2.44

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 (468) hide show
  1. package/CHANGELOG.md +48 -1
  2. package/bin/lib/seed-ai-local-team.js +41 -4
  3. package/docs/LOCAL-OVERLAY.md +6 -4
  4. package/docs/PRESET-CONTRIBUTION.md +2 -2
  5. package/docs/PRESET-ENGLISH-STYLE.md +1 -1
  6. package/docs/specs/INDEX.md +3 -1
  7. package/docs/specs/_templates/feature.md +6 -0
  8. package/package.json +1 -1
  9. package/presets/_shared/README.md +1 -1
  10. package/presets/_shared/assets/docs-specs/_templates/feature.md +6 -0
  11. package/presets/_shared/core/agent-team/agent-artifact-contracts.md +1 -1
  12. package/presets/_shared/core/agent-team/agent-team-intake.md +1 -1
  13. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +23 -7
  14. package/presets/_shared/core/agent-team/language-policy.md +24 -16
  15. package/presets/_shared/core/agent-team/plan-graph.md +9 -1
  16. package/presets/_shared/core/quality/anti-hallucination-contract.md +2 -0
  17. package/presets/_shared/core/quality/context-and-iteration.md +2 -1
  18. package/presets/_shared/hooks/chain-team-phases.sh.tmpl +1080 -4
  19. package/presets/claude/android-kotlin/REPO_AGENTS.md +1 -3
  20. package/presets/claude/android-kotlin/commands/task-continue.md +1 -1
  21. package/presets/claude/android-kotlin/commands/task.md +1 -3
  22. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +1080 -4
  23. package/presets/claude/android-kotlin/rules/stack/android-app-core.md +1 -3
  24. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-intake.md +1 -1
  25. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +23 -7
  26. package/presets/claude/android-kotlin/rules/tooling-and-review/ai-local-overlay.md +1 -1
  27. package/presets/claude/android-kotlin/rules/tooling-and-review/anti-hallucination-contract.md +2 -0
  28. package/presets/claude/android-kotlin/rules/tooling-and-review/language-policy.md +25 -17
  29. package/presets/claude/go/REPO_AGENTS.md +1 -3
  30. package/presets/claude/go/commands/task-continue.md +1 -1
  31. package/presets/claude/go/commands/task.md +1 -3
  32. package/presets/claude/go/hooks/chain-team-phases.sh +1080 -4
  33. package/presets/claude/go/rules/stack/go-app-core.md +1 -3
  34. package/presets/claude/go/rules/tooling-and-review/agent-team-intake.md +1 -1
  35. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +23 -7
  36. package/presets/claude/go/rules/tooling-and-review/ai-local-overlay.md +1 -1
  37. package/presets/claude/go/rules/tooling-and-review/anti-hallucination-contract.md +2 -0
  38. package/presets/claude/go/rules/tooling-and-review/language-policy.md +25 -17
  39. package/presets/claude/ios-swift/REPO_AGENTS.md +1 -3
  40. package/presets/claude/ios-swift/commands/task-continue.md +1 -1
  41. package/presets/claude/ios-swift/commands/task.md +1 -3
  42. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +1080 -4
  43. package/presets/claude/ios-swift/rules/stack/ios-app-core.md +1 -3
  44. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-intake.md +1 -1
  45. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +23 -7
  46. package/presets/claude/ios-swift/rules/tooling-and-review/ai-local-overlay.md +1 -1
  47. package/presets/claude/ios-swift/rules/tooling-and-review/anti-hallucination-contract.md +2 -0
  48. package/presets/claude/ios-swift/rules/tooling-and-review/language-policy.md +25 -17
  49. package/presets/claude/java/REPO_AGENTS.md +1 -3
  50. package/presets/claude/java/commands/task-continue.md +1 -1
  51. package/presets/claude/java/commands/task.md +1 -3
  52. package/presets/claude/java/hooks/chain-team-phases.sh +1080 -4
  53. package/presets/claude/java/rules/stack/java-app-core.md +1 -3
  54. package/presets/claude/java/rules/tooling-and-review/agent-team-intake.md +1 -1
  55. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +23 -7
  56. package/presets/claude/java/rules/tooling-and-review/ai-local-overlay.md +1 -1
  57. package/presets/claude/java/rules/tooling-and-review/anti-hallucination-contract.md +2 -0
  58. package/presets/claude/java/rules/tooling-and-review/language-policy.md +25 -17
  59. package/presets/claude/mcp-ts/REPO_AGENTS.md +1 -3
  60. package/presets/claude/mcp-ts/commands/task-continue.md +1 -1
  61. package/presets/claude/mcp-ts/commands/task.md +1 -3
  62. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +1080 -4
  63. package/presets/claude/mcp-ts/rules/stack/mcp-ts-app-core.md +1 -3
  64. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-intake.md +1 -1
  65. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +23 -7
  66. package/presets/claude/mcp-ts/rules/tooling-and-review/ai-local-overlay.md +1 -1
  67. package/presets/claude/mcp-ts/rules/tooling-and-review/anti-hallucination-contract.md +2 -0
  68. package/presets/claude/mcp-ts/rules/tooling-and-review/language-policy.md +25 -17
  69. package/presets/claude/next/REPO_AGENTS.md +2 -4
  70. package/presets/claude/next/agents/openspec-author.md +26 -2
  71. package/presets/claude/next/agents/task-analyst.md +15 -6
  72. package/presets/claude/next/agents/task-router.md +20 -2
  73. package/presets/{cursor/next/ai-local/rules-library → claude/next/ai-local/rules}/task-levels.md +2 -0
  74. package/presets/claude/next/commands/task-continue.md +1 -1
  75. package/presets/claude/next/commands/task.md +1 -3
  76. package/presets/claude/next/hooks/chain-team-phases.sh +1080 -4
  77. package/presets/claude/next/rules/stack/next-app-core.md +1 -3
  78. package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +1 -1
  79. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +23 -7
  80. package/presets/claude/next/rules/tooling-and-review/ai-local-overlay.md +2 -2
  81. package/presets/claude/next/rules/tooling-and-review/anti-hallucination-contract.md +2 -0
  82. package/presets/claude/next/rules/tooling-and-review/language-policy.md +25 -17
  83. package/presets/claude/nuxt/REPO_AGENTS.md +1 -3
  84. package/presets/claude/nuxt/agents/README.md +1 -1
  85. package/presets/claude/nuxt/commands/task-continue.md +1 -1
  86. package/presets/claude/nuxt/commands/task.md +1 -3
  87. package/presets/claude/nuxt/hooks/chain-team-phases.sh +1080 -4
  88. package/presets/claude/nuxt/rules/stack/nuxt-app-core.md +1 -3
  89. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-intake.md +1 -1
  90. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +23 -7
  91. package/presets/claude/nuxt/rules/tooling-and-review/ai-local-overlay.md +1 -1
  92. package/presets/claude/nuxt/rules/tooling-and-review/anti-hallucination-contract.md +2 -0
  93. package/presets/claude/nuxt/rules/tooling-and-review/language-policy.md +25 -17
  94. package/presets/claude/php-hexagonal/REPO_AGENTS.md +1 -3
  95. package/presets/claude/php-hexagonal/commands/task-continue.md +1 -1
  96. package/presets/claude/php-hexagonal/commands/task.md +1 -3
  97. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +1080 -4
  98. package/presets/claude/php-hexagonal/rules/stack/php-app-core.md +1 -3
  99. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-intake.md +1 -1
  100. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +23 -7
  101. package/presets/claude/php-hexagonal/rules/tooling-and-review/ai-local-overlay.md +1 -1
  102. package/presets/claude/php-hexagonal/rules/tooling-and-review/anti-hallucination-contract.md +2 -0
  103. package/presets/claude/php-hexagonal/rules/tooling-and-review/language-policy.md +25 -17
  104. package/presets/claude/php-laravel/REPO_AGENTS.md +1 -3
  105. package/presets/claude/php-laravel/commands/task-continue.md +1 -1
  106. package/presets/claude/php-laravel/commands/task.md +1 -3
  107. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +1080 -4
  108. package/presets/claude/php-laravel/rules/stack/laravel-app-core.md +1 -3
  109. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-intake.md +1 -1
  110. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +23 -7
  111. package/presets/claude/php-laravel/rules/tooling-and-review/ai-local-overlay.md +1 -1
  112. package/presets/claude/php-laravel/rules/tooling-and-review/anti-hallucination-contract.md +2 -0
  113. package/presets/claude/php-laravel/rules/tooling-and-review/language-policy.md +25 -17
  114. package/presets/claude/svelte/REPO_AGENTS.md +1 -3
  115. package/presets/claude/svelte/agents/README.md +1 -1
  116. package/presets/claude/svelte/commands/task-continue.md +1 -1
  117. package/presets/claude/svelte/commands/task.md +1 -3
  118. package/presets/claude/svelte/hooks/chain-team-phases.sh +1080 -4
  119. package/presets/claude/svelte/rules/stack/svelte-app-core.md +1 -3
  120. package/presets/claude/svelte/rules/tooling-and-review/agent-team-intake.md +1 -1
  121. package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +23 -7
  122. package/presets/claude/svelte/rules/tooling-and-review/ai-local-overlay.md +1 -1
  123. package/presets/claude/svelte/rules/tooling-and-review/anti-hallucination-contract.md +2 -0
  124. package/presets/claude/svelte/rules/tooling-and-review/language-policy.md +25 -17
  125. package/presets/cursor/android-kotlin/REPO_AGENTS.md +1 -3
  126. package/presets/cursor/android-kotlin/commands/task-continue.md +1 -1
  127. package/presets/cursor/android-kotlin/commands/task.md +1 -3
  128. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +1080 -4
  129. package/presets/cursor/android-kotlin/rules/agent-team-intake.mdc +1 -1
  130. package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +2 -9
  131. package/presets/cursor/android-kotlin/rules/ai-local-overlay.mdc +1 -1
  132. package/presets/cursor/android-kotlin/rules/android-app-core.mdc +1 -3
  133. package/presets/cursor/android-kotlin/rules/anti-hallucination-contract.mdc +2 -0
  134. package/presets/cursor/android-kotlin/rules/language-policy.mdc +25 -17
  135. package/presets/cursor/go/REPO_AGENTS.md +1 -3
  136. package/presets/cursor/go/commands/task-continue.md +1 -1
  137. package/presets/cursor/go/commands/task.md +1 -3
  138. package/presets/cursor/go/hooks/chain-team-phases.sh +1080 -4
  139. package/presets/cursor/go/rules/agent-team-intake.mdc +1 -1
  140. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +2 -9
  141. package/presets/cursor/go/rules/ai-local-overlay.mdc +1 -1
  142. package/presets/cursor/go/rules/anti-hallucination-contract.mdc +2 -0
  143. package/presets/cursor/go/rules/go-app-core.mdc +1 -3
  144. package/presets/cursor/go/rules/language-policy.mdc +25 -17
  145. package/presets/cursor/ios-swift/REPO_AGENTS.md +1 -3
  146. package/presets/cursor/ios-swift/commands/task-continue.md +1 -1
  147. package/presets/cursor/ios-swift/commands/task.md +1 -3
  148. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +1080 -4
  149. package/presets/cursor/ios-swift/rules/agent-team-intake.mdc +1 -1
  150. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +2 -9
  151. package/presets/cursor/ios-swift/rules/ai-local-overlay.mdc +1 -1
  152. package/presets/cursor/ios-swift/rules/anti-hallucination-contract.mdc +2 -0
  153. package/presets/cursor/ios-swift/rules/ios-app-core.mdc +1 -3
  154. package/presets/cursor/ios-swift/rules/language-policy.mdc +25 -17
  155. package/presets/cursor/java/REPO_AGENTS.md +1 -3
  156. package/presets/cursor/java/commands/task-continue.md +1 -1
  157. package/presets/cursor/java/commands/task.md +1 -3
  158. package/presets/cursor/java/hooks/chain-team-phases.sh +1080 -4
  159. package/presets/cursor/java/rules/agent-team-intake.mdc +1 -1
  160. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +2 -9
  161. package/presets/cursor/java/rules/ai-local-overlay.mdc +1 -1
  162. package/presets/cursor/java/rules/anti-hallucination-contract.mdc +2 -0
  163. package/presets/cursor/java/rules/java-app-core.mdc +1 -3
  164. package/presets/cursor/java/rules/language-policy.mdc +25 -17
  165. package/presets/cursor/mcp-ts/REPO_AGENTS.md +1 -3
  166. package/presets/cursor/mcp-ts/commands/task-continue.md +1 -1
  167. package/presets/cursor/mcp-ts/commands/task.md +1 -3
  168. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +1080 -4
  169. package/presets/cursor/mcp-ts/rules/agent-team-intake.mdc +1 -1
  170. package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +2 -9
  171. package/presets/cursor/mcp-ts/rules/ai-local-overlay.mdc +1 -1
  172. package/presets/cursor/mcp-ts/rules/anti-hallucination-contract.mdc +2 -0
  173. package/presets/cursor/mcp-ts/rules/language-policy.mdc +25 -17
  174. package/presets/cursor/mcp-ts/rules/mcp-ts-app-core.mdc +1 -3
  175. package/presets/cursor/next/REPO_AGENTS.md +2 -4
  176. package/presets/cursor/next/agents/README.md +1 -1
  177. package/presets/cursor/next/agents/build-verifier.md +2 -0
  178. package/presets/cursor/next/agents/feature-developer.md +9 -0
  179. package/presets/cursor/next/agents/openspec-author.md +26 -2
  180. package/presets/cursor/next/agents/task-analyst.md +20 -6
  181. package/presets/cursor/next/agents/task-router.md +31 -2
  182. package/presets/cursor/next/ai-local/conventions.md +20 -0
  183. package/presets/{mavis/next/ai-local/rules-library → cursor/next/ai-local/rules}/task-levels.md +12 -0
  184. package/presets/cursor/next/commands/task-continue.md +1 -1
  185. package/presets/cursor/next/commands/task.md +1 -3
  186. package/presets/cursor/next/hooks/chain-team-phases.sh +1080 -4
  187. package/presets/cursor/next/rules/agent-team-intake.mdc +1 -1
  188. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +20 -11
  189. package/presets/cursor/next/rules/ai-local-overlay.mdc +2 -2
  190. package/presets/cursor/next/rules/anti-hallucination-contract.mdc +2 -0
  191. package/presets/cursor/next/rules/language-policy.mdc +25 -17
  192. package/presets/cursor/next/rules/next-app-core.mdc +1 -3
  193. package/presets/cursor/nuxt/REPO_AGENTS.md +1 -3
  194. package/presets/cursor/nuxt/agents/README.md +1 -1
  195. package/presets/cursor/nuxt/commands/task-continue.md +1 -1
  196. package/presets/cursor/nuxt/commands/task.md +1 -3
  197. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +1080 -4
  198. package/presets/cursor/nuxt/rules/agent-team-intake.mdc +1 -1
  199. package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +2 -9
  200. package/presets/cursor/nuxt/rules/ai-local-overlay.mdc +1 -1
  201. package/presets/cursor/nuxt/rules/anti-hallucination-contract.mdc +2 -0
  202. package/presets/cursor/nuxt/rules/language-policy.mdc +25 -17
  203. package/presets/cursor/nuxt/rules/nuxt-app-core.mdc +1 -3
  204. package/presets/cursor/php-hexagonal/REPO_AGENTS.md +1 -3
  205. package/presets/cursor/php-hexagonal/commands/task-continue.md +1 -1
  206. package/presets/cursor/php-hexagonal/commands/task.md +1 -3
  207. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +1080 -4
  208. package/presets/cursor/php-hexagonal/rules/agent-team-intake.mdc +1 -1
  209. package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +2 -9
  210. package/presets/cursor/php-hexagonal/rules/ai-local-overlay.mdc +1 -1
  211. package/presets/cursor/php-hexagonal/rules/anti-hallucination-contract.mdc +2 -0
  212. package/presets/cursor/php-hexagonal/rules/language-policy.mdc +25 -17
  213. package/presets/cursor/php-hexagonal/rules/php-app-core.mdc +1 -3
  214. package/presets/cursor/php-laravel/REPO_AGENTS.md +1 -3
  215. package/presets/cursor/php-laravel/commands/task-continue.md +1 -1
  216. package/presets/cursor/php-laravel/commands/task.md +1 -3
  217. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +1080 -4
  218. package/presets/cursor/php-laravel/rules/agent-team-intake.mdc +1 -1
  219. package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +2 -9
  220. package/presets/cursor/php-laravel/rules/ai-local-overlay.mdc +1 -1
  221. package/presets/cursor/php-laravel/rules/anti-hallucination-contract.mdc +2 -0
  222. package/presets/cursor/php-laravel/rules/language-policy.mdc +25 -17
  223. package/presets/cursor/php-laravel/rules/laravel-app-core.mdc +1 -3
  224. package/presets/cursor/svelte/REPO_AGENTS.md +1 -3
  225. package/presets/cursor/svelte/agents/README.md +1 -1
  226. package/presets/cursor/svelte/commands/task-continue.md +1 -1
  227. package/presets/cursor/svelte/commands/task.md +1 -3
  228. package/presets/cursor/svelte/hooks/chain-team-phases.sh +1080 -4
  229. package/presets/cursor/svelte/rules/agent-team-intake.mdc +1 -1
  230. package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +2 -9
  231. package/presets/cursor/svelte/rules/ai-local-overlay.mdc +1 -1
  232. package/presets/cursor/svelte/rules/anti-hallucination-contract.mdc +2 -0
  233. package/presets/cursor/svelte/rules/language-policy.mdc +25 -17
  234. package/presets/cursor/svelte/rules/svelte-app-core.mdc +1 -3
  235. package/presets/mavis/android-kotlin/REPO_AGENTS.md +1 -3
  236. package/presets/mavis/android-kotlin/adapter-map.json +1 -1
  237. package/presets/mavis/android-kotlin/commands/task-continue.md +1 -1
  238. package/presets/mavis/android-kotlin/commands/task.md +1 -3
  239. package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +1080 -4
  240. package/presets/mavis/android-kotlin/rules/agent-team-intake.md +1 -1
  241. package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +23 -7
  242. package/presets/mavis/android-kotlin/rules/ai-local-overlay.md +1 -1
  243. package/presets/mavis/android-kotlin/rules/android-app-core.md +1 -3
  244. package/presets/mavis/android-kotlin/rules/anti-hallucination-contract.md +2 -0
  245. package/presets/mavis/android-kotlin/rules/language-policy.md +24 -16
  246. package/presets/mavis/go/REPO_AGENTS.md +1 -3
  247. package/presets/mavis/go/adapter-map.json +1 -1
  248. package/presets/mavis/go/commands/task-continue.md +1 -1
  249. package/presets/mavis/go/commands/task.md +1 -3
  250. package/presets/mavis/go/hooks/chain-team-phases.sh +1080 -4
  251. package/presets/mavis/go/rules/agent-team-intake.md +1 -1
  252. package/presets/mavis/go/rules/agent-team-orchestrator.md +23 -7
  253. package/presets/mavis/go/rules/ai-local-overlay.md +1 -1
  254. package/presets/mavis/go/rules/anti-hallucination-contract.md +2 -0
  255. package/presets/mavis/go/rules/go-app-core.md +1 -3
  256. package/presets/mavis/go/rules/language-policy.md +24 -16
  257. package/presets/mavis/ios-swift/REPO_AGENTS.md +1 -3
  258. package/presets/mavis/ios-swift/adapter-map.json +1 -1
  259. package/presets/mavis/ios-swift/commands/task-continue.md +1 -1
  260. package/presets/mavis/ios-swift/commands/task.md +1 -3
  261. package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +1080 -4
  262. package/presets/mavis/ios-swift/rules/agent-team-intake.md +1 -1
  263. package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +23 -7
  264. package/presets/mavis/ios-swift/rules/ai-local-overlay.md +1 -1
  265. package/presets/mavis/ios-swift/rules/anti-hallucination-contract.md +2 -0
  266. package/presets/mavis/ios-swift/rules/ios-app-core.md +1 -3
  267. package/presets/mavis/ios-swift/rules/language-policy.md +24 -16
  268. package/presets/mavis/java/REPO_AGENTS.md +1 -3
  269. package/presets/mavis/java/adapter-map.json +1 -1
  270. package/presets/mavis/java/commands/task-continue.md +1 -1
  271. package/presets/mavis/java/commands/task.md +1 -3
  272. package/presets/mavis/java/hooks/chain-team-phases.sh +1080 -4
  273. package/presets/mavis/java/rules/agent-team-intake.md +1 -1
  274. package/presets/mavis/java/rules/agent-team-orchestrator.md +23 -7
  275. package/presets/mavis/java/rules/ai-local-overlay.md +1 -1
  276. package/presets/mavis/java/rules/anti-hallucination-contract.md +2 -0
  277. package/presets/mavis/java/rules/java-app-core.md +1 -3
  278. package/presets/mavis/java/rules/language-policy.md +24 -16
  279. package/presets/mavis/mcp-ts/REPO_AGENTS.md +1 -3
  280. package/presets/mavis/mcp-ts/adapter-map.json +1 -1
  281. package/presets/mavis/mcp-ts/commands/task-continue.md +1 -1
  282. package/presets/mavis/mcp-ts/commands/task.md +1 -3
  283. package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +1080 -4
  284. package/presets/mavis/mcp-ts/rules/agent-team-intake.md +1 -1
  285. package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +23 -7
  286. package/presets/mavis/mcp-ts/rules/ai-local-overlay.md +1 -1
  287. package/presets/mavis/mcp-ts/rules/anti-hallucination-contract.md +2 -0
  288. package/presets/mavis/mcp-ts/rules/language-policy.md +24 -16
  289. package/presets/mavis/mcp-ts/rules/mcp-ts-app-core.md +1 -3
  290. package/presets/mavis/next/REPO_AGENTS.md +2 -4
  291. package/presets/mavis/next/adapter-map.json +5 -5
  292. package/presets/mavis/next/agents/build-verifier.md +2 -0
  293. package/presets/mavis/next/agents/feature-developer.md +9 -0
  294. package/presets/mavis/next/agents/openspec-author.md +26 -2
  295. package/presets/mavis/next/agents/task-analyst.md +20 -6
  296. package/presets/mavis/next/agents/task-router.md +31 -2
  297. package/presets/mavis/next/ai-local/conventions.md +20 -0
  298. package/presets/{opencode/next/ai-local/rules-library → mavis/next/ai-local/rules}/task-levels.md +12 -0
  299. package/presets/mavis/next/commands/task-continue.md +1 -1
  300. package/presets/mavis/next/commands/task.md +1 -3
  301. package/presets/mavis/next/hooks/chain-team-phases.sh +1080 -4
  302. package/presets/mavis/next/rules/agent-team-intake.md +1 -1
  303. package/presets/mavis/next/rules/agent-team-orchestrator.md +23 -7
  304. package/presets/mavis/next/rules/ai-local-overlay.md +2 -2
  305. package/presets/mavis/next/rules/anti-hallucination-contract.md +2 -0
  306. package/presets/mavis/next/rules/language-policy.md +24 -16
  307. package/presets/mavis/next/rules/next-app-core.md +1 -3
  308. package/presets/mavis/nuxt/REPO_AGENTS.md +1 -3
  309. package/presets/mavis/nuxt/adapter-map.json +1 -1
  310. package/presets/mavis/nuxt/commands/task-continue.md +1 -1
  311. package/presets/mavis/nuxt/commands/task.md +1 -3
  312. package/presets/mavis/nuxt/hooks/chain-team-phases.sh +1080 -4
  313. package/presets/mavis/nuxt/rules/agent-team-intake.md +1 -1
  314. package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +23 -7
  315. package/presets/mavis/nuxt/rules/ai-local-overlay.md +1 -1
  316. package/presets/mavis/nuxt/rules/anti-hallucination-contract.md +2 -0
  317. package/presets/mavis/nuxt/rules/language-policy.md +24 -16
  318. package/presets/mavis/nuxt/rules/nuxt-app-core.md +1 -3
  319. package/presets/mavis/php-hexagonal/REPO_AGENTS.md +1 -3
  320. package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
  321. package/presets/mavis/php-hexagonal/commands/task-continue.md +1 -1
  322. package/presets/mavis/php-hexagonal/commands/task.md +1 -3
  323. package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +1080 -4
  324. package/presets/mavis/php-hexagonal/rules/agent-team-intake.md +1 -1
  325. package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +23 -7
  326. package/presets/mavis/php-hexagonal/rules/ai-local-overlay.md +1 -1
  327. package/presets/mavis/php-hexagonal/rules/anti-hallucination-contract.md +2 -0
  328. package/presets/mavis/php-hexagonal/rules/language-policy.md +24 -16
  329. package/presets/mavis/php-hexagonal/rules/php-app-core.md +1 -3
  330. package/presets/mavis/php-laravel/REPO_AGENTS.md +1 -3
  331. package/presets/mavis/php-laravel/adapter-map.json +1 -1
  332. package/presets/mavis/php-laravel/commands/task-continue.md +1 -1
  333. package/presets/mavis/php-laravel/commands/task.md +1 -3
  334. package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +1080 -4
  335. package/presets/mavis/php-laravel/rules/agent-team-intake.md +1 -1
  336. package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +23 -7
  337. package/presets/mavis/php-laravel/rules/ai-local-overlay.md +1 -1
  338. package/presets/mavis/php-laravel/rules/anti-hallucination-contract.md +2 -0
  339. package/presets/mavis/php-laravel/rules/language-policy.md +24 -16
  340. package/presets/mavis/php-laravel/rules/laravel-app-core.md +1 -3
  341. package/presets/mavis/svelte/REPO_AGENTS.md +1 -3
  342. package/presets/mavis/svelte/adapter-map.json +1 -1
  343. package/presets/mavis/svelte/commands/task-continue.md +1 -1
  344. package/presets/mavis/svelte/commands/task.md +1 -3
  345. package/presets/mavis/svelte/hooks/chain-team-phases.sh +1080 -4
  346. package/presets/mavis/svelte/rules/agent-team-intake.md +1 -1
  347. package/presets/mavis/svelte/rules/agent-team-orchestrator.md +23 -7
  348. package/presets/mavis/svelte/rules/ai-local-overlay.md +1 -1
  349. package/presets/mavis/svelte/rules/anti-hallucination-contract.md +2 -0
  350. package/presets/mavis/svelte/rules/language-policy.md +24 -16
  351. package/presets/mavis/svelte/rules/svelte-app-core.md +1 -3
  352. package/presets/opencode/android-kotlin/REPO_AGENTS.md +1 -3
  353. package/presets/opencode/android-kotlin/adapter-map.json +1 -1
  354. package/presets/opencode/android-kotlin/commands/task-continue.md +1 -1
  355. package/presets/opencode/android-kotlin/commands/task.md +1 -3
  356. package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +1080 -4
  357. package/presets/opencode/android-kotlin/rules/agent-team-intake.md +1 -1
  358. package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +23 -7
  359. package/presets/opencode/android-kotlin/rules/ai-local-overlay.md +1 -1
  360. package/presets/opencode/android-kotlin/rules/android-app-core.md +1 -3
  361. package/presets/opencode/android-kotlin/rules/anti-hallucination-contract.md +2 -0
  362. package/presets/opencode/android-kotlin/rules/language-policy.md +24 -16
  363. package/presets/opencode/go/REPO_AGENTS.md +1 -3
  364. package/presets/opencode/go/adapter-map.json +1 -1
  365. package/presets/opencode/go/commands/task-continue.md +1 -1
  366. package/presets/opencode/go/commands/task.md +1 -3
  367. package/presets/opencode/go/hooks/chain-team-phases.sh +1080 -4
  368. package/presets/opencode/go/rules/agent-team-intake.md +1 -1
  369. package/presets/opencode/go/rules/agent-team-orchestrator.md +23 -7
  370. package/presets/opencode/go/rules/ai-local-overlay.md +1 -1
  371. package/presets/opencode/go/rules/anti-hallucination-contract.md +2 -0
  372. package/presets/opencode/go/rules/go-app-core.md +1 -3
  373. package/presets/opencode/go/rules/language-policy.md +24 -16
  374. package/presets/opencode/ios-swift/REPO_AGENTS.md +1 -3
  375. package/presets/opencode/ios-swift/adapter-map.json +1 -1
  376. package/presets/opencode/ios-swift/commands/task-continue.md +1 -1
  377. package/presets/opencode/ios-swift/commands/task.md +1 -3
  378. package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +1080 -4
  379. package/presets/opencode/ios-swift/rules/agent-team-intake.md +1 -1
  380. package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +23 -7
  381. package/presets/opencode/ios-swift/rules/ai-local-overlay.md +1 -1
  382. package/presets/opencode/ios-swift/rules/anti-hallucination-contract.md +2 -0
  383. package/presets/opencode/ios-swift/rules/ios-app-core.md +1 -3
  384. package/presets/opencode/ios-swift/rules/language-policy.md +24 -16
  385. package/presets/opencode/java/REPO_AGENTS.md +1 -3
  386. package/presets/opencode/java/adapter-map.json +1 -1
  387. package/presets/opencode/java/commands/task-continue.md +1 -1
  388. package/presets/opencode/java/commands/task.md +1 -3
  389. package/presets/opencode/java/hooks/chain-team-phases.sh +1080 -4
  390. package/presets/opencode/java/rules/agent-team-intake.md +1 -1
  391. package/presets/opencode/java/rules/agent-team-orchestrator.md +23 -7
  392. package/presets/opencode/java/rules/ai-local-overlay.md +1 -1
  393. package/presets/opencode/java/rules/anti-hallucination-contract.md +2 -0
  394. package/presets/opencode/java/rules/java-app-core.md +1 -3
  395. package/presets/opencode/java/rules/language-policy.md +24 -16
  396. package/presets/opencode/mcp-ts/REPO_AGENTS.md +1 -3
  397. package/presets/opencode/mcp-ts/adapter-map.json +1 -1
  398. package/presets/opencode/mcp-ts/commands/task-continue.md +1 -1
  399. package/presets/opencode/mcp-ts/commands/task.md +1 -3
  400. package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +1080 -4
  401. package/presets/opencode/mcp-ts/rules/agent-team-intake.md +1 -1
  402. package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +23 -7
  403. package/presets/opencode/mcp-ts/rules/ai-local-overlay.md +1 -1
  404. package/presets/opencode/mcp-ts/rules/anti-hallucination-contract.md +2 -0
  405. package/presets/opencode/mcp-ts/rules/language-policy.md +24 -16
  406. package/presets/opencode/mcp-ts/rules/mcp-ts-app-core.md +1 -3
  407. package/presets/opencode/next/REPO_AGENTS.md +2 -4
  408. package/presets/opencode/next/adapter-map.json +5 -5
  409. package/presets/opencode/next/agents/build-verifier.md +2 -0
  410. package/presets/opencode/next/agents/feature-developer.md +9 -0
  411. package/presets/opencode/next/agents/openspec-author.md +26 -2
  412. package/presets/opencode/next/agents/task-analyst.md +20 -6
  413. package/presets/opencode/next/agents/task-router.md +31 -2
  414. package/presets/opencode/next/ai-local/conventions.md +20 -0
  415. package/presets/opencode/next/ai-local/rules/task-levels.md +40 -0
  416. package/presets/opencode/next/commands/task-continue.md +1 -1
  417. package/presets/opencode/next/commands/task.md +1 -3
  418. package/presets/opencode/next/hooks/chain-team-phases.sh +1080 -4
  419. package/presets/opencode/next/rules/agent-team-intake.md +1 -1
  420. package/presets/opencode/next/rules/agent-team-orchestrator.md +23 -7
  421. package/presets/opencode/next/rules/ai-local-overlay.md +2 -2
  422. package/presets/opencode/next/rules/anti-hallucination-contract.md +2 -0
  423. package/presets/opencode/next/rules/language-policy.md +24 -16
  424. package/presets/opencode/next/rules/next-app-core.md +1 -3
  425. package/presets/opencode/nuxt/REPO_AGENTS.md +1 -3
  426. package/presets/opencode/nuxt/adapter-map.json +1 -1
  427. package/presets/opencode/nuxt/commands/task-continue.md +1 -1
  428. package/presets/opencode/nuxt/commands/task.md +1 -3
  429. package/presets/opencode/nuxt/hooks/chain-team-phases.sh +1080 -4
  430. package/presets/opencode/nuxt/rules/agent-team-intake.md +1 -1
  431. package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +23 -7
  432. package/presets/opencode/nuxt/rules/ai-local-overlay.md +1 -1
  433. package/presets/opencode/nuxt/rules/anti-hallucination-contract.md +2 -0
  434. package/presets/opencode/nuxt/rules/language-policy.md +24 -16
  435. package/presets/opencode/nuxt/rules/nuxt-app-core.md +1 -3
  436. package/presets/opencode/php-hexagonal/REPO_AGENTS.md +1 -3
  437. package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
  438. package/presets/opencode/php-hexagonal/commands/task-continue.md +1 -1
  439. package/presets/opencode/php-hexagonal/commands/task.md +1 -3
  440. package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +1080 -4
  441. package/presets/opencode/php-hexagonal/rules/agent-team-intake.md +1 -1
  442. package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +23 -7
  443. package/presets/opencode/php-hexagonal/rules/ai-local-overlay.md +1 -1
  444. package/presets/opencode/php-hexagonal/rules/anti-hallucination-contract.md +2 -0
  445. package/presets/opencode/php-hexagonal/rules/language-policy.md +24 -16
  446. package/presets/opencode/php-hexagonal/rules/php-app-core.md +1 -3
  447. package/presets/opencode/php-laravel/REPO_AGENTS.md +1 -3
  448. package/presets/opencode/php-laravel/adapter-map.json +1 -1
  449. package/presets/opencode/php-laravel/commands/task-continue.md +1 -1
  450. package/presets/opencode/php-laravel/commands/task.md +1 -3
  451. package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +1080 -4
  452. package/presets/opencode/php-laravel/rules/agent-team-intake.md +1 -1
  453. package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +23 -7
  454. package/presets/opencode/php-laravel/rules/ai-local-overlay.md +1 -1
  455. package/presets/opencode/php-laravel/rules/anti-hallucination-contract.md +2 -0
  456. package/presets/opencode/php-laravel/rules/language-policy.md +24 -16
  457. package/presets/opencode/php-laravel/rules/laravel-app-core.md +1 -3
  458. package/presets/opencode/svelte/REPO_AGENTS.md +1 -3
  459. package/presets/opencode/svelte/adapter-map.json +1 -1
  460. package/presets/opencode/svelte/commands/task-continue.md +1 -1
  461. package/presets/opencode/svelte/commands/task.md +1 -3
  462. package/presets/opencode/svelte/hooks/chain-team-phases.sh +1080 -4
  463. package/presets/opencode/svelte/rules/agent-team-intake.md +1 -1
  464. package/presets/opencode/svelte/rules/agent-team-orchestrator.md +23 -7
  465. package/presets/opencode/svelte/rules/ai-local-overlay.md +1 -1
  466. package/presets/opencode/svelte/rules/anti-hallucination-contract.md +2 -0
  467. package/presets/opencode/svelte/rules/language-policy.md +24 -16
  468. package/presets/opencode/svelte/rules/svelte-app-core.md +1 -3
package/CHANGELOG.md CHANGED
@@ -2,7 +2,54 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
- No unpublished changes.
5
+ ### Dialogue language resolves on every user message
6
+
7
+ - **Always-on.** `ai-local-overlay`, each stack app-core, and root `AGENTS.md` resolve the user-facing language on every user message, including a question and a message without a slash command. `/task` and the other commands reuse that tag and, when a task exists, record `language:` in `prompt.md`.
8
+ - **Requestable detail.** `language-policy` stays requestable. `next` keeps its four always-on rules. The structural gate requires the `every user message` anchor on the always-on surfaces.
9
+
10
+ ## 0.2.43
11
+
12
+ ### A decomposition ready set sits beside the step queue
13
+
14
+ - **Ready set.** Tasks whose `dependsOn` are satisfied and whose row or manifest artifact is not complete form the ready set. A blocked row records `waiting_on`. Completing the only root of a three-node DAG reveals the children. `pipeline.json` `steps[].dependsOn` still decides which agent runs. Reviewer and QA steps stay on the pipeline. The handoff carries one ready-set line.
15
+ - **`focus.md`.** Every `writeStatus` rewrites `.ai.local/team/tasks/<slug>/focus.md` after `status.json` lands. The file is a view: slug, pipeline step index, one ready-set line, one archive index line, authoritative paths for incomplete manifest ids, the last `.memlog.md` `event:` line, and the next gate, kept under 100 lines. `status.json`, `metrics.json`, `artifact-manifest.json`, and `.memlog.md` stay the system of record. `/task-continue` reads `focus.md` first.
16
+ - **File lists.** Each decomposition task lists the repo paths it may create or modify. The list is a subset of the implementing step's `writeScopes[]` when that step declares them. Tasks with no `dependsOn` path between them keep those lists disjoint; a shared path stays sequential. `docs/specs/**` or `openspec/**` and `app/**` stay in different lists. When a Files column exists, a completed receipt that cites a production path outside that list stalls. Overlapping `writeScopes` under `presets/**` stay serial.
17
+
18
+ ### Closed manifest markdown leaves the default resume read
19
+
20
+ - **Archive.** Closing a completed manifest entry moves bulky markdown named in `authoritativePaths` to `.ai.local/team/tasks/<slug>/archive/YYYY-MM-DD/` and appends one `.memlog.md` `event:` line. The entry keeps its id, status, and `authoritativePaths` (rewritten to the archive path). The slug and earlier memlog lines stay. Closing the same entry again does not append another line.
21
+ - **Living files stay.** `brief.md`, `decomposition.md`, `goal.md`, `prompt.md`, `prompt-log.md`, `pipeline.json`, `implementation.md`, `.memlog.md`, `focus.md`, and the hook ledger stay in the task folder. The default resume read includes the manifest id and the new memlog line and omits the archived body.
22
+
23
+ ### Specs name one store, and propose waits while a decision is open
24
+
25
+ - **Three cases.** Capability behavior already described as a delta spec → OpenSpec delta only. A page or feature document → `docs/specs` only, via `spec-authoring`. Both, when behavior and the published page change, with one human gate naming both paths. `openspec-author` still refuses `app/**` and `docs/specs/**`. An engineering task-list edit is not the living spec. Both `docs/specs/INDEX.md` copies carry the same pointer.
26
+ - **Propose.** `openDecisionCount` 0 and no open marker: propose proceeds without an explore step. `openDecisionCount` greater than 0, an open `[NEEDS CLARIFICATION]` line in `brief.md`, or an open `OQ-N` question: propose waits for an explore pass or a task-analyst spike. A pipeline that is not an OpenSpec change does not gain an explore step. Phase 3 still runs `openspec validate <change-id> --type change --strict` and `openspec validate --specs --strict`.
27
+ - **Marker.** Each unresolved product decision is one literal `[NEEDS CLARIFICATION]` line in `brief.md`. A brief that still has one is blocked Definition of Ready. A new spec carries at most three. `// VERIFY` stays a code comment.
28
+
29
+ ### A standards draft from a completed stop stays inactive
30
+
31
+ - **Where it lands.** When a completed stop carries `standardsDraft`, the postflight appends a provenance-tagged line (`incident: <id>` or `read: <path>`) under `## Pending` in `.ai.local/conventions.md`, or writes a file under `.ai.local/rules-library/`. It does not create a file under `.ai.local/rules/`. `light` and `spike` skip the postflight. A draft failure does not fail the stop.
32
+ - **Second run.** The same provenance does not write again. A new provenance tag appends another pending line and leaves an accepted Gotchas, Patterns, or Decisions line unchanged. Pending drafts and `rules-library/` files stay inactive until a human moves a file into `.ai.local/rules/`.
33
+
34
+ ### The strict implementation rail stays off unless the task asks
35
+
36
+ - **On switch.** task-router sets top-level `pipeline.json` `"implementationRail": "on"` only for a production app implementation task (`feature`, `bugfix`, `refactor`, `migration`, or `a11y` whose scope includes application code) when the user or the task record asks. Omit the field for off. L0, docs-only, research, spike, and preset-only tasks do not take the rail. L0–L3 selection and `light` | `standard` | `full` keep their meanings.
37
+ - **Hook.** With the rail off, the feature-developer handoff keeps the test-before-handoff rule. With the rail on and an open `[NEEDS CLARIFICATION]` line, the hook does not start `feature-developer` and waits at `/task-continue`. With the rail on and markers clear, the handoff requires a failing test before production edits, a branch or worktree before the first implementation task, and `code-reviewer` between decomposition tasks. Debug retries for that handoff stop at two. `build-verifier` and `code-reviewer` stay.
38
+
39
+ ### `next` installs `task-levels` as an active rule
40
+
41
+ - **Install.** `init` copies `ai-local/rules/*.md` into `.ai.local/rules/` and does not overwrite an existing file. The `next` stack ships `task-levels` there, so L0–L3 selection applies on a fresh install. `task-levels` left the inactive seed library. The other seeds stay inactive. `router-pages` still activates only for a static Pages app.
42
+ - **Short list.** When `task-levels` selects L0 or a skip-analyst L1, task-router may emit a short `steps[]` list. L0 and skip-analyst L1 do not require `brief.md`. L2 and L3 still attach an OpenSpec change. The short list keeps `build-verifier` and `code-reviewer` on implementation pipelines.
43
+
44
+ ### `next` runs the preset gate before a generated-tree handoff
45
+
46
+ - **Generated trees.** When the change edits Cursor next agents or `presets/_shared/hooks/**`, `feature-developer` and `build-verifier` run `node scripts/fix-generated.mjs` and then `yarn check:preset-structure` from `packages/ai-rules`, and require exit 0 before handoff or validation PASS.
47
+ - **Claude copies.** A change-set that edits Cursor next `openspec-author`, `task-router`, or `task-analyst` also includes the matching `presets/claude/next/agents/` paths.
48
+
49
+ ### Upgrade
50
+
51
+ - `npx @bonesofspring/ai-rules update` replaces `hooks/chain-team-phases.sh` and the agent prompts, so the ready-set line, `focus.md`, closed-body compaction, the rail block, and the standards-draft postflight land on re-init.
52
+ - `init` / `update` does not overwrite an existing `.ai.local/rules/task-levels.md` or `.ai.local/conventions.md`. Copy the package `## Pending` and `## Advisory index` sections into an existing `conventions.md` to pick up inactive drafts. A `next` install that has no `task-levels.md` receives the active copy.
6
53
 
7
54
  ## 0.2.42
8
55
 
@@ -340,11 +340,11 @@ function seedConventions(presetTeamSrc, cwd) {
340
340
  */
341
341
  function seedAiLocalRules(presetTeamSrc, cwd) {
342
342
  if (!presetTeamSrc) {
343
- return false;
343
+ return { seeded: false, created: [] };
344
344
  }
345
345
  const libraryDir = path.join(path.dirname(presetTeamSrc), 'ai-local', 'rules-library');
346
346
  if (!fs.existsSync(libraryDir) || !fs.statSync(libraryDir).isDirectory()) {
347
- return false;
347
+ return seedActiveOverlayRules(presetTeamSrc, cwd);
348
348
  }
349
349
  const destDir = path.join(cwd, '.ai.local', 'rules-library');
350
350
  assertSafeDest(cwd, destDir, '.ai.local/rules-library');
@@ -365,7 +365,38 @@ function seedAiLocalRules(presetTeamSrc, cwd) {
365
365
  console.log(`Seeded .ai.local/rules-library/ (${copied} rules; ${skipped} already present)`);
366
366
  }
367
367
  activateRouterPagesSeed(cwd, libraryDir);
368
- return copied > 0;
368
+ const active = seedActiveOverlayRules(presetTeamSrc, cwd);
369
+ return { seeded: copied > 0 || active.seeded, created: active.created };
370
+ }
371
+
372
+ /**
373
+ * Copy `presets/<opt>/<stack>/ai-local/rules/*.md` into `.ai.local/rules/`.
374
+ * These ship active. An existing consumer file is left untouched.
375
+ */
376
+ function seedActiveOverlayRules(presetTeamSrc, cwd) {
377
+ if (!presetTeamSrc) {
378
+ return { seeded: false, created: [] };
379
+ }
380
+ const rulesDir = path.join(path.dirname(presetTeamSrc), 'ai-local', 'rules');
381
+ if (!fs.existsSync(rulesDir) || !fs.statSync(rulesDir).isDirectory()) {
382
+ return { seeded: false, created: [] };
383
+ }
384
+ const destDir = path.join(cwd, '.ai.local', 'rules');
385
+ assertSafeDest(cwd, destDir, '.ai.local/rules');
386
+ const created = [];
387
+ for (const entry of fs.readdirSync(rulesDir)) {
388
+ if (!entry.endsWith('.md')) continue;
389
+ const src = path.join(rulesDir, entry);
390
+ if (!fs.statSync(src).isFile()) continue;
391
+ const dest = path.join(destDir, entry);
392
+ if (fs.existsSync(dest)) continue;
393
+ copyFile(src, dest);
394
+ created.push(dest);
395
+ }
396
+ if (created.length > 0) {
397
+ console.log(`Activated .ai.local/rules/ (${created.length} rule${created.length === 1 ? '' : 's'})`);
398
+ }
399
+ return { seeded: created.length > 0, created };
369
400
  }
370
401
 
371
402
  function hasStaticExport(cwd) {
@@ -560,6 +591,7 @@ function seedAiLocalTeam({ cwd, presetTeamSrc }) {
560
591
  assertSafeDest(cwd, path.join(aiLocalRoot, '.gitignore'), '.ai.local/.gitignore');
561
592
  assertSafeDest(cwd, path.join(aiLocalRoot, 'scripts'), '.ai.local/scripts');
562
593
  assertSafeDest(cwd, path.join(aiLocalRoot, 'rules-library'), '.ai.local/rules-library');
594
+ assertSafeDest(cwd, path.join(aiLocalRoot, 'rules'), '.ai.local/rules');
563
595
  } catch (error) {
564
596
  warn(`${error instanceof Error ? error.message : String(error)}; skipped .ai.local seeding`);
565
597
  return empty;
@@ -580,6 +612,7 @@ function seedAiLocalTeam({ cwd, presetTeamSrc }) {
580
612
  dest,
581
613
  path.join(aiLocalRoot, 'conventions.md'),
582
614
  path.join(aiLocalRoot, 'rules-library'),
615
+ path.join(aiLocalRoot, 'rules'),
583
616
  ].filter((target) => !fs.existsSync(target));
584
617
  fs.mkdirSync(dest, { recursive: true });
585
618
  const ignoreCreated = ensureAiLocalIgnored(aiLocalRoot);
@@ -592,7 +625,11 @@ function seedAiLocalTeam({ cwd, presetTeamSrc }) {
592
625
  const migrated = migrateLegacyTeams(cwd, dest);
593
626
  copyTemplates(presetTeamSrc, dest);
594
627
  const conventionsSeeded = seedConventions(presetTeamSrc, cwd);
595
- const rulesLibrarySeeded = seedAiLocalRules(presetTeamSrc, cwd);
628
+ const rulesSeed = seedAiLocalRules(presetTeamSrc, cwd);
629
+ const rulesLibrarySeeded = rulesSeed.seeded;
630
+ if (!freshPaths.includes(path.join(aiLocalRoot, 'rules'))) {
631
+ for (const created of rulesSeed.created) createdPaths.push(created);
632
+ }
596
633
 
597
634
  if (migrated) {
598
635
  console.log('Migrated legacy .{tool}/team → .ai.local/team');
@@ -31,11 +31,13 @@ No IDE config, no `@include`, no codegen. Same files work in Cursor, Claude Code
31
31
 
32
32
  ## Seed library (`.ai.local/rules-library/`)
33
33
 
34
+ `init` copies `presets/<tool>/<stack>/ai-local/rules/*.md` into `.ai.local/rules/` and does not overwrite an existing file. The next stack ships `task-levels` there, so L0–L3 selection applies on install.
35
+
34
36
  `init` also seeds **staged-inactive** rule templates into `.ai.local/rules-library/`. They ship with every install but **do not apply** until you move a matching file into `.ai.local/rules/`.
35
37
 
36
38
  Why staged: they encode common repo shapes (Pages Router, no-`FC`, a component-catalog quality gate, commit hygiene) that only matter once you confirm your repo actually needs them. Keeping them inactive avoids spending context on rules that do not apply.
37
39
 
38
- The `ai-local-overlay` rule instructs the model to treat a matching seed as the applicable local rule and to recommend activation. The next-stack seed set (27 files) includes: `router-pages` (`override: kill next-app-router` for Pages Router repos), `no-react-fc`, `component-child-decomposition`, `single-source-copy-constants`, `commit-hygiene`, `pre-pr-checklist`, `api-contract-source`, `agent-pipeline-gates`, `artifact-lifecycle`, `agent-artifacts-no-local-paths`, `no-test-driven-behavior-change`, `mcp-required-for-ui-layout`, `ui-change-review-gate`, `task-levels`, `analytics-events`, `feature-flags-experiments`, `pwa-service-worker`, `qa-test-cases`, `forms-validation`, and the `storybook-*` set.
40
+ The `ai-local-overlay` rule instructs the model to treat a matching seed as the applicable local rule and to recommend activation. The next-stack seed set (26 files) includes: `router-pages` (`override: kill next-app-router` for Pages Router repos), `no-react-fc`, `component-child-decomposition`, `single-source-copy-constants`, `commit-hygiene`, `pre-pr-checklist`, `api-contract-source`, `agent-pipeline-gates`, `artifact-lifecycle`, `agent-artifacts-no-local-paths`, `no-test-driven-behavior-change`, `mcp-required-for-ui-layout`, `ui-change-review-gate`, `analytics-events`, `feature-flags-experiments`, `pwa-service-worker`, `qa-test-cases`, `forms-validation`, and the `storybook-*` set. `task-levels` is not in that set; `init` installs it under `.ai.local/rules/`.
39
41
 
40
42
  ```bash
41
43
  # activate a seed
@@ -170,9 +172,9 @@ A single markdown file (no header conventions). The `## Language` setting is opt
170
172
  `conventions.md` also carries the optional **dialogue-language setting** for agents:
171
173
 
172
174
  - **`## Language` section** — a bullet whose value is a **BCP-47** tag (default `en`). Every user-facing interaction the agent sends (clarifying questions, plan/human-gate prompts, `/task-continue`, status answers, summaries, escalations) uses that language. Development, reasoning, and all artifacts (including `prompt.md` and `review.md`) stay **English**.
173
- - **Resolution order** — the `.ai.local` setting wins; else the agent infers the language from the prompt; else English. A mixed-language prompt uses the **dominant** language. In a monorepo the **nearest** `.ai.local` wins.
174
- - **Conflict** — a `.ai.local` setting wins over a mid-task prompt in another language; the mismatch is surfaced once, never as a blocking question. Agents never ask you to confirm a language.
175
- - **Persistence** — the resolved tag is recorded per task as an additive `language: <BCP-47>` line in `.ai.local/team/tasks/<slug>/prompt.md` (plus a `.memlog.md` `event:`) and reused for the whole task. Reference rule: `agent-team/language-policy`.
175
+ - **Resolution order** — on every user message, before the reply, including a question and a message without a slash command. An active task's stored tag wins; else the `.ai.local` setting; else the agent infers the language from the prompt; else English. A mixed-language prompt uses the **dominant** language. In a monorepo the **nearest** `.ai.local` wins. Commands reuse that resolution.
176
+ - **Conflict** — a `.ai.local` setting wins over a later prompt in another language; the mismatch is surfaced once, never as a blocking question. Agents never ask you to confirm a language.
177
+ - **Persistence** — when a task exists, the resolved tag is recorded as an additive `language: <BCP-47>` line in `.ai.local/team/tasks/<slug>/prompt.md` (plus a `.memlog.md` `event:`) and reused for the whole task. A message with no task still resolves. Reference rule: `agent-team/language-policy`.
176
178
 
177
179
  **Behavior-change note (existing consumers):** an English-only prompt with no `## Language` setting still resolves to **English**, so default behavior is unchanged. The setting pins a language explicitly; adding it is opt-in and needs no other config. The change is about the agent's **runtime output** language only — preset prose and all artifacts remain English (`docs/PRESET-ENGLISH-STYLE.md`).
178
180
 
@@ -99,7 +99,7 @@ Sync marker (after frontmatter in platform files):
99
99
 
100
100
  **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). The obligation is anchored on the **always-on** root entry `REPO_AGENTS.md` → `AGENTS.md` (native always-on for every platform), because the A–D consumers (`commands/task.md`, `agent-team-intake`, `agent-team-orchestrator`) are all `referenced`/lazy and only fire under `/task`. Enforced by `scripts/check-preset-prompt-persistence.sh` (wired into `check-preset-structure.sh`), which now also asserts the `REPO_AGENTS.md` clause (check **E**).
101
101
 
102
- **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`).
102
+ **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**. Resolution runs on every user message, including a question and a message without a slash command, from the always-on surfaces before any command runs. Order: an active task's `language:` tag, else `.ai.local/conventions.md` `## Language` (nearest `.ai.local` wins), else the prompt language (mixed → dominant), else English. When a task exists, that tag is persisted as an additive `language: <BCP-47>` line in the `prompt.md` header (+ a `.memlog.md` `event:`; never `status.json` / `metrics.json` / an `artifacts[]` body). Commands reuse the tag; they do not own resolution. The detailed rule is a **requestable** EMBED stem (`core/agent-team/language-policy.md`); the resolution 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`), which requires the `every user message` anchor on those always-on bodies. Runtime output language is **orthogonal** to preset prose language — the prose stays English (`docs/PRESET-ENGLISH-STYLE.md`).
103
103
 
104
104
  Intentional fork / mode change: document in PR (and optionally in validation-report).
105
105
 
@@ -391,7 +391,7 @@ Load these when editing files under `packages/ai-rules/presets/**`, `.cursor/**`
391
391
  | `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**. |
392
392
  | `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, from the **always-on** root `REPO_AGENTS.md` entry (check **E** — reachability without `/task`), 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`. |
393
393
  | `scripts/check-preset-reachability.sh` / `yarn check:preset-reachability` | **FAIL** if a non-`preset-*` OpenCode/Mavis rule is reachable by neither a direct reference (entry / agent / command / skill) nor the transitive closure of rule→rule references from the `root-entry` rules. `preset-*` meta rules are exempt as preset-authoring-only. **Refuses vacuous PASS** on an empty iteration set. Wired into `check-preset-structure.sh` next to `prompt-persistence`. |
394
- | `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`. |
394
+ | `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>` + `REPO_AGENTS.md` must contain `native language` and `every user message`), 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`. |
395
395
  | `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`. |
396
396
  | `scripts/check-anti-hallucination-coverage.mjs` | **FAIL** when the shared contract, a Cursor load-line embed, a writer stack floor, or a generated Rules-to-load stem is missing. Writer roles are `implementer`, `unit-test`, `e2e`, `qa`, and `reviewer` (`code-reviewer` loads `STACK_FLOOR_STEMS` plus the contract). `/task` and the orchestrator must not name a floor stem. Does not scan consumer `app/**` and does not call Context7. Fixture `test-anti-hallucination-coverage.mjs` deletes `anti-hallucination-contract` from `next.reviewer` in memory and expects FAIL mentioning `next` and `reviewer`. Wired into `check-preset-structure.sh` immediately after `check-claude-agent-blocks.mjs`. |
397
397
  | `scripts/check-preset-structure.sh` / `yarn check:preset-structure` | Orchestrator: twin-map + token-budget + leakage + shared-core drift + anti-hallucination coverage (**all hard**; drift via `AI_RULES_DRIFT_FAIL=1`). Does **not** run rule-eval. |
@@ -24,7 +24,7 @@ The same rule covers code comments and agent-produced artifacts (see `quality/co
24
24
  Two languages are **orthogonal** and must not be conflated:
25
25
 
26
26
  - **Preset prose language** — the text inside `packages/ai-rules/presets/**` is **English** (this guide). Rule bodies, agents, skills, commands, and package docs are never translated.
27
- - **Runtime output language** — the language an agent uses to *talk to the user* at run time. The `language-policy` contract makes every user-facing interaction (questions, gate prompts, `/task-continue`, status, summaries, escalations) use the user's native language — resolved from the `.ai.local/conventions.md` `## Language` setting (else the prompt language, else English) and persisted per task in the `prompt.md` header.
27
+ - **Runtime output language** — the language an agent uses to *talk to the user* at run time. The `language-policy` contract makes every user-facing interaction (questions, gate prompts, `/task-continue`, status, summaries, escalations) use the user's native language. Resolution runs on every user message from the always-on surfaces (`.ai.local/conventions.md` `## Language`, else the prompt language, else English), including a message that is not a slash command, and is persisted per task in the `prompt.md` header when a task exists.
28
28
 
29
29
  Consequence: a non-English speaker is answered in their language while the code, reasoning, and every artifact (`brief.md`, `review.md`, the `prompt.md` header, and this preset prose) stay **English**. The policy does **not** introduce non-English text into preset files — runtime dialogue never lives in the presets. The i18n audit below still applies: a retained non-English *example* inside a rule needs an `<!-- i18n-keep: … -->` marker.
30
30
 
@@ -9,4 +9,6 @@ Discovery table for `docs/specs/**`. Agents start here when the file exists.
9
9
  <!-- example-row: example-page | page | example | Example page | docs/specs/domains/example/example-page.md | /example | ExamplePage | draft -->
10
10
  ```
11
11
 
12
- <!-- Add one row per page/feature spec. Keep `id` and `path` in sync with frontmatter. -->
12
+ <!-- Add one row per page/feature spec. Keep `id` and `path` in sync with frontmatter. -->
13
+
14
+ Spec-store pointer: behavior of a capability already described as a delta spec → OpenSpec delta only. A page or feature document in `docs/specs` → that tree only (skill `spec-authoring`). Both, when behavior and the published page change, with one human gate naming both paths. An engineering task-list edit is not the living spec.
@@ -30,3 +30,9 @@ Cross-page shared behavior for this domain. Prefer `type: feature` on backend/MC
30
30
  ## Cross-cutting states
31
31
 
32
32
  N/A
33
+
34
+ ## Unresolved product decisions
35
+
36
+ One literal `[NEEDS CLARIFICATION]` line per unresolved product decision. At most three on a new spec. Remove the line when the decision is resolved.
37
+
38
+ - [NEEDS CLARIFICATION] <unresolved product decision>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonesofspring/ai-rules",
3
- "version": "0.2.42",
3
+ "version": "0.2.44",
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",
@@ -24,7 +24,7 @@ Every core file is classified in `scripts/_lib/embed-stems.json` as **embed**, *
24
24
 
25
25
  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.
26
26
 
27
- 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).
27
+ Every user-facing interaction runs in the user's **native language**. Resolution happens on every user message — a question, a one-liner, or a slash command — from the always-on surfaces, before any command runs. Order: an active task's `language:` tag, else the `.ai.local/conventions.md` `## Language` setting (nearest `.ai.local` wins), else the prompt language (mixed → dominant), else English. When a task exists, that tag is persisted as an additive `language: <BCP-47>` line in the `prompt.md` header (+ a `.memlog.md` `event:`). Development, reasoning, and all artifacts stay **English**. The detailed contract is the requestable EMBED stem `core/agent-team/language-policy.md`; the resolution clause rides the always-on `ai-local-overlay`, `<stack>-app-core`, and root `REPO_AGENTS.md` → `AGENTS.md` surfaces (no new always-on slot). Commands reuse the resolved tag; they do not own resolution.
28
28
 
29
29
  ## Folders
30
30
 
@@ -30,3 +30,9 @@ Cross-page shared behavior for this domain. Prefer `type: feature` on backend/MC
30
30
  ## Cross-cutting states
31
31
 
32
32
  N/A
33
+
34
+ ## Unresolved product decisions
35
+
36
+ One literal `[NEEDS CLARIFICATION]` line per unresolved product decision. At most three on a new spec. Remove the line when the decision is resolved.
37
+
38
+ - [NEEDS CLARIFICATION] <unresolved product decision>
@@ -126,7 +126,7 @@ Every task persists the **verbatim original user prompt** — whether or not `/t
126
126
 
127
127
  **Verbatim semantics:** the fenced `text` block is the source of truth. The header is additive only and must never alter, translate, or paraphrase the user's words (the requester's language is preserved; the header stays English). The persisted prompt is a task-folder artifact subject to the no-local-paths discipline — any redaction is an explicit owner decision, never silent.
128
128
 
129
- **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).
129
+ **Dialogue language (`language: <BCP-47>`):** the header also carries the task's resolved user-facing language (see **language-policy**). The always-on rule resolves it on every user message (`.ai.local` `## Language` → prompt language → English; mixed → dominant; nearest `.ai.local` wins). When a task starts, that tag is recorded once 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).
130
130
 
131
131
  ## Prompt log
132
132
 
@@ -7,6 +7,6 @@ When the user message looks like a **work request** (implement, add, fix, refact
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
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
- 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**.
10
+ 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**.
11
11
 
12
12
  Exceptions: user explicitly says “no pipeline”, “just do it”, or continues an active slug.
@@ -33,6 +33,22 @@ Roster of specialists is **stack-specific** (agent names and write scopes differ
33
33
 
34
34
  Full prompts: stack `agents/*.md`. Artifact conventions: stack `team/README.md`; schema SoT: **agent-artifact-contracts**.
35
35
 
36
+ **Product specs:** When `/task` or `/spec-start` touches pages/features/`docs/specs`: if INDEX exists and no generate intent → instruct next agent to load requestable **`product-specs`** (consume; soft-fail; never invent). If generate/bootstrap/`spec-gen` → load **`product-specs-authoring`** + skill **`spec-authoring`** inside **task-analyst** (not a separate pipeline step); pass created spec paths + INDEX diff in handoff; human gate must approve before feature-developer. No-op if INDEX absent and no author intent.
37
+
38
+ Spec-store checklist. Pick one case:
39
+
40
+ 1. Behavior of a capability already described as a delta spec → OpenSpec delta only.
41
+ 2. Page or feature document in `docs/specs` → that tree only (skill `spec-authoring`). `openspec-author` still refuses `app/**` and `docs/specs/**`.
42
+ 3. Both, when behavior and the published page change, with one human gate naming both paths.
43
+
44
+ An engineering task-list edit is not the living spec. Do not change propose → validate → human merge → archive. A manifest receipt may name an existing OpenSpec change id as a cross-reference only.
45
+
46
+ ## Strict implementation rail (optional)
47
+
48
+ The strict implementation rail defaults to off. `.ai.local/rules/task-levels.md` holds the flag. task-router sets top-level `pipeline.json` `"implementationRail": "on"` only for a production app implementation task when the user or the task record asks. L0, docs-only, research, and preset-only tasks do not take the rail. The L0–L3 selection order is unchanged. `light` | `standard` | `full` keep their meanings.
49
+
50
+ When the rail is off, the feature-developer handoff keeps the pre-change test-before-handoff rule. When the rail is on and a `[NEEDS CLARIFICATION]` marker is open, the hook does not start the implementation handoff. When the rail is on and markers are clear, feature-developer writes a failing test before production edits, uses a branch or worktree before the first implementation task, and runs `code-reviewer` between decomposition tasks. Debug retries for that handoff stop at two. `build-verifier` and `code-reviewer` stay.
51
+
36
52
  ## Dynamic pipeline
37
53
 
38
54
  ```mermaid
@@ -117,7 +133,7 @@ Replanning is a **named, auditable operation** — never a silent reorder. Trigg
117
133
 
118
134
  ## Context budget & checkpoint/resume
119
135
 
120
- Work in bounded waves (one artifact class across the target surface); mechanical waves (generation, embed sync) are delegated to repo scripts rather than spent on tokens. **Checkpoint** each completed wave to `.memlog.md` (`## <date>` + an `event:` line) and record the produced paths on the `implementation` manifest entry (`authoritativePaths`). A resumed run (e.g. `/task-continue`) reads `artifact-manifest.json` + `.memlog.md` and continues at the first stage whose exit criteria are unmet — never re-derive state from the chat. See **context-and-iteration** for the budget, checkpoint, resume, and refinement loop.
136
+ Work in bounded waves (one artifact class across the target surface). **Checkpoint** each completed wave to `.memlog.md` (`## <date>` + an `event:` line) and record the produced paths on the `implementation` manifest entry (`authoritativePaths`). That checkpoint is the hook `writeStatus` path: it rewrites `.ai.local/team/tasks/<slug>/focus.md`. `focus.md` is a view, not the system of record. It lists slug, pipeline step index, authoritative paths for incomplete manifest ids, the last `.memlog.md` `event:` line, the next gate, one decomposition ready-set line, and one archive index line, and it stays under 100 lines. `status.json`, `metrics.json`, `artifact-manifest.json`, and `.memlog.md` stay the system of record. A resumed run (`/task-continue`) reads `focus.md` first, then `artifact-manifest.json` and `.memlog.md`, and continues at the first stage whose exit criteria are unmet — never re-derive state from the chat. A completed manifest entry keeps id, status, and `authoritativePaths`, and the default resume read omits that entry's markdown body; closing it appends one new `.memlog.md` event: line, moves the bulky body to `.ai.local/team/tasks/<slug>/archive/YYYY-MM-DD/`, and leaves earlier memlog lines, the human-readable slug and artifact ids, and the manifest entry in place, with no Beads hash ids and no Taskmaster tags. Mechanical waves (generation, embed sync) are delegated to repo scripts. See **context-and-iteration** for the budget, checkpoint, resume, and refinement loop.
121
137
 
122
138
  ## Self-review & context hygiene
123
139
 
@@ -158,7 +174,7 @@ Each producing agent runs a **pre-receipt self-review** of its own output — go
158
174
  | `waveSteps` | Step indexes of the in-flight wave; cleared on wave completion |
159
175
  | `waveId` | `<runId>:wave-<firstStepIndex>` for the in-flight wave |
160
176
  | `graphMode` | Cached `steps.some(s => Array.isArray(s.dependsOn))` |
161
- | `blockedSteps` | Steps that ended `blocked`, excluded from the ready set until a human-approved retry |
177
+ | `blockedSteps` | Steps that ended `blocked`, excluded from the ready queue until a human-approved retry |
162
178
 
163
179
  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).
164
180
 
@@ -189,7 +205,7 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
189
205
 
190
206
  ## Rules (strict)
191
207
 
192
- 1. **`/task` always starts with task-router** (except user says "skip router" with documented pipeline).
208
+ 1. **`/task` always starts with task-router** (except user says "skip router" with documented pipeline). When `.ai.local/rules/task-levels.md` selects **L0** or a skip-analyst **L1**, task-router may emit a short `steps[]` list for that level. **L2** / **L3** still attach an OpenSpec change. `pipeline.json` → `steps[]` still schedules the run. This short list does not remove `build-verifier` or `code-reviewer` from implementation pipelines.
193
209
  2. Read `pipeline.json` before every subagent invocation.
194
210
  3. One role per Task call — **except** parallel steps: multiple Task calls in one message.
195
211
  4. **Never** skip `humanGates` without `/task-continue` or explicit user approval.
@@ -199,15 +215,15 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
199
215
  8. When all steps complete, suggest `/technical-retro <slug>`.
200
216
  9. If `autoChain: false` in pipeline, do not rely on hook — manual step only.
201
217
  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.
202
- 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**.
203
- 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.
204
- 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.
218
+ 11. **Answer the user in the resolved dialogue language for the whole task.** The always-on language rule already resolved it on this turn (`.ai.local` `## Language` → prompt language → English). Pass that tag to every step; `/task-continue` keeps it. Never ask the user to pick a language. Development, reasoning, and artifacts stay English. See **language-policy**.
219
+ 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. The role pipeline and the engineering graph are two linked objects: `pipeline.json` `steps[].dependsOn` still decides which agent runs; the decomposition ready set only chooses rows inside the active step. Reviewer and QA steps stay on the pipeline.
220
+ 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. Each decomposition task lists the repo paths it may create or modify. That list is a subset of the implementing step's `writeScopes[]` when the step declares `writeScopes`. Tasks with no `dependsOn` path between them keep those lists disjoint; a shared path stays sequential. `docs/specs/**` or `openspec/**` paths and `app/**` paths stay in different lists. `steps[].writeScopes[]` stays the role-level authority. Reviewer steps stay team-artifact only.
205
221
 
206
222
  ## Team artifact I/O (Cursor Shell sandbox)
207
223
 
208
224
  - **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.
209
225
  - **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.
210
- - **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**.
226
+ - **Answer in the resolved dialogue language.** The always-on language rule already resolved it on this turn (`.ai.local` `## Language` → prompt language → English; mixed → dominant; nearest `.ai.local` wins). 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**.
211
227
  - 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).
212
228
  - If Shell must touch team paths and fails with EPERM, retry with `required_permissions: ["all"]`. Prefer Write for artifacts.
213
229
  - Prefer repo under `~/Projects` / `WebstormProjects` over `~/Desktop` when using agent team heavily.
@@ -1,8 +1,9 @@
1
1
  # Language policy
2
2
 
3
- Behavior contract for **every agent and command in any consumer repo** — stack-agnostic. Not a
4
- preset-authoring meta rule. The essentials are anchored on the always-on surfaces; this rule is the
5
- detailed reference.
3
+ Behavior contract for **every agent in any consumer repo** — stack-agnostic. Not a
4
+ preset-authoring meta rule. Resolve the dialogue language on every user message from the
5
+ always-on surfaces (`ai-local-overlay`, the stack app-core, root `AGENTS.md`). This file
6
+ is the detailed reference. A slash command does not gate resolution.
6
7
 
7
8
  ## Two halves (mandatory)
8
9
 
@@ -12,30 +13,37 @@ detailed reference.
12
13
  code, identifiers, logs, or artifacts.
13
14
  2. **Every user-facing interaction is in the user's native language.** Clarifying questions, plan /
14
15
  human-gate prompts, `/task-continue` prompts, status answers, plan/progress summaries, and error
15
- escalations are written in the resolved language. Every such message — no exception.
16
+ escalations are written in the resolved language. Every such message — a question, a one-liner, or a
17
+ slash command — no exception.
16
18
 
17
- ## Resolution (ordered)
19
+ ## Resolution (every user message)
18
20
 
19
- 1. **Explicit `.ai.local` setting** — the `## Language` section of `.ai.local/conventions.md`. The
21
+ Resolve on every user message, before you answer. Do not wait for `/task`, `/update`, or any other
22
+ command. Those commands reuse the language this step already resolved.
23
+
24
+ 1. **Active task tag** — when a task is in progress, the `language:` value already stored in that task's
25
+ `prompt.md`.
26
+ 2. **Explicit `.ai.local` setting** — the `## Language` section of `.ai.local/conventions.md`. The
20
27
  **nearest** `.ai.local` wins in a monorepo.
21
- 2. Otherwise **infer from the prompt language**. A mixed-language prompt uses the **dominant** language of
28
+ 3. Otherwise **infer from the prompt language**. A mixed-language prompt uses the **dominant** language of
22
29
  the request.
23
- 3. Otherwise **English** (English-only / ambiguous prompt).
30
+ 4. Otherwise **English** (English-only / ambiguous prompt).
24
31
 
25
- The `.ai.local` setting **wins over** a mid-task prompt in another language. On a disagreement, follow the
32
+ The `.ai.local` setting **wins over** a later prompt in another language. On a disagreement, follow the
26
33
  setting and surface the mismatch **once in one sentence** — never block, and **never ask a
27
- language-confirmation question**.
34
+ language-confirmation question**. A message with no task still resolves on this turn.
28
35
 
29
36
  ## Per-task persistence
30
37
 
31
- Resolve the language once at task start and reuse it for the whole task — every pipeline agent and every
32
- `/task-continue`. Persist the BCP-47 tag in the `prompt.md` header (`language: <BCP-47>`) and an
33
- append-only `.memlog.md` `event:` checkpoint. A later correction is an append-only memlog event (the fenced
34
- verbatim block is frozen). Never store it in `status.json`, `metrics.json`, or an `artifacts[]` body.
38
+ When a task artifact is created, record the language already resolved above and reuse it for the whole
39
+ task — every pipeline agent and every `/task-continue`. Persist the BCP-47 tag in the `prompt.md` header
40
+ (`language: <BCP-47>`) and an append-only `.memlog.md` `event:` checkpoint. A later correction is an
41
+ append-only memlog event (the fenced verbatim block is frozen). Never store it in `status.json`,
42
+ `metrics.json`, or an `artifacts[]` body.
35
43
 
36
44
  ## See also
37
45
 
38
- - `ai-local-overlay` — reads `.ai.local` every turn; carries the setting read.
39
- - `agent-team-intake` — resolves the language when a work request starts.
46
+ - `ai-local-overlay` — always-on; resolves the language on every user message.
47
+ - `agent-team-intake` — persists the already-resolved language when a work request starts.
40
48
  - `agent-team-orchestrator` — carries the resolved language across steps.
41
49
  - `agent-artifact-contracts` — the `prompt.md` header contract.
@@ -21,7 +21,7 @@ Express the graph as a diagram plus an explicit edge list (`T2←T1`, …) so a
21
21
  - **`steps[].taskIds[]`** — decomposition task IDs the step realizes: the shared vocabulary with this graph, and a `dependsOn` alias.
22
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
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.
24
+ - **Ready queue** — the step queue 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. `pipeline.json` `steps[].dependsOn` still decides which agent runs.
25
25
  - **Wave** — the join unit. A single `parallel: true` step is a one-step wave, so existing behavior is preserved.
26
26
 
27
27
  ## Conflict model
@@ -41,6 +41,14 @@ A **unit** is one `(stepIndex, agent)` slot. Two units are **conflict-free** iff
41
41
 
42
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
43
 
44
+ **Decomposition parallel vs `presets/**` writeScopes.** Overlapping `writeScopes` under `presets/**` force **serial** pipeline steps even when `decomposition.md` lists parallelizable groups. Set `pipeline.json` `steps[].dependsOn` to follow leverage order when write scopes overlap (C1 still applies: overlapping scopes are never `parallel: true`).
45
+
46
+ ## Ready
47
+
48
+ The **decomposition ready set** lists task ids whose `dependsOn` are all satisfied and whose manifest artifact or task row is not complete. A manifest artifact completes a task when `status` is `completed` and `taskIds` or `id` names that task. A task row is complete when its `Status`, `Done`, or `State` cell is `complete`, `completed`, or `done`. A blocked row records `waiting_on` (the unmet dependency ids). Publish the set as a `## Ready` section in `decomposition.md` and keep it with the plan.
49
+
50
+ The role pipeline and the engineering graph are two linked objects: `pipeline.json` `steps[].dependsOn` still decides which agent runs; the decomposition ready set only chooses rows inside the active step. Reviewer and QA steps stay on the pipeline. The hook keeps the step queue and passes this ready set to the active step as data, including one ready-set line on `focus.md`.
51
+
44
52
  ## Epics / stages
45
53
 
46
54
  For a large flow, group tasks into **epics / stages**, each with a table:
@@ -12,6 +12,8 @@ Do not invent MCP or tool input schemas. Read the installed schema, or mark unce
12
12
 
13
13
  `// VERIFY` is an uncertainty marker. It is not confirmation and it is not a passing check.
14
14
 
15
+ For team specs and `brief.md`, the artifact marker is a literal `[NEEDS CLARIFICATION]` line for each unresolved product decision. This contract points at that marker. `// VERIFY` stays a code comment and is not a spec token.
16
+
15
17
  Context7 is optional. When it is down or absent, write `// VERIFY` and state the uncertainty. Do not block the pipeline and do not invent the signature.
16
18
 
17
19
  Status claims follow `verification-before-completion`. Procedural rules stay in `anti-sycophancy-discipline`. Stack floors stay in their own stems.
@@ -12,7 +12,8 @@ Stack-agnostic. Keep each run inside a bounded context, checkpoint progress to d
12
12
 
13
13
  - The checkpoint lives in `.memlog.md` — append `## <date>` with an `event:` line per completed wave/stage (append-only; never mutate history).
14
14
  - Record the produced paths on the `implementation` manifest entry (`authoritativePaths`) after each wave.
15
- - **Resume** reads `artifact-manifest.json` + `.memlog.md`, skips completed waves, and continues at the first stage whose exit criteria are unmet — never re-derive state from chat history.
15
+ - The hook `writeStatus` path also rewrites `.ai.local/team/tasks/<slug>/focus.md` (slug, pipeline step index, authoritative paths for incomplete manifest ids, last `.memlog.md` `event:` line, next gate, one decomposition ready-set line, one archive index line, under 100 lines). `focus.md` is a view. `status.json`, `metrics.json`, `artifact-manifest.json`, and `.memlog.md` stay the system of record.
16
+ - **Resume** reads `focus.md` first, then `artifact-manifest.json` + `.memlog.md`, skips completed waves, and continues at the first stage whose exit criteria are unmet — never re-derive state from chat history.
16
17
 
17
18
  ## Iterative refinement
18
19