@bonesofspring/ai-rules 0.2.66 → 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 (843) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/README.md +6 -4
  3. package/bin/cli.js +9 -1
  4. package/bin/lib/engine-scripts.js +3 -10
  5. package/bin/lib/seed-ai-local-team.js +27 -1
  6. package/docs/OPENCODE-COMPATIBILITY.md +1 -0
  7. package/docs/OPENCODE.md +14 -1
  8. package/docs/PRESET-CONTRIBUTION.md +15 -8
  9. package/docs/TEAM-DB.md +107 -106
  10. package/docs/TOKEN-ECONOMY.md +36 -3
  11. package/docs/openapi/team-db.v1.json +3910 -1471
  12. package/package.json +13 -5
  13. package/presets/_shared/ai-local/scripts/dump-output.mjs +63 -12
  14. package/presets/_shared/ai-local/scripts/processes.mjs +467 -55
  15. package/presets/_shared/ai-local/scripts/team-db-api.mjs +564 -10
  16. package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +819 -50
  17. package/presets/_shared/ai-local/scripts/team-db-project.mjs +659 -5
  18. package/presets/_shared/ai-local/scripts/team-db-schema.mjs +135 -0
  19. package/presets/_shared/ai-local/scripts/team-db-task-runner.mjs +11 -6
  20. package/presets/_shared/ai-local/scripts/team-db-tracker.mjs +2 -0
  21. package/presets/_shared/ai-local/scripts/team-db.mjs +16 -54
  22. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +5 -5
  23. package/presets/_shared/core/architecture/feature-delivery-workflow.md +3 -7
  24. package/presets/_shared/core/meta/preset-pr-checklist.md +2 -2
  25. package/presets/_shared/core/quality/code-quality-and-refactoring.md +2 -6
  26. package/presets/_shared/core/quality/verification-before-completion.md +20 -3
  27. package/presets/_shared/hooks/chain-team-phases.sh.tmpl +21 -5
  28. package/presets/_shared/hooks/list-ai-local.mjs +17 -0
  29. package/presets/claude/android-kotlin/REPO_AGENTS.md +7 -47
  30. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +21 -5
  31. package/presets/claude/android-kotlin/hooks/list-ai-local.mjs +17 -0
  32. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  33. package/presets/claude/android-kotlin/rules/tooling-and-review/code-quality.md +2 -6
  34. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  35. package/presets/claude/go/REPO_AGENTS.md +7 -47
  36. package/presets/claude/go/hooks/chain-team-phases.sh +21 -5
  37. package/presets/claude/go/hooks/list-ai-local.mjs +17 -0
  38. package/presets/claude/go/rules/architecture/feature-delivery.md +3 -7
  39. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  40. package/presets/claude/go/rules/tooling-and-review/code-quality.md +2 -6
  41. package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  42. package/presets/claude/ios-swift/REPO_AGENTS.md +7 -47
  43. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +21 -5
  44. package/presets/claude/ios-swift/hooks/list-ai-local.mjs +17 -0
  45. package/presets/claude/ios-swift/rules/architecture/feature-delivery.md +3 -7
  46. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  47. package/presets/claude/ios-swift/rules/tooling-and-review/code-quality.md +2 -6
  48. package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  49. package/presets/claude/java/REPO_AGENTS.md +7 -47
  50. package/presets/claude/java/hooks/chain-team-phases.sh +21 -5
  51. package/presets/claude/java/hooks/list-ai-local.mjs +17 -0
  52. package/presets/claude/java/rules/architecture/feature-delivery.md +3 -7
  53. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  54. package/presets/claude/java/rules/tooling-and-review/code-quality.md +2 -6
  55. package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  56. package/presets/claude/mcp-ts/REPO_AGENTS.md +7 -47
  57. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +21 -5
  58. package/presets/claude/mcp-ts/hooks/list-ai-local.mjs +17 -0
  59. package/presets/claude/mcp-ts/rules/architecture/feature-delivery.md +3 -7
  60. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  61. package/presets/claude/mcp-ts/rules/tooling-and-review/code-quality.md +2 -6
  62. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  63. package/presets/claude/mol/REPO_AGENTS.md +9 -49
  64. package/presets/claude/mol/hooks/chain-team-phases.sh +21 -5
  65. package/presets/claude/mol/hooks/list-ai-local.mjs +17 -0
  66. package/presets/claude/mol/rules/architecture/feature-delivery-workflow.md +3 -7
  67. package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  68. package/presets/claude/mol/rules/tooling-and-review/code-quality.md +2 -6
  69. package/presets/claude/mol/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  70. package/presets/claude/next/REPO_AGENTS.md +10 -50
  71. package/presets/claude/next/agents/accessibility-reviewer.md +0 -1
  72. package/presets/claude/next/agents/api-contract-reviewer.md +0 -1
  73. package/presets/claude/next/agents/build-verifier.md +12 -8
  74. package/presets/claude/next/agents/ci-investigator.md +5 -2
  75. package/presets/claude/next/agents/code-reviewer.md +1 -1
  76. package/presets/claude/next/agents/codebase-analyzer.md +0 -1
  77. package/presets/claude/next/agents/debugger.md +5 -2
  78. package/presets/claude/next/agents/feature-developer.md +11 -8
  79. package/presets/claude/next/agents/migration-specialist.md +0 -1
  80. package/presets/claude/next/agents/mockup-reviewer.md +0 -1
  81. package/presets/claude/next/agents/openspec-author.md +0 -1
  82. package/presets/claude/next/agents/performance-auditor.md +0 -1
  83. package/presets/claude/next/agents/playwright-test-generator.md +0 -1
  84. package/presets/claude/next/agents/playwright-test-healer.md +0 -1
  85. package/presets/claude/next/agents/playwright-test-planner.md +0 -1
  86. package/presets/claude/next/agents/qa-tester.md +3 -3
  87. package/presets/claude/next/agents/security-reviewer.md +0 -1
  88. package/presets/claude/next/agents/solution-architect.md +0 -1
  89. package/presets/claude/next/agents/task-analyst.md +0 -1
  90. package/presets/claude/next/agents/task-router.md +8 -7
  91. package/presets/claude/next/agents/tech-writer.md +0 -1
  92. package/presets/claude/next/agents/unit-test-generator.md +0 -1
  93. package/presets/claude/next/agents/unit-test-healer.md +0 -1
  94. package/presets/claude/next/agents/unit-test-planner.md +0 -1
  95. package/presets/claude/next/commands/README.md +0 -6
  96. package/presets/claude/next/hooks/chain-team-phases.sh +21 -5
  97. package/presets/claude/next/hooks/list-ai-local.mjs +17 -0
  98. package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +9 -9
  99. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  100. package/presets/claude/next/rules/tooling-and-review/code-quality.md +2 -6
  101. package/presets/claude/next/rules/tooling-and-review/post-change-lint.md +12 -16
  102. package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  103. package/presets/claude/next/skills/feature-delivery/SKILL.md +1 -1
  104. package/presets/claude/next/skills/playwright-e2e/SKILL.md +1 -1
  105. package/presets/claude/next/skills/unit-testing/SKILL.md +1 -1
  106. package/presets/claude/nuxt/REPO_AGENTS.md +8 -48
  107. package/presets/claude/nuxt/agents/accessibility-reviewer.md +0 -1
  108. package/presets/claude/nuxt/agents/api-contract-reviewer.md +0 -1
  109. package/presets/claude/nuxt/agents/build-verifier.md +5 -3
  110. package/presets/claude/nuxt/agents/ci-investigator.md +1 -1
  111. package/presets/claude/nuxt/agents/code-reviewer.md +0 -1
  112. package/presets/claude/nuxt/agents/codebase-analyzer.md +0 -1
  113. package/presets/claude/nuxt/agents/debugger.md +1 -1
  114. package/presets/claude/nuxt/agents/feature-developer.md +6 -6
  115. package/presets/claude/nuxt/agents/migration-specialist.md +0 -1
  116. package/presets/claude/nuxt/agents/mockup-reviewer.md +0 -1
  117. package/presets/claude/nuxt/agents/openspec-author.md +0 -1
  118. package/presets/claude/nuxt/agents/performance-auditor.md +0 -1
  119. package/presets/claude/nuxt/agents/playwright-test-generator.md +0 -1
  120. package/presets/claude/nuxt/agents/playwright-test-healer.md +0 -1
  121. package/presets/claude/nuxt/agents/playwright-test-planner.md +0 -1
  122. package/presets/claude/nuxt/agents/qa-tester.md +3 -3
  123. package/presets/claude/nuxt/agents/security-reviewer.md +0 -1
  124. package/presets/claude/nuxt/agents/solution-architect.md +0 -1
  125. package/presets/claude/nuxt/agents/task-analyst.md +0 -1
  126. package/presets/claude/nuxt/agents/task-router.md +8 -7
  127. package/presets/claude/nuxt/agents/tech-writer.md +0 -1
  128. package/presets/claude/nuxt/agents/unit-test-generator.md +0 -1
  129. package/presets/claude/nuxt/agents/unit-test-healer.md +0 -1
  130. package/presets/claude/nuxt/agents/unit-test-planner.md +0 -1
  131. package/presets/claude/nuxt/hooks/chain-team-phases.sh +21 -5
  132. package/presets/claude/nuxt/hooks/list-ai-local.mjs +17 -0
  133. package/presets/claude/nuxt/rules/architecture/feature-delivery-workflow.md +3 -7
  134. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  135. package/presets/claude/nuxt/rules/tooling-and-review/code-quality.md +2 -6
  136. package/presets/claude/nuxt/rules/tooling-and-review/post-change-lint.md +14 -14
  137. package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  138. package/presets/claude/nuxt/skills/feature-delivery/SKILL.md +1 -1
  139. package/presets/claude/nuxt/skills/playwright-e2e/SKILL.md +1 -1
  140. package/presets/claude/nuxt/skills/unit-testing/SKILL.md +1 -1
  141. package/presets/claude/php-hexagonal/REPO_AGENTS.md +7 -47
  142. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +21 -5
  143. package/presets/claude/php-hexagonal/hooks/list-ai-local.mjs +17 -0
  144. package/presets/claude/php-hexagonal/rules/architecture/feature-delivery.md +3 -7
  145. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  146. package/presets/claude/php-hexagonal/rules/tooling-and-review/code-quality.md +2 -6
  147. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  148. package/presets/claude/php-laravel/REPO_AGENTS.md +7 -47
  149. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +21 -5
  150. package/presets/claude/php-laravel/hooks/list-ai-local.mjs +17 -0
  151. package/presets/claude/php-laravel/rules/architecture/feature-delivery.md +3 -7
  152. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  153. package/presets/claude/php-laravel/rules/tooling-and-review/code-quality.md +2 -6
  154. package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  155. package/presets/claude/svelte/REPO_AGENTS.md +8 -48
  156. package/presets/claude/svelte/agents/accessibility-reviewer.md +0 -1
  157. package/presets/claude/svelte/agents/api-contract-reviewer.md +0 -1
  158. package/presets/claude/svelte/agents/build-verifier.md +5 -3
  159. package/presets/claude/svelte/agents/ci-investigator.md +1 -1
  160. package/presets/claude/svelte/agents/code-reviewer.md +0 -1
  161. package/presets/claude/svelte/agents/codebase-analyzer.md +0 -1
  162. package/presets/claude/svelte/agents/debugger.md +1 -1
  163. package/presets/claude/svelte/agents/feature-developer.md +6 -6
  164. package/presets/claude/svelte/agents/migration-specialist.md +0 -1
  165. package/presets/claude/svelte/agents/mockup-reviewer.md +0 -1
  166. package/presets/claude/svelte/agents/openspec-author.md +0 -1
  167. package/presets/claude/svelte/agents/performance-auditor.md +0 -1
  168. package/presets/claude/svelte/agents/playwright-test-generator.md +0 -1
  169. package/presets/claude/svelte/agents/playwright-test-healer.md +0 -1
  170. package/presets/claude/svelte/agents/playwright-test-planner.md +0 -1
  171. package/presets/claude/svelte/agents/qa-tester.md +3 -3
  172. package/presets/claude/svelte/agents/security-reviewer.md +0 -1
  173. package/presets/claude/svelte/agents/solution-architect.md +0 -1
  174. package/presets/claude/svelte/agents/task-analyst.md +0 -1
  175. package/presets/claude/svelte/agents/task-router.md +8 -7
  176. package/presets/claude/svelte/agents/tech-writer.md +0 -1
  177. package/presets/claude/svelte/agents/unit-test-generator.md +0 -1
  178. package/presets/claude/svelte/agents/unit-test-healer.md +0 -1
  179. package/presets/claude/svelte/agents/unit-test-planner.md +0 -1
  180. package/presets/claude/svelte/hooks/chain-team-phases.sh +21 -5
  181. package/presets/claude/svelte/hooks/list-ai-local.mjs +17 -0
  182. package/presets/claude/svelte/rules/architecture/feature-delivery-workflow.md +3 -7
  183. package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
  184. package/presets/claude/svelte/rules/tooling-and-review/code-quality.md +2 -6
  185. package/presets/claude/svelte/rules/tooling-and-review/post-change-lint.md +14 -14
  186. package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  187. package/presets/claude/svelte/skills/feature-delivery/SKILL.md +1 -1
  188. package/presets/claude/svelte/skills/playwright-e2e/SKILL.md +1 -1
  189. package/presets/claude/svelte/skills/unit-testing/SKILL.md +1 -1
  190. package/presets/cursor/android-kotlin/AGENTS.md +0 -10
  191. package/presets/cursor/android-kotlin/REPO_AGENTS.md +7 -47
  192. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +21 -5
  193. package/presets/cursor/android-kotlin/hooks/list-ai-local.mjs +17 -0
  194. package/presets/cursor/android-kotlin/rules/code-quality-and-refactoring.mdc +2 -6
  195. package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +2 -2
  196. package/presets/cursor/go/AGENTS.md +0 -8
  197. package/presets/cursor/go/REPO_AGENTS.md +7 -47
  198. package/presets/cursor/go/hooks/chain-team-phases.sh +21 -5
  199. package/presets/cursor/go/hooks/list-ai-local.mjs +17 -0
  200. package/presets/cursor/go/rules/code-quality-and-refactoring.mdc +2 -6
  201. package/presets/cursor/go/rules/preset-pr-checklist.mdc +2 -2
  202. package/presets/cursor/ios-swift/AGENTS.md +0 -10
  203. package/presets/cursor/ios-swift/REPO_AGENTS.md +7 -47
  204. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +21 -5
  205. package/presets/cursor/ios-swift/hooks/list-ai-local.mjs +17 -0
  206. package/presets/cursor/ios-swift/rules/code-quality-and-refactoring.mdc +2 -6
  207. package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +2 -2
  208. package/presets/cursor/java/AGENTS.md +0 -8
  209. package/presets/cursor/java/REPO_AGENTS.md +7 -47
  210. package/presets/cursor/java/hooks/chain-team-phases.sh +21 -5
  211. package/presets/cursor/java/hooks/list-ai-local.mjs +17 -0
  212. package/presets/cursor/java/rules/code-quality-and-refactoring.mdc +2 -6
  213. package/presets/cursor/java/rules/preset-pr-checklist.mdc +2 -2
  214. package/presets/cursor/mcp-ts/AGENTS.md +0 -6
  215. package/presets/cursor/mcp-ts/REPO_AGENTS.md +7 -47
  216. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +21 -5
  217. package/presets/cursor/mcp-ts/hooks/list-ai-local.mjs +17 -0
  218. package/presets/cursor/mcp-ts/rules/code-quality-and-refactoring.mdc +2 -6
  219. package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +2 -2
  220. package/presets/cursor/mol/AGENTS.md +0 -11
  221. package/presets/cursor/mol/REPO_AGENTS.md +9 -49
  222. package/presets/cursor/mol/hooks/chain-team-phases.sh +21 -5
  223. package/presets/cursor/mol/hooks/list-ai-local.mjs +17 -0
  224. package/presets/cursor/mol/rules/code-quality-and-refactoring.mdc +2 -6
  225. package/presets/cursor/mol/rules/preset-pr-checklist.mdc +2 -2
  226. package/presets/cursor/next/AGENTS.md +1 -12
  227. package/presets/cursor/next/REPO_AGENTS.md +10 -50
  228. package/presets/cursor/next/agents/build-verifier.md +11 -7
  229. package/presets/cursor/next/agents/code-reviewer.md +1 -0
  230. package/presets/cursor/next/agents/feature-developer.md +6 -6
  231. package/presets/cursor/next/agents/qa-tester.md +3 -2
  232. package/presets/cursor/next/agents/task-router.md +8 -6
  233. package/presets/cursor/next/commands/README.md +0 -6
  234. package/presets/cursor/next/hooks/chain-team-phases.sh +21 -5
  235. package/presets/cursor/next/hooks/list-ai-local.mjs +17 -0
  236. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +4 -4
  237. package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +2 -6
  238. package/presets/cursor/next/rules/feature-delivery-workflow.mdc +6 -2
  239. package/presets/cursor/next/rules/post-change-lint.mdc +12 -16
  240. package/presets/cursor/next/rules/preset-pr-checklist.mdc +2 -2
  241. package/presets/cursor/next/skills/feature-delivery/SKILL.md +1 -1
  242. package/presets/cursor/next/skills/playwright-e2e/SKILL.md +1 -1
  243. package/presets/cursor/next/skills/unit-testing/SKILL.md +1 -1
  244. package/presets/cursor/nuxt/AGENTS.md +1 -12
  245. package/presets/cursor/nuxt/REPO_AGENTS.md +8 -48
  246. package/presets/cursor/nuxt/agents/build-verifier.md +1 -1
  247. package/presets/cursor/nuxt/agents/feature-developer.md +2 -2
  248. package/presets/cursor/nuxt/agents/qa-tester.md +3 -2
  249. package/presets/cursor/nuxt/agents/task-router.md +8 -6
  250. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +21 -5
  251. package/presets/cursor/nuxt/hooks/list-ai-local.mjs +17 -0
  252. package/presets/cursor/nuxt/rules/code-quality-and-refactoring.mdc +2 -6
  253. package/presets/cursor/nuxt/rules/post-change-lint.mdc +14 -14
  254. package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +2 -2
  255. package/presets/cursor/nuxt/skills/feature-delivery/SKILL.md +1 -1
  256. package/presets/cursor/nuxt/skills/playwright-e2e/SKILL.md +1 -1
  257. package/presets/cursor/nuxt/skills/unit-testing/SKILL.md +1 -1
  258. package/presets/cursor/php-hexagonal/AGENTS.md +0 -8
  259. package/presets/cursor/php-hexagonal/REPO_AGENTS.md +7 -47
  260. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +21 -5
  261. package/presets/cursor/php-hexagonal/hooks/list-ai-local.mjs +17 -0
  262. package/presets/cursor/php-hexagonal/rules/code-quality-and-refactoring.mdc +2 -6
  263. package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +2 -2
  264. package/presets/cursor/php-laravel/AGENTS.md +0 -8
  265. package/presets/cursor/php-laravel/REPO_AGENTS.md +7 -47
  266. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +21 -5
  267. package/presets/cursor/php-laravel/hooks/list-ai-local.mjs +17 -0
  268. package/presets/cursor/php-laravel/rules/code-quality-and-refactoring.mdc +2 -6
  269. package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +2 -2
  270. package/presets/cursor/svelte/AGENTS.md +1 -12
  271. package/presets/cursor/svelte/REPO_AGENTS.md +8 -48
  272. package/presets/cursor/svelte/agents/build-verifier.md +1 -1
  273. package/presets/cursor/svelte/agents/feature-developer.md +2 -2
  274. package/presets/cursor/svelte/agents/qa-tester.md +3 -2
  275. package/presets/cursor/svelte/agents/task-router.md +8 -6
  276. package/presets/cursor/svelte/hooks/chain-team-phases.sh +21 -5
  277. package/presets/cursor/svelte/hooks/list-ai-local.mjs +17 -0
  278. package/presets/cursor/svelte/rules/code-quality-and-refactoring.mdc +2 -6
  279. package/presets/cursor/svelte/rules/post-change-lint.mdc +14 -14
  280. package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +2 -2
  281. package/presets/cursor/svelte/skills/feature-delivery/SKILL.md +1 -1
  282. package/presets/cursor/svelte/skills/playwright-e2e/SKILL.md +1 -1
  283. package/presets/cursor/svelte/skills/unit-testing/SKILL.md +1 -1
  284. package/presets/mavis/android-kotlin/MAVIS.md +0 -2
  285. package/presets/mavis/android-kotlin/REPO_AGENTS.md +7 -47
  286. package/presets/mavis/android-kotlin/adapter-map.json +1 -1
  287. package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +21 -5
  288. package/presets/mavis/android-kotlin/hooks/list-ai-local.mjs +17 -0
  289. package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +5 -5
  290. package/presets/mavis/android-kotlin/rules/code-quality-and-refactoring.md +2 -6
  291. package/presets/mavis/android-kotlin/rules/preset-pr-checklist.md +2 -2
  292. package/presets/mavis/go/MAVIS.md +8 -0
  293. package/presets/mavis/go/REPO_AGENTS.md +7 -47
  294. package/presets/mavis/go/adapter-map.json +1 -1
  295. package/presets/mavis/go/hooks/chain-team-phases.sh +21 -5
  296. package/presets/mavis/go/hooks/list-ai-local.mjs +17 -0
  297. package/presets/mavis/go/rules/agent-team-orchestrator.md +5 -5
  298. package/presets/mavis/go/rules/code-quality-and-refactoring.md +2 -6
  299. package/presets/mavis/go/rules/feature-delivery-workflow.md +3 -7
  300. package/presets/mavis/go/rules/preset-pr-checklist.md +2 -2
  301. package/presets/mavis/ios-swift/MAVIS.md +0 -2
  302. package/presets/mavis/ios-swift/REPO_AGENTS.md +7 -47
  303. package/presets/mavis/ios-swift/adapter-map.json +1 -1
  304. package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +21 -5
  305. package/presets/mavis/ios-swift/hooks/list-ai-local.mjs +17 -0
  306. package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +5 -5
  307. package/presets/mavis/ios-swift/rules/code-quality-and-refactoring.md +2 -6
  308. package/presets/mavis/ios-swift/rules/feature-delivery-workflow.md +3 -7
  309. package/presets/mavis/ios-swift/rules/preset-pr-checklist.md +2 -2
  310. package/presets/mavis/java/MAVIS.md +14 -0
  311. package/presets/mavis/java/REPO_AGENTS.md +7 -47
  312. package/presets/mavis/java/adapter-map.json +1 -1
  313. package/presets/mavis/java/hooks/chain-team-phases.sh +21 -5
  314. package/presets/mavis/java/hooks/list-ai-local.mjs +17 -0
  315. package/presets/mavis/java/rules/agent-team-orchestrator.md +5 -5
  316. package/presets/mavis/java/rules/code-quality-and-refactoring.md +2 -6
  317. package/presets/mavis/java/rules/feature-delivery-workflow.md +3 -7
  318. package/presets/mavis/java/rules/preset-pr-checklist.md +2 -2
  319. package/presets/mavis/mcp-ts/MAVIS.md +6 -0
  320. package/presets/mavis/mcp-ts/REPO_AGENTS.md +7 -47
  321. package/presets/mavis/mcp-ts/adapter-map.json +1 -1
  322. package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +21 -5
  323. package/presets/mavis/mcp-ts/hooks/list-ai-local.mjs +17 -0
  324. package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +5 -5
  325. package/presets/mavis/mcp-ts/rules/code-quality-and-refactoring.md +2 -6
  326. package/presets/mavis/mcp-ts/rules/feature-delivery-workflow.md +3 -7
  327. package/presets/mavis/mcp-ts/rules/preset-pr-checklist.md +2 -2
  328. package/presets/mavis/mol/MAVIS.md +1 -5
  329. package/presets/mavis/mol/REPO_AGENTS.md +9 -49
  330. package/presets/mavis/mol/adapter-map.json +1 -1
  331. package/presets/mavis/mol/hooks/chain-team-phases.sh +21 -5
  332. package/presets/mavis/mol/hooks/list-ai-local.mjs +17 -0
  333. package/presets/mavis/mol/rules/agent-team-orchestrator.md +5 -5
  334. package/presets/mavis/mol/rules/code-quality-and-refactoring.md +2 -6
  335. package/presets/mavis/mol/rules/feature-delivery-workflow.md +3 -7
  336. package/presets/mavis/mol/rules/preset-pr-checklist.md +2 -2
  337. package/presets/mavis/next/MAVIS.md +2 -6
  338. package/presets/mavis/next/REPO_AGENTS.md +10 -50
  339. package/presets/mavis/next/adapter-map.json +1 -17
  340. package/presets/mavis/next/agents/accessibility-reviewer.md +0 -1
  341. package/presets/mavis/next/agents/api-contract-reviewer.md +0 -1
  342. package/presets/mavis/next/agents/build-verifier.md +12 -8
  343. package/presets/mavis/next/agents/ci-investigator.md +5 -2
  344. package/presets/mavis/next/agents/code-reviewer.md +1 -1
  345. package/presets/mavis/next/agents/codebase-analyzer.md +0 -1
  346. package/presets/mavis/next/agents/debugger.md +5 -2
  347. package/presets/mavis/next/agents/feature-developer.md +11 -8
  348. package/presets/mavis/next/agents/migration-specialist.md +0 -1
  349. package/presets/mavis/next/agents/mockup-reviewer.md +0 -1
  350. package/presets/mavis/next/agents/openspec-author.md +0 -1
  351. package/presets/mavis/next/agents/performance-auditor.md +0 -1
  352. package/presets/mavis/next/agents/playwright-test-generator.md +0 -1
  353. package/presets/mavis/next/agents/playwright-test-healer.md +0 -1
  354. package/presets/mavis/next/agents/playwright-test-planner.md +0 -1
  355. package/presets/mavis/next/agents/qa-tester.md +3 -3
  356. package/presets/mavis/next/agents/security-reviewer.md +0 -1
  357. package/presets/mavis/next/agents/solution-architect.md +0 -1
  358. package/presets/mavis/next/agents/task-analyst.md +0 -1
  359. package/presets/mavis/next/agents/task-router.md +8 -7
  360. package/presets/mavis/next/agents/tech-writer.md +0 -1
  361. package/presets/mavis/next/agents/unit-test-generator.md +0 -1
  362. package/presets/mavis/next/agents/unit-test-healer.md +0 -1
  363. package/presets/mavis/next/agents/unit-test-planner.md +0 -1
  364. package/presets/mavis/next/commands/README.md +0 -6
  365. package/presets/mavis/next/hooks/chain-team-phases.sh +21 -5
  366. package/presets/mavis/next/hooks/list-ai-local.mjs +17 -0
  367. package/presets/mavis/next/rules/agent-team-orchestrator.md +5 -5
  368. package/presets/mavis/next/rules/code-quality-and-refactoring.md +2 -6
  369. package/presets/mavis/next/rules/feature-delivery-workflow.md +9 -9
  370. package/presets/mavis/next/rules/post-change-lint.md +11 -15
  371. package/presets/mavis/next/rules/preset-pr-checklist.md +2 -2
  372. package/presets/mavis/next/skills/feature-delivery/SKILL.md +1 -1
  373. package/presets/mavis/next/skills/playwright-e2e/SKILL.md +1 -1
  374. package/presets/mavis/next/skills/unit-testing/SKILL.md +1 -1
  375. package/presets/mavis/nuxt/MAVIS.md +2 -6
  376. package/presets/mavis/nuxt/REPO_AGENTS.md +8 -48
  377. package/presets/mavis/nuxt/adapter-map.json +1 -1
  378. package/presets/mavis/nuxt/agents/accessibility-reviewer.md +0 -1
  379. package/presets/mavis/nuxt/agents/api-contract-reviewer.md +0 -1
  380. package/presets/mavis/nuxt/agents/build-verifier.md +2 -2
  381. package/presets/mavis/nuxt/agents/ci-investigator.md +1 -1
  382. package/presets/mavis/nuxt/agents/code-reviewer.md +0 -1
  383. package/presets/mavis/nuxt/agents/codebase-analyzer.md +0 -1
  384. package/presets/mavis/nuxt/agents/debugger.md +1 -1
  385. package/presets/mavis/nuxt/agents/feature-developer.md +3 -3
  386. package/presets/mavis/nuxt/agents/migration-specialist.md +0 -1
  387. package/presets/mavis/nuxt/agents/mockup-reviewer.md +0 -1
  388. package/presets/mavis/nuxt/agents/openspec-author.md +0 -1
  389. package/presets/mavis/nuxt/agents/performance-auditor.md +0 -1
  390. package/presets/mavis/nuxt/agents/playwright-test-generator.md +0 -1
  391. package/presets/mavis/nuxt/agents/playwright-test-healer.md +0 -1
  392. package/presets/mavis/nuxt/agents/playwright-test-planner.md +0 -1
  393. package/presets/mavis/nuxt/agents/qa-tester.md +3 -3
  394. package/presets/mavis/nuxt/agents/security-reviewer.md +0 -1
  395. package/presets/mavis/nuxt/agents/solution-architect.md +0 -1
  396. package/presets/mavis/nuxt/agents/task-analyst.md +0 -1
  397. package/presets/mavis/nuxt/agents/task-router.md +8 -7
  398. package/presets/mavis/nuxt/agents/tech-writer.md +0 -1
  399. package/presets/mavis/nuxt/agents/unit-test-generator.md +0 -1
  400. package/presets/mavis/nuxt/agents/unit-test-healer.md +0 -1
  401. package/presets/mavis/nuxt/agents/unit-test-planner.md +0 -1
  402. package/presets/mavis/nuxt/hooks/chain-team-phases.sh +21 -5
  403. package/presets/mavis/nuxt/hooks/list-ai-local.mjs +17 -0
  404. package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +5 -5
  405. package/presets/mavis/nuxt/rules/code-quality-and-refactoring.md +2 -6
  406. package/presets/mavis/nuxt/rules/feature-delivery-workflow.md +3 -7
  407. package/presets/mavis/nuxt/rules/post-change-lint.md +13 -13
  408. package/presets/mavis/nuxt/rules/preset-pr-checklist.md +2 -2
  409. package/presets/mavis/nuxt/skills/feature-delivery/SKILL.md +1 -1
  410. package/presets/mavis/nuxt/skills/playwright-e2e/SKILL.md +1 -1
  411. package/presets/mavis/nuxt/skills/unit-testing/SKILL.md +1 -1
  412. package/presets/mavis/php-hexagonal/MAVIS.md +16 -0
  413. package/presets/mavis/php-hexagonal/REPO_AGENTS.md +7 -47
  414. package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
  415. package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +21 -5
  416. package/presets/mavis/php-hexagonal/hooks/list-ai-local.mjs +17 -0
  417. package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +5 -5
  418. package/presets/mavis/php-hexagonal/rules/code-quality-and-refactoring.md +2 -6
  419. package/presets/mavis/php-hexagonal/rules/feature-delivery-workflow.md +3 -7
  420. package/presets/mavis/php-hexagonal/rules/preset-pr-checklist.md +2 -2
  421. package/presets/mavis/php-laravel/MAVIS.md +16 -0
  422. package/presets/mavis/php-laravel/REPO_AGENTS.md +7 -47
  423. package/presets/mavis/php-laravel/adapter-map.json +1 -1
  424. package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +21 -5
  425. package/presets/mavis/php-laravel/hooks/list-ai-local.mjs +17 -0
  426. package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +5 -5
  427. package/presets/mavis/php-laravel/rules/code-quality-and-refactoring.md +2 -6
  428. package/presets/mavis/php-laravel/rules/feature-delivery-workflow.md +3 -7
  429. package/presets/mavis/php-laravel/rules/preset-pr-checklist.md +2 -2
  430. package/presets/mavis/svelte/MAVIS.md +2 -6
  431. package/presets/mavis/svelte/REPO_AGENTS.md +8 -48
  432. package/presets/mavis/svelte/adapter-map.json +1 -1
  433. package/presets/mavis/svelte/agents/accessibility-reviewer.md +0 -1
  434. package/presets/mavis/svelte/agents/api-contract-reviewer.md +0 -1
  435. package/presets/mavis/svelte/agents/build-verifier.md +2 -2
  436. package/presets/mavis/svelte/agents/ci-investigator.md +1 -1
  437. package/presets/mavis/svelte/agents/code-reviewer.md +0 -1
  438. package/presets/mavis/svelte/agents/codebase-analyzer.md +0 -1
  439. package/presets/mavis/svelte/agents/debugger.md +1 -1
  440. package/presets/mavis/svelte/agents/feature-developer.md +3 -3
  441. package/presets/mavis/svelte/agents/migration-specialist.md +0 -1
  442. package/presets/mavis/svelte/agents/mockup-reviewer.md +0 -1
  443. package/presets/mavis/svelte/agents/openspec-author.md +0 -1
  444. package/presets/mavis/svelte/agents/performance-auditor.md +0 -1
  445. package/presets/mavis/svelte/agents/playwright-test-generator.md +0 -1
  446. package/presets/mavis/svelte/agents/playwright-test-healer.md +0 -1
  447. package/presets/mavis/svelte/agents/playwright-test-planner.md +0 -1
  448. package/presets/mavis/svelte/agents/qa-tester.md +3 -3
  449. package/presets/mavis/svelte/agents/security-reviewer.md +0 -1
  450. package/presets/mavis/svelte/agents/solution-architect.md +0 -1
  451. package/presets/mavis/svelte/agents/task-analyst.md +0 -1
  452. package/presets/mavis/svelte/agents/task-router.md +8 -7
  453. package/presets/mavis/svelte/agents/tech-writer.md +0 -1
  454. package/presets/mavis/svelte/agents/unit-test-generator.md +0 -1
  455. package/presets/mavis/svelte/agents/unit-test-healer.md +0 -1
  456. package/presets/mavis/svelte/agents/unit-test-planner.md +0 -1
  457. package/presets/mavis/svelte/hooks/chain-team-phases.sh +21 -5
  458. package/presets/mavis/svelte/hooks/list-ai-local.mjs +17 -0
  459. package/presets/mavis/svelte/rules/agent-team-orchestrator.md +5 -5
  460. package/presets/mavis/svelte/rules/code-quality-and-refactoring.md +2 -6
  461. package/presets/mavis/svelte/rules/feature-delivery-workflow.md +3 -7
  462. package/presets/mavis/svelte/rules/post-change-lint.md +13 -13
  463. package/presets/mavis/svelte/rules/preset-pr-checklist.md +2 -2
  464. package/presets/mavis/svelte/skills/feature-delivery/SKILL.md +1 -1
  465. package/presets/mavis/svelte/skills/playwright-e2e/SKILL.md +1 -1
  466. package/presets/mavis/svelte/skills/unit-testing/SKILL.md +1 -1
  467. package/presets/opencode/android-kotlin/OPENCODE.md +1 -43
  468. package/presets/opencode/android-kotlin/REPO_AGENTS.md +7 -47
  469. package/presets/opencode/android-kotlin/adapter-map.json +1 -1
  470. package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +21 -5
  471. package/presets/opencode/android-kotlin/hooks/list-ai-local.mjs +17 -0
  472. package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +5 -5
  473. package/presets/opencode/android-kotlin/rules/code-quality-and-refactoring.md +2 -6
  474. package/presets/opencode/android-kotlin/rules/preset-pr-checklist.md +2 -2
  475. package/presets/opencode/go/OPENCODE.md +7 -39
  476. package/presets/opencode/go/REPO_AGENTS.md +7 -47
  477. package/presets/opencode/go/adapter-map.json +1 -1
  478. package/presets/opencode/go/hooks/chain-team-phases.sh +21 -5
  479. package/presets/opencode/go/hooks/list-ai-local.mjs +17 -0
  480. package/presets/opencode/go/rules/agent-team-orchestrator.md +5 -5
  481. package/presets/opencode/go/rules/code-quality-and-refactoring.md +2 -6
  482. package/presets/opencode/go/rules/feature-delivery-workflow.md +3 -7
  483. package/presets/opencode/go/rules/preset-pr-checklist.md +2 -2
  484. package/presets/opencode/ios-swift/OPENCODE.md +1 -43
  485. package/presets/opencode/ios-swift/REPO_AGENTS.md +7 -47
  486. package/presets/opencode/ios-swift/adapter-map.json +1 -1
  487. package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +21 -5
  488. package/presets/opencode/ios-swift/hooks/list-ai-local.mjs +17 -0
  489. package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +5 -5
  490. package/presets/opencode/ios-swift/rules/code-quality-and-refactoring.md +2 -6
  491. package/presets/opencode/ios-swift/rules/feature-delivery-workflow.md +3 -7
  492. package/presets/opencode/ios-swift/rules/preset-pr-checklist.md +2 -2
  493. package/presets/opencode/java/OPENCODE.md +12 -38
  494. package/presets/opencode/java/REPO_AGENTS.md +7 -47
  495. package/presets/opencode/java/adapter-map.json +1 -1
  496. package/presets/opencode/java/hooks/chain-team-phases.sh +21 -5
  497. package/presets/opencode/java/hooks/list-ai-local.mjs +17 -0
  498. package/presets/opencode/java/rules/agent-team-orchestrator.md +5 -5
  499. package/presets/opencode/java/rules/code-quality-and-refactoring.md +2 -6
  500. package/presets/opencode/java/rules/feature-delivery-workflow.md +3 -7
  501. package/presets/opencode/java/rules/preset-pr-checklist.md +2 -2
  502. package/presets/opencode/mcp-ts/OPENCODE.md +5 -39
  503. package/presets/opencode/mcp-ts/REPO_AGENTS.md +7 -47
  504. package/presets/opencode/mcp-ts/adapter-map.json +1 -1
  505. package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +21 -5
  506. package/presets/opencode/mcp-ts/hooks/list-ai-local.mjs +17 -0
  507. package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +5 -5
  508. package/presets/opencode/mcp-ts/rules/code-quality-and-refactoring.md +2 -6
  509. package/presets/opencode/mcp-ts/rules/feature-delivery-workflow.md +3 -7
  510. package/presets/opencode/mcp-ts/rules/preset-pr-checklist.md +2 -2
  511. package/presets/opencode/mol/OPENCODE.md +1 -44
  512. package/presets/opencode/mol/REPO_AGENTS.md +9 -49
  513. package/presets/opencode/mol/adapter-map.json +1 -1
  514. package/presets/opencode/mol/hooks/chain-team-phases.sh +21 -5
  515. package/presets/opencode/mol/hooks/list-ai-local.mjs +17 -0
  516. package/presets/opencode/mol/rules/agent-team-orchestrator.md +5 -5
  517. package/presets/opencode/mol/rules/code-quality-and-refactoring.md +2 -6
  518. package/presets/opencode/mol/rules/feature-delivery-workflow.md +3 -7
  519. package/presets/opencode/mol/rules/preset-pr-checklist.md +2 -2
  520. package/presets/opencode/next/OPENCODE.md +2 -45
  521. package/presets/opencode/next/REPO_AGENTS.md +10 -50
  522. package/presets/opencode/next/adapter-map.json +1 -17
  523. package/presets/opencode/next/agents/accessibility-reviewer.md +0 -1
  524. package/presets/opencode/next/agents/api-contract-reviewer.md +0 -1
  525. package/presets/opencode/next/agents/build-verifier.md +12 -8
  526. package/presets/opencode/next/agents/ci-investigator.md +5 -2
  527. package/presets/opencode/next/agents/code-reviewer.md +1 -1
  528. package/presets/opencode/next/agents/codebase-analyzer.md +0 -1
  529. package/presets/opencode/next/agents/debugger.md +5 -2
  530. package/presets/opencode/next/agents/feature-developer.md +11 -8
  531. package/presets/opencode/next/agents/migration-specialist.md +0 -1
  532. package/presets/opencode/next/agents/mockup-reviewer.md +0 -1
  533. package/presets/opencode/next/agents/openspec-author.md +0 -1
  534. package/presets/opencode/next/agents/performance-auditor.md +0 -1
  535. package/presets/opencode/next/agents/playwright-test-generator.md +0 -1
  536. package/presets/opencode/next/agents/playwright-test-healer.md +0 -1
  537. package/presets/opencode/next/agents/playwright-test-planner.md +0 -1
  538. package/presets/opencode/next/agents/qa-tester.md +3 -3
  539. package/presets/opencode/next/agents/security-reviewer.md +0 -1
  540. package/presets/opencode/next/agents/solution-architect.md +0 -1
  541. package/presets/opencode/next/agents/task-analyst.md +0 -1
  542. package/presets/opencode/next/agents/task-router.md +8 -7
  543. package/presets/opencode/next/agents/tech-writer.md +0 -1
  544. package/presets/opencode/next/agents/unit-test-generator.md +0 -1
  545. package/presets/opencode/next/agents/unit-test-healer.md +0 -1
  546. package/presets/opencode/next/agents/unit-test-planner.md +0 -1
  547. package/presets/opencode/next/commands/README.md +0 -6
  548. package/presets/opencode/next/hooks/chain-team-phases.sh +21 -5
  549. package/presets/opencode/next/hooks/list-ai-local.mjs +17 -0
  550. package/presets/opencode/next/rules/agent-team-orchestrator.md +5 -5
  551. package/presets/opencode/next/rules/code-quality-and-refactoring.md +2 -6
  552. package/presets/opencode/next/rules/feature-delivery-workflow.md +9 -9
  553. package/presets/opencode/next/rules/post-change-lint.md +11 -15
  554. package/presets/opencode/next/rules/preset-pr-checklist.md +2 -2
  555. package/presets/opencode/next/skills/feature-delivery/SKILL.md +1 -1
  556. package/presets/opencode/next/skills/playwright-e2e/SKILL.md +1 -1
  557. package/presets/opencode/next/skills/unit-testing/SKILL.md +1 -1
  558. package/presets/opencode/nuxt/OPENCODE.md +2 -45
  559. package/presets/opencode/nuxt/REPO_AGENTS.md +8 -48
  560. package/presets/opencode/nuxt/adapter-map.json +1 -1
  561. package/presets/opencode/nuxt/agents/accessibility-reviewer.md +0 -1
  562. package/presets/opencode/nuxt/agents/api-contract-reviewer.md +0 -1
  563. package/presets/opencode/nuxt/agents/build-verifier.md +2 -2
  564. package/presets/opencode/nuxt/agents/ci-investigator.md +1 -1
  565. package/presets/opencode/nuxt/agents/code-reviewer.md +0 -1
  566. package/presets/opencode/nuxt/agents/codebase-analyzer.md +0 -1
  567. package/presets/opencode/nuxt/agents/debugger.md +1 -1
  568. package/presets/opencode/nuxt/agents/feature-developer.md +3 -3
  569. package/presets/opencode/nuxt/agents/migration-specialist.md +0 -1
  570. package/presets/opencode/nuxt/agents/mockup-reviewer.md +0 -1
  571. package/presets/opencode/nuxt/agents/openspec-author.md +0 -1
  572. package/presets/opencode/nuxt/agents/performance-auditor.md +0 -1
  573. package/presets/opencode/nuxt/agents/playwright-test-generator.md +0 -1
  574. package/presets/opencode/nuxt/agents/playwright-test-healer.md +0 -1
  575. package/presets/opencode/nuxt/agents/playwright-test-planner.md +0 -1
  576. package/presets/opencode/nuxt/agents/qa-tester.md +3 -3
  577. package/presets/opencode/nuxt/agents/security-reviewer.md +0 -1
  578. package/presets/opencode/nuxt/agents/solution-architect.md +0 -1
  579. package/presets/opencode/nuxt/agents/task-analyst.md +0 -1
  580. package/presets/opencode/nuxt/agents/task-router.md +8 -7
  581. package/presets/opencode/nuxt/agents/tech-writer.md +0 -1
  582. package/presets/opencode/nuxt/agents/unit-test-generator.md +0 -1
  583. package/presets/opencode/nuxt/agents/unit-test-healer.md +0 -1
  584. package/presets/opencode/nuxt/agents/unit-test-planner.md +0 -1
  585. package/presets/opencode/nuxt/hooks/chain-team-phases.sh +21 -5
  586. package/presets/opencode/nuxt/hooks/list-ai-local.mjs +17 -0
  587. package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +5 -5
  588. package/presets/opencode/nuxt/rules/code-quality-and-refactoring.md +2 -6
  589. package/presets/opencode/nuxt/rules/feature-delivery-workflow.md +3 -7
  590. package/presets/opencode/nuxt/rules/post-change-lint.md +13 -13
  591. package/presets/opencode/nuxt/rules/preset-pr-checklist.md +2 -2
  592. package/presets/opencode/nuxt/skills/feature-delivery/SKILL.md +1 -1
  593. package/presets/opencode/nuxt/skills/playwright-e2e/SKILL.md +1 -1
  594. package/presets/opencode/nuxt/skills/unit-testing/SKILL.md +1 -1
  595. package/presets/opencode/php-hexagonal/OPENCODE.md +14 -38
  596. package/presets/opencode/php-hexagonal/REPO_AGENTS.md +7 -47
  597. package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
  598. package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +21 -5
  599. package/presets/opencode/php-hexagonal/hooks/list-ai-local.mjs +17 -0
  600. package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +5 -5
  601. package/presets/opencode/php-hexagonal/rules/code-quality-and-refactoring.md +2 -6
  602. package/presets/opencode/php-hexagonal/rules/feature-delivery-workflow.md +3 -7
  603. package/presets/opencode/php-hexagonal/rules/preset-pr-checklist.md +2 -2
  604. package/presets/opencode/php-laravel/OPENCODE.md +14 -38
  605. package/presets/opencode/php-laravel/REPO_AGENTS.md +7 -47
  606. package/presets/opencode/php-laravel/adapter-map.json +1 -1
  607. package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +21 -5
  608. package/presets/opencode/php-laravel/hooks/list-ai-local.mjs +17 -0
  609. package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +5 -5
  610. package/presets/opencode/php-laravel/rules/code-quality-and-refactoring.md +2 -6
  611. package/presets/opencode/php-laravel/rules/feature-delivery-workflow.md +3 -7
  612. package/presets/opencode/php-laravel/rules/preset-pr-checklist.md +2 -2
  613. package/presets/opencode/plugins/output-guard/README.md +43 -0
  614. package/presets/opencode/plugins/output-guard/index.ts +306 -0
  615. package/presets/opencode/plugins/output-guard/ledger.ts +43 -0
  616. package/presets/opencode/plugins/output-guard/package.json +9 -0
  617. package/presets/opencode/plugins/output-guard/rewrite.ts +149 -0
  618. package/presets/opencode/plugins/task-status/economy.ts +112 -0
  619. package/presets/opencode/plugins/task-status/task-view.ts +86 -20
  620. package/presets/opencode/plugins/task-status/tui.tsx +19 -5
  621. package/presets/opencode/plugins/task-status/types.ts +3 -1
  622. package/presets/opencode/svelte/OPENCODE.md +2 -45
  623. package/presets/opencode/svelte/REPO_AGENTS.md +8 -48
  624. package/presets/opencode/svelte/adapter-map.json +1 -1
  625. package/presets/opencode/svelte/agents/accessibility-reviewer.md +0 -1
  626. package/presets/opencode/svelte/agents/api-contract-reviewer.md +0 -1
  627. package/presets/opencode/svelte/agents/build-verifier.md +2 -2
  628. package/presets/opencode/svelte/agents/ci-investigator.md +1 -1
  629. package/presets/opencode/svelte/agents/code-reviewer.md +0 -1
  630. package/presets/opencode/svelte/agents/codebase-analyzer.md +0 -1
  631. package/presets/opencode/svelte/agents/debugger.md +1 -1
  632. package/presets/opencode/svelte/agents/feature-developer.md +3 -3
  633. package/presets/opencode/svelte/agents/migration-specialist.md +0 -1
  634. package/presets/opencode/svelte/agents/mockup-reviewer.md +0 -1
  635. package/presets/opencode/svelte/agents/openspec-author.md +0 -1
  636. package/presets/opencode/svelte/agents/performance-auditor.md +0 -1
  637. package/presets/opencode/svelte/agents/playwright-test-generator.md +0 -1
  638. package/presets/opencode/svelte/agents/playwright-test-healer.md +0 -1
  639. package/presets/opencode/svelte/agents/playwright-test-planner.md +0 -1
  640. package/presets/opencode/svelte/agents/qa-tester.md +3 -3
  641. package/presets/opencode/svelte/agents/security-reviewer.md +0 -1
  642. package/presets/opencode/svelte/agents/solution-architect.md +0 -1
  643. package/presets/opencode/svelte/agents/task-analyst.md +0 -1
  644. package/presets/opencode/svelte/agents/task-router.md +8 -7
  645. package/presets/opencode/svelte/agents/tech-writer.md +0 -1
  646. package/presets/opencode/svelte/agents/unit-test-generator.md +0 -1
  647. package/presets/opencode/svelte/agents/unit-test-healer.md +0 -1
  648. package/presets/opencode/svelte/agents/unit-test-planner.md +0 -1
  649. package/presets/opencode/svelte/hooks/chain-team-phases.sh +21 -5
  650. package/presets/opencode/svelte/hooks/list-ai-local.mjs +17 -0
  651. package/presets/opencode/svelte/rules/agent-team-orchestrator.md +5 -5
  652. package/presets/opencode/svelte/rules/code-quality-and-refactoring.md +2 -6
  653. package/presets/opencode/svelte/rules/feature-delivery-workflow.md +3 -7
  654. package/presets/opencode/svelte/rules/post-change-lint.md +13 -13
  655. package/presets/opencode/svelte/rules/preset-pr-checklist.md +2 -2
  656. package/presets/opencode/svelte/skills/feature-delivery/SKILL.md +1 -1
  657. package/presets/opencode/svelte/skills/playwright-e2e/SKILL.md +1 -1
  658. package/presets/opencode/svelte/skills/unit-testing/SKILL.md +1 -1
  659. package/presets/zcode/android-kotlin/REPO_AGENTS.md +7 -47
  660. package/presets/zcode/android-kotlin/adapter-map.json +1 -1
  661. package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +21 -5
  662. package/presets/zcode/android-kotlin/hooks/list-ai-local.mjs +17 -0
  663. package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +5 -5
  664. package/presets/zcode/android-kotlin/rules/code-quality-and-refactoring.md +2 -6
  665. package/presets/zcode/android-kotlin/rules/preset-pr-checklist.md +2 -2
  666. package/presets/zcode/go/REPO_AGENTS.md +7 -47
  667. package/presets/zcode/go/adapter-map.json +1 -1
  668. package/presets/zcode/go/hooks/chain-team-phases.sh +21 -5
  669. package/presets/zcode/go/hooks/list-ai-local.mjs +17 -0
  670. package/presets/zcode/go/rules/agent-team-orchestrator.md +5 -5
  671. package/presets/zcode/go/rules/code-quality-and-refactoring.md +2 -6
  672. package/presets/zcode/go/rules/feature-delivery-workflow.md +3 -7
  673. package/presets/zcode/go/rules/preset-pr-checklist.md +2 -2
  674. package/presets/zcode/ios-swift/REPO_AGENTS.md +7 -47
  675. package/presets/zcode/ios-swift/adapter-map.json +1 -1
  676. package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +21 -5
  677. package/presets/zcode/ios-swift/hooks/list-ai-local.mjs +17 -0
  678. package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +5 -5
  679. package/presets/zcode/ios-swift/rules/code-quality-and-refactoring.md +2 -6
  680. package/presets/zcode/ios-swift/rules/feature-delivery-workflow.md +3 -7
  681. package/presets/zcode/ios-swift/rules/preset-pr-checklist.md +2 -2
  682. package/presets/zcode/java/REPO_AGENTS.md +7 -47
  683. package/presets/zcode/java/adapter-map.json +1 -1
  684. package/presets/zcode/java/hooks/chain-team-phases.sh +21 -5
  685. package/presets/zcode/java/hooks/list-ai-local.mjs +17 -0
  686. package/presets/zcode/java/rules/agent-team-orchestrator.md +5 -5
  687. package/presets/zcode/java/rules/code-quality-and-refactoring.md +2 -6
  688. package/presets/zcode/java/rules/feature-delivery-workflow.md +3 -7
  689. package/presets/zcode/java/rules/preset-pr-checklist.md +2 -2
  690. package/presets/zcode/mcp-ts/REPO_AGENTS.md +7 -47
  691. package/presets/zcode/mcp-ts/adapter-map.json +1 -1
  692. package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +21 -5
  693. package/presets/zcode/mcp-ts/hooks/list-ai-local.mjs +17 -0
  694. package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +5 -5
  695. package/presets/zcode/mcp-ts/rules/code-quality-and-refactoring.md +2 -6
  696. package/presets/zcode/mcp-ts/rules/feature-delivery-workflow.md +3 -7
  697. package/presets/zcode/mcp-ts/rules/preset-pr-checklist.md +2 -2
  698. package/presets/zcode/mol/REPO_AGENTS.md +9 -49
  699. package/presets/zcode/mol/adapter-map.json +1 -1
  700. package/presets/zcode/mol/hooks/chain-team-phases.sh +21 -5
  701. package/presets/zcode/mol/hooks/list-ai-local.mjs +17 -0
  702. package/presets/zcode/mol/rules/agent-team-orchestrator.md +5 -5
  703. package/presets/zcode/mol/rules/code-quality-and-refactoring.md +2 -6
  704. package/presets/zcode/mol/rules/feature-delivery-workflow.md +3 -7
  705. package/presets/zcode/mol/rules/preset-pr-checklist.md +2 -2
  706. package/presets/zcode/next/REPO_AGENTS.md +10 -50
  707. package/presets/zcode/next/adapter-map.json +1 -17
  708. package/presets/zcode/next/agents/accessibility-reviewer.md +0 -1
  709. package/presets/zcode/next/agents/api-contract-reviewer.md +0 -1
  710. package/presets/zcode/next/agents/build-verifier.md +12 -8
  711. package/presets/zcode/next/agents/ci-investigator.md +5 -2
  712. package/presets/zcode/next/agents/code-reviewer.md +1 -1
  713. package/presets/zcode/next/agents/codebase-analyzer.md +0 -1
  714. package/presets/zcode/next/agents/debugger.md +5 -2
  715. package/presets/zcode/next/agents/feature-developer.md +11 -8
  716. package/presets/zcode/next/agents/migration-specialist.md +0 -1
  717. package/presets/zcode/next/agents/mockup-reviewer.md +0 -1
  718. package/presets/zcode/next/agents/openspec-author.md +0 -1
  719. package/presets/zcode/next/agents/performance-auditor.md +0 -1
  720. package/presets/zcode/next/agents/playwright-test-generator.md +0 -1
  721. package/presets/zcode/next/agents/playwright-test-healer.md +0 -1
  722. package/presets/zcode/next/agents/playwright-test-planner.md +0 -1
  723. package/presets/zcode/next/agents/qa-tester.md +3 -3
  724. package/presets/zcode/next/agents/security-reviewer.md +0 -1
  725. package/presets/zcode/next/agents/solution-architect.md +0 -1
  726. package/presets/zcode/next/agents/task-analyst.md +0 -1
  727. package/presets/zcode/next/agents/task-router.md +8 -7
  728. package/presets/zcode/next/agents/tech-writer.md +0 -1
  729. package/presets/zcode/next/agents/unit-test-generator.md +0 -1
  730. package/presets/zcode/next/agents/unit-test-healer.md +0 -1
  731. package/presets/zcode/next/agents/unit-test-planner.md +0 -1
  732. package/presets/zcode/next/commands/README.md +0 -6
  733. package/presets/zcode/next/hooks/chain-team-phases.sh +21 -5
  734. package/presets/zcode/next/hooks/list-ai-local.mjs +17 -0
  735. package/presets/zcode/next/rules/agent-team-orchestrator.md +5 -5
  736. package/presets/zcode/next/rules/code-quality-and-refactoring.md +2 -6
  737. package/presets/zcode/next/rules/feature-delivery-workflow.md +9 -9
  738. package/presets/zcode/next/rules/post-change-lint.md +11 -15
  739. package/presets/zcode/next/rules/preset-pr-checklist.md +2 -2
  740. package/presets/zcode/next/skills/feature-delivery/SKILL.md +1 -1
  741. package/presets/zcode/next/skills/playwright-e2e/SKILL.md +1 -1
  742. package/presets/zcode/next/skills/unit-testing/SKILL.md +1 -1
  743. package/presets/zcode/nuxt/REPO_AGENTS.md +8 -48
  744. package/presets/zcode/nuxt/adapter-map.json +1 -1
  745. package/presets/zcode/nuxt/agents/accessibility-reviewer.md +0 -1
  746. package/presets/zcode/nuxt/agents/api-contract-reviewer.md +0 -1
  747. package/presets/zcode/nuxt/agents/build-verifier.md +2 -2
  748. package/presets/zcode/nuxt/agents/ci-investigator.md +1 -1
  749. package/presets/zcode/nuxt/agents/code-reviewer.md +0 -1
  750. package/presets/zcode/nuxt/agents/codebase-analyzer.md +0 -1
  751. package/presets/zcode/nuxt/agents/debugger.md +1 -1
  752. package/presets/zcode/nuxt/agents/feature-developer.md +3 -3
  753. package/presets/zcode/nuxt/agents/migration-specialist.md +0 -1
  754. package/presets/zcode/nuxt/agents/mockup-reviewer.md +0 -1
  755. package/presets/zcode/nuxt/agents/openspec-author.md +0 -1
  756. package/presets/zcode/nuxt/agents/performance-auditor.md +0 -1
  757. package/presets/zcode/nuxt/agents/playwright-test-generator.md +0 -1
  758. package/presets/zcode/nuxt/agents/playwright-test-healer.md +0 -1
  759. package/presets/zcode/nuxt/agents/playwright-test-planner.md +0 -1
  760. package/presets/zcode/nuxt/agents/qa-tester.md +3 -3
  761. package/presets/zcode/nuxt/agents/security-reviewer.md +0 -1
  762. package/presets/zcode/nuxt/agents/solution-architect.md +0 -1
  763. package/presets/zcode/nuxt/agents/task-analyst.md +0 -1
  764. package/presets/zcode/nuxt/agents/task-router.md +8 -7
  765. package/presets/zcode/nuxt/agents/tech-writer.md +0 -1
  766. package/presets/zcode/nuxt/agents/unit-test-generator.md +0 -1
  767. package/presets/zcode/nuxt/agents/unit-test-healer.md +0 -1
  768. package/presets/zcode/nuxt/agents/unit-test-planner.md +0 -1
  769. package/presets/zcode/nuxt/hooks/chain-team-phases.sh +21 -5
  770. package/presets/zcode/nuxt/hooks/list-ai-local.mjs +17 -0
  771. package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +5 -5
  772. package/presets/zcode/nuxt/rules/code-quality-and-refactoring.md +2 -6
  773. package/presets/zcode/nuxt/rules/feature-delivery-workflow.md +3 -7
  774. package/presets/zcode/nuxt/rules/post-change-lint.md +13 -13
  775. package/presets/zcode/nuxt/rules/preset-pr-checklist.md +2 -2
  776. package/presets/zcode/nuxt/skills/feature-delivery/SKILL.md +1 -1
  777. package/presets/zcode/nuxt/skills/playwright-e2e/SKILL.md +1 -1
  778. package/presets/zcode/nuxt/skills/unit-testing/SKILL.md +1 -1
  779. package/presets/zcode/php-hexagonal/REPO_AGENTS.md +7 -47
  780. package/presets/zcode/php-hexagonal/adapter-map.json +1 -1
  781. package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +21 -5
  782. package/presets/zcode/php-hexagonal/hooks/list-ai-local.mjs +17 -0
  783. package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +5 -5
  784. package/presets/zcode/php-hexagonal/rules/code-quality-and-refactoring.md +2 -6
  785. package/presets/zcode/php-hexagonal/rules/feature-delivery-workflow.md +3 -7
  786. package/presets/zcode/php-hexagonal/rules/preset-pr-checklist.md +2 -2
  787. package/presets/zcode/php-laravel/REPO_AGENTS.md +7 -47
  788. package/presets/zcode/php-laravel/adapter-map.json +1 -1
  789. package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +21 -5
  790. package/presets/zcode/php-laravel/hooks/list-ai-local.mjs +17 -0
  791. package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +5 -5
  792. package/presets/zcode/php-laravel/rules/code-quality-and-refactoring.md +2 -6
  793. package/presets/zcode/php-laravel/rules/feature-delivery-workflow.md +3 -7
  794. package/presets/zcode/php-laravel/rules/preset-pr-checklist.md +2 -2
  795. package/presets/zcode/svelte/REPO_AGENTS.md +8 -48
  796. package/presets/zcode/svelte/adapter-map.json +1 -1
  797. package/presets/zcode/svelte/agents/accessibility-reviewer.md +0 -1
  798. package/presets/zcode/svelte/agents/api-contract-reviewer.md +0 -1
  799. package/presets/zcode/svelte/agents/build-verifier.md +2 -2
  800. package/presets/zcode/svelte/agents/ci-investigator.md +1 -1
  801. package/presets/zcode/svelte/agents/code-reviewer.md +0 -1
  802. package/presets/zcode/svelte/agents/codebase-analyzer.md +0 -1
  803. package/presets/zcode/svelte/agents/debugger.md +1 -1
  804. package/presets/zcode/svelte/agents/feature-developer.md +3 -3
  805. package/presets/zcode/svelte/agents/migration-specialist.md +0 -1
  806. package/presets/zcode/svelte/agents/mockup-reviewer.md +0 -1
  807. package/presets/zcode/svelte/agents/openspec-author.md +0 -1
  808. package/presets/zcode/svelte/agents/performance-auditor.md +0 -1
  809. package/presets/zcode/svelte/agents/playwright-test-generator.md +0 -1
  810. package/presets/zcode/svelte/agents/playwright-test-healer.md +0 -1
  811. package/presets/zcode/svelte/agents/playwright-test-planner.md +0 -1
  812. package/presets/zcode/svelte/agents/qa-tester.md +3 -3
  813. package/presets/zcode/svelte/agents/security-reviewer.md +0 -1
  814. package/presets/zcode/svelte/agents/solution-architect.md +0 -1
  815. package/presets/zcode/svelte/agents/task-analyst.md +0 -1
  816. package/presets/zcode/svelte/agents/task-router.md +8 -7
  817. package/presets/zcode/svelte/agents/tech-writer.md +0 -1
  818. package/presets/zcode/svelte/agents/unit-test-generator.md +0 -1
  819. package/presets/zcode/svelte/agents/unit-test-healer.md +0 -1
  820. package/presets/zcode/svelte/agents/unit-test-planner.md +0 -1
  821. package/presets/zcode/svelte/hooks/chain-team-phases.sh +21 -5
  822. package/presets/zcode/svelte/hooks/list-ai-local.mjs +17 -0
  823. package/presets/zcode/svelte/rules/agent-team-orchestrator.md +5 -5
  824. package/presets/zcode/svelte/rules/code-quality-and-refactoring.md +2 -6
  825. package/presets/zcode/svelte/rules/feature-delivery-workflow.md +3 -7
  826. package/presets/zcode/svelte/rules/post-change-lint.md +13 -13
  827. package/presets/zcode/svelte/rules/preset-pr-checklist.md +2 -2
  828. package/presets/zcode/svelte/skills/feature-delivery/SKILL.md +1 -1
  829. package/presets/zcode/svelte/skills/playwright-e2e/SKILL.md +1 -1
  830. package/presets/zcode/svelte/skills/unit-testing/SKILL.md +1 -1
  831. package/scripts/report-context-cost.mjs +432 -0
  832. package/presets/_shared/ai-local/scripts/team-db-dashboard.mjs +0 -2103
  833. package/presets/_shared/ai-local/scripts/team-db-ui.mjs +0 -750
  834. package/presets/claude/next/commands/ui-start.md +0 -78
  835. package/presets/claude/next/commands/ui-stop.md +0 -71
  836. package/presets/cursor/next/commands/ui-start.md +0 -78
  837. package/presets/cursor/next/commands/ui-stop.md +0 -71
  838. package/presets/mavis/next/commands/ui-start.md +0 -73
  839. package/presets/mavis/next/commands/ui-stop.md +0 -66
  840. package/presets/opencode/next/commands/ui-start.md +0 -81
  841. package/presets/opencode/next/commands/ui-stop.md +0 -74
  842. package/presets/zcode/next/commands/ui-start.md +0 -81
  843. package/presets/zcode/next/commands/ui-stop.md +0 -74
