@bonesofspring/ai-rules 0.2.67 → 0.2.68

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 (770) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +4 -4
  3. package/bin/lib/engine-scripts.js +3 -6
  4. package/bin/lib/seed-ai-local-team.js +1 -1
  5. package/docs/PRESET-CONTRIBUTION.md +15 -8
  6. package/docs/TEAM-DB.md +105 -105
  7. package/docs/TOKEN-ECONOMY.md +4 -2
  8. package/docs/openapi/team-db.v1.json +3905 -1466
  9. package/package.json +4 -4
  10. package/presets/_shared/ai-local/scripts/processes.mjs +467 -55
  11. package/presets/_shared/ai-local/scripts/team-db-api.mjs +564 -10
  12. package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +816 -47
  13. package/presets/_shared/ai-local/scripts/team-db-project.mjs +659 -5
  14. package/presets/_shared/ai-local/scripts/team-db-schema.mjs +135 -0
  15. package/presets/_shared/ai-local/scripts/team-db-task-runner.mjs +11 -6
  16. package/presets/_shared/ai-local/scripts/team-db.mjs +16 -54
  17. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +5 -5
  18. package/presets/_shared/core/architecture/feature-delivery-workflow.md +3 -7
  19. package/presets/_shared/core/meta/preset-pr-checklist.md +2 -2
  20. package/presets/_shared/core/quality/code-quality-and-refactoring.md +2 -6
  21. package/presets/_shared/core/quality/verification-before-completion.md +20 -3
  22. package/presets/_shared/hooks/chain-team-phases.sh.tmpl +12 -3
  23. package/presets/claude/android-kotlin/REPO_AGENTS.md +7 -47
  24. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +12 -3
  25. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  26. package/presets/claude/android-kotlin/rules/tooling-and-review/code-quality.md +2 -6
  27. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  28. package/presets/claude/go/REPO_AGENTS.md +7 -47
  29. package/presets/claude/go/hooks/chain-team-phases.sh +12 -3
  30. package/presets/claude/go/rules/architecture/feature-delivery.md +3 -7
  31. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  32. package/presets/claude/go/rules/tooling-and-review/code-quality.md +2 -6
  33. package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  34. package/presets/claude/ios-swift/REPO_AGENTS.md +7 -47
  35. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +12 -3
  36. package/presets/claude/ios-swift/rules/architecture/feature-delivery.md +3 -7
  37. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  38. package/presets/claude/ios-swift/rules/tooling-and-review/code-quality.md +2 -6
  39. package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  40. package/presets/claude/java/REPO_AGENTS.md +7 -47
  41. package/presets/claude/java/hooks/chain-team-phases.sh +12 -3
  42. package/presets/claude/java/rules/architecture/feature-delivery.md +3 -7
  43. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  44. package/presets/claude/java/rules/tooling-and-review/code-quality.md +2 -6
  45. package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  46. package/presets/claude/mcp-ts/REPO_AGENTS.md +7 -47
  47. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +12 -3
  48. package/presets/claude/mcp-ts/rules/architecture/feature-delivery.md +3 -7
  49. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  50. package/presets/claude/mcp-ts/rules/tooling-and-review/code-quality.md +2 -6
  51. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  52. package/presets/claude/mol/REPO_AGENTS.md +9 -49
  53. package/presets/claude/mol/hooks/chain-team-phases.sh +12 -3
  54. package/presets/claude/mol/rules/architecture/feature-delivery-workflow.md +3 -7
  55. package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  56. package/presets/claude/mol/rules/tooling-and-review/code-quality.md +2 -6
  57. package/presets/claude/mol/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  58. package/presets/claude/next/REPO_AGENTS.md +10 -50
  59. package/presets/claude/next/agents/accessibility-reviewer.md +0 -1
  60. package/presets/claude/next/agents/api-contract-reviewer.md +0 -1
  61. package/presets/claude/next/agents/build-verifier.md +12 -8
  62. package/presets/claude/next/agents/code-reviewer.md +1 -1
  63. package/presets/claude/next/agents/codebase-analyzer.md +0 -1
  64. package/presets/claude/next/agents/feature-developer.md +6 -6
  65. package/presets/claude/next/agents/migration-specialist.md +0 -1
  66. package/presets/claude/next/agents/mockup-reviewer.md +0 -1
  67. package/presets/claude/next/agents/openspec-author.md +0 -1
  68. package/presets/claude/next/agents/performance-auditor.md +0 -1
  69. package/presets/claude/next/agents/playwright-test-generator.md +0 -1
  70. package/presets/claude/next/agents/playwright-test-healer.md +0 -1
  71. package/presets/claude/next/agents/playwright-test-planner.md +0 -1
  72. package/presets/claude/next/agents/qa-tester.md +3 -3
  73. package/presets/claude/next/agents/security-reviewer.md +0 -1
  74. package/presets/claude/next/agents/solution-architect.md +0 -1
  75. package/presets/claude/next/agents/task-analyst.md +0 -1
  76. package/presets/claude/next/agents/task-router.md +8 -7
  77. package/presets/claude/next/agents/tech-writer.md +0 -1
  78. package/presets/claude/next/agents/unit-test-generator.md +0 -1
  79. package/presets/claude/next/agents/unit-test-healer.md +0 -1
  80. package/presets/claude/next/agents/unit-test-planner.md +0 -1
  81. package/presets/claude/next/commands/README.md +0 -6
  82. package/presets/claude/next/hooks/chain-team-phases.sh +12 -3
  83. package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +5 -9
  84. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  85. package/presets/claude/next/rules/tooling-and-review/code-quality.md +2 -6
  86. package/presets/claude/next/rules/tooling-and-review/post-change-lint.md +12 -16
  87. package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  88. package/presets/claude/next/skills/feature-delivery/SKILL.md +1 -1
  89. package/presets/claude/next/skills/playwright-e2e/SKILL.md +1 -1
  90. package/presets/claude/next/skills/unit-testing/SKILL.md +1 -1
  91. package/presets/claude/nuxt/REPO_AGENTS.md +8 -48
  92. package/presets/claude/nuxt/agents/accessibility-reviewer.md +0 -1
  93. package/presets/claude/nuxt/agents/api-contract-reviewer.md +0 -1
  94. package/presets/claude/nuxt/agents/build-verifier.md +5 -3
  95. package/presets/claude/nuxt/agents/ci-investigator.md +1 -1
  96. package/presets/claude/nuxt/agents/code-reviewer.md +0 -1
  97. package/presets/claude/nuxt/agents/codebase-analyzer.md +0 -1
  98. package/presets/claude/nuxt/agents/debugger.md +1 -1
  99. package/presets/claude/nuxt/agents/feature-developer.md +6 -6
  100. package/presets/claude/nuxt/agents/migration-specialist.md +0 -1
  101. package/presets/claude/nuxt/agents/mockup-reviewer.md +0 -1
  102. package/presets/claude/nuxt/agents/openspec-author.md +0 -1
  103. package/presets/claude/nuxt/agents/performance-auditor.md +0 -1
  104. package/presets/claude/nuxt/agents/playwright-test-generator.md +0 -1
  105. package/presets/claude/nuxt/agents/playwright-test-healer.md +0 -1
  106. package/presets/claude/nuxt/agents/playwright-test-planner.md +0 -1
  107. package/presets/claude/nuxt/agents/qa-tester.md +3 -3
  108. package/presets/claude/nuxt/agents/security-reviewer.md +0 -1
  109. package/presets/claude/nuxt/agents/solution-architect.md +0 -1
  110. package/presets/claude/nuxt/agents/task-analyst.md +0 -1
  111. package/presets/claude/nuxt/agents/task-router.md +8 -7
  112. package/presets/claude/nuxt/agents/tech-writer.md +0 -1
  113. package/presets/claude/nuxt/agents/unit-test-generator.md +0 -1
  114. package/presets/claude/nuxt/agents/unit-test-healer.md +0 -1
  115. package/presets/claude/nuxt/agents/unit-test-planner.md +0 -1
  116. package/presets/claude/nuxt/hooks/chain-team-phases.sh +12 -3
  117. package/presets/claude/nuxt/rules/architecture/feature-delivery-workflow.md +3 -7
  118. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  119. package/presets/claude/nuxt/rules/tooling-and-review/code-quality.md +2 -6
  120. package/presets/claude/nuxt/rules/tooling-and-review/post-change-lint.md +14 -14
  121. package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  122. package/presets/claude/nuxt/skills/feature-delivery/SKILL.md +1 -1
  123. package/presets/claude/nuxt/skills/playwright-e2e/SKILL.md +1 -1
  124. package/presets/claude/nuxt/skills/unit-testing/SKILL.md +1 -1
  125. package/presets/claude/php-hexagonal/REPO_AGENTS.md +7 -47
  126. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +12 -3
  127. package/presets/claude/php-hexagonal/rules/architecture/feature-delivery.md +3 -7
  128. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  129. package/presets/claude/php-hexagonal/rules/tooling-and-review/code-quality.md +2 -6
  130. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  131. package/presets/claude/php-laravel/REPO_AGENTS.md +7 -47
  132. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +12 -3
  133. package/presets/claude/php-laravel/rules/architecture/feature-delivery.md +3 -7
  134. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  135. package/presets/claude/php-laravel/rules/tooling-and-review/code-quality.md +2 -6
  136. package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  137. package/presets/claude/svelte/REPO_AGENTS.md +8 -48
  138. package/presets/claude/svelte/agents/accessibility-reviewer.md +0 -1
  139. package/presets/claude/svelte/agents/api-contract-reviewer.md +0 -1
  140. package/presets/claude/svelte/agents/build-verifier.md +5 -3
  141. package/presets/claude/svelte/agents/ci-investigator.md +1 -1
  142. package/presets/claude/svelte/agents/code-reviewer.md +0 -1
  143. package/presets/claude/svelte/agents/codebase-analyzer.md +0 -1
  144. package/presets/claude/svelte/agents/debugger.md +1 -1
  145. package/presets/claude/svelte/agents/feature-developer.md +6 -6
  146. package/presets/claude/svelte/agents/migration-specialist.md +0 -1
  147. package/presets/claude/svelte/agents/mockup-reviewer.md +0 -1
  148. package/presets/claude/svelte/agents/openspec-author.md +0 -1
  149. package/presets/claude/svelte/agents/performance-auditor.md +0 -1
  150. package/presets/claude/svelte/agents/playwright-test-generator.md +0 -1
  151. package/presets/claude/svelte/agents/playwright-test-healer.md +0 -1
  152. package/presets/claude/svelte/agents/playwright-test-planner.md +0 -1
  153. package/presets/claude/svelte/agents/qa-tester.md +3 -3
  154. package/presets/claude/svelte/agents/security-reviewer.md +0 -1
  155. package/presets/claude/svelte/agents/solution-architect.md +0 -1
  156. package/presets/claude/svelte/agents/task-analyst.md +0 -1
  157. package/presets/claude/svelte/agents/task-router.md +8 -7
  158. package/presets/claude/svelte/agents/tech-writer.md +0 -1
  159. package/presets/claude/svelte/agents/unit-test-generator.md +0 -1
  160. package/presets/claude/svelte/agents/unit-test-healer.md +0 -1
  161. package/presets/claude/svelte/agents/unit-test-planner.md +0 -1
  162. package/presets/claude/svelte/hooks/chain-team-phases.sh +12 -3
  163. package/presets/claude/svelte/rules/architecture/feature-delivery-workflow.md +3 -7
  164. package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  165. package/presets/claude/svelte/rules/tooling-and-review/code-quality.md +2 -6
  166. package/presets/claude/svelte/rules/tooling-and-review/post-change-lint.md +14 -14
  167. package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  168. package/presets/claude/svelte/skills/feature-delivery/SKILL.md +1 -1
  169. package/presets/claude/svelte/skills/playwright-e2e/SKILL.md +1 -1
  170. package/presets/claude/svelte/skills/unit-testing/SKILL.md +1 -1
  171. package/presets/cursor/android-kotlin/AGENTS.md +0 -10
  172. package/presets/cursor/android-kotlin/REPO_AGENTS.md +7 -47
  173. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +12 -3
  174. package/presets/cursor/android-kotlin/rules/code-quality-and-refactoring.mdc +2 -6
  175. package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +2 -2
  176. package/presets/cursor/go/AGENTS.md +0 -8
  177. package/presets/cursor/go/REPO_AGENTS.md +7 -47
  178. package/presets/cursor/go/hooks/chain-team-phases.sh +12 -3
  179. package/presets/cursor/go/rules/code-quality-and-refactoring.mdc +2 -6
  180. package/presets/cursor/go/rules/preset-pr-checklist.mdc +2 -2
  181. package/presets/cursor/ios-swift/AGENTS.md +0 -10
  182. package/presets/cursor/ios-swift/REPO_AGENTS.md +7 -47
  183. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +12 -3
  184. package/presets/cursor/ios-swift/rules/code-quality-and-refactoring.mdc +2 -6
  185. package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +2 -2
  186. package/presets/cursor/java/AGENTS.md +0 -8
  187. package/presets/cursor/java/REPO_AGENTS.md +7 -47
  188. package/presets/cursor/java/hooks/chain-team-phases.sh +12 -3
  189. package/presets/cursor/java/rules/code-quality-and-refactoring.mdc +2 -6
  190. package/presets/cursor/java/rules/preset-pr-checklist.mdc +2 -2
  191. package/presets/cursor/mcp-ts/AGENTS.md +0 -6
  192. package/presets/cursor/mcp-ts/REPO_AGENTS.md +7 -47
  193. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +12 -3
  194. package/presets/cursor/mcp-ts/rules/code-quality-and-refactoring.mdc +2 -6
  195. package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +2 -2
  196. package/presets/cursor/mol/AGENTS.md +0 -11
  197. package/presets/cursor/mol/REPO_AGENTS.md +9 -49
  198. package/presets/cursor/mol/hooks/chain-team-phases.sh +12 -3
  199. package/presets/cursor/mol/rules/code-quality-and-refactoring.mdc +2 -6
  200. package/presets/cursor/mol/rules/preset-pr-checklist.mdc +2 -2
  201. package/presets/cursor/next/AGENTS.md +1 -12
  202. package/presets/cursor/next/REPO_AGENTS.md +10 -50
  203. package/presets/cursor/next/agents/build-verifier.md +11 -7
  204. package/presets/cursor/next/agents/code-reviewer.md +1 -0
  205. package/presets/cursor/next/agents/feature-developer.md +6 -6
  206. package/presets/cursor/next/agents/qa-tester.md +3 -2
  207. package/presets/cursor/next/agents/task-router.md +8 -6
  208. package/presets/cursor/next/commands/README.md +0 -6
  209. package/presets/cursor/next/hooks/chain-team-phases.sh +12 -3
  210. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +4 -4
  211. package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +2 -6
  212. package/presets/cursor/next/rules/feature-delivery-workflow.mdc +2 -2
  213. package/presets/cursor/next/rules/post-change-lint.mdc +12 -16
  214. package/presets/cursor/next/rules/preset-pr-checklist.mdc +2 -2
  215. package/presets/cursor/next/skills/feature-delivery/SKILL.md +1 -1
  216. package/presets/cursor/next/skills/playwright-e2e/SKILL.md +1 -1
  217. package/presets/cursor/next/skills/unit-testing/SKILL.md +1 -1
  218. package/presets/cursor/nuxt/AGENTS.md +1 -12
  219. package/presets/cursor/nuxt/REPO_AGENTS.md +8 -48
  220. package/presets/cursor/nuxt/agents/build-verifier.md +1 -1
  221. package/presets/cursor/nuxt/agents/feature-developer.md +2 -2
  222. package/presets/cursor/nuxt/agents/qa-tester.md +3 -2
  223. package/presets/cursor/nuxt/agents/task-router.md +8 -6
  224. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +12 -3
  225. package/presets/cursor/nuxt/rules/code-quality-and-refactoring.mdc +2 -6
  226. package/presets/cursor/nuxt/rules/post-change-lint.mdc +14 -14
  227. package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +2 -2
  228. package/presets/cursor/nuxt/skills/feature-delivery/SKILL.md +1 -1
  229. package/presets/cursor/nuxt/skills/playwright-e2e/SKILL.md +1 -1
  230. package/presets/cursor/nuxt/skills/unit-testing/SKILL.md +1 -1
  231. package/presets/cursor/php-hexagonal/AGENTS.md +0 -8
  232. package/presets/cursor/php-hexagonal/REPO_AGENTS.md +7 -47
  233. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +12 -3
  234. package/presets/cursor/php-hexagonal/rules/code-quality-and-refactoring.mdc +2 -6
  235. package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +2 -2
  236. package/presets/cursor/php-laravel/AGENTS.md +0 -8
  237. package/presets/cursor/php-laravel/REPO_AGENTS.md +7 -47
  238. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +12 -3
  239. package/presets/cursor/php-laravel/rules/code-quality-and-refactoring.mdc +2 -6
  240. package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +2 -2
  241. package/presets/cursor/svelte/AGENTS.md +1 -12
  242. package/presets/cursor/svelte/REPO_AGENTS.md +8 -48
  243. package/presets/cursor/svelte/agents/build-verifier.md +1 -1
  244. package/presets/cursor/svelte/agents/feature-developer.md +2 -2
  245. package/presets/cursor/svelte/agents/qa-tester.md +3 -2
  246. package/presets/cursor/svelte/agents/task-router.md +8 -6
  247. package/presets/cursor/svelte/hooks/chain-team-phases.sh +12 -3
  248. package/presets/cursor/svelte/rules/code-quality-and-refactoring.mdc +2 -6
  249. package/presets/cursor/svelte/rules/post-change-lint.mdc +14 -14
  250. package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +2 -2
  251. package/presets/cursor/svelte/skills/feature-delivery/SKILL.md +1 -1
  252. package/presets/cursor/svelte/skills/playwright-e2e/SKILL.md +1 -1
  253. package/presets/cursor/svelte/skills/unit-testing/SKILL.md +1 -1
  254. package/presets/mavis/android-kotlin/MAVIS.md +0 -2
  255. package/presets/mavis/android-kotlin/REPO_AGENTS.md +7 -47
  256. package/presets/mavis/android-kotlin/adapter-map.json +1 -1
  257. package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +12 -3
  258. package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +5 -5
  259. package/presets/mavis/android-kotlin/rules/code-quality-and-refactoring.md +2 -6
  260. package/presets/mavis/android-kotlin/rules/preset-pr-checklist.md +2 -2
  261. package/presets/mavis/go/MAVIS.md +8 -0
  262. package/presets/mavis/go/REPO_AGENTS.md +7 -47
  263. package/presets/mavis/go/adapter-map.json +1 -1
  264. package/presets/mavis/go/hooks/chain-team-phases.sh +12 -3
  265. package/presets/mavis/go/rules/agent-team-orchestrator.md +5 -5
  266. package/presets/mavis/go/rules/code-quality-and-refactoring.md +2 -6
  267. package/presets/mavis/go/rules/feature-delivery-workflow.md +3 -7
  268. package/presets/mavis/go/rules/preset-pr-checklist.md +2 -2
  269. package/presets/mavis/ios-swift/MAVIS.md +0 -2
  270. package/presets/mavis/ios-swift/REPO_AGENTS.md +7 -47
  271. package/presets/mavis/ios-swift/adapter-map.json +1 -1
  272. package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +12 -3
  273. package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +5 -5
  274. package/presets/mavis/ios-swift/rules/code-quality-and-refactoring.md +2 -6
  275. package/presets/mavis/ios-swift/rules/feature-delivery-workflow.md +3 -7
  276. package/presets/mavis/ios-swift/rules/preset-pr-checklist.md +2 -2
  277. package/presets/mavis/java/MAVIS.md +14 -0
  278. package/presets/mavis/java/REPO_AGENTS.md +7 -47
  279. package/presets/mavis/java/adapter-map.json +1 -1
  280. package/presets/mavis/java/hooks/chain-team-phases.sh +12 -3
  281. package/presets/mavis/java/rules/agent-team-orchestrator.md +5 -5
  282. package/presets/mavis/java/rules/code-quality-and-refactoring.md +2 -6
  283. package/presets/mavis/java/rules/feature-delivery-workflow.md +3 -7
  284. package/presets/mavis/java/rules/preset-pr-checklist.md +2 -2
  285. package/presets/mavis/mcp-ts/MAVIS.md +6 -0
  286. package/presets/mavis/mcp-ts/REPO_AGENTS.md +7 -47
  287. package/presets/mavis/mcp-ts/adapter-map.json +1 -1
  288. package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +12 -3
  289. package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +5 -5
  290. package/presets/mavis/mcp-ts/rules/code-quality-and-refactoring.md +2 -6
  291. package/presets/mavis/mcp-ts/rules/feature-delivery-workflow.md +3 -7
  292. package/presets/mavis/mcp-ts/rules/preset-pr-checklist.md +2 -2
  293. package/presets/mavis/mol/MAVIS.md +1 -5
  294. package/presets/mavis/mol/REPO_AGENTS.md +9 -49
  295. package/presets/mavis/mol/adapter-map.json +1 -1
  296. package/presets/mavis/mol/hooks/chain-team-phases.sh +12 -3
  297. package/presets/mavis/mol/rules/agent-team-orchestrator.md +5 -5
  298. package/presets/mavis/mol/rules/code-quality-and-refactoring.md +2 -6
  299. package/presets/mavis/mol/rules/feature-delivery-workflow.md +3 -7
  300. package/presets/mavis/mol/rules/preset-pr-checklist.md +2 -2
  301. package/presets/mavis/next/MAVIS.md +2 -6
  302. package/presets/mavis/next/REPO_AGENTS.md +10 -50
  303. package/presets/mavis/next/adapter-map.json +1 -17
  304. package/presets/mavis/next/agents/accessibility-reviewer.md +0 -1
  305. package/presets/mavis/next/agents/api-contract-reviewer.md +0 -1
  306. package/presets/mavis/next/agents/build-verifier.md +12 -8
  307. package/presets/mavis/next/agents/code-reviewer.md +1 -1
  308. package/presets/mavis/next/agents/codebase-analyzer.md +0 -1
  309. package/presets/mavis/next/agents/feature-developer.md +6 -6
  310. package/presets/mavis/next/agents/migration-specialist.md +0 -1
  311. package/presets/mavis/next/agents/mockup-reviewer.md +0 -1
  312. package/presets/mavis/next/agents/openspec-author.md +0 -1
  313. package/presets/mavis/next/agents/performance-auditor.md +0 -1
  314. package/presets/mavis/next/agents/playwright-test-generator.md +0 -1
  315. package/presets/mavis/next/agents/playwright-test-healer.md +0 -1
  316. package/presets/mavis/next/agents/playwright-test-planner.md +0 -1
  317. package/presets/mavis/next/agents/qa-tester.md +3 -3
  318. package/presets/mavis/next/agents/security-reviewer.md +0 -1
  319. package/presets/mavis/next/agents/solution-architect.md +0 -1
  320. package/presets/mavis/next/agents/task-analyst.md +0 -1
  321. package/presets/mavis/next/agents/task-router.md +8 -7
  322. package/presets/mavis/next/agents/tech-writer.md +0 -1
  323. package/presets/mavis/next/agents/unit-test-generator.md +0 -1
  324. package/presets/mavis/next/agents/unit-test-healer.md +0 -1
  325. package/presets/mavis/next/agents/unit-test-planner.md +0 -1
  326. package/presets/mavis/next/commands/README.md +0 -6
  327. package/presets/mavis/next/hooks/chain-team-phases.sh +12 -3
  328. package/presets/mavis/next/rules/agent-team-orchestrator.md +5 -5
  329. package/presets/mavis/next/rules/code-quality-and-refactoring.md +2 -6
  330. package/presets/mavis/next/rules/feature-delivery-workflow.md +5 -9
  331. package/presets/mavis/next/rules/post-change-lint.md +11 -15
  332. package/presets/mavis/next/rules/preset-pr-checklist.md +2 -2
  333. package/presets/mavis/next/skills/feature-delivery/SKILL.md +1 -1
  334. package/presets/mavis/next/skills/playwright-e2e/SKILL.md +1 -1
  335. package/presets/mavis/next/skills/unit-testing/SKILL.md +1 -1
  336. package/presets/mavis/nuxt/MAVIS.md +2 -6
  337. package/presets/mavis/nuxt/REPO_AGENTS.md +8 -48
  338. package/presets/mavis/nuxt/adapter-map.json +1 -1
  339. package/presets/mavis/nuxt/agents/accessibility-reviewer.md +0 -1
  340. package/presets/mavis/nuxt/agents/api-contract-reviewer.md +0 -1
  341. package/presets/mavis/nuxt/agents/build-verifier.md +2 -2
  342. package/presets/mavis/nuxt/agents/ci-investigator.md +1 -1
  343. package/presets/mavis/nuxt/agents/code-reviewer.md +0 -1
  344. package/presets/mavis/nuxt/agents/codebase-analyzer.md +0 -1
  345. package/presets/mavis/nuxt/agents/debugger.md +1 -1
  346. package/presets/mavis/nuxt/agents/feature-developer.md +3 -3
  347. package/presets/mavis/nuxt/agents/migration-specialist.md +0 -1
  348. package/presets/mavis/nuxt/agents/mockup-reviewer.md +0 -1
  349. package/presets/mavis/nuxt/agents/openspec-author.md +0 -1
  350. package/presets/mavis/nuxt/agents/performance-auditor.md +0 -1
  351. package/presets/mavis/nuxt/agents/playwright-test-generator.md +0 -1
  352. package/presets/mavis/nuxt/agents/playwright-test-healer.md +0 -1
  353. package/presets/mavis/nuxt/agents/playwright-test-planner.md +0 -1
  354. package/presets/mavis/nuxt/agents/qa-tester.md +3 -3
  355. package/presets/mavis/nuxt/agents/security-reviewer.md +0 -1
  356. package/presets/mavis/nuxt/agents/solution-architect.md +0 -1
  357. package/presets/mavis/nuxt/agents/task-analyst.md +0 -1
  358. package/presets/mavis/nuxt/agents/task-router.md +8 -7
  359. package/presets/mavis/nuxt/agents/tech-writer.md +0 -1
  360. package/presets/mavis/nuxt/agents/unit-test-generator.md +0 -1
  361. package/presets/mavis/nuxt/agents/unit-test-healer.md +0 -1
  362. package/presets/mavis/nuxt/agents/unit-test-planner.md +0 -1
  363. package/presets/mavis/nuxt/hooks/chain-team-phases.sh +12 -3
  364. package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +5 -5
  365. package/presets/mavis/nuxt/rules/code-quality-and-refactoring.md +2 -6
  366. package/presets/mavis/nuxt/rules/feature-delivery-workflow.md +3 -7
  367. package/presets/mavis/nuxt/rules/post-change-lint.md +13 -13
  368. package/presets/mavis/nuxt/rules/preset-pr-checklist.md +2 -2
  369. package/presets/mavis/nuxt/skills/feature-delivery/SKILL.md +1 -1
  370. package/presets/mavis/nuxt/skills/playwright-e2e/SKILL.md +1 -1
  371. package/presets/mavis/nuxt/skills/unit-testing/SKILL.md +1 -1
  372. package/presets/mavis/php-hexagonal/MAVIS.md +16 -0
  373. package/presets/mavis/php-hexagonal/REPO_AGENTS.md +7 -47
  374. package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
  375. package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +12 -3
  376. package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +5 -5
  377. package/presets/mavis/php-hexagonal/rules/code-quality-and-refactoring.md +2 -6
  378. package/presets/mavis/php-hexagonal/rules/feature-delivery-workflow.md +3 -7
  379. package/presets/mavis/php-hexagonal/rules/preset-pr-checklist.md +2 -2
  380. package/presets/mavis/php-laravel/MAVIS.md +16 -0
  381. package/presets/mavis/php-laravel/REPO_AGENTS.md +7 -47
  382. package/presets/mavis/php-laravel/adapter-map.json +1 -1
  383. package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +12 -3
  384. package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +5 -5
  385. package/presets/mavis/php-laravel/rules/code-quality-and-refactoring.md +2 -6
  386. package/presets/mavis/php-laravel/rules/feature-delivery-workflow.md +3 -7
  387. package/presets/mavis/php-laravel/rules/preset-pr-checklist.md +2 -2
  388. package/presets/mavis/svelte/MAVIS.md +2 -6
  389. package/presets/mavis/svelte/REPO_AGENTS.md +8 -48
  390. package/presets/mavis/svelte/adapter-map.json +1 -1
  391. package/presets/mavis/svelte/agents/accessibility-reviewer.md +0 -1
  392. package/presets/mavis/svelte/agents/api-contract-reviewer.md +0 -1
  393. package/presets/mavis/svelte/agents/build-verifier.md +2 -2
  394. package/presets/mavis/svelte/agents/ci-investigator.md +1 -1
  395. package/presets/mavis/svelte/agents/code-reviewer.md +0 -1
  396. package/presets/mavis/svelte/agents/codebase-analyzer.md +0 -1
  397. package/presets/mavis/svelte/agents/debugger.md +1 -1
  398. package/presets/mavis/svelte/agents/feature-developer.md +3 -3
  399. package/presets/mavis/svelte/agents/migration-specialist.md +0 -1
  400. package/presets/mavis/svelte/agents/mockup-reviewer.md +0 -1
  401. package/presets/mavis/svelte/agents/openspec-author.md +0 -1
  402. package/presets/mavis/svelte/agents/performance-auditor.md +0 -1
  403. package/presets/mavis/svelte/agents/playwright-test-generator.md +0 -1
  404. package/presets/mavis/svelte/agents/playwright-test-healer.md +0 -1
  405. package/presets/mavis/svelte/agents/playwright-test-planner.md +0 -1
  406. package/presets/mavis/svelte/agents/qa-tester.md +3 -3
  407. package/presets/mavis/svelte/agents/security-reviewer.md +0 -1
  408. package/presets/mavis/svelte/agents/solution-architect.md +0 -1
  409. package/presets/mavis/svelte/agents/task-analyst.md +0 -1
  410. package/presets/mavis/svelte/agents/task-router.md +8 -7
  411. package/presets/mavis/svelte/agents/tech-writer.md +0 -1
  412. package/presets/mavis/svelte/agents/unit-test-generator.md +0 -1
  413. package/presets/mavis/svelte/agents/unit-test-healer.md +0 -1
  414. package/presets/mavis/svelte/agents/unit-test-planner.md +0 -1
  415. package/presets/mavis/svelte/hooks/chain-team-phases.sh +12 -3
  416. package/presets/mavis/svelte/rules/agent-team-orchestrator.md +5 -5
  417. package/presets/mavis/svelte/rules/code-quality-and-refactoring.md +2 -6
  418. package/presets/mavis/svelte/rules/feature-delivery-workflow.md +3 -7
  419. package/presets/mavis/svelte/rules/post-change-lint.md +13 -13
  420. package/presets/mavis/svelte/rules/preset-pr-checklist.md +2 -2
  421. package/presets/mavis/svelte/skills/feature-delivery/SKILL.md +1 -1
  422. package/presets/mavis/svelte/skills/playwright-e2e/SKILL.md +1 -1
  423. package/presets/mavis/svelte/skills/unit-testing/SKILL.md +1 -1
  424. package/presets/opencode/android-kotlin/OPENCODE.md +1 -43
  425. package/presets/opencode/android-kotlin/REPO_AGENTS.md +7 -47
  426. package/presets/opencode/android-kotlin/adapter-map.json +1 -1
  427. package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +12 -3
  428. package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +5 -5
  429. package/presets/opencode/android-kotlin/rules/code-quality-and-refactoring.md +2 -6
  430. package/presets/opencode/android-kotlin/rules/preset-pr-checklist.md +2 -2
  431. package/presets/opencode/go/OPENCODE.md +7 -39
  432. package/presets/opencode/go/REPO_AGENTS.md +7 -47
  433. package/presets/opencode/go/adapter-map.json +1 -1
  434. package/presets/opencode/go/hooks/chain-team-phases.sh +12 -3
  435. package/presets/opencode/go/rules/agent-team-orchestrator.md +5 -5
  436. package/presets/opencode/go/rules/code-quality-and-refactoring.md +2 -6
  437. package/presets/opencode/go/rules/feature-delivery-workflow.md +3 -7
  438. package/presets/opencode/go/rules/preset-pr-checklist.md +2 -2
  439. package/presets/opencode/ios-swift/OPENCODE.md +1 -43
  440. package/presets/opencode/ios-swift/REPO_AGENTS.md +7 -47
  441. package/presets/opencode/ios-swift/adapter-map.json +1 -1
  442. package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +12 -3
  443. package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +5 -5
  444. package/presets/opencode/ios-swift/rules/code-quality-and-refactoring.md +2 -6
  445. package/presets/opencode/ios-swift/rules/feature-delivery-workflow.md +3 -7
  446. package/presets/opencode/ios-swift/rules/preset-pr-checklist.md +2 -2
  447. package/presets/opencode/java/OPENCODE.md +12 -38
  448. package/presets/opencode/java/REPO_AGENTS.md +7 -47
  449. package/presets/opencode/java/adapter-map.json +1 -1
  450. package/presets/opencode/java/hooks/chain-team-phases.sh +12 -3
  451. package/presets/opencode/java/rules/agent-team-orchestrator.md +5 -5
  452. package/presets/opencode/java/rules/code-quality-and-refactoring.md +2 -6
  453. package/presets/opencode/java/rules/feature-delivery-workflow.md +3 -7
  454. package/presets/opencode/java/rules/preset-pr-checklist.md +2 -2
  455. package/presets/opencode/mcp-ts/OPENCODE.md +5 -39
  456. package/presets/opencode/mcp-ts/REPO_AGENTS.md +7 -47
  457. package/presets/opencode/mcp-ts/adapter-map.json +1 -1
  458. package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +12 -3
  459. package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +5 -5
  460. package/presets/opencode/mcp-ts/rules/code-quality-and-refactoring.md +2 -6
  461. package/presets/opencode/mcp-ts/rules/feature-delivery-workflow.md +3 -7
  462. package/presets/opencode/mcp-ts/rules/preset-pr-checklist.md +2 -2
  463. package/presets/opencode/mol/OPENCODE.md +1 -44
  464. package/presets/opencode/mol/REPO_AGENTS.md +9 -49
  465. package/presets/opencode/mol/adapter-map.json +1 -1
  466. package/presets/opencode/mol/hooks/chain-team-phases.sh +12 -3
  467. package/presets/opencode/mol/rules/agent-team-orchestrator.md +5 -5
  468. package/presets/opencode/mol/rules/code-quality-and-refactoring.md +2 -6
  469. package/presets/opencode/mol/rules/feature-delivery-workflow.md +3 -7
  470. package/presets/opencode/mol/rules/preset-pr-checklist.md +2 -2
  471. package/presets/opencode/next/OPENCODE.md +2 -45
  472. package/presets/opencode/next/REPO_AGENTS.md +10 -50
  473. package/presets/opencode/next/adapter-map.json +1 -17
  474. package/presets/opencode/next/agents/accessibility-reviewer.md +0 -1
  475. package/presets/opencode/next/agents/api-contract-reviewer.md +0 -1
  476. package/presets/opencode/next/agents/build-verifier.md +12 -8
  477. package/presets/opencode/next/agents/code-reviewer.md +1 -1
  478. package/presets/opencode/next/agents/codebase-analyzer.md +0 -1
  479. package/presets/opencode/next/agents/feature-developer.md +6 -6
  480. package/presets/opencode/next/agents/migration-specialist.md +0 -1
  481. package/presets/opencode/next/agents/mockup-reviewer.md +0 -1
  482. package/presets/opencode/next/agents/openspec-author.md +0 -1
  483. package/presets/opencode/next/agents/performance-auditor.md +0 -1
  484. package/presets/opencode/next/agents/playwright-test-generator.md +0 -1
  485. package/presets/opencode/next/agents/playwright-test-healer.md +0 -1
  486. package/presets/opencode/next/agents/playwright-test-planner.md +0 -1
  487. package/presets/opencode/next/agents/qa-tester.md +3 -3
  488. package/presets/opencode/next/agents/security-reviewer.md +0 -1
  489. package/presets/opencode/next/agents/solution-architect.md +0 -1
  490. package/presets/opencode/next/agents/task-analyst.md +0 -1
  491. package/presets/opencode/next/agents/task-router.md +8 -7
  492. package/presets/opencode/next/agents/tech-writer.md +0 -1
  493. package/presets/opencode/next/agents/unit-test-generator.md +0 -1
  494. package/presets/opencode/next/agents/unit-test-healer.md +0 -1
  495. package/presets/opencode/next/agents/unit-test-planner.md +0 -1
  496. package/presets/opencode/next/commands/README.md +0 -6
  497. package/presets/opencode/next/hooks/chain-team-phases.sh +12 -3
  498. package/presets/opencode/next/rules/agent-team-orchestrator.md +5 -5
  499. package/presets/opencode/next/rules/code-quality-and-refactoring.md +2 -6
  500. package/presets/opencode/next/rules/feature-delivery-workflow.md +5 -9
  501. package/presets/opencode/next/rules/post-change-lint.md +11 -15
  502. package/presets/opencode/next/rules/preset-pr-checklist.md +2 -2
  503. package/presets/opencode/next/skills/feature-delivery/SKILL.md +1 -1
  504. package/presets/opencode/next/skills/playwright-e2e/SKILL.md +1 -1
  505. package/presets/opencode/next/skills/unit-testing/SKILL.md +1 -1
  506. package/presets/opencode/nuxt/OPENCODE.md +2 -45
  507. package/presets/opencode/nuxt/REPO_AGENTS.md +8 -48
  508. package/presets/opencode/nuxt/adapter-map.json +1 -1
  509. package/presets/opencode/nuxt/agents/accessibility-reviewer.md +0 -1
  510. package/presets/opencode/nuxt/agents/api-contract-reviewer.md +0 -1
  511. package/presets/opencode/nuxt/agents/build-verifier.md +2 -2
  512. package/presets/opencode/nuxt/agents/ci-investigator.md +1 -1
  513. package/presets/opencode/nuxt/agents/code-reviewer.md +0 -1
  514. package/presets/opencode/nuxt/agents/codebase-analyzer.md +0 -1
  515. package/presets/opencode/nuxt/agents/debugger.md +1 -1
  516. package/presets/opencode/nuxt/agents/feature-developer.md +3 -3
  517. package/presets/opencode/nuxt/agents/migration-specialist.md +0 -1
  518. package/presets/opencode/nuxt/agents/mockup-reviewer.md +0 -1
  519. package/presets/opencode/nuxt/agents/openspec-author.md +0 -1
  520. package/presets/opencode/nuxt/agents/performance-auditor.md +0 -1
  521. package/presets/opencode/nuxt/agents/playwright-test-generator.md +0 -1
  522. package/presets/opencode/nuxt/agents/playwright-test-healer.md +0 -1
  523. package/presets/opencode/nuxt/agents/playwright-test-planner.md +0 -1
  524. package/presets/opencode/nuxt/agents/qa-tester.md +3 -3
  525. package/presets/opencode/nuxt/agents/security-reviewer.md +0 -1
  526. package/presets/opencode/nuxt/agents/solution-architect.md +0 -1
  527. package/presets/opencode/nuxt/agents/task-analyst.md +0 -1
  528. package/presets/opencode/nuxt/agents/task-router.md +8 -7
  529. package/presets/opencode/nuxt/agents/tech-writer.md +0 -1
  530. package/presets/opencode/nuxt/agents/unit-test-generator.md +0 -1
  531. package/presets/opencode/nuxt/agents/unit-test-healer.md +0 -1
  532. package/presets/opencode/nuxt/agents/unit-test-planner.md +0 -1
  533. package/presets/opencode/nuxt/hooks/chain-team-phases.sh +12 -3
  534. package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +5 -5
  535. package/presets/opencode/nuxt/rules/code-quality-and-refactoring.md +2 -6
  536. package/presets/opencode/nuxt/rules/feature-delivery-workflow.md +3 -7
  537. package/presets/opencode/nuxt/rules/post-change-lint.md +13 -13
  538. package/presets/opencode/nuxt/rules/preset-pr-checklist.md +2 -2
  539. package/presets/opencode/nuxt/skills/feature-delivery/SKILL.md +1 -1
  540. package/presets/opencode/nuxt/skills/playwright-e2e/SKILL.md +1 -1
  541. package/presets/opencode/nuxt/skills/unit-testing/SKILL.md +1 -1
  542. package/presets/opencode/php-hexagonal/OPENCODE.md +14 -38
  543. package/presets/opencode/php-hexagonal/REPO_AGENTS.md +7 -47
  544. package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
  545. package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +12 -3
  546. package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +5 -5
  547. package/presets/opencode/php-hexagonal/rules/code-quality-and-refactoring.md +2 -6
  548. package/presets/opencode/php-hexagonal/rules/feature-delivery-workflow.md +3 -7
  549. package/presets/opencode/php-hexagonal/rules/preset-pr-checklist.md +2 -2
  550. package/presets/opencode/php-laravel/OPENCODE.md +14 -38
  551. package/presets/opencode/php-laravel/REPO_AGENTS.md +7 -47
  552. package/presets/opencode/php-laravel/adapter-map.json +1 -1
  553. package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +12 -3
  554. package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +5 -5
  555. package/presets/opencode/php-laravel/rules/code-quality-and-refactoring.md +2 -6
  556. package/presets/opencode/php-laravel/rules/feature-delivery-workflow.md +3 -7
  557. package/presets/opencode/php-laravel/rules/preset-pr-checklist.md +2 -2
  558. package/presets/opencode/plugins/output-guard/index.ts +7 -1
  559. package/presets/opencode/plugins/output-guard/ledger.ts +43 -0
  560. package/presets/opencode/plugins/task-status/economy.ts +112 -0
  561. package/presets/opencode/plugins/task-status/task-view.ts +28 -0
  562. package/presets/opencode/plugins/task-status/tui.tsx +14 -2
  563. package/presets/opencode/plugins/task-status/types.ts +3 -1
  564. package/presets/opencode/svelte/OPENCODE.md +2 -45
  565. package/presets/opencode/svelte/REPO_AGENTS.md +8 -48
  566. package/presets/opencode/svelte/adapter-map.json +1 -1
  567. package/presets/opencode/svelte/agents/accessibility-reviewer.md +0 -1
  568. package/presets/opencode/svelte/agents/api-contract-reviewer.md +0 -1
  569. package/presets/opencode/svelte/agents/build-verifier.md +2 -2
  570. package/presets/opencode/svelte/agents/ci-investigator.md +1 -1
  571. package/presets/opencode/svelte/agents/code-reviewer.md +0 -1
  572. package/presets/opencode/svelte/agents/codebase-analyzer.md +0 -1
  573. package/presets/opencode/svelte/agents/debugger.md +1 -1
  574. package/presets/opencode/svelte/agents/feature-developer.md +3 -3
  575. package/presets/opencode/svelte/agents/migration-specialist.md +0 -1
  576. package/presets/opencode/svelte/agents/mockup-reviewer.md +0 -1
  577. package/presets/opencode/svelte/agents/openspec-author.md +0 -1
  578. package/presets/opencode/svelte/agents/performance-auditor.md +0 -1
  579. package/presets/opencode/svelte/agents/playwright-test-generator.md +0 -1
  580. package/presets/opencode/svelte/agents/playwright-test-healer.md +0 -1
  581. package/presets/opencode/svelte/agents/playwright-test-planner.md +0 -1
  582. package/presets/opencode/svelte/agents/qa-tester.md +3 -3
  583. package/presets/opencode/svelte/agents/security-reviewer.md +0 -1
  584. package/presets/opencode/svelte/agents/solution-architect.md +0 -1
  585. package/presets/opencode/svelte/agents/task-analyst.md +0 -1
  586. package/presets/opencode/svelte/agents/task-router.md +8 -7
  587. package/presets/opencode/svelte/agents/tech-writer.md +0 -1
  588. package/presets/opencode/svelte/agents/unit-test-generator.md +0 -1
  589. package/presets/opencode/svelte/agents/unit-test-healer.md +0 -1
  590. package/presets/opencode/svelte/agents/unit-test-planner.md +0 -1
  591. package/presets/opencode/svelte/hooks/chain-team-phases.sh +12 -3
  592. package/presets/opencode/svelte/rules/agent-team-orchestrator.md +5 -5
  593. package/presets/opencode/svelte/rules/code-quality-and-refactoring.md +2 -6
  594. package/presets/opencode/svelte/rules/feature-delivery-workflow.md +3 -7
  595. package/presets/opencode/svelte/rules/post-change-lint.md +13 -13
  596. package/presets/opencode/svelte/rules/preset-pr-checklist.md +2 -2
  597. package/presets/opencode/svelte/skills/feature-delivery/SKILL.md +1 -1
  598. package/presets/opencode/svelte/skills/playwright-e2e/SKILL.md +1 -1
  599. package/presets/opencode/svelte/skills/unit-testing/SKILL.md +1 -1
  600. package/presets/zcode/android-kotlin/REPO_AGENTS.md +7 -47
  601. package/presets/zcode/android-kotlin/adapter-map.json +1 -1
  602. package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +12 -3
  603. package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +5 -5
  604. package/presets/zcode/android-kotlin/rules/code-quality-and-refactoring.md +2 -6
  605. package/presets/zcode/android-kotlin/rules/preset-pr-checklist.md +2 -2
  606. package/presets/zcode/go/REPO_AGENTS.md +7 -47
  607. package/presets/zcode/go/adapter-map.json +1 -1
  608. package/presets/zcode/go/hooks/chain-team-phases.sh +12 -3
  609. package/presets/zcode/go/rules/agent-team-orchestrator.md +5 -5
  610. package/presets/zcode/go/rules/code-quality-and-refactoring.md +2 -6
  611. package/presets/zcode/go/rules/feature-delivery-workflow.md +3 -7
  612. package/presets/zcode/go/rules/preset-pr-checklist.md +2 -2
  613. package/presets/zcode/ios-swift/REPO_AGENTS.md +7 -47
  614. package/presets/zcode/ios-swift/adapter-map.json +1 -1
  615. package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +12 -3
  616. package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +5 -5
  617. package/presets/zcode/ios-swift/rules/code-quality-and-refactoring.md +2 -6
  618. package/presets/zcode/ios-swift/rules/feature-delivery-workflow.md +3 -7
  619. package/presets/zcode/ios-swift/rules/preset-pr-checklist.md +2 -2
  620. package/presets/zcode/java/REPO_AGENTS.md +7 -47
  621. package/presets/zcode/java/adapter-map.json +1 -1
  622. package/presets/zcode/java/hooks/chain-team-phases.sh +12 -3
  623. package/presets/zcode/java/rules/agent-team-orchestrator.md +5 -5
  624. package/presets/zcode/java/rules/code-quality-and-refactoring.md +2 -6
  625. package/presets/zcode/java/rules/feature-delivery-workflow.md +3 -7
  626. package/presets/zcode/java/rules/preset-pr-checklist.md +2 -2
  627. package/presets/zcode/mcp-ts/REPO_AGENTS.md +7 -47
  628. package/presets/zcode/mcp-ts/adapter-map.json +1 -1
  629. package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +12 -3
  630. package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +5 -5
  631. package/presets/zcode/mcp-ts/rules/code-quality-and-refactoring.md +2 -6
  632. package/presets/zcode/mcp-ts/rules/feature-delivery-workflow.md +3 -7
  633. package/presets/zcode/mcp-ts/rules/preset-pr-checklist.md +2 -2
  634. package/presets/zcode/mol/REPO_AGENTS.md +9 -49
  635. package/presets/zcode/mol/adapter-map.json +1 -1
  636. package/presets/zcode/mol/hooks/chain-team-phases.sh +12 -3
  637. package/presets/zcode/mol/rules/agent-team-orchestrator.md +5 -5
  638. package/presets/zcode/mol/rules/code-quality-and-refactoring.md +2 -6
  639. package/presets/zcode/mol/rules/feature-delivery-workflow.md +3 -7
  640. package/presets/zcode/mol/rules/preset-pr-checklist.md +2 -2
  641. package/presets/zcode/next/REPO_AGENTS.md +10 -50
  642. package/presets/zcode/next/adapter-map.json +1 -17
  643. package/presets/zcode/next/agents/accessibility-reviewer.md +0 -1
  644. package/presets/zcode/next/agents/api-contract-reviewer.md +0 -1
  645. package/presets/zcode/next/agents/build-verifier.md +12 -8
  646. package/presets/zcode/next/agents/code-reviewer.md +1 -1
  647. package/presets/zcode/next/agents/codebase-analyzer.md +0 -1
  648. package/presets/zcode/next/agents/feature-developer.md +6 -6
  649. package/presets/zcode/next/agents/migration-specialist.md +0 -1
  650. package/presets/zcode/next/agents/mockup-reviewer.md +0 -1
  651. package/presets/zcode/next/agents/openspec-author.md +0 -1
  652. package/presets/zcode/next/agents/performance-auditor.md +0 -1
  653. package/presets/zcode/next/agents/playwright-test-generator.md +0 -1
  654. package/presets/zcode/next/agents/playwright-test-healer.md +0 -1
  655. package/presets/zcode/next/agents/playwright-test-planner.md +0 -1
  656. package/presets/zcode/next/agents/qa-tester.md +3 -3
  657. package/presets/zcode/next/agents/security-reviewer.md +0 -1
  658. package/presets/zcode/next/agents/solution-architect.md +0 -1
  659. package/presets/zcode/next/agents/task-analyst.md +0 -1
  660. package/presets/zcode/next/agents/task-router.md +8 -7
  661. package/presets/zcode/next/agents/tech-writer.md +0 -1
  662. package/presets/zcode/next/agents/unit-test-generator.md +0 -1
  663. package/presets/zcode/next/agents/unit-test-healer.md +0 -1
  664. package/presets/zcode/next/agents/unit-test-planner.md +0 -1
  665. package/presets/zcode/next/commands/README.md +0 -6
  666. package/presets/zcode/next/hooks/chain-team-phases.sh +12 -3
  667. package/presets/zcode/next/rules/agent-team-orchestrator.md +5 -5
  668. package/presets/zcode/next/rules/code-quality-and-refactoring.md +2 -6
  669. package/presets/zcode/next/rules/feature-delivery-workflow.md +5 -9
  670. package/presets/zcode/next/rules/post-change-lint.md +11 -15
  671. package/presets/zcode/next/rules/preset-pr-checklist.md +2 -2
  672. package/presets/zcode/next/skills/feature-delivery/SKILL.md +1 -1
  673. package/presets/zcode/next/skills/playwright-e2e/SKILL.md +1 -1
  674. package/presets/zcode/next/skills/unit-testing/SKILL.md +1 -1
  675. package/presets/zcode/nuxt/REPO_AGENTS.md +8 -48
  676. package/presets/zcode/nuxt/adapter-map.json +1 -1
  677. package/presets/zcode/nuxt/agents/accessibility-reviewer.md +0 -1
  678. package/presets/zcode/nuxt/agents/api-contract-reviewer.md +0 -1
  679. package/presets/zcode/nuxt/agents/build-verifier.md +2 -2
  680. package/presets/zcode/nuxt/agents/ci-investigator.md +1 -1
  681. package/presets/zcode/nuxt/agents/code-reviewer.md +0 -1
  682. package/presets/zcode/nuxt/agents/codebase-analyzer.md +0 -1
  683. package/presets/zcode/nuxt/agents/debugger.md +1 -1
  684. package/presets/zcode/nuxt/agents/feature-developer.md +3 -3
  685. package/presets/zcode/nuxt/agents/migration-specialist.md +0 -1
  686. package/presets/zcode/nuxt/agents/mockup-reviewer.md +0 -1
  687. package/presets/zcode/nuxt/agents/openspec-author.md +0 -1
  688. package/presets/zcode/nuxt/agents/performance-auditor.md +0 -1
  689. package/presets/zcode/nuxt/agents/playwright-test-generator.md +0 -1
  690. package/presets/zcode/nuxt/agents/playwright-test-healer.md +0 -1
  691. package/presets/zcode/nuxt/agents/playwright-test-planner.md +0 -1
  692. package/presets/zcode/nuxt/agents/qa-tester.md +3 -3
  693. package/presets/zcode/nuxt/agents/security-reviewer.md +0 -1
  694. package/presets/zcode/nuxt/agents/solution-architect.md +0 -1
  695. package/presets/zcode/nuxt/agents/task-analyst.md +0 -1
  696. package/presets/zcode/nuxt/agents/task-router.md +8 -7
  697. package/presets/zcode/nuxt/agents/tech-writer.md +0 -1
  698. package/presets/zcode/nuxt/agents/unit-test-generator.md +0 -1
  699. package/presets/zcode/nuxt/agents/unit-test-healer.md +0 -1
  700. package/presets/zcode/nuxt/agents/unit-test-planner.md +0 -1
  701. package/presets/zcode/nuxt/hooks/chain-team-phases.sh +12 -3
  702. package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +5 -5
  703. package/presets/zcode/nuxt/rules/code-quality-and-refactoring.md +2 -6
  704. package/presets/zcode/nuxt/rules/feature-delivery-workflow.md +3 -7
  705. package/presets/zcode/nuxt/rules/post-change-lint.md +13 -13
  706. package/presets/zcode/nuxt/rules/preset-pr-checklist.md +2 -2
  707. package/presets/zcode/nuxt/skills/feature-delivery/SKILL.md +1 -1
  708. package/presets/zcode/nuxt/skills/playwright-e2e/SKILL.md +1 -1
  709. package/presets/zcode/nuxt/skills/unit-testing/SKILL.md +1 -1
  710. package/presets/zcode/php-hexagonal/REPO_AGENTS.md +7 -47
  711. package/presets/zcode/php-hexagonal/adapter-map.json +1 -1
  712. package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +12 -3
  713. package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +5 -5
  714. package/presets/zcode/php-hexagonal/rules/code-quality-and-refactoring.md +2 -6
  715. package/presets/zcode/php-hexagonal/rules/feature-delivery-workflow.md +3 -7
  716. package/presets/zcode/php-hexagonal/rules/preset-pr-checklist.md +2 -2
  717. package/presets/zcode/php-laravel/REPO_AGENTS.md +7 -47
  718. package/presets/zcode/php-laravel/adapter-map.json +1 -1
  719. package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +12 -3
  720. package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +5 -5
  721. package/presets/zcode/php-laravel/rules/code-quality-and-refactoring.md +2 -6
  722. package/presets/zcode/php-laravel/rules/feature-delivery-workflow.md +3 -7
  723. package/presets/zcode/php-laravel/rules/preset-pr-checklist.md +2 -2
  724. package/presets/zcode/svelte/REPO_AGENTS.md +8 -48
  725. package/presets/zcode/svelte/adapter-map.json +1 -1
  726. package/presets/zcode/svelte/agents/accessibility-reviewer.md +0 -1
  727. package/presets/zcode/svelte/agents/api-contract-reviewer.md +0 -1
  728. package/presets/zcode/svelte/agents/build-verifier.md +2 -2
  729. package/presets/zcode/svelte/agents/ci-investigator.md +1 -1
  730. package/presets/zcode/svelte/agents/code-reviewer.md +0 -1
  731. package/presets/zcode/svelte/agents/codebase-analyzer.md +0 -1
  732. package/presets/zcode/svelte/agents/debugger.md +1 -1
  733. package/presets/zcode/svelte/agents/feature-developer.md +3 -3
  734. package/presets/zcode/svelte/agents/migration-specialist.md +0 -1
  735. package/presets/zcode/svelte/agents/mockup-reviewer.md +0 -1
  736. package/presets/zcode/svelte/agents/openspec-author.md +0 -1
  737. package/presets/zcode/svelte/agents/performance-auditor.md +0 -1
  738. package/presets/zcode/svelte/agents/playwright-test-generator.md +0 -1
  739. package/presets/zcode/svelte/agents/playwright-test-healer.md +0 -1
  740. package/presets/zcode/svelte/agents/playwright-test-planner.md +0 -1
  741. package/presets/zcode/svelte/agents/qa-tester.md +3 -3
  742. package/presets/zcode/svelte/agents/security-reviewer.md +0 -1
  743. package/presets/zcode/svelte/agents/solution-architect.md +0 -1
  744. package/presets/zcode/svelte/agents/task-analyst.md +0 -1
  745. package/presets/zcode/svelte/agents/task-router.md +8 -7
  746. package/presets/zcode/svelte/agents/tech-writer.md +0 -1
  747. package/presets/zcode/svelte/agents/unit-test-generator.md +0 -1
  748. package/presets/zcode/svelte/agents/unit-test-healer.md +0 -1
  749. package/presets/zcode/svelte/agents/unit-test-planner.md +0 -1
  750. package/presets/zcode/svelte/hooks/chain-team-phases.sh +12 -3
  751. package/presets/zcode/svelte/rules/agent-team-orchestrator.md +5 -5
  752. package/presets/zcode/svelte/rules/code-quality-and-refactoring.md +2 -6
  753. package/presets/zcode/svelte/rules/feature-delivery-workflow.md +3 -7
  754. package/presets/zcode/svelte/rules/post-change-lint.md +13 -13
  755. package/presets/zcode/svelte/rules/preset-pr-checklist.md +2 -2
  756. package/presets/zcode/svelte/skills/feature-delivery/SKILL.md +1 -1
  757. package/presets/zcode/svelte/skills/playwright-e2e/SKILL.md +1 -1
  758. package/presets/zcode/svelte/skills/unit-testing/SKILL.md +1 -1
  759. package/presets/_shared/ai-local/scripts/team-db-dashboard.mjs +0 -2103
  760. package/presets/_shared/ai-local/scripts/team-db-ui.mjs +0 -750
  761. package/presets/claude/next/commands/ui-start.md +0 -78
  762. package/presets/claude/next/commands/ui-stop.md +0 -71
  763. package/presets/cursor/next/commands/ui-start.md +0 -78
  764. package/presets/cursor/next/commands/ui-stop.md +0 -71
  765. package/presets/mavis/next/commands/ui-start.md +0 -73
  766. package/presets/mavis/next/commands/ui-stop.md +0 -66
  767. package/presets/opencode/next/commands/ui-start.md +0 -81
  768. package/presets/opencode/next/commands/ui-stop.md +0 -74
  769. package/presets/zcode/next/commands/ui-start.md +0 -81
  770. package/presets/zcode/next/commands/ui-stop.md +0 -74