package/docs/TEAM-DB.md CHANGED
@@ -4,25 +4,23 @@
4
4
  The task files remain the source of truth; the database exists so an operator or a tool can
5
5
  query history without walking JSON on every request.
6
6
 
7
- The projection is installed by `init` as ten `team-db*.mjs` modules under `.ai.local/scripts/`:
7
+ The projection is installed by `init` as eight `team-db*.mjs` modules under `.ai.local/scripts/`:
8
8
 
9
9
  | Module | Role |
10
10
  |---|---|
11
- | `team-db.mjs` | CLI: `init`, `sync`, `delete`, `migrate-tasks`, `check`, `search`, `serve`, `jobs`, `schedule`, `tracker`, `task-run`, `ui` |
12
- | `team-db-ui.mjs` | the `ui` supervisor: probe-first `start`, `stop`, `status`, `restart`, the ownership marker, leader-only termination |
11
+ | `team-db.mjs` | CLI: `init`, `sync`, `delete`, `migrate-tasks`, `check`, `search`, `serve`, `jobs`, `schedule`, `tracker`, `task-run` |
13
12
  | `team-db-tracker.mjs` | the file-authoritative tracker: items, links, the launch queue, eligibility order, import |
14
13
  | `team-db-task-runner.mjs` | the opt-in `team/runner.json` supervisor behind tracker Continue |
15
14
  | `team-db-schema.mjs` | capability probe, embedded migrations, pragmas, fingerprint, integrity |
16
15
  | `team-db-project.mjs` | parsers, idempotent projector, confirmed task deletion, retention, search |
17
16
  | `team-db-api.mjs` | `node:http` server (reads plus the bounded mutations), query layer, security boundary |
18
17
  | `team-db-openapi.mjs` | the OpenAPI 3.1 document source |
19
- | `team-db-dashboard.mjs` | the no-build dashboard (HTML, CSS, JS strings) |
20
18
  | `team-db-scheduler.mjs` | job model, cron/interval math, the file store, the projection, and the timer |
21
19
 
22
- The same seeded set is `ENGINE_SCRIPTS` in `bin/lib/engine-scripts.js`: the ten `team-db*.mjs`
20
+ The same seeded set is `ENGINE_SCRIPTS` in `bin/lib/engine-scripts.js`: the eight `team-db*.mjs`
23
21
  modules plus the self-learning engine, `manifest.mjs`, `dump-output.mjs`,
24
22
  `check-write-scope.mjs`, `aggregate-agent-task-metrics.mjs`, and the `processes.mjs` +
25
- `process-lease.mjs` process manager (twenty-two published entries;
23
+ `process-lease.mjs` process manager (twenty published entries;
26
24
  `node -e "require('./bin/lib/engine-scripts.js').SHIPPED_ENGINE_SCRIPTS.length"` prints the
27
25
  shipped count). One further module, `upstream-research.mjs`, is declared in
28
26
  `REPO_ONLY_ENGINE_SCRIPTS`: it exists in this repository's preset source and dogfood mirror but
@@ -46,7 +44,8 @@ is excluded from the published tarball, and a consumer install skips it without
46
44
  asynchronous child process — the server never opens a writable connection, and the kill
47
45
  switch answers before a child is spawned. Job writes carry `application/json` and at most
48
46
  64 KiB, run-now an absent body or `{}`. The rescan and delete children are bounded at 30 s,
49
- a job write or run-now at 10 s. There is no write-back, no telemetry, and no outbound call.
47
+ a job write or run-now at 10 s. There is no write-back and no outbound call; the efficiency
48
+ ledgers are local files read by a full sync.
50
49
  - **The scheduler writes files before rows.** `scheduler/jobs.json` is the definition of
51
50
  record, `scheduler/runs/**` and `scheduler/state.json` are its runtime state, and the three
52
51
  `scheduled_jobs` / `job_runs` / `job_run_events` tables are projections of those files. The
@@ -66,9 +65,10 @@ team.db-shm
66
65
  team-db-errors.log
67
66
  team/scheduler/runs/
68
67
  team/scheduler/state.json
68
+ team/output-guard/
69
69
  ```
70
70
 
71
- `team/scheduler/jobs.json` stays tracked: definitions are code, run output is not. The
71
+ `team/scheduler/jobs.json` stays tracked: definitions are code, run output is not. `team/output-guard/` holds the OpenCode output-guard spill files; runtime state, never commit. The
72
72
  consumer root `.gitignore` is never created or edited. Never commit the database even
73
73
  for a demo: it contains copies of prompts and task documents.
74
74
 
@@ -112,17 +112,15 @@ and the pipeline run with exit 0.
112
112
  node .ai.local/scripts/team-db.mjs init [--root <team-dir>] [--rebuild]
113
113
  node .ai.local/scripts/team-db.mjs sync [--root <team-dir>] [--slug <slug>] [--quiet] [--json]
114
114
  [--maintain] [--prune] [--vacuum]
115
- [--rebuild | --no-rebuild] [--deadline-ms <n>]
115
+ [--rebuild | --no-rebuild]
116
+ [--telemetry | --no-telemetry] [--deadline-ms <n>]
116
117
  node .ai.local/scripts/team-db.mjs delete --slug <slug> [--root <team-dir>] [--json]
117
118
  node .ai.local/scripts/team-db.mjs migrate-tasks [--root <team-dir>] [--quiet] [--json]
118
119
  [--rebuild | --no-rebuild]
119
120
  node .ai.local/scripts/team-db.mjs check [--root <team-dir>]
120
121
  node .ai.local/scripts/team-db.mjs search <query> [--limit <n>] [--json] [--root <team-dir>]
121
122
  node .ai.local/scripts/team-db.mjs serve [--root <team-dir>] [--host <addr>] [--port <n>]
122
- [--allow-remote] [--open]
123
- node .ai.local/scripts/team-db.mjs ui start|restart [--root <team-dir>] [--json] [--quiet]
124
- [--host <loopback>] [--port <n>] [--open]
125
- node .ai.local/scripts/team-db.mjs ui stop|status [--root <team-dir>] [--json] [--quiet]
123
+ [--allow-remote]
126
124
  node .ai.local/scripts/team-db.mjs jobs list [--enabled] [--sort <key>] [--json] [--quiet]
127
125
  node .ai.local/scripts/team-db.mjs jobs get <id> [--json]
128
126
  node .ai.local/scripts/team-db.mjs jobs put --file <path|-> [--dry-run] [--json]
@@ -199,13 +197,15 @@ targets must be on the same host.
199
197
 
200
198
  | Name | Effect |
201
199
  |---|---|
202
- | `AI_RULES_TEAM_DB_DISABLE` | truthy value turns the **projection** off — the database write points, the `task-run ensure` seed and `serve` stop; `ui start`/`ui restart` refuse with `E_DISABLED` before any probe, write or signal; the task files and the `tracker` file verbs stay usable (the tracker is not disabled by this switch, R3-7) |
200
+ | `AI_RULES_TEAM_DB_DISABLE` | truthy value turns the **projection** off — the database write points, the `task-run ensure` seed and `serve` stop; the task files and the `tracker` file verbs stay usable (the tracker is not disabled by this switch, R3-7) |
203
201
  | `AI_RULES_TEAM_DB_FORCE_FALLBACK` | truthy value forces the file-only path even on a supported runtime |
204
202
  | `AI_RULES_TEAM_DB_ROOT` | team directory when `--root` is absent |
205
203
  | `AI_RULES_TEAM_DB_PATH` | database file path (default `<teamRoot>/team.db`) |
206
204
  | `AI_RULES_TEAM_DB_LOG` | error-log path (default `<cwd>/.ai.local/team/team-db-errors.log`) |
207
205
  | `AI_RULES_TEAM_DB_SEAM` | phase label in the error log: `hook`, `receipt`, `cli`, `serve` |
208
206
  | `AI_RULES_TEAM_DB_TRACKER_DRAIN_DISABLE` | truthy value stops the hook stop-seam auto-drain only; the `tracker` file verbs stay usable |
207
+ | `AI_RULES_TEAM_DB_TELEMETRY_DIR` | output-guard ledger directory read by a full sync (default `<teamRoot>/output-guard`); the API and the hook never read it |
208
+ | `AI_RULES_OUTPUT_GUARD_ROTATE_BYTES` | ledger rotation cap read once by the plugin's `setup()` (default 8 MiB, `0` disables); never read inside the `context` hook |
209
209
 
210
210
  No other environment value is read or persisted. The error log stores a timestamp, a code,
211
211
  a phase, and a message; it never stores prompt content or an environment value, and it is
@@ -361,8 +361,8 @@ for repository maintainers.
361
361
  The `next` preset carries one `pipeline` job, `upstream-research`, and one engine module,
362
362
  `.ai.local/scripts/upstream-research.mjs`. The job renders `upstream/prompt.md` and runs the
363
363
  module with `--prompt {promptFile} --team-root . --repo-root ../..`; it is a normal
364
- definition in `scheduler/jobs.json`, so `jobs list|get|put|enable|disable|run`, the dashboard
365
- Jobs tab, and every job route work unchanged. `init`/`update` seed the definition into
364
+ definition in `scheduler/jobs.json`, so `jobs list|get|put|enable|disable|run`, the API job
365
+ routes, and every consumer UI work unchanged. `init`/`update` seed the definition into
366
366
  `scheduler/jobs.json` when the file is absent (template:
367
367
  `presets/cursor/next/team/upstream/jobs.json`; the validator supplies the
368
368
  `createdAt`/`updatedAt`/`revision` defaults on read), and a definition the operator already
@@ -462,6 +462,24 @@ two bounded directory listings inside the existing sync deadline — 200 items m
462
462
  under 250 ms — and is idempotent by `content_hash` with `absent_at` marking like the task
463
463
  walker; `sync --prune` removes tombstoned tracker rows.
464
464
 
465
+ Migration `0005-efficiency` moves `SCHEMA_VERSION` to 5. It is additive: `attempts` gains the
466
+ eleven usage columns, `gates` gains `outcome` and `outcome_derived`, and seven tables appear —
467
+ `tool_calls`, `usage_turns`, `session_tasks`, `telemetry_sources`, `efficiency_runs`,
468
+ `efficiency_run_cells`, `context_cost_hosts` — with the eight named indexes from the approved
469
+ SQL. A v4 database opens and migrates in place without losing a row; a v5 database is refused
470
+ by a v4 binary with `E_SCHEMA_NEWER`. The added columns stay `NULL` when no writer reported
471
+ them: a host `usage` object on `attempt_finished` wins, and `usage_recorded`
472
+ events are summed only when that object is absent, with `usage_source` recording `host` or
473
+ `cli`. A full `sync` ingests `output-guard/results*.jsonl` and `usage*.jsonl` (tool calls and
474
+ turns) plus `.session-leases/*.json` (session → task windows); a `--slug` sync never ingests,
475
+ `--no-telemetry` skips it, and `--telemetry` combined with `--slug` is `E_USAGE` exit 3. A
476
+ per-file `(size, mtime)` watermark in `telemetry_sources` makes a second run over an unchanged
477
+ tree a no-op, and a duplicate `(sessionID, callID)` / `(sessionID, messageID)` keeps the
478
+ earliest `observed_at`, so a plugin reload cannot move a row to a later day. Attribution runs
479
+ through the lease window only; a row outside every window stays `unmapped`. Three remaining
480
+ tables — `efficiency_runs`, `efficiency_run_cells`, `context_cost_hosts` — are populated by
481
+ later phases and stay empty in P1.
482
+
465
483
  Each connection sets `journal_mode=WAL`, `busy_timeout=5000`, `foreign_keys=ON`, and
466
484
  `synchronous=NORMAL`. One task is projected in one transaction; a `SIGKILL` mid-sync
467
485
  rolls back the in-flight task and leaves `integrity_check` `ok`.
@@ -500,15 +518,16 @@ The registry is not a migration chain: `MIGRATIONS` and `SCHEMA_VERSION` are unc
500
518
  closed, and FTS5 stays a **runtime capability** — a runtime without FTS5 records `like` in `schema_meta`, so the
501
519
  registry never turns FTS5 into a hard schema dependency.
502
520
 
503
- ## Dashboard and API
521
+ ## HTTP API
504
522
 
505
523
  `team-db.mjs serve` prints one line with the bound URL (default
506
- `http://127.0.0.1:4178`). The dashboard is a single no-build HTML document at `/`, its CSS and
507
- JS are served from `/assets/`, and the OpenAPI 3.1 document is at `/openapi.json`. The frozen
508
- document is checked in at `packages/ai-rules/docs/openapi/team-db.v1.json`; the gate is
524
+ `http://127.0.0.1:4178`). It serves JSON only: the OpenAPI 3.1 document is at `/openapi.json`,
525
+ and there is no built-in HTML page or browser surface. The frozen document is checked in at
526
+ `packages/ai-rules/docs/openapi/team-db.v1.json`; the gate is
509
527
  `node scripts/check-team-db-contract.mjs`. The server loads its modules at start: restart
510
528
  `serve` after an update to take a new route or method set — a stale process keeps answering
511
- the old surface (for example, `405` on a route the new code serves).
529
+ the old surface (for example, `405` on a route the new code serves). A consumer that wants a
530
+ browser surface builds it in its own app and proxies to this API.
512
531
 
513
532
  The API exposes the delete as `DELETE /api/v1/tasks/{slug}` — the same canonical deletion
514
533
  as the CLI, executed as one bounded child. It answers `200` with `{"slug":"<S>"}` on
@@ -531,88 +550,58 @@ the confirmed task delete and the rescan to the named interface without authenti
531
550
  A job definition carries arbitrary `argv` and run-now enqueues it, so that surface
532
551
  executes operator-supplied commands as the API user; see `## Scheduled jobs`.
533
552
 
534
- ## Dashboard lifecycle
535
-
536
- `ui` runs the same server `serve` does, detached, with a marker the next call can prove:
537
-
538
- ```bash
539
- node .ai.local/scripts/team-db.mjs ui start [--host <loopback>] [--port <n>] [--open] [--json] [--quiet]
540
- node .ai.local/scripts/team-db.mjs ui status [--json]
541
- node .ai.local/scripts/team-db.mjs ui stop [--json]
542
- node .ai.local/scripts/team-db.mjs ui restart [--host <loopback>] [--port <n>] [--open] [--json] [--quiet]
543
- ```
544
-
545
- Exit codes: `0` started, already running, stopped, or nothing running; `1` a refusal
546
- (`E_UI_OTHER_ROOT`, `E_UI_PORT_FOREIGN`, `E_UI_DISABLED`, `E_UI_UNAVAILABLE`, `E_UI_DB_MISSING`),
547
- or a leader that outlived `SIGKILL` (the marker is kept); `2` a start failure
548
- (`E_UI_START_TIMEOUT`, `E_UI_CHILD_EXIT`, `E_UI_MARKER_UNWRITABLE`, `E_UI_PORT_IN_USE`); `3` usage.
549
-
550
- The bind address is loopback (`127.0.0.1` by default): `--allow-remote` and any non-loopback
551
- `--host` are usage errors, so the verb never exposes the dashboard.
552
-
553
- **`start` is probe-first.** A server that already answers `200` on the requested target with this
554
- repository's `rootId` is the no-op: the command prints the same pid, leaves `startedAt` untouched
555
- and writes nothing. A live marker for this root on another port is reused the same way instead of
556
- starting a second server. Only a free port leads to a detached `serve` and the marker; `restart` is
557
- the verb that stops and replaces an owned server. The `ui` path writes the marker plus at most one
558
- bounded `sync` — the missing-projection repair (`503 E_DB_MISSING` → one `team-db.mjs sync`, 30 s
559
- cap) — and nothing under `team/`: no `migrate-tasks`, no `runner.json`. The `E_DISABLED` and
560
- `E_UI_UNAVAILABLE` preflights run before any probe, write or signal, so a disabled runtime never
561
- stops a live server.
562
-
563
- The marker is `.ai.local/.ui/api.json` —
564
- `{schemaVersion,pid,host,port,root,rootId,startedAt,command}` — written `0600` through
565
- `api.json.tmp` + rename, with `rootId = sha256(realpath(resolved team root)).slice(0, 12)`: a hash,
566
- never a path, and never transmitted. A marker whose `host` is outside `LOOPBACK_HOSTS`, or whose
567
- port is not an integer in `0..65535`, is treated as unreadable: no probe ever targets it, and `stop`
568
- removes it as stale.
569
-
570
- **Ownership is the authorization.** A signal needs the marker pid alive **and**
571
- `ps -p <pid> -o command=` matching `/team-db\.mjs\s+serve\b/`; the marker alone never authorizes one.
572
- `stop` re-proves ownership immediately before each signal, signals that leader pid only — never the
573
- process group, because `serve` spawns bounded delete children — sends `SIGTERM`, polls every 100 ms
574
- for at most 5 000 ms, then `SIGKILL`s and verifies the pid is gone. A process that survives keeps its
575
- marker and the command exits `1`. A live pid whose command does not match is left running with its
576
- marker intact. A server answering with a different `rootId` is `E_UI_OTHER_ROOT`; a port answered by
577
- something that is not a team-db health document is `E_UI_PORT_FOREIGN`; neither writes a marker.
578
-
579
- **Platform.** `ui` is POSIX only: the ownership proof reads `ps`, and no equivalent command-line
580
- reader exists on Windows, so no signal is ever sent there and `stop` reports the pid as unowned.
581
- Use the foreground `serve` on Windows.
582
-
583
- **The root override.** `--root <team-dir>` wins; otherwise `AI_RULES_TEAM_DB_ROOT`; otherwise
584
- `<cwd>/.ai.local/team` — the same precedence as the projection layers, so `ui status` and `ui stop`
585
- find a server started through the environment variable.
586
-
587
- **The timer stays separate.** `ui start` never starts `team-db.mjs schedule`: the timer is one
588
- foreground process holding a lease, and it is started explicitly. `ui start` and `ui status --json`
589
- report the read-only `/health.scheduler` block instead.
590
-
591
- A consumer tree installed from an older release needs `ai-rules update --fix`. A plain `update`
592
- refreshes the command files but leaves an existing engine module alone, so a stale `team-db.mjs`
593
- answers `ui` with exit `3`. A fork whose engine predates the verb uses the foreground
594
- `node .ai.local/scripts/team-db.mjs serve`.
595
-
596
- ### Dashboard parity
597
-
598
- | Surface | Dashboard | Excluded, with the reason |
599
- |---|---|---|
600
- | Tasks | list, detail, rescan, confirmed delete | — |
601
- | Task delete | `DELETE /api/v1/tasks/{slug}` behind `confirm()`; the `200` success is announced in the page-level live region and focus returns to the list heading; `409 E_ACTIVE_TASK` names `activeSlug` in the detail live region | — |
602
- | Tracker | read-only list, item panel (dependencies, dependents, linked tasks), queue section | create, update, enqueue and cancel stay in `team-db.mjs tracker` and the API: the dashboard is a read-plus-two-mutations operator surface, and the four writes carry graph and lease rules a browser page must not own |
603
- | Jobs | definitions, next fire, run-now, runs, logs | unchanged |
604
- | Mutating calls | exactly two on the task surface: `POST /api/v1/sync`, `DELETE /api/v1/tasks/{slug}` | pinned by `test-team-db-dashboard.mjs`, which also enumerates the four pre-existing jobs writes (`POST`/`PUT`/`DELETE /api/v1/jobs*`, run-now) and fails on a seventh `method:` site; together with no inline style or handler, no absolute URL, and the unchanged CSP |
605
-
606
- ### Delivery surface
607
-
608
- | Platform | `next` commands | Other stacks |
553
+ ### Efficiency read plane
554
+
555
+ `/api/v1/stats` carries an `efficiency` object beside the task counts, and
556
+ `/api/v1/tasks/{slug}/metrics` carries one per task. Six operations serve the cuts: `GET
557
+ /api/v1/efficiency/{series,tools,distribution,ab-runs,ab-runs/{runKey},context-cost}`.
558
+
559
+ - **`/stats.efficiency` is projection-wide.** `window` is always `{from:null,to:null}` and no
560
+ `/stats` parameter narrows the block. `attempts.total` counts **finished** attempts only
561
+ (`completed | changes_requested | validation_failed | blocked`; a skipped attempt is not
562
+ finished), so it is not the same number as `stats.attempts.total`. `measured` counts
563
+ `usage_origin = 'measured'`, `hostVerified` adds `usage_source = 'host'`; both coverages divide
564
+ by `total` and are `null` at `0/0`. `attribution` reports the sessions seen, the mapped
565
+ sessions, and the unattributed calls/turns.
566
+ - **Task efficiency.** `tokens` is `null` when nothing was measured; each kind is
567
+ `integer | null` and an unreported kind stays `null`. `costUsd` is `number | null`,
568
+ `durationMs` equals `totalAttemptDurationMs`, and `byAgent`/`byStep` count finished attempts
569
+ (Σ `attempts` = `attemptsTotal`, Σ `measured` = `attemptsMeasured`) with `tokens`/`costUsd`
570
+ `null` on an unmeasured row. `gates[]` carries every gate, `durationMs` nullable and a derived
571
+ `outcome` (`advanced_to_done | rework | re_gated | open | unknown`); a legacy row projected
572
+ before the derivation reads `unknown`, never a gate state. `/gates` is unchanged.
573
+ - **Tables only.** No operation has a writer before P4/P5: `/efficiency/ab-runs` answers
574
+ `{items:[],total:0,limit,offset,nextOffset:null}`, `/efficiency/ab-runs/{runKey}` answers 404
575
+ for an absent key (a malformed key is `422 E_VALIDATION`), and `/efficiency/context-cost`
576
+ answers `{snapshotAt:null,hosts:[],tasks:[…]}` with `tasks` populated from
577
+ `tasks.file_count`/`document_bytes`.
578
+
579
+ | Operation | Parameters | Behaviour |
609
580
  |---|---|---|
610
- | cursor | `ui-start.md`, `ui-stop.md` (authored) | — |
611
- | claude, mavis, opencode, zcode | the same two files (generated twins) | — |
612
- | every released stack | — | the verb: `node .ai.local/scripts/team-db.mjs ui start\|status\|stop\|restart` |
613
-
614
- Ten twins across five platforms: `find presets -path '*/next/commands/ui-start.md' | wc -l` prints 5,
615
- and the same for `ui-stop.md`. The verb is the contract on every stack; the command is discoverability.
581
+ | `GET /api/v1/efficiency/series` | `from`, `to`, `bucket=day\|week`, `metric`, `groupBy`, `includeAbsent`, `task` | Complete axis (`buckets[]`), an empty bucket is `{value:null,numerator:null,denominator:null,n:0}`, `truncated:false`, `coverage:null`. `from`/`to` default to the last 30 days and are echoed normalized; `from>to` is `422 E_VALIDATION` on `from`; over 400 buckets is `416 E_RANGE` on `from`. `week` keys are the Monday of the ISO week. Call metrics (`keptOutBytes`, `keptOutRatio`, `calls`) accept `none\|tool\|category`; turn metrics (`tokensTotal`, `costUsd`, `turns`) accept `none\|agent\|model`; any other pair is `422` on `groupBy`. |
582
+ | `GET /api/v1/efficiency/tools` | `from`, `to`, `limit` 1..50 (12), `includeAbsent`, `task` | Grain `(tool,category)`, ordered by `rawBytes DESC`; `otherCalls` is the sum of the folded rows, so `Σ items.calls + otherCalls = totals.calls`; `keptOutRatio` is `0` at `rawBytes=0`. |
583
+ | `GET /api/v1/efficiency/distribution` | `from`, `to` | `metric` echoes `rawBytes`; nearest-rank `p50/p90/p95/max` over `tool_calls.raw_bytes`, all `0` on an empty window; six fixed half-open bins from `[0,1024,8192,65536,262144,1048576]`, the last to `null`, summing to `calls`. |
584
+ | `GET /api/v1/efficiency/ab-runs` | `limit` 1..200 (50), `offset` 0..1000000 | The `efficiency_runs` rows newest first (`generated_at DESC, run_key DESC`), no `cells`. |
585
+ | `GET /api/v1/efficiency/ab-runs/{runKey}` | path `runKey` = `^[0-9]{8}T[0-9]{6}Z$` | The run row plus its `cells[]`. The tracker run-id pattern would reject every bench stamp, so the endpoint has its own. |
586
+ | `GET /api/v1/efficiency/context-cost` | — | `snapshotAt` is the newest `snapshot_at` (`null` when none); `hosts` is that snapshot only, each with `estimatedBytesPerFourTokens = round(bytes/4)` beside the stored `estimatedTokens`; `tasks` lists the present tasks. |
587
+
588
+ `includeAbsent=false` (the default) excludes rows whose `task_slug` is NULL; `true` includes
589
+ them, and a `task=<slug>` filter implies attributed rows only. The `/stats.efficiency`
590
+ `attribution` block is the counterweight a consumer UI must show beside any default number.
591
+
592
+ Gate outcomes are derived from the **next** event after `human_gate_ended`: `task_completed` →
593
+ `advanced_to_done`; `attempt_started`/`retry_scheduled` → `rework`; `human_gate_started` →
594
+ `re_gated`; no next event → `open`; anything else → `unknown`. A gate without an end, or whose
595
+ end is the last event, is `open`. The `gates.outcome` column stays nullable (migration 5 is
596
+ additive); the projector writes `outcome` with `outcome_derived = 1` and the read mapping turns a
597
+ legacy `NULL` into `unknown`.
598
+
599
+ ## API only
600
+
601
+ `team-db.mjs serve` exposes the read plane and the bounded mutations over HTTP. It serves no
602
+ HTML, starts no browser, and has no dashboard module. The only browser UI in this repository is
603
+ `apps/team-tasks-ui`, which proxies to this API; other consumers build their own surface the
604
+ same way.
616
605
 
617
606
  ## Prompt capture
618
607
 
@@ -627,6 +616,14 @@ for tasks absent longer than 90 days while keeping normalized rows and hashes. I
627
616
  null `prompts.content`: prompt retention equals task-folder retention, and deleting the folder
628
617
  is the lever.
629
618
 
619
+ The efficiency tables store **no free text**: `tool_calls` has no `command`, `path`, or agent
620
+ column, and `usage_turns` has no model output. The same 90-day cutoff deletes `tool_calls` and
621
+ `usage_turns` rows by `day` under `sync --maintain`; `efficiency_runs` keeps the newest 50.
622
+ Telemetry retention follows the existing 90-day cutoff; a telemetry-only 180-day constant is a
623
+ P2 decision.
624
+ The ledgers themselves are git-ignored files under `team/output-guard/`, rotated at 8 MiB by
625
+ the plugin's `setup()` with two `.1` / `.2` archives, and a fresh clone is empty by design.
626
+
630
627
  Run output crosses the same boundary and is **not** redacted: `scheduler/runs/**` holds a
631
628
  child's `stdout` and `stderr` verbatim, a job inherits the listed `envPassthrough` names, and
632
629
  only the retention caps bound how long the bytes stay on disk.
@@ -661,17 +658,21 @@ node scripts/test-team-db-migrate-tasks.mjs
661
658
  node scripts/test-team-db-dualwrite.mjs
662
659
  node scripts/test-team-db-api.mjs
663
660
  node scripts/test-team-db-security.mjs
664
- node scripts/test-team-db-dashboard.mjs
665
661
  node scripts/test-team-db-concurrency.mjs
666
662
  node scripts/test-team-db-scheduler.mjs
667
663
  node scripts/test-team-db-fixtures.mjs
664
+ node scripts/test-team-db-efficiency.mjs
668
665
  ```
669
666
 
670
667
  `test-team-db-fixtures.mjs` is the FAIL-direction suite: every gate above is exercised on a
671
- planted defect, not only on the happy path.
668
+ planted defect, not only on the happy path. `test-team-db-efficiency.mjs` pins the v5
669
+ telemetry plane: usage precedence, duplicate observation days, coverage `null` at `0/0`, the
670
+ watermark re-run, the lease window, classifier parity with `report-efficiency.mjs`, and the
671
+ `record-usage` CLI surface. `record-usage.mjs` is repo-local: it has no preset twin and
672
+ `package.json#files` excludes `.ai.local/**`, so an installed package gets the orchestrator
673
+ prose without the CLI until P2 ships a twin or drops the prose.
672
674
 
673
675
  Links: [`../README.md`](../README.md), [`PRESET-CONTRIBUTION.md`](PRESET-CONTRIBUTION.md),
674
- the OpenSpec changes `openspec/changes/2026-11-06-agent-team-sqlite-dashboard/` and
675
- `openspec/changes/2026-11-10-preset-task-scheduler-impl/`, and ADRs
676
+ the OpenSpec change `openspec/changes/2026-11-10-preset-task-scheduler-impl/`, and ADRs
676
677
  `.ai.local/adr/0004-team-db-projection.md` and `.ai.local/adr/0005-team-db-scheduler.md` in
677
678
  this repository.
@@ -49,7 +49,19 @@ Example run, 2026-11-13; file lists elided; task bytes move as a task grows.
49
49
  { "key": "UI", "file": "app/src/ui/pages/Example/Example.tsx", "cap": 420, "attachedLines": 415, "headroom": 5 }
50
50
  ],