@@ -29,7 +29,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
29
29
  - [ ] **UI-only surfaces:** `mockup-reviewer`, `accessibility-reviewer`, `ux-design`, and the stack performance skill ship only on UI stacks (`check-preset-leakage.sh`)
30
30
  - [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn release:gate`; keep every registered golden stem paired
31
31
  - [ ] **Anti-hallucination:** `check-anti-hallucination-coverage.mjs` is green inside `yarn release:gate`. Every role loads `anti-hallucination-contract`. Writer roles, including `code-reviewer`, also load `STACK_FLOOR_STEMS`. Register a new skill family in `SKILL_CONTRACT_CLASS` (`writer` or `reader`) or the gate FAILs.
32
- - [ ] **Gate:** `yarn check:fast` in the loop; `yarn release:gate` from `packages/ai-rules/` before a release (full composite: twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
32
+ - [ ] **Gate:** `yarn check:task <slug>` (or `yarn check:changed` on a clean tree) and the gates it names; `yarn check:fast` only when it names none; `yarn release:gate` from `packages/ai-rules/` before a release (full composite: twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
33
33
 
34
34
  ## Pointers
35
35
 
@@ -39,7 +39,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
39
39
  - Sync: `preset-twin-sync`
40
40
  - Budget: `preset-token-budget`
41
41
  - Leakage: `preset-no-cross-stack-leakage`
42
- - Validation: `yarn check:fast` in the loop (`packages/ai-rules/scripts/check-preset-fast.sh`); `yarn release:gate` before a release (`packages/ai-rules/scripts/release-gate.sh`)
42
+ - Validation: same `check:task` / `check:changed` loop; `yarn release:gate` before a release (`packages/ai-rules/scripts/release-gate.sh`)
43
43
  - Dogfood scripts: `packages/ai-rules/scripts/sync-dogfood-cursor.sh`, `sync-dogfood-claude.sh`, `sync-dogfood-mavis.sh`, `sync-dogfood-opencode.sh`
44
44
  - Drift script: `packages/ai-rules/scripts/check-shared-core-drift.sh`
45
45
  - Orchestrator: when editing presets, load this checklist + twin-sync
@@ -5,33 +5,14 @@ Cross-tool repo-root guide. Tool-specific maps stay under `.cursor/AGENTS.md`, `
5
5
  ## Cross-tool setup
6
6
 
7
7
  - Treat this file as the **shared** entry for any agent (Cursor, Claude Code, Mavis, OpenCode, ZCode, or other).
8
- - All five platforms ship **the same** root file. `init` overwrites it; content does not depend on which tool ran last.
9
- - Tool maps (agent-team tables, slash commands) live in `.cursor/AGENTS.md` / `.claude/CLAUDE.md` / `.mavis/AGENTS.md` / `.opencode/AGENTS.md` — use them when that tool is installed.
10
- - **Language.** On every user message, before you answer, resolve the dialogue language and answer in the user's **native language** (`.ai.local/conventions.md` `## Language`, else the prompt language, else English), including a question and a message without a slash command. Commands reuse this resolution. Development, reasoning, and artifacts stay **English**. See the `language-policy` rule.
11
- - Install:
12
-
13
- ```bash
14
- npx @bonesofspring/ai-rules init multi --preset ios-swift
15
- ```
16
-
17
- Refresh tools already installed in this repository, keeping each recorded preset (`/update` runs the same command):
18
-
19
- ```bash
20
- npx @bonesofspring/ai-rules update
21
- ```
22
-
23
- Per-tool: `init cursor|claude|mavis|opencode|zcode --preset ios-swift`. `init` overwrites this file from the preset (`REPO_AGENTS.md` → `AGENTS.md`). `clean` of one tool leaves this file if another tool install remains. Living gotchas belong in `.ai.local/conventions.md`, not here.
8
+ - Every installed platform ships **the same** root file; `init` overwrites it from the preset (`REPO_AGENTS.md` → `AGENTS.md`). `clean` of one tool leaves it while another install remains.
9
+ - Tool maps — agent team, slash commands, always-on rules — live in `.cursor/AGENTS.md`, `.claude/CLAUDE.md`, `.mavis/AGENTS.md`, `.opencode/AGENTS.md`. ZCode loads this file natively and has no per-tool map. Read the map for the tool you run in; do not read another installed tool's tree.
10
+ - **Language.** On every user message, resolve the dialogue language and answer in the user's **native language**: a `language:` stored for an active task, else `## Language` in the nearest `.ai.local/conventions.md`, else the prompt language, else English. Development, reasoning, and artifacts stay **English** (see `language-policy`).
11
+ - Install / refresh: `npx @bonesofspring/ai-rules init multi --preset ios-swift` (`/update` runs `init update`); MCP catalog: `init mcp`.
24
12
 
25
13
  ## Presence-based load
26
14
 
27
- Read the map and the essential rules for the tool you are running in. Do not preload the full catalog. Do not read the other installed tool trees — their copies of the same rules belong to that host.
28
-
29
- - Cursor host: `.cursor/AGENTS.md`. Always-on rules are already injected.
30
- - Claude Code host: `.claude/CLAUDE.md`. Session-start rules are already injected.
31
- - Mavis host: read `.mavis/AGENTS.md`, then `.mavis/rules/ios-app-core.md`, `.mavis/rules/architecture-boundaries.md`, `.mavis/rules/code-quality-and-refactoring.md`, `.mavis/rules/ai-local-overlay.md`.
32
- - OpenCode host: read `.opencode/AGENTS.md`, then `.opencode/rules/ios-app-core.md`, `.opencode/rules/architecture-boundaries.md`, `.opencode/rules/code-quality-and-refactoring.md`, `.opencode/rules/ai-local-overlay.md`.
33
-
34
- Mavis has no native rule discovery without those root paths. OpenCode has no `alwaysApply` engine — those root-entry files are its always-on set.
15
+ Read the map and the essential rules for the tool you are running in; that map lists them. Do not preload the full catalog. Do not read another installed tool's tree — its copies of the same rules belong to that host.
35
16
 
36
17
  ## Pipelines are shared
37
18
 
@@ -66,33 +47,12 @@ Empty output or a failed run stays silent.
66
47
  - Review destructive git before running; respect shell hooks.
67
48
  - Do not skip signing / CI gates unless the user explicitly asks.
68
49
 
69
- ## Tool entry points
70
-
71
- | Tool | Map |
72
- |------|-----|
73
- | Cursor | `.cursor/AGENTS.md` (optional if Cursor not installed) |
74
- | Claude Code | `.claude/CLAUDE.md` (optional if Claude not installed) |
75
- | Mavis | `.mavis/AGENTS.md` (optional if Mavis not installed) |
76
- | OpenCode | `.opencode/AGENTS.md` (optional if OpenCode not installed) |
77
- | ZCode | this file — loaded natively, no per-tool copy |
78
-
79
- Rules: `.cursor/rules/`, `.claude/rules/`, `.mavis/rules/`, `.opencode/rules/`, or `.zcode/rules/`.
80
- Skills: `.cursor/skills/`, `.claude/skills/`, `.mavis/skills/`, `.opencode/skills/`, or `.zcode/skills/`.
81
-
82
- ## ZCode host
83
-
84
- ZCode loads this file natively and has no per-tool map: this file is the entry. Read the essential rules under `.zcode/rules/` (plain Markdown) when the task scope matches their subject, and use the agents in `.zcode/agents/`, commands in `.zcode/commands/`, and skills in `.zcode/skills/` as the pipeline directs.
85
- On the first reply of a session, run `node .zcode/hooks/check-preset-update.mjs` when it exists; the notice rules above apply.
86
- On every turn, run `node .zcode/hooks/list-ai-local.mjs` with the paths this step will touch, apply the printed `.ai.local/rules/*.md` and `.ai.local/conventions.md`, and acknowledge `Using .ai.local: <rule-name>`. Authoring guide: `docs/LOCAL-OVERLAY.md` in the `@bonesofspring/ai-rules` package.
87
-
88
50
  ## Living conventions
89
51
 
90
52
  Gotchas, local patterns, and team decisions: **`.ai.local/conventions.md`** (fill after init; `init` does not overwrite it).
91
53
 
92
54
  ## Local overlay (`.ai.local/`) — MANDATORY
93
55
 
94
- A `.ai.local/` directory MAY exist at the repo root or at any nesting depth in monorepos. **All agents MUST read and apply it on every turn.** Rules there override preset rules; in conflicts, the local rule wins. `override: kill <preset-rule-name>` drops the named preset rule from the agent's context entirely.
95
-
96
- Plain markdown rules under `.ai.local/rules/*.md` are read by the agent with higher priority than preset rules. Living gotchas live in `.ai.local/conventions.md`.
56
+ A `.ai.local/` directory MAY exist at the repo root or at any nesting depth in monorepos. **Every agent MUST read and apply it on every turn.** Rules there override preset rules; `override: kill <preset-rule-name>` drops that preset rule from context entirely.
97
57
 
98
- On every turn, run `list-ai-local.mjs` from the host hooks directory (`.cursor`, `.claude`, `.mavis`, `.opencode`, or `.zcode`) with the paths this step will touch, apply the printed `.ai.local/rules/*.md` and `.ai.local/conventions.md`, and acknowledge `Using .ai.local: <rule-name>`. Authoring guide: `docs/LOCAL-OVERLAY.md` in the `@bonesofspring/ai-rules` package. The `ai-local-overlay` rule is always-on on Cursor and session-start on Claude (no `paths:`). Mavis and OpenCode have no native `alwaysApply`; this section plus the platform entry's essential-rules list is the reinforcement.
58
+ On every turn, run `list-ai-local.mjs` from the host hooks directory (`.cursor`, `.claude`, `.mavis`, `.opencode`, or `.zcode`) with the paths this step will touch, then apply the printed `.ai.local/rules/*.md` and `.ai.local/conventions.md`. The root overlay applies to every path; a nested one applies only under its directory. Do not read `shadowed` files or `rules-library/**` as rules. Acknowledge `Using .ai.local: <rule-name>` when answering. Authoring guide: `docs/LOCAL-OVERLAY.md`.
@@ -3,7 +3,7 @@
3
3
  "platform": "zcode",
4
4
  "stack": "ios-swift",
5
5
  "semanticSource": "cursor/ios-swift",
6
- "sourceRevision": "2ccc97fbc9cfcda17c06b3b49304e1f0a4b2efa7633eb05ab41874ac3f5acd76",
6
+ "sourceRevision": "e00dee906859658da2b1c6a07b3793a51b90ff9a47f377c4dc45fd72e9ee8403",
7
7
  "entries": [
8
8
  {
9
9
  "source": "AGENTS.md",
@@ -2652,7 +2652,16 @@ if (status.state === 'changes_requested') {
2652
2652
  process.stdout.write('{}');
2653
2653
  process.exit(0);
2654
2654
  }
2655
- const retryAfterFixStepIndex = typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0;
2655
+ const reviewerStepIndex = typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0;
2656
+ let verifierStepIndex = -1;
2657
+ for (let index = reviewerStepIndex - 1; index >= 0; index -= 1) {
2658
+ if (getStepAgents(steps[index]).includes('build-verifier')) {
2659
+ verifierStepIndex = index;
2660
+ break;
2661
+ }
2662
+ }
2663
+ const retryGate = verifierStepIndex >= 0 ? 'build-verifier' : reviewer;
2664
+ const retryAfterFixStepIndex = verifierStepIndex >= 0 ? verifierStepIndex : reviewerStepIndex;
2656
2665
  const developerIndex = scheduleRetry('feature-developer', reviewer, finishedAttempt);
2657
2666
  if (developerIndex < 0) {
2658
2667
  beginHumanGate();
@@ -2665,10 +2674,10 @@ if (status.state === 'changes_requested') {
2665
2674
  currentAgent: 'feature-developer',
2666
2675
  state: 'in_progress',
2667
2676
  phase: 'executing',
2668
- retryAfterFix: reviewer,
2677
+ retryAfterFix: retryGate,
2669
2678
  retryAfterFixStepIndex,
2670
2679
  });
2671
- out(handoffForAgent('feature-developer', steps[developerIndex]?.scope, steps[developerIndex]) + ` After fixes, re-run ${reviewer}.`);
2680
+ out(handoffForAgent('feature-developer', steps[developerIndex]?.scope, steps[developerIndex]) + ` After fixes, re-run ${retryGate}.`);
2672
2681
  process.exit(0);
2673
2682
  }
2674
2683
 
@@ -201,8 +201,8 @@ Additional states: `blocked` — a step (or a parallel producer) cannot proceed;
201
201
  | `in_progress` | Current step running |
202
202
  | `completed` | Current step done; hook advances |
203
203
  | `awaiting_approval` | Human gate; wait for `/task-continue` |
204
- | `changes_requested` | Reviewer blocked; re-run developer (`retryAfterFix`) |
205
- | `validation_failed` | build-verifier failed; re-run developer then build-verifier |
204
+ | `changes_requested` | Reviewer blocked; re-run developer → `build-verifier` (delta) → same reviewer when the fix touches code/tests; docs/artifacts only → same reviewer |
205
+ | `validation_failed` | build-verifier failed; re-run developer then `build-verifier` (delta) |
206
206
  | `blocked` | Pipeline / step cannot proceed (e.g. `pipeline_parse_error`, completion of a parallel step whose producer's receipt was missing — see `agent-artifact-contracts.md` § Completion receipts) |
207
207
  | `awaiting_artifact_receipt` | Producer stopped but the bound or assigned-output receipt was missing or stale; hook keeps the attempt active and does not advance. See `agent-artifact-contracts.md` (Schema field name + Receipt binding) for the silent-bug class that lands here. |
208
208
  | `paused` | Operator sentinel engaged; the hook recorded the pause and refused to advance or hand off. Remove the sentinel and run `/task-continue`. |
@@ -242,8 +242,8 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
242
242
  3. One role per Task call — **except** parallel steps: multiple Task calls in one message.
243
243
  4. **Never** skip `humanGates` without `/task-continue` or explicit user approval.
244
244
  5. Persist handoffs to disk (`brief.md`, `decomposition.md`, `debug-report.md`, `validation-report.md`, `architecture.md`, `migration-plan.md`, `ci-report.md`, `a11y-review.md`, `perf-report.md`, `security-review.md`, `api-contract-review.md`, `unit-test-plan.md`, `documentation.md`, `review.md`, `mockup-review.md`, `ux-design.md`) and update the producer-owned terminal receipt in `artifact-manifest.json`.
245
- 6. On `changes_requested` from reviewers: hook sets `retryAfterFix` → developer → same reviewer. Exception: embedded `mockup-reviewer` FAIL (`changes_requested` while the completed/current agent is `mockup-reviewer`) → `awaiting_approval` / `/task-continue` only — do **not** `retryAfterFix` to developer. A `mockup-reviewer` verdict `mockup-change-requested` (a defect whose fix belongs in the design source, not the implementation) routes the same way — `awaiting_approval`, no developer retry.
246
- 7. On `validation_failed` from `build-verifier`: hook sets `retryAfterFix: build-verifier` → developer → build-verifier.
245
+ 6. On `changes_requested` from reviewers: hook sets `retryAfterFix` → developer → `build-verifier` (delta) → same reviewer when the fix touches code/tests; a docs/artifacts-only fix returns to the same reviewer without a code gate. Exception: embedded `mockup-reviewer` FAIL (`changes_requested` while the completed/current agent is `mockup-reviewer`) → `awaiting_approval` / `/task-continue` only — do **not** `retryAfterFix` to developer. A `mockup-reviewer` verdict `mockup-change-requested` (a defect whose fix belongs in the design source, not the implementation) routes the same way — `awaiting_approval`, no developer retry.
246
+ 7. On `validation_failed` from `build-verifier`: hook sets `retryAfterFix: build-verifier` → developer → build-verifier (delta).
247
247
  8. When all steps complete, suggest `/technical-retro <slug>`.
248
248
  9. If `autoChain: false` in pipeline, do not rely on hook — manual step only.
249
249
  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. A message that explicitly addresses a **closed** slug follows the same ledger with the `post-terminal` marker — append-only, no reopen, one bounded `sync --slug`; see § Team artifact I/O.
@@ -280,7 +280,7 @@ Use Task tool or `/agent-name`. Pass: slug, artifact paths, step `scope` if set.
280
280
  **Token usage.** When the host exposes token counts, append a `usage_recorded` event next to the attempt:
281
281
 
282
282
  ```bash
283
- node .ai.local/scripts/record-usage.mjs --task <slug> --attempt <attemptId> --input <n> --output <n> [--cached <n>] [--model <id>]
283
+ node .ai.local/scripts/record-usage.mjs --task <slug> --attempt <attemptId> --input <n> --output <n> [--cached <n>] [--cache-write <n>] [--reasoning <n>] [--turn <turnId>] [--model <id>]
284
284
  ```
285
285
 
286
286
  The chain hook also forwards a `usage` object from its input into the `attempt_finished` event. Never estimate or invent token counts; a missing usage record stays missing.
@@ -7,12 +7,8 @@
7
7
 
8
8
  # Principles
9
9
 
10
- - **KISS:** the simplest change in the repository’s patterns.
11
- - **DRY + Rule of Three:** share only after the 3rd repetition (wrong abstraction costs more than duplication).
12
- - **YAGNI:** no APIs, flags, or “for later” layers without a current requirement.
13
- - **SOLID:** S — one reason to change; O — composition/new implementations; L — subtype contract; I — narrow ports; D — abstractions (ports), details in stack adapters.
14
- - **CUPID:** Composable; Unix philosophy (one responsibility); Predictable; Idiomatic (repo); Domain-based.
15
- - **Composition over inheritance;** Law of Demeter — no `a.b.c.d` chains; via public API / facade.
10
+ - **KISS / YAGNI / DRY (Rule of Three):** the simplest change in the repository’s patterns; share after the 3rd repetition; no “for later” APIs, flags, or layers.
11
+ - **SOLID / CUPID, applied:** composition over inheritance; one reason to change; narrow ports; no `a.b.c.d` chains — go through a public API or facade.
16
12
 
17
13
  # Over-abstraction guardrails
18
14
 
@@ -12,7 +12,7 @@ Typical feature with data and UI. Concrete directories and rule stems — in the
12
12
  4. **State** — store / ViewModel / use cases; no direct HTTP and no DTOs in UI.
13
13
  5. **UI** — thin views/components; data via state; design system. If the prompt or `brief.md` contains a `figma.com` URL, **mockup review must complete** (or the user must continue past FAIL/`BLOCKED_MCP` via `/task-continue`) **before UI work**. When required-signal and **no** `figma.com`, **`ux-design.md` must exist** (not `INCOMPLETE`) before UI work — else blocked, hand back to analyst. Non-UI tasks no-op these gates. When a mockup contract exists for the WP, the UI step consumes it (per-node spec = the binding baseline) and a post-implementation verification gate runs against it (scope per `mockup-review` § Post-implementation gate) — screenshot / value / state / structural-parity diff plus a freeze re-check; unmapped implemented components are findings, not silent additions.
14
14
  6. **Tests** — unit for mappers / non-trivial logic; e2e/UI per stack convention.
15
- 7. **Completion** — stack post-change gate (lint/build) + package/toolchain rules. When the current WP spans **more than one** layer or module, `implementation.md` includes a **Code Map** (3–8 annotated repo-relative paths) and **Suggested Review Order** (`concern | path:line | ≤15 word note`). Omit both for a single-file or single-layer WP.
15
+ 7. **Completion** — closure gate: `build-verifier` runs the stack gate set **once**, after the last authoring step. During Build (steps 1–6) do not run project lint/test/build; author code and tests. When the current WP spans **more than one** layer or module, `implementation.md` includes a **Code Map** (3–8 annotated repo-relative paths) and **Suggested Review Order** (`concern | path:line | ≤15 word note`). Omit both for a single-file or single-layer WP.
16
16
 
17
17
  ## Context hygiene
18
18
 
@@ -20,13 +20,9 @@ A command whose output can exceed ~4 KB — a test run, a build/lint log, `git l
20
20
 
21
21
  ## Iterative refinement loop
22
22
 
23
- Every stage runs the named loop **draft → evaluate against named criteria → refine**:
23
+ Every stage runs the named loop **draft → structural evaluation → refine** against a named oracle: reference-feature parity, layer/import shape, schema/contract parity, or review. The oracle is **not** a project test run. Tests are authored in the stage and executed by the closure gate; a failing test is closure evidence, not a per-stage trigger. When `implementationRail: tdd` is explicitly on, targeted tests are the documented cadence exception.
24
24
 
25
- - **Draft** the artifact (or work package) for the stage.
26
- - **Evaluate** it against the stage's "done when" / exit criteria with the **named oracle** — a structural gate, a reviewer parity check, a test suite, or a human approval.
27
- - **Refine** and re-evaluate until the oracle passes or the human re-scopes; loop back to the owning task, never forward past a failed oracle.
28
-
29
- **Exit criteria:** a layer or stage is complete only when its named criteria hold (mapper tests green, parity check passes, gate output clean). Do not advance to the next checklist step while the current step's oracle fails; a repeatedly failing oracle triggers **plan revision**.
25
+ **Exit criteria:** a layer or stage is complete only when its structural criteria hold (reference parity, barrel/import shape, authored test present). Do not advance to the next checklist step while the current step's oracle fails; a repeatedly failing oracle triggers **plan revision**.
30
26
 
31
27
  ## Data flow (orientation)
32
28
 
@@ -29,7 +29,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
29
29
  - [ ] **UI-only surfaces:** `mockup-reviewer`, `accessibility-reviewer`, `ux-design`, and the stack performance skill ship only on UI stacks (`check-preset-leakage.sh`)
30
30
  - [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn release:gate`; keep every registered golden stem paired
31
31
  - [ ] **Anti-hallucination:** `check-anti-hallucination-coverage.mjs` is green inside `yarn release:gate`. Every role loads `anti-hallucination-contract`. Writer roles, including `code-reviewer`, also load `STACK_FLOOR_STEMS`. Register a new skill family in `SKILL_CONTRACT_CLASS` (`writer` or `reader`) or the gate FAILs.
32
- - [ ] **Gate:** `yarn check:fast` in the loop; `yarn release:gate` from `packages/ai-rules/` before a release (full composite: twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
32
+ - [ ] **Gate:** `yarn check:task <slug>` (or `yarn check:changed` on a clean tree) and the gates it names; `yarn check:fast` only when it names none; `yarn release:gate` from `packages/ai-rules/` before a release (full composite: twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
33
33
 
34
34
  ## Pointers
35
35
 
@@ -39,7 +39,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
39
39
  - Sync: `preset-twin-sync`
40
40
  - Budget: `preset-token-budget`
41
41
  - Leakage: `preset-no-cross-stack-leakage`
42
- - Validation: `yarn check:fast` in the loop (`packages/ai-rules/scripts/check-preset-fast.sh`); `yarn release:gate` before a release (`packages/ai-rules/scripts/release-gate.sh`)
42
+ - Validation: same `check:task` / `check:changed` loop; `yarn release:gate` before a release (`packages/ai-rules/scripts/release-gate.sh`)
43
43
  - Dogfood scripts: `packages/ai-rules/scripts/sync-dogfood-cursor.sh`, `sync-dogfood-claude.sh`, `sync-dogfood-mavis.sh`, `sync-dogfood-opencode.sh`
44
44
  - Drift script: `packages/ai-rules/scripts/check-shared-core-drift.sh`
45
45
  - Orchestrator: when editing presets, load this checklist + twin-sync
@@ -5,33 +5,14 @@ Cross-tool repo-root guide. Tool-specific maps stay under `.cursor/AGENTS.md`, `
5
5
  ## Cross-tool setup
6
6
 
7
7
  - Treat this file as the **shared** entry for any agent (Cursor, Claude Code, Mavis, OpenCode, ZCode, or other).
8
- - All five platforms ship **the same** root file. `init` overwrites it; content does not depend on which tool ran last.
9
- - Tool maps (agent-team tables, slash commands) live in `.cursor/AGENTS.md` / `.claude/CLAUDE.md` / `.mavis/AGENTS.md` / `.opencode/AGENTS.md` — use them when that tool is installed.
10
- - **Language.** On every user message, before you answer, resolve the dialogue language and answer in the user's **native language** (`.ai.local/conventions.md` `## Language`, else the prompt language, else English), including a question and a message without a slash command. Commands reuse this resolution. Development, reasoning, and artifacts stay **English**. See the `language-policy` rule.
11
- - Install:
12
-
13
- ```bash
14
- npx @bonesofspring/ai-rules init multi --preset java
15
- ```
16
-
17
- Refresh tools already installed in this repository, keeping each recorded preset (`/update` runs the same command):
18
-
19
- ```bash
20
- npx @bonesofspring/ai-rules update
21
- ```
22
-
23
- Per-tool: `init cursor|claude|mavis|opencode|zcode --preset java`. `init` overwrites this file from the preset (`REPO_AGENTS.md` → `AGENTS.md`). `clean` of one tool leaves this file if another tool install remains. Living gotchas belong in `.ai.local/conventions.md`, not here.
8
+ - Every installed platform ships **the same** root file; `init` overwrites it from the preset (`REPO_AGENTS.md` → `AGENTS.md`). `clean` of one tool leaves it while another install remains.
9
+ - Tool maps — agent team, slash commands, always-on rules — live in `.cursor/AGENTS.md`, `.claude/CLAUDE.md`, `.mavis/AGENTS.md`, `.opencode/AGENTS.md`. ZCode loads this file natively and has no per-tool map. Read the map for the tool you run in; do not read another installed tool's tree.
10
+ - **Language.** On every user message, resolve the dialogue language and answer in the user's **native language**: a `language:` stored for an active task, else `## Language` in the nearest `.ai.local/conventions.md`, else the prompt language, else English. Development, reasoning, and artifacts stay **English** (see `language-policy`).
11
+ - Install / refresh: `npx @bonesofspring/ai-rules init multi --preset java` (`/update` runs `init update`); MCP catalog: `init mcp`.
24
12
 
25
13
  ## Presence-based load
26
14
 
27
- Read the map and the essential rules for the tool you are running in. Do not preload the full catalog. Do not read the other installed tool trees — their copies of the same rules belong to that host.
28
-
29
- - Cursor host: `.cursor/AGENTS.md`. Always-on rules are already injected.
30
- - Claude Code host: `.claude/CLAUDE.md`. Session-start rules are already injected.
31
- - Mavis host: read `.mavis/AGENTS.md`, then `.mavis/rules/java-app-core.md`, `.mavis/rules/architecture-boundaries.md`, `.mavis/rules/code-quality-and-refactoring.md`, `.mavis/rules/ai-local-overlay.md`.
32
- - OpenCode host: read `.opencode/AGENTS.md`, then `.opencode/rules/java-app-core.md`, `.opencode/rules/architecture-boundaries.md`, `.opencode/rules/code-quality-and-refactoring.md`, `.opencode/rules/ai-local-overlay.md`.
33
-
34
- Mavis has no native rule discovery without those root paths. OpenCode has no `alwaysApply` engine — those root-entry files are its always-on set.
15
+ Read the map and the essential rules for the tool you are running in; that map lists them. Do not preload the full catalog. Do not read another installed tool's tree — its copies of the same rules belong to that host.
35
16
 
36
17
  ## Pipelines are shared
37
18
 
@@ -66,33 +47,12 @@ Empty output or a failed run stays silent.
66
47
  - Do not commit secrets (`.env`, tokens, credentials).
67
48
  - Review destructive git before running; respect shell hooks.
68
49
 
69
- ## Tool entry points
70
-
71
- | Tool | Map |
72
- |------|-----|
73
- | Cursor | `.cursor/AGENTS.md` (optional if Cursor not installed) |
74
- | Claude Code | `.claude/CLAUDE.md` (optional if Claude not installed) |
75
- | Mavis | `.mavis/AGENTS.md` (optional if Mavis not installed) |
76
- | OpenCode | `.opencode/AGENTS.md` (optional if OpenCode not installed) |
77
- | ZCode | this file — loaded natively, no per-tool copy |
78
-
79
- Rules: `.cursor/rules/`, `.claude/rules/`, `.mavis/rules/`, `.opencode/rules/`, or `.zcode/rules/`.
80
- Skills: `.cursor/skills/`, `.claude/skills/`, `.mavis/skills/`, `.opencode/skills/`, or `.zcode/skills/`.
81
-
82
- ## ZCode host
83
-
84
- ZCode loads this file natively and has no per-tool map: this file is the entry. Read the essential rules under `.zcode/rules/` (plain Markdown) when the task scope matches their subject, and use the agents in `.zcode/agents/`, commands in `.zcode/commands/`, and skills in `.zcode/skills/` as the pipeline directs.
85
- On the first reply of a session, run `node .zcode/hooks/check-preset-update.mjs` when it exists; the notice rules above apply.
86
- On every turn, run `node .zcode/hooks/list-ai-local.mjs` with the paths this step will touch, apply the printed `.ai.local/rules/*.md` and `.ai.local/conventions.md`, and acknowledge `Using .ai.local: <rule-name>`. Authoring guide: `docs/LOCAL-OVERLAY.md` in the `@bonesofspring/ai-rules` package.
87
-
88
50
  ## Living conventions
89
51
 
90
52
  Gotchas, local patterns, and team decisions: **`.ai.local/conventions.md`** (fill after init; `init` does not overwrite it).
91
53
 
92
54
  ## Local overlay (`.ai.local/`) — MANDATORY
93
55
 
94
- A `.ai.local/` directory MAY exist at the repo root or at any nesting depth in monorepos. **All agents MUST read and apply it on every turn.** Rules there override preset rules; in conflicts, the local rule wins. `override: kill <preset-rule-name>` drops the named preset rule from the agent's context entirely.
95
-
96
- Plain markdown rules under `.ai.local/rules/*.md` are read by the agent with higher priority than preset rules. Living gotchas live in `.ai.local/conventions.md`.
56
+ A `.ai.local/` directory MAY exist at the repo root or at any nesting depth in monorepos. **Every agent MUST read and apply it on every turn.** Rules there override preset rules; `override: kill <preset-rule-name>` drops that preset rule from context entirely.
97
57
 
98
- On every turn, run `list-ai-local.mjs` from the host hooks directory (`.cursor`, `.claude`, `.mavis`, `.opencode`, or `.zcode`) with the paths this step will touch, apply the printed `.ai.local/rules/*.md` and `.ai.local/conventions.md`, and acknowledge `Using .ai.local: <rule-name>`. Authoring guide: `docs/LOCAL-OVERLAY.md` in the `@bonesofspring/ai-rules` package. The `ai-local-overlay` rule is always-on on Cursor and session-start on Claude (no `paths:`). Mavis and OpenCode have no native `alwaysApply`; this section plus the platform entry's essential-rules list is the reinforcement.
58
+ On every turn, run `list-ai-local.mjs` from the host hooks directory (`.cursor`, `.claude`, `.mavis`, `.opencode`, or `.zcode`) with the paths this step will touch, then apply the printed `.ai.local/rules/*.md` and `.ai.local/conventions.md`. The root overlay applies to every path; a nested one applies only under its directory. Do not read `shadowed` files or `rules-library/**` as rules. Acknowledge `Using .ai.local: <rule-name>` when answering. Authoring guide: `docs/LOCAL-OVERLAY.md`.
@@ -3,7 +3,7 @@
3
3
  "platform": "zcode",
4
4
  "stack": "java",
5
5
  "semanticSource": "cursor/java",
6
- "sourceRevision": "71288da6b6d831ff65f7643d7a9aadade8b48939a2572853405ee5137225f2a6",
6
+ "sourceRevision": "883dc68b811df469bd53c643c769e3997d85f1d9802852dc578f866bbd9a3e31",
7
7
  "entries": [
8
8
  {
9
9
  "source": "AGENTS.md",
@@ -2647,7 +2647,16 @@ if (status.state === 'changes_requested') {
2647
2647
  process.stdout.write('{}');
2648
2648
  process.exit(0);
2649
2649
  }
2650
- const retryAfterFixStepIndex = typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0;
2650
+ const reviewerStepIndex = typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0;
2651
+ let verifierStepIndex = -1;
2652
+ for (let index = reviewerStepIndex - 1; index >= 0; index -= 1) {
2653
+ if (getStepAgents(steps[index]).includes('build-verifier')) {
2654
+ verifierStepIndex = index;
2655
+ break;
2656
+ }
2657
+ }
2658
+ const retryGate = verifierStepIndex >= 0 ? 'build-verifier' : reviewer;
2659
+ const retryAfterFixStepIndex = verifierStepIndex >= 0 ? verifierStepIndex : reviewerStepIndex;
2651
2660
  const developerIndex = scheduleRetry('feature-developer', reviewer, finishedAttempt);
2652
2661
  if (developerIndex < 0) {
2653
2662
  beginHumanGate();
@@ -2660,10 +2669,10 @@ if (status.state === 'changes_requested') {
2660
2669
  currentAgent: 'feature-developer',
2661
2670
  state: 'in_progress',
2662
2671
  phase: 'executing',
2663
- retryAfterFix: reviewer,
2672
+ retryAfterFix: retryGate,
2664
2673
  retryAfterFixStepIndex,
2665
2674
  });
2666
- out(handoffForAgent('feature-developer', steps[developerIndex]?.scope, steps[developerIndex]) + ` After fixes, re-run ${reviewer}.`);
2675
+ out(handoffForAgent('feature-developer', steps[developerIndex]?.scope, steps[developerIndex]) + ` After fixes, re-run ${retryGate}.`);
2667
2676
  process.exit(0);
2668
2677
  }
2669
2678
 
@@ -201,8 +201,8 @@ Additional states: `blocked` — a step (or a parallel producer) cannot proceed;
201
201
  | `in_progress` | Current step running |
202
202
  | `completed` | Current step done; hook advances |
203
203
  | `awaiting_approval` | Human gate; wait for `/task-continue` |
204
- | `changes_requested` | Reviewer blocked; re-run developer (`retryAfterFix`) |
205
- | `validation_failed` | build-verifier failed; re-run developer then build-verifier |
204
+ | `changes_requested` | Reviewer blocked; re-run developer → `build-verifier` (delta) → same reviewer when the fix touches code/tests; docs/artifacts only → same reviewer |
205
+ | `validation_failed` | build-verifier failed; re-run developer then `build-verifier` (delta) |
206
206
  | `blocked` | Pipeline / step cannot proceed (e.g. `pipeline_parse_error`, completion of a parallel step whose producer's receipt was missing — see `agent-artifact-contracts.md` § Completion receipts) |
207
207
  | `awaiting_artifact_receipt` | Producer stopped but the bound or assigned-output receipt was missing or stale; hook keeps the attempt active and does not advance. See `agent-artifact-contracts.md` (Schema field name + Receipt binding) for the silent-bug class that lands here. |
208
208
  | `paused` | Operator sentinel engaged; the hook recorded the pause and refused to advance or hand off. Remove the sentinel and run `/task-continue`. |
@@ -242,8 +242,8 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
242
242
  3. One role per Task call — **except** parallel steps: multiple Task calls in one message.
243
243
  4. **Never** skip `humanGates` without `/task-continue` or explicit user approval.
244
244
  5. Persist handoffs to disk (`brief.md`, `decomposition.md`, `debug-report.md`, `validation-report.md`, `architecture.md`, `migration-plan.md`, `ci-report.md`, `a11y-review.md`, `perf-report.md`, `security-review.md`, `api-contract-review.md`, `unit-test-plan.md`, `documentation.md`, `review.md`, `mockup-review.md`, `ux-design.md`) and update the producer-owned terminal receipt in `artifact-manifest.json`.
245
- 6. On `changes_requested` from reviewers: hook sets `retryAfterFix` → developer → same reviewer. Exception: embedded `mockup-reviewer` FAIL (`changes_requested` while the completed/current agent is `mockup-reviewer`) → `awaiting_approval` / `/task-continue` only — do **not** `retryAfterFix` to developer. A `mockup-reviewer` verdict `mockup-change-requested` (a defect whose fix belongs in the design source, not the implementation) routes the same way — `awaiting_approval`, no developer retry.
246
- 7. On `validation_failed` from `build-verifier`: hook sets `retryAfterFix: build-verifier` → developer → build-verifier.
245
+ 6. On `changes_requested` from reviewers: hook sets `retryAfterFix` → developer → `build-verifier` (delta) → same reviewer when the fix touches code/tests; a docs/artifacts-only fix returns to the same reviewer without a code gate. Exception: embedded `mockup-reviewer` FAIL (`changes_requested` while the completed/current agent is `mockup-reviewer`) → `awaiting_approval` / `/task-continue` only — do **not** `retryAfterFix` to developer. A `mockup-reviewer` verdict `mockup-change-requested` (a defect whose fix belongs in the design source, not the implementation) routes the same way — `awaiting_approval`, no developer retry.
246
+ 7. On `validation_failed` from `build-verifier`: hook sets `retryAfterFix: build-verifier` → developer → build-verifier (delta).
247
247
  8. When all steps complete, suggest `/technical-retro <slug>`.
248
248
  9. If `autoChain: false` in pipeline, do not rely on hook — manual step only.
249
249
  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. A message that explicitly addresses a **closed** slug follows the same ledger with the `post-terminal` marker — append-only, no reopen, one bounded `sync --slug`; see § Team artifact I/O.
@@ -280,7 +280,7 @@ Use Task tool or `/agent-name`. Pass: slug, artifact paths, step `scope` if set.
280
280
  **Token usage.** When the host exposes token counts, append a `usage_recorded` event next to the attempt:
281
281
 
282
282
  ```bash
283
- node .ai.local/scripts/record-usage.mjs --task <slug> --attempt <attemptId> --input <n> --output <n> [--cached <n>] [--model <id>]
283
+ node .ai.local/scripts/record-usage.mjs --task <slug> --attempt <attemptId> --input <n> --output <n> [--cached <n>] [--cache-write <n>] [--reasoning <n>] [--turn <turnId>] [--model <id>]
284
284
  ```
285
285
 
286
286
  The chain hook also forwards a `usage` object from its input into the `attempt_finished` event. Never estimate or invent token counts; a missing usage record stays missing.
@@ -7,12 +7,8 @@
7
7
 
8
8
  # Principles
9
9
 
10
- - **KISS:** the simplest change in the repository’s patterns.
11
- - **DRY + Rule of Three:** share only after the 3rd repetition (wrong abstraction costs more than duplication).
12
- - **YAGNI:** no APIs, flags, or “for later” layers without a current requirement.
13
- - **SOLID:** S — one reason to change; O — composition/new implementations; L — subtype contract; I — narrow ports; D — abstractions (ports), details in stack adapters.
14
- - **CUPID:** Composable; Unix philosophy (one responsibility); Predictable; Idiomatic (repo); Domain-based.
15
- - **Composition over inheritance;** Law of Demeter — no `a.b.c.d` chains; via public API / facade.
10
+ - **KISS / YAGNI / DRY (Rule of Three):** the simplest change in the repository’s patterns; share after the 3rd repetition; no “for later” APIs, flags, or layers.
11
+ - **SOLID / CUPID, applied:** composition over inheritance; one reason to change; narrow ports; no `a.b.c.d` chains — go through a public API or facade.
16
12
 
17
13
  # Over-abstraction guardrails
18
14
 
@@ -12,7 +12,7 @@ Typical feature with data and UI. Concrete directories and rule stems — in the
12
12
  4. **State** — store / ViewModel / use cases; no direct HTTP and no DTOs in UI.
13
13
  5. **UI** — thin views/components; data via state; design system. If the prompt or `brief.md` contains a `figma.com` URL, **mockup review must complete** (or the user must continue past FAIL/`BLOCKED_MCP` via `/task-continue`) **before UI work**. When required-signal and **no** `figma.com`, **`ux-design.md` must exist** (not `INCOMPLETE`) before UI work — else blocked, hand back to analyst. Non-UI tasks no-op these gates. When a mockup contract exists for the WP, the UI step consumes it (per-node spec = the binding baseline) and a post-implementation verification gate runs against it (scope per `mockup-review` § Post-implementation gate) — screenshot / value / state / structural-parity diff plus a freeze re-check; unmapped implemented components are findings, not silent additions.
14
14
  6. **Tests** — unit for mappers / non-trivial logic; e2e/UI per stack convention.
15
- 7. **Completion** — stack post-change gate (lint/build) + package/toolchain rules. When the current WP spans **more than one** layer or module, `implementation.md` includes a **Code Map** (3–8 annotated repo-relative paths) and **Suggested Review Order** (`concern | path:line | ≤15 word note`). Omit both for a single-file or single-layer WP.
15
+ 7. **Completion** — closure gate: `build-verifier` runs the stack gate set **once**, after the last authoring step. During Build (steps 1–6) do not run project lint/test/build; author code and tests. When the current WP spans **more than one** layer or module, `implementation.md` includes a **Code Map** (3–8 annotated repo-relative paths) and **Suggested Review Order** (`concern | path:line | ≤15 word note`). Omit both for a single-file or single-layer WP.
16
16
 
17
17
  ## Context hygiene
18
18
 
@@ -20,13 +20,9 @@ A command whose output can exceed ~4 KB — a test run, a build/lint log, `git l
20
20
 
21
21
  ## Iterative refinement loop
22
22
 
23
- Every stage runs the named loop **draft → evaluate against named criteria → refine**:
23
+ Every stage runs the named loop **draft → structural evaluation → refine** against a named oracle: reference-feature parity, layer/import shape, schema/contract parity, or review. The oracle is **not** a project test run. Tests are authored in the stage and executed by the closure gate; a failing test is closure evidence, not a per-stage trigger. When `implementationRail: tdd` is explicitly on, targeted tests are the documented cadence exception.
24
24
 
25
- - **Draft** the artifact (or work package) for the stage.
26
- - **Evaluate** it against the stage's "done when" / exit criteria with the **named oracle** — a structural gate, a reviewer parity check, a test suite, or a human approval.
27
- - **Refine** and re-evaluate until the oracle passes or the human re-scopes; loop back to the owning task, never forward past a failed oracle.
28
-
29
- **Exit criteria:** a layer or stage is complete only when its named criteria hold (mapper tests green, parity check passes, gate output clean). Do not advance to the next checklist step while the current step's oracle fails; a repeatedly failing oracle triggers **plan revision**.
25
+ **Exit criteria:** a layer or stage is complete only when its structural criteria hold (reference parity, barrel/import shape, authored test present). Do not advance to the next checklist step while the current step's oracle fails; a repeatedly failing oracle triggers **plan revision**.
30
26
 
31
27
  ## Data flow (orientation)
32
28
 
@@ -29,7 +29,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
29
29
  - [ ] **UI-only surfaces:** `mockup-reviewer`, `accessibility-reviewer`, `ux-design`, and the stack performance skill ship only on UI stacks (`check-preset-leakage.sh`)
30
30
  - [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn release:gate`; keep every registered golden stem paired
31
31
  - [ ] **Anti-hallucination:** `check-anti-hallucination-coverage.mjs` is green inside `yarn release:gate`. Every role loads `anti-hallucination-contract`. Writer roles, including `code-reviewer`, also load `STACK_FLOOR_STEMS`. Register a new skill family in `SKILL_CONTRACT_CLASS` (`writer` or `reader`) or the gate FAILs.
32
- - [ ] **Gate:** `yarn check:fast` in the loop; `yarn release:gate` from `packages/ai-rules/` before a release (full composite: twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
32
+ - [ ] **Gate:** `yarn check:task <slug>` (or `yarn check:changed` on a clean tree) and the gates it names; `yarn check:fast` only when it names none; `yarn release:gate` from `packages/ai-rules/` before a release (full composite: twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
33
33
 
34
34
  ## Pointers
35
35
 
@@ -39,7 +39,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
39
39
  - Sync: `preset-twin-sync`
40
40
  - Budget: `preset-token-budget`
41
41
  - Leakage: `preset-no-cross-stack-leakage`
42
- - Validation: `yarn check:fast` in the loop (`packages/ai-rules/scripts/check-preset-fast.sh`); `yarn release:gate` before a release (`packages/ai-rules/scripts/release-gate.sh`)
42
+ - Validation: same `check:task` / `check:changed` loop; `yarn release:gate` before a release (`packages/ai-rules/scripts/release-gate.sh`)
43
43
  - Dogfood scripts: `packages/ai-rules/scripts/sync-dogfood-cursor.sh`, `sync-dogfood-claude.sh`, `sync-dogfood-mavis.sh`, `sync-dogfood-opencode.sh`
44
44
  - Drift script: `packages/ai-rules/scripts/check-shared-core-drift.sh`
45
45
  - Orchestrator: when editing presets, load this checklist + twin-sync
@@ -5,33 +5,14 @@ Cross-tool repo-root guide. Tool-specific maps stay under `.cursor/AGENTS.md`, `
5
5
  ## Cross-tool setup
6
6
 
7
7
  - Treat this file as the **shared** entry for any agent (Cursor, Claude Code, Mavis, OpenCode, ZCode, or other).
8
- - All five platforms ship **the same** root file. `init` overwrites it; content does not depend on which tool ran last.
9
- - Tool maps (agent-team tables, slash commands) live in `.cursor/AGENTS.md` / `.claude/CLAUDE.md` / `.mavis/AGENTS.md` / `.opencode/AGENTS.md` — use them when that tool is installed.
10
- - **Language.** On every user message, before you answer, resolve the dialogue language and answer in the user's **native language** (`.ai.local/conventions.md` `## Language`, else the prompt language, else English), including a question and a message without a slash command. Commands reuse this resolution. Development, reasoning, and artifacts stay **English**. See the `language-policy` rule.
11
- - Install:
12
-
13
- ```bash
14
- npx @bonesofspring/ai-rules init multi --preset mcp-ts
15
- ```
16
-
17
- Refresh tools already installed in this repository, keeping each recorded preset (`/update` runs the same command):
18
-
19
- ```bash
20
- npx @bonesofspring/ai-rules update
21
- ```
22
-
23
- Per-tool: `init cursor|claude|mavis|opencode|zcode --preset mcp-ts`. `init` overwrites this file from the preset (`REPO_AGENTS.md` → `AGENTS.md`). `clean` of one tool leaves this file if another tool install remains. Living gotchas belong in `.ai.local/conventions.md`, not here.
8
+ - Every installed platform ships **the same** root file; `init` overwrites it from the preset (`REPO_AGENTS.md` → `AGENTS.md`). `clean` of one tool leaves it while another install remains.
9
+ - Tool maps — agent team, slash commands, always-on rules — live in `.cursor/AGENTS.md`, `.claude/CLAUDE.md`, `.mavis/AGENTS.md`, `.opencode/AGENTS.md`. ZCode loads this file natively and has no per-tool map. Read the map for the tool you run in; do not read another installed tool's tree.
10
+ - **Language.** On every user message, resolve the dialogue language and answer in the user's **native language**: a `language:` stored for an active task, else `## Language` in the nearest `.ai.local/conventions.md`, else the prompt language, else English. Development, reasoning, and artifacts stay **English** (see `language-policy`).
11
+ - Install / refresh: `npx @bonesofspring/ai-rules init multi --preset mcp-ts` (`/update` runs `init update`); MCP catalog: `init mcp`.
24
12
 
25
13
  ## Presence-based load
26
14
 
27
- Read the map and the essential rules for the tool you are running in. Do not preload the full catalog. Do not read the other installed tool trees — their copies of the same rules belong to that host.
28
-
29
- - Cursor host: `.cursor/AGENTS.md`. Always-on rules are already injected.
30
- - Claude Code host: `.claude/CLAUDE.md`. Session-start rules are already injected.
31
- - Mavis host: read `.mavis/AGENTS.md`, then `.mavis/rules/mcp-ts-app-core.md`, `.mavis/rules/mcp-server-boundaries.md`, `.mavis/rules/code-quality-and-refactoring.md`, `.mavis/rules/ai-local-overlay.md`.
32
- - OpenCode host: read `.opencode/AGENTS.md`, then `.opencode/rules/mcp-ts-app-core.md`, `.opencode/rules/mcp-server-boundaries.md`, `.opencode/rules/code-quality-and-refactoring.md`, `.opencode/rules/ai-local-overlay.md`.
33
-
34
- Mavis has no native rule discovery without those root paths. OpenCode has no `alwaysApply` engine — those root-entry files are its always-on set.
15
+ Read the map and the essential rules for the tool you are running in; that map lists them. Do not preload the full catalog. Do not read another installed tool's tree — its copies of the same rules belong to that host.
35
16
 
36
17
  ## Pipelines are shared
37
18
 
@@ -69,33 +50,12 @@ Empty output or a failed run stays silent.
69
50
  - Do not weaken CI or skip hooks unless the user explicitly asks.
70
51
  - Tool handlers must not log secrets or widen filesystem/network capability without AC.
71
52
 
72
- ## Tool entry points
73
-
74
- | Tool | Map |
75
- |------|-----|
76
- | Cursor | `.cursor/AGENTS.md` (optional if Cursor not installed) |
77
- | Claude Code | `.claude/CLAUDE.md` (optional if Claude not installed) |
78
- | Mavis | `.mavis/AGENTS.md` (optional if Mavis not installed) |
79
- | OpenCode | `.opencode/AGENTS.md` (optional if OpenCode not installed) |
80
- | ZCode | this file — loaded natively, no per-tool copy |
81
-
82
- Rules: `.cursor/rules/`, `.claude/rules/`, `.mavis/rules/`, `.opencode/rules/`, or `.zcode/rules/`.
83
- Skills: `.cursor/skills/`, `.claude/skills/`, `.mavis/skills/`, `.opencode/skills/`, or `.zcode/skills/`.
84
-
85
- ## ZCode host
86
-
87
- ZCode loads this file natively and has no per-tool map: this file is the entry. Read the essential rules under `.zcode/rules/` (plain Markdown) when the task scope matches their subject, and use the agents in `.zcode/agents/`, commands in `.zcode/commands/`, and skills in `.zcode/skills/` as the pipeline directs.
88
- On the first reply of a session, run `node .zcode/hooks/check-preset-update.mjs` when it exists; the notice rules above apply.
89
- On every turn, run `node .zcode/hooks/list-ai-local.mjs` with the paths this step will touch, apply the printed `.ai.local/rules/*.md` and `.ai.local/conventions.md`, and acknowledge `Using .ai.local: <rule-name>`. Authoring guide: `docs/LOCAL-OVERLAY.md` in the `@bonesofspring/ai-rules` package.
90
-
91
53
  ## Living conventions
92
54
 
93
55
  Gotchas, local patterns, and team decisions: **`.ai.local/conventions.md`** (fill after init; `init` does not overwrite it).
94
56
 
95
57
  ## Local overlay (`.ai.local/`) — MANDATORY
96
58
 
97
- A `.ai.local/` directory MAY exist at the repo root or at any nesting depth in monorepos. **All agents MUST read and apply it on every turn.** Rules there override preset rules; in conflicts, the local rule wins. `override: kill <preset-rule-name>` drops the named preset rule from the agent's context entirely.
98
-
99
- Plain markdown rules under `.ai.local/rules/*.md` are read by the agent with higher priority than preset rules. Living gotchas live in `.ai.local/conventions.md`.
59
+ A `.ai.local/` directory MAY exist at the repo root or at any nesting depth in monorepos. **Every agent MUST read and apply it on every turn.** Rules there override preset rules; `override: kill <preset-rule-name>` drops that preset rule from context entirely.
100
60
 
101
- On every turn, run `list-ai-local.mjs` from the host hooks directory (`.cursor`, `.claude`, `.mavis`, `.opencode`, or `.zcode`) with the paths this step will touch, apply the printed `.ai.local/rules/*.md` and `.ai.local/conventions.md`, and acknowledge `Using .ai.local: <rule-name>`. Authoring guide: `docs/LOCAL-OVERLAY.md` in the `@bonesofspring/ai-rules` package. The `ai-local-overlay` rule is always-on on Cursor and session-start on Claude (no `paths:`). Mavis and OpenCode have no native `alwaysApply`; this section plus the platform entry's essential-rules list is the reinforcement.
61
+ On every turn, run `list-ai-local.mjs` from the host hooks directory (`.cursor`, `.claude`, `.mavis`, `.opencode`, or `.zcode`) with the paths this step will touch, then apply the printed `.ai.local/rules/*.md` and `.ai.local/conventions.md`. The root overlay applies to every path; a nested one applies only under its directory. Do not read `shadowed` files or `rules-library/**` as rules. Acknowledge `Using .ai.local: <rule-name>` when answering. Authoring guide: `docs/LOCAL-OVERLAY.md`.
@@ -3,7 +3,7 @@
3
3
  "platform": "zcode",
4
4
  "stack": "mcp-ts",
5
5
  "semanticSource": "cursor/mcp-ts",
6
- "sourceRevision": "4c1d96d715f8498ce64cda62057e19e836a08e9742f2aed30d98a2564eea421b",
6
+ "sourceRevision": "363a5f307746c7be1e331aa6f4ba8d7895b549c97454368b7ef64091706143a7",
7
7
  "entries": [
8
8
  {
9
9
  "source": "AGENTS.md",
@@ -2594,7 +2594,16 @@ if (status.state === 'changes_requested') {
2594
2594
  process.stdout.write('{}');
2595
2595
  process.exit(0);
2596
2596
  }
2597
- const retryAfterFixStepIndex = typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0;
2597
+ const reviewerStepIndex = typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0;
2598
+ let verifierStepIndex = -1;
2599
+ for (let index = reviewerStepIndex - 1; index >= 0; index -= 1) {
2600
+ if (getStepAgents(steps[index]).includes('build-verifier')) {
2601
+ verifierStepIndex = index;
2602
+ break;
2603
+ }
2604
+ }
2605
+ const retryGate = verifierStepIndex >= 0 ? 'build-verifier' : reviewer;
2606
+ const retryAfterFixStepIndex = verifierStepIndex >= 0 ? verifierStepIndex : reviewerStepIndex;
2598
2607
  const developerIndex = scheduleRetry('feature-developer', reviewer, finishedAttempt);
2599
2608
  if (developerIndex < 0) {
2600
2609
  beginHumanGate();
@@ -2607,10 +2616,10 @@ if (status.state === 'changes_requested') {
2607
2616
  currentAgent: 'feature-developer',
2608
2617
  state: 'in_progress',
2609
2618
  phase: 'executing',
2610
- retryAfterFix: reviewer,
2619
+ retryAfterFix: retryGate,
2611
2620
  retryAfterFixStepIndex,
2612
2621
  });
2613
- out(handoffForAgent('feature-developer', steps[developerIndex]?.scope, steps[developerIndex]) + ` After fixes, re-run ${reviewer}.`);
2622
+ out(handoffForAgent('feature-developer', steps[developerIndex]?.scope, steps[developerIndex]) + ` After fixes, re-run ${retryGate}.`);
2614
2623
  process.exit(0);
2615
2624
  }
2616
2625