51
51
  "tasks": [{ "slug": "context-cost-report", "files": 8, "bytes": 18257 }],
52
- "usage": { "events": 0, "input": 0, "output": 0, "cached": 0 }
52
+ "usage": { "events": 0, "input": 0, "output": 0, "cached": 0 },
53
+ "outputGuard": {
54
+ "present": true,
55
+ "file": ".ai.local/team/output-guard/stats.jsonl",
56
+ "events": 10,
57
+ "invalid": 0,
58
+ "beforeBytes": 113996,
59
+ "afterBytes": 34189,
60
+ "savedBytes": 79807,
61
+ "savedRatio": 0.7,
62
+ "sessions": 1,
63
+ "tools": ["read", "shell"]
64
+ }
53
65
  }
54
66
  ```
55
67
 
@@ -57,6 +69,25 @@ Example run, 2026-11-13; file lists elided; task bytes move as a task grows.
57
69
 
58
70
  `tasks` sums every file under `.ai.local/team/tasks/<slug>`, `archive/` included. A missing team directory returns `tasks: []`.
59
71
 
72
+ `outputGuard` reads `.ai.local/team/output-guard/stats.jsonl`, written by the OpenCode output guard. Rows are deduped by `path` because a plugin reload re-records a historical result. `savedRatio` is the byte saving on the replaced tool results, not a session-token claim; `invalid` counts unreadable rows. A missing file returns `present: false` and zeros.
73
+
74
+ ## Effectiveness (separate report)
75
+
76
+ This report measures **fixed inputs**. It does not measure a session. The output guard writes two more ledgers under `.ai.local/team/output-guard/`:
77
+
78
+ - `results.jsonl` — every tool result, replaced or not (the denominator);
79
+ - `usage.jsonl` — one row per assistant step, from the OpenCode `ctx.session.context` tokens and cost.
80
+
81
+ `report-efficiency.mjs` reads both and prints measured tool bytes, input/output/reasoning/cache tokens, cost, turns, and quality. `bench-efficiency.mjs` runs an A/B (guard off/on) through `opencode run --standalone` with a deterministic oracle and writes `efficiency.json`; `report-efficiency --bench <file>` merges it. The byte percentage is always labelled as tool-result bytes, never as a token saving.
82
+
83
+ ```bash
84
+ yarn report:efficiency
85
+ yarn report:efficiency --html /tmp/efficiency.html
86
+ yarn bench:efficiency --model <provider/model> --runs 3
87
+ ```
88
+
89
+ The A/B needs `--runs 5` for a verdict; `--runs 1` is a smoke. Each run starts a private server, so the arm env (`AI_RULES_OUTPUT_GUARD=0|1`) applies without touching the shared server.
90
+
60
91
  `usage` sums `input`, `output`, and `cached` over `metrics.json` events with `type: "usage_recorded"`. Zero events is a valid result and prints as zero. A usage record that was never written stays missing; the report does not infer one.
61
92
 
62
93
  ## Baseline
@@ -65,8 +96,10 @@ Measured 2026-11-13 on the same file sets:
65
96
 
66
97
  | Surface | Bytes |
67
98
  |---|---|
68
- | OpenCode always-on set (5 files) | 17,285 |
69
- | Root `AGENTS.md` (ZCode entry; Mavis `REPO_AGENTS.md` target) | 9,648 |
99
+ | OpenCode always-on set (5 files) | 14,673 |
100
+ | Root `AGENTS.md` (ZCode entry; Mavis `REPO_AGENTS.md` target) | 6,058 |
101
+
102
+ The OpenCode row counts `instructions` only; the root `AGENTS.md` is loaded natively on top of that list, so the session prompt carries both rows.
70
103
 
71
104
  Re-run the command for the current tree; these numbers move with any rule edit.
72
105