@bonesofspring/ai-rules 0.2.26 → 0.2.27

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 (874) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +1 -1
  4. package/bin/cli.js +262 -44
  5. package/bin/lib/safe-path.js +93 -0
  6. package/bin/lib/seed-ai-local-team.js +5 -0
  7. package/bin/mavis-install.js +35 -8
  8. package/bin/opencode-install.js +34 -11
  9. package/docs/LOCAL-OVERLAY.md +186 -0
  10. package/docs/MAVIS-COMPATIBILITY.md +174 -0
  11. package/docs/MAVIS.md +120 -0
  12. package/docs/OPENCODE-COMPATIBILITY.md +54 -0
  13. package/docs/OPENCODE.md +123 -0
  14. package/docs/PRESET-CONTRIBUTION.md +431 -0
  15. package/docs/PRESET-ENGLISH-STYLE.md +91 -0
  16. package/docs/specs/INDEX.md +9 -0
  17. package/docs/specs/_templates/feature.md +32 -0
  18. package/docs/specs/_templates/page.md +47 -0
  19. package/package.json +6 -1
  20. package/presets/_shared/core/meta/preset-layering.md +1 -1
  21. package/presets/_shared/core/meta/preset-pr-checklist.md +1 -1
  22. package/presets/_shared/core/meta/preset-token-budget.md +10 -10
  23. package/presets/_shared/core/quality/code-quality-and-refactoring.md +6 -0
  24. package/presets/claude/android-kotlin/agents/build-verifier.md +2 -2
  25. package/presets/claude/android-kotlin/commands/task.md +1 -1
  26. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +32 -3
  27. package/presets/claude/android-kotlin/hooks/examples/README.md +5 -3
  28. package/presets/claude/android-kotlin/hooks/examples/test-on-save.example.sh +6 -4
  29. package/presets/claude/android-kotlin/rules/README.md +1 -1
  30. package/presets/claude/android-kotlin/rules/tooling-and-review/code-quality.md +6 -0
  31. package/presets/claude/android-kotlin/rules/tooling-and-review/mcp-usage.md +1 -1
  32. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-layering.md +2 -2
  33. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  34. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  35. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-token-budget.md +11 -11
  36. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-twin-sync.md +1 -1
  37. package/presets/claude/android-kotlin/rules/ui-and-accessibility/compose.md +2 -0
  38. package/presets/claude/go/CLAUDE.md +1 -1
  39. package/presets/claude/go/agents/build-verifier.md +1 -1
  40. package/presets/claude/go/commands/task.md +1 -1
  41. package/presets/claude/go/hooks/chain-team-phases.sh +32 -3
  42. package/presets/claude/go/hooks/examples/README.md +5 -3
  43. package/presets/claude/go/rules/README.md +1 -1
  44. package/presets/claude/go/rules/api-and-data/adapters-driven.md +3 -3
  45. package/presets/claude/go/rules/api-and-data/adapters-driving.md +2 -2
  46. package/presets/claude/go/rules/api-and-data/api-grpc.md +2 -2
  47. package/presets/claude/go/rules/api-and-data/api-http.md +3 -3
  48. package/presets/claude/go/rules/api-and-data/messaging-adapters.md +1 -1
  49. package/presets/claude/go/rules/api-and-data/persistence-adapters.md +2 -2
  50. package/presets/claude/go/rules/architecture/application-usecases.md +1 -1
  51. package/presets/claude/go/rules/architecture/domain-layer.md +1 -1
  52. package/presets/claude/go/rules/architecture/feature-delivery.md +1 -1
  53. package/presets/claude/go/rules/architecture/ports-interfaces.md +2 -2
  54. package/presets/claude/go/rules/stack/go-conventions.md +1 -1
  55. package/presets/claude/go/rules/testing/e2e.md +2 -2
  56. package/presets/claude/go/rules/testing/integration.md +2 -2
  57. package/presets/claude/go/rules/testing/unit.md +1 -1
  58. package/presets/claude/go/rules/tooling-and-review/agent-team-intake.md +1 -1
  59. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  60. package/presets/claude/go/rules/tooling-and-review/code-quality.md +6 -0
  61. package/presets/claude/go/rules/tooling-and-review/code-review.md +1 -1
  62. package/presets/claude/go/rules/tooling-and-review/go-tooling.md +1 -1
  63. package/presets/claude/go/rules/tooling-and-review/mcp-usage.md +1 -1
  64. package/presets/claude/go/rules/tooling-and-review/post-change-test.md +1 -1
  65. package/presets/claude/go/rules/tooling-and-review/preset-layering.md +1 -1
  66. package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  67. package/presets/claude/go/rules/tooling-and-review/preset-token-budget.md +10 -10
  68. package/presets/claude/go/rules/tooling-and-review/security-go.md +3 -3
  69. package/presets/claude/go/rules/tooling-and-review/technical-retro.md +1 -1
  70. package/presets/claude/ios-swift/agents/build-verifier.md +3 -3
  71. package/presets/claude/ios-swift/commands/task.md +1 -1
  72. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +32 -3
  73. package/presets/claude/ios-swift/hooks/examples/README.md +5 -3
  74. package/presets/claude/ios-swift/rules/README.md +1 -1
  75. package/presets/claude/ios-swift/rules/architecture/feature-delivery.md +3 -3
  76. package/presets/claude/ios-swift/rules/architecture/reference-features.md +1 -1
  77. package/presets/claude/ios-swift/rules/tooling-and-review/code-quality.md +6 -0
  78. package/presets/claude/ios-swift/rules/tooling-and-review/mcp-usage.md +1 -1
  79. package/presets/claude/ios-swift/rules/tooling-and-review/post-change-build.md +2 -2
  80. package/presets/claude/ios-swift/rules/tooling-and-review/preset-layering.md +2 -2
  81. package/presets/claude/ios-swift/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  82. package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  83. package/presets/claude/ios-swift/rules/tooling-and-review/preset-token-budget.md +11 -11
  84. package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +1 -1
  85. package/presets/claude/ios-swift/rules/ui-and-accessibility/swiftui.md +7 -0
  86. package/presets/claude/java/CLAUDE.md +2 -2
  87. package/presets/claude/java/agents/build-verifier.md +1 -1
  88. package/presets/claude/java/commands/task.md +1 -1
  89. package/presets/claude/java/hooks/chain-team-phases.sh +32 -3
  90. package/presets/claude/java/hooks/examples/README.md +5 -3
  91. package/presets/claude/java/rules/README.md +1 -1
  92. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  93. package/presets/claude/java/rules/tooling-and-review/code-quality.md +6 -0
  94. package/presets/claude/java/rules/tooling-and-review/mcp-usage.md +1 -1
  95. package/presets/claude/java/rules/tooling-and-review/preset-layering.md +1 -1
  96. package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  97. package/presets/claude/java/rules/tooling-and-review/preset-token-budget.md +10 -10
  98. package/presets/claude/mcp-ts/CLAUDE.md +1 -1
  99. package/presets/claude/mcp-ts/agents/build-verifier.md +1 -1
  100. package/presets/claude/mcp-ts/commands/task.md +1 -1
  101. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +32 -3
  102. package/presets/claude/mcp-ts/rules/README.md +1 -1
  103. package/presets/claude/mcp-ts/rules/api-and-data/mcp-auth-secrets.md +4 -4
  104. package/presets/claude/mcp-ts/rules/api-and-data/mcp-contract-testing.md +2 -2
  105. package/presets/claude/mcp-ts/rules/api-and-data/mcp-tool-design.md +1 -1
  106. package/presets/claude/mcp-ts/rules/api-and-data/mcp-transport-packaging.md +2 -2
  107. package/presets/claude/mcp-ts/rules/architecture/mcp-server-boundaries.md +1 -1
  108. package/presets/claude/mcp-ts/rules/testing/unit.md +2 -2
  109. package/presets/claude/mcp-ts/rules/tooling-and-review/anti-sycophancy-discipline.md +2 -2
  110. package/presets/claude/mcp-ts/rules/tooling-and-review/code-quality.md +6 -0
  111. package/presets/claude/mcp-ts/rules/tooling-and-review/mcp-ts-tooling.md +3 -3
  112. package/presets/claude/mcp-ts/rules/tooling-and-review/post-change-test.md +1 -1
  113. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-layering.md +1 -1
  114. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  115. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-token-budget.md +10 -10
  116. package/presets/claude/mcp-ts/rules/tooling-and-review/security-mcp.md +1 -1
  117. package/presets/claude/next/README.md +1 -1
  118. package/presets/claude/next/agents/build-verifier.md +2 -2
  119. package/presets/claude/next/commands/task.md +1 -1
  120. package/presets/claude/next/hooks/chain-team-phases.sh +32 -3
  121. package/presets/claude/next/hooks/examples/README.md +5 -3
  122. package/presets/claude/next/rules/README.md +1 -1
  123. package/presets/claude/next/rules/api-and-data/api-services.md +6 -4
  124. package/presets/claude/next/rules/api-and-data/store-rtk.md +6 -5
  125. package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +4 -0
  126. package/presets/claude/next/rules/architecture/reference-features.md +1 -1
  127. package/presets/claude/next/rules/stack/next-app-core.md +2 -1
  128. package/presets/claude/next/rules/testing/tests-unit.md +1 -0
  129. package/presets/claude/next/rules/tooling-and-review/code-quality.md +6 -0
  130. package/presets/claude/next/rules/tooling-and-review/preset-layering.md +2 -2
  131. package/presets/claude/next/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  132. package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  133. package/presets/claude/next/rules/tooling-and-review/preset-token-budget.md +11 -11
  134. package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +1 -1
  135. package/presets/claude/next/rules/ui-and-accessibility/react-ui.md +37 -1
  136. package/presets/claude/next/team/fixtures/metrics-scenarios/tasks/human-gate/metrics.json +69 -0
  137. package/presets/claude/next/team/fixtures/metrics-scenarios/tasks/missing-ledger/status.json +5 -0
  138. package/presets/claude/next/team/fixtures/metrics-scenarios/tasks/parallel-receipts/metrics.json +79 -0
  139. package/presets/claude/next/team/fixtures/metrics-scenarios/tasks/serial-retry/metrics.json +124 -0
  140. package/presets/claude/next/team/fixtures/metrics-scenarios/tasks/validation-failed/metrics.json +124 -0
  141. package/presets/claude/next/team/fixtures/metrics.example.json +54 -0
  142. package/presets/claude/nuxt/agents/build-verifier.md +2 -2
  143. package/presets/claude/nuxt/commands/task.md +1 -1
  144. package/presets/claude/nuxt/hooks/chain-team-phases.sh +32 -3
  145. package/presets/claude/nuxt/hooks/examples/README.md +5 -3
  146. package/presets/claude/nuxt/hooks/examples/format-edited.example.sh +8 -7
  147. package/presets/claude/nuxt/hooks/examples/test-on-save.example.sh +8 -3
  148. package/presets/claude/nuxt/rules/README.md +1 -1
  149. package/presets/claude/nuxt/rules/architecture/layer-barrel-exports.md +1 -1
  150. package/presets/claude/nuxt/rules/architecture/reference-features.md +1 -1
  151. package/presets/claude/nuxt/rules/tooling-and-review/code-quality.md +6 -0
  152. package/presets/claude/nuxt/rules/tooling-and-review/preset-layering.md +2 -2
  153. package/presets/claude/nuxt/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  154. package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  155. package/presets/claude/nuxt/rules/tooling-and-review/preset-token-budget.md +11 -11
  156. package/presets/claude/nuxt/rules/tooling-and-review/preset-twin-sync.md +1 -1
  157. package/presets/claude/nuxt/rules/ui-and-accessibility/vue-ui.md +7 -0
  158. package/presets/claude/nuxt/team/fixtures/metrics-scenarios/tasks/human-gate/metrics.json +69 -0
  159. package/presets/claude/nuxt/team/fixtures/metrics-scenarios/tasks/missing-ledger/status.json +5 -0
  160. package/presets/claude/nuxt/team/fixtures/metrics-scenarios/tasks/parallel-receipts/metrics.json +79 -0
  161. package/presets/claude/nuxt/team/fixtures/metrics-scenarios/tasks/serial-retry/metrics.json +124 -0
  162. package/presets/claude/nuxt/team/fixtures/metrics-scenarios/tasks/validation-failed/metrics.json +124 -0
  163. package/presets/claude/nuxt/team/fixtures/metrics.example.json +54 -0
  164. package/presets/claude/php-hexagonal/CLAUDE.md +2 -2
  165. package/presets/claude/php-hexagonal/agents/build-verifier.md +1 -1
  166. package/presets/claude/php-hexagonal/commands/task.md +1 -1
  167. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +32 -3
  168. package/presets/claude/php-hexagonal/hooks/examples/README.md +5 -3
  169. package/presets/claude/php-hexagonal/rules/README.md +1 -1
  170. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  171. package/presets/claude/php-hexagonal/rules/tooling-and-review/code-quality.md +6 -0
  172. package/presets/claude/php-hexagonal/rules/tooling-and-review/mcp-usage.md +1 -1
  173. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-layering.md +1 -1
  174. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  175. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-token-budget.md +10 -10
  176. package/presets/claude/php-laravel/agents/build-verifier.md +1 -1
  177. package/presets/claude/php-laravel/commands/task.md +1 -1
  178. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +32 -3
  179. package/presets/claude/php-laravel/hooks/examples/README.md +5 -3
  180. package/presets/claude/php-laravel/rules/README.md +1 -1
  181. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  182. package/presets/claude/php-laravel/rules/tooling-and-review/code-quality.md +6 -0
  183. package/presets/claude/php-laravel/rules/tooling-and-review/mcp-usage.md +1 -1
  184. package/presets/claude/php-laravel/rules/tooling-and-review/preset-layering.md +1 -1
  185. package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  186. package/presets/claude/php-laravel/rules/tooling-and-review/preset-token-budget.md +10 -10
  187. package/presets/claude/svelte/agents/build-verifier.md +2 -2
  188. package/presets/claude/svelte/commands/task.md +1 -1
  189. package/presets/claude/svelte/hooks/chain-team-phases.sh +32 -3
  190. package/presets/claude/svelte/hooks/examples/README.md +5 -3
  191. package/presets/claude/svelte/rules/README.md +1 -1
  192. package/presets/claude/svelte/rules/api-and-data/store-svelte.md +1 -1
  193. package/presets/claude/svelte/rules/architecture/layer-barrel-exports.md +1 -1
  194. package/presets/claude/svelte/rules/architecture/reference-features.md +1 -1
  195. package/presets/claude/svelte/rules/tooling-and-review/code-quality.md +6 -0
  196. package/presets/claude/svelte/rules/tooling-and-review/mcp-usage.md +1 -1
  197. package/presets/claude/svelte/rules/tooling-and-review/preset-layering.md +2 -2
  198. package/presets/claude/svelte/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  199. package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +2 -2
  200. package/presets/claude/svelte/rules/tooling-and-review/preset-token-budget.md +11 -11
  201. package/presets/claude/svelte/rules/tooling-and-review/preset-twin-sync.md +1 -1
  202. package/presets/claude/svelte/rules/ui-and-accessibility/no-rest-props-spread.md +1 -1
  203. package/presets/claude/svelte/rules/ui-and-accessibility/svelte-ui.md +7 -0
  204. package/presets/claude/svelte/team/fixtures/metrics-scenarios/tasks/human-gate/metrics.json +69 -0
  205. package/presets/claude/svelte/team/fixtures/metrics-scenarios/tasks/missing-ledger/status.json +5 -0
  206. package/presets/claude/svelte/team/fixtures/metrics-scenarios/tasks/parallel-receipts/metrics.json +79 -0
  207. package/presets/claude/svelte/team/fixtures/metrics-scenarios/tasks/serial-retry/metrics.json +124 -0
  208. package/presets/claude/svelte/team/fixtures/metrics-scenarios/tasks/validation-failed/metrics.json +124 -0
  209. package/presets/claude/svelte/team/fixtures/metrics.example.json +54 -0
  210. package/presets/cursor/android-kotlin/agents/build-verifier.md +2 -2
  211. package/presets/cursor/android-kotlin/commands/task.md +1 -1
  212. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +32 -3
  213. package/presets/cursor/android-kotlin/hooks/examples/test-on-save.example.sh +6 -4
  214. package/presets/cursor/android-kotlin/rules/README.md +1 -1
  215. package/presets/cursor/android-kotlin/rules/code-quality-and-refactoring.mdc +6 -0
  216. package/presets/cursor/android-kotlin/rules/compose-ui.mdc +2 -0
  217. package/presets/cursor/android-kotlin/rules/preset-layering.mdc +2 -2
  218. package/presets/cursor/android-kotlin/rules/preset-no-cross-stack-leakage.mdc +1 -1
  219. package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +2 -2
  220. package/presets/cursor/android-kotlin/rules/preset-token-budget.mdc +11 -11
  221. package/presets/cursor/android-kotlin/rules/preset-twin-sync.mdc +1 -1
  222. package/presets/cursor/go/README.md +1 -1
  223. package/presets/cursor/go/agents/build-verifier.md +1 -1
  224. package/presets/cursor/go/commands/task.md +1 -1
  225. package/presets/cursor/go/hooks/chain-team-phases.sh +32 -3
  226. package/presets/cursor/go/rules/README.md +2 -2
  227. package/presets/cursor/go/rules/code-quality-and-refactoring.mdc +6 -0
  228. package/presets/cursor/go/rules/preset-layering.mdc +1 -1
  229. package/presets/cursor/go/rules/preset-pr-checklist.mdc +1 -1
  230. package/presets/cursor/go/rules/preset-token-budget.mdc +10 -10
  231. package/presets/cursor/ios-swift/README.md +1 -1
  232. package/presets/cursor/ios-swift/agents/build-verifier.md +3 -3
  233. package/presets/cursor/ios-swift/commands/task.md +1 -1
  234. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +32 -3
  235. package/presets/cursor/ios-swift/rules/README.md +2 -2
  236. package/presets/cursor/ios-swift/rules/code-quality-and-refactoring.mdc +6 -0
  237. package/presets/cursor/ios-swift/rules/preset-layering.mdc +2 -2
  238. package/presets/cursor/ios-swift/rules/preset-no-cross-stack-leakage.mdc +1 -1
  239. package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +2 -2
  240. package/presets/cursor/ios-swift/rules/preset-token-budget.mdc +11 -11
  241. package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +1 -1
  242. package/presets/cursor/ios-swift/rules/reference-features.mdc +1 -1
  243. package/presets/cursor/ios-swift/rules/swiftui-ui.mdc +7 -0
  244. package/presets/cursor/java/AGENTS.md +1 -1
  245. package/presets/cursor/java/agents/build-verifier.md +1 -1
  246. package/presets/cursor/java/commands/task.md +1 -1
  247. package/presets/cursor/java/hooks/chain-team-phases.sh +32 -3
  248. package/presets/cursor/java/rules/README.md +2 -2
  249. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +1 -1
  250. package/presets/cursor/java/rules/code-quality-and-refactoring.mdc +6 -0
  251. package/presets/cursor/java/rules/preset-layering.mdc +1 -1
  252. package/presets/cursor/java/rules/preset-pr-checklist.mdc +1 -1
  253. package/presets/cursor/java/rules/preset-token-budget.mdc +10 -10
  254. package/presets/cursor/mcp-ts/agents/build-verifier.md +1 -1
  255. package/presets/cursor/mcp-ts/commands/task.md +1 -1
  256. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +32 -3
  257. package/presets/cursor/mcp-ts/rules/README.md +2 -2
  258. package/presets/cursor/mcp-ts/rules/anti-sycophancy-discipline.mdc +2 -2
  259. package/presets/cursor/mcp-ts/rules/code-quality-and-refactoring.mdc +6 -0
  260. package/presets/cursor/mcp-ts/rules/mcp-auth-secrets.mdc +4 -4
  261. package/presets/cursor/mcp-ts/rules/mcp-contract-testing.mdc +2 -2
  262. package/presets/cursor/mcp-ts/rules/mcp-server-boundaries.mdc +1 -1
  263. package/presets/cursor/mcp-ts/rules/mcp-tool-design.mdc +1 -1
  264. package/presets/cursor/mcp-ts/rules/mcp-transport-packaging.mdc +2 -2
  265. package/presets/cursor/mcp-ts/rules/mcp-ts-tooling.mdc +3 -3
  266. package/presets/cursor/mcp-ts/rules/preset-layering.mdc +1 -1
  267. package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +1 -1
  268. package/presets/cursor/mcp-ts/rules/preset-token-budget.mdc +10 -10
  269. package/presets/cursor/mcp-ts/rules/security-mcp.mdc +1 -1
  270. package/presets/cursor/mcp-ts/rules/tests-unit.mdc +2 -2
  271. package/presets/cursor/next/README.md +2 -2
  272. package/presets/cursor/next/agents/build-verifier.md +2 -2
  273. package/presets/cursor/next/commands/task.md +1 -1
  274. package/presets/cursor/next/hooks/chain-team-phases.sh +32 -3
  275. package/presets/cursor/next/rules/README.md +1 -1
  276. package/presets/cursor/next/rules/api-services.mdc +6 -4
  277. package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +6 -0
  278. package/presets/cursor/next/rules/feature-delivery-workflow.mdc +4 -0
  279. package/presets/cursor/next/rules/next-app-core.mdc +2 -1
  280. package/presets/cursor/next/rules/preset-layering.mdc +2 -2
  281. package/presets/cursor/next/rules/preset-no-cross-stack-leakage.mdc +1 -1
  282. package/presets/cursor/next/rules/preset-pr-checklist.mdc +2 -2
  283. package/presets/cursor/next/rules/preset-token-budget.mdc +11 -11
  284. package/presets/cursor/next/rules/preset-twin-sync.mdc +1 -1
  285. package/presets/cursor/next/rules/react-ui.mdc +37 -1
  286. package/presets/cursor/next/rules/reference-features.mdc +1 -1
  287. package/presets/cursor/next/rules/store-rtk.mdc +6 -5
  288. package/presets/cursor/next/rules/tests-unit.mdc +1 -0
  289. package/presets/cursor/nuxt/README.md +1 -1
  290. package/presets/cursor/nuxt/agents/build-verifier.md +2 -2
  291. package/presets/cursor/nuxt/commands/task.md +1 -1
  292. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +32 -3
  293. package/presets/cursor/nuxt/hooks/examples/format-edited.example.sh +8 -7
  294. package/presets/cursor/nuxt/hooks/examples/test-on-save.example.sh +8 -3
  295. package/presets/cursor/nuxt/rules/anti-sycophancy-discipline.mdc +1 -1
  296. package/presets/cursor/nuxt/rules/code-quality-and-refactoring.mdc +6 -0
  297. package/presets/cursor/nuxt/rules/design-guidance.mdc +1 -1
  298. package/presets/cursor/nuxt/rules/layer-barrel-exports.mdc +1 -1
  299. package/presets/cursor/nuxt/rules/preset-layering.mdc +2 -2
  300. package/presets/cursor/nuxt/rules/preset-no-cross-stack-leakage.mdc +1 -1
  301. package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +2 -2
  302. package/presets/cursor/nuxt/rules/preset-token-budget.mdc +11 -11
  303. package/presets/cursor/nuxt/rules/preset-twin-sync.mdc +1 -1
  304. package/presets/cursor/nuxt/rules/reference-features.mdc +1 -1
  305. package/presets/cursor/nuxt/rules/vue-ui.mdc +7 -0
  306. package/presets/cursor/php-hexagonal/AGENTS.md +1 -1
  307. package/presets/cursor/php-hexagonal/agents/build-verifier.md +1 -1
  308. package/presets/cursor/php-hexagonal/commands/task.md +1 -1
  309. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +32 -3
  310. package/presets/cursor/php-hexagonal/rules/README.md +2 -2
  311. package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +1 -1
  312. package/presets/cursor/php-hexagonal/rules/code-quality-and-refactoring.mdc +6 -0
  313. package/presets/cursor/php-hexagonal/rules/preset-layering.mdc +1 -1
  314. package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +1 -1
  315. package/presets/cursor/php-hexagonal/rules/preset-token-budget.mdc +10 -10
  316. package/presets/cursor/php-laravel/AGENTS.md +1 -1
  317. package/presets/cursor/php-laravel/agents/build-verifier.md +1 -1
  318. package/presets/cursor/php-laravel/commands/task.md +1 -1
  319. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +32 -3
  320. package/presets/cursor/php-laravel/rules/README.md +2 -2
  321. package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +1 -1
  322. package/presets/cursor/php-laravel/rules/code-quality-and-refactoring.mdc +6 -0
  323. package/presets/cursor/php-laravel/rules/preset-layering.mdc +1 -1
  324. package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +1 -1
  325. package/presets/cursor/php-laravel/rules/preset-token-budget.mdc +10 -10
  326. package/presets/cursor/svelte/README.md +1 -1
  327. package/presets/cursor/svelte/agents/build-verifier.md +2 -2
  328. package/presets/cursor/svelte/commands/task.md +1 -1
  329. package/presets/cursor/svelte/hooks/chain-team-phases.sh +32 -3
  330. package/presets/cursor/svelte/rules/code-quality-and-refactoring.mdc +6 -0
  331. package/presets/cursor/svelte/rules/layer-barrel-exports.mdc +1 -1
  332. package/presets/cursor/svelte/rules/preset-layering.mdc +2 -2
  333. package/presets/cursor/svelte/rules/preset-no-cross-stack-leakage.mdc +1 -1
  334. package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +2 -2
  335. package/presets/cursor/svelte/rules/preset-token-budget.mdc +11 -11
  336. package/presets/cursor/svelte/rules/preset-twin-sync.mdc +1 -1
  337. package/presets/cursor/svelte/rules/reference-features.mdc +1 -1
  338. package/presets/cursor/svelte/rules/svelte-ui.mdc +7 -0
  339. package/presets/mavis/android-kotlin/adapter-map.json +1 -1
  340. package/presets/mavis/android-kotlin/agents/build-verifier.md +2 -2
  341. package/presets/mavis/android-kotlin/commands/spec-start.md +2 -2
  342. package/presets/mavis/android-kotlin/commands/task.md +6 -6
  343. package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +32 -3
  344. package/presets/mavis/android-kotlin/rules/code-quality-and-refactoring.md +14 -0
  345. package/presets/mavis/android-kotlin/rules/code-review-mr.md +39 -0
  346. package/presets/mavis/android-kotlin/rules/compose-ui.md +2 -0
  347. package/presets/mavis/android-kotlin/rules/design-guidance.md +5 -0
  348. package/presets/mavis/android-kotlin/rules/mcp-usage.md +8 -0
  349. package/presets/mavis/android-kotlin/rules/mockup-review.md +4 -0
  350. package/presets/mavis/android-kotlin/rules/preset-layering.md +1 -1
  351. package/presets/mavis/android-kotlin/rules/preset-no-cross-stack-leakage.md +4 -0
  352. package/presets/mavis/android-kotlin/rules/preset-pr-checklist.md +1 -1
  353. package/presets/mavis/android-kotlin/rules/preset-token-budget.md +10 -10
  354. package/presets/mavis/android-kotlin/rules/product-specs-authoring.md +6 -0
  355. package/presets/mavis/android-kotlin/rules/product-specs.md +5 -0
  356. package/presets/mavis/android-kotlin/rules/ux-design.md +4 -0
  357. package/presets/mavis/android-kotlin/skills/debug-investigation/SKILL.md +39 -0
  358. package/presets/mavis/go/adapter-map.json +1 -1
  359. package/presets/mavis/go/agents/build-verifier.md +1 -1
  360. package/presets/mavis/go/commands/spec-start.md +2 -2
  361. package/presets/mavis/go/commands/task.md +6 -6
  362. package/presets/mavis/go/hooks/chain-team-phases.sh +32 -3
  363. package/presets/mavis/go/rules/agent-team-intake.md +4 -0
  364. package/presets/mavis/go/rules/code-quality-and-refactoring.md +15 -0
  365. package/presets/mavis/go/rules/code-review-mr.md +7 -0
  366. package/presets/mavis/go/rules/design-guidance.md +5 -0
  367. package/presets/mavis/go/rules/mcp-usage.md +7 -0
  368. package/presets/mavis/go/rules/preset-layering.md +1 -1
  369. package/presets/mavis/go/rules/preset-pr-checklist.md +1 -1
  370. package/presets/mavis/go/rules/preset-token-budget.md +10 -10
  371. package/presets/mavis/go/rules/product-specs-authoring.md +6 -0
  372. package/presets/mavis/go/rules/product-specs.md +6 -0
  373. package/presets/mavis/go/skills/debug-investigation/SKILL.md +20 -0
  374. package/presets/mavis/ios-swift/adapter-map.json +1 -1
  375. package/presets/mavis/ios-swift/agents/build-verifier.md +3 -3
  376. package/presets/mavis/ios-swift/commands/spec-start.md +2 -2
  377. package/presets/mavis/ios-swift/commands/task.md +6 -6
  378. package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +32 -3
  379. package/presets/mavis/ios-swift/rules/code-quality-and-refactoring.md +14 -0
  380. package/presets/mavis/ios-swift/rules/code-review-mr.md +39 -0
  381. package/presets/mavis/ios-swift/rules/design-guidance.md +5 -0
  382. package/presets/mavis/ios-swift/rules/feature-delivery-workflow.md +66 -0
  383. package/presets/mavis/ios-swift/rules/mcp-usage.md +8 -0
  384. package/presets/mavis/ios-swift/rules/mockup-review.md +4 -0
  385. package/presets/mavis/ios-swift/rules/preset-layering.md +1 -1
  386. package/presets/mavis/ios-swift/rules/preset-pr-checklist.md +1 -1
  387. package/presets/mavis/ios-swift/rules/preset-token-budget.md +10 -10
  388. package/presets/mavis/ios-swift/rules/product-specs-authoring.md +6 -0
  389. package/presets/mavis/ios-swift/rules/product-specs.md +5 -0
  390. package/presets/mavis/ios-swift/rules/reference-features.md +49 -0
  391. package/presets/mavis/ios-swift/rules/swiftui-ui.md +7 -0
  392. package/presets/mavis/ios-swift/rules/ux-design.md +4 -0
  393. package/presets/mavis/ios-swift/skills/debug-investigation/SKILL.md +39 -0
  394. package/presets/mavis/java/adapter-map.json +1 -1
  395. package/presets/mavis/java/agents/build-verifier.md +1 -1
  396. package/presets/mavis/java/commands/spec-start.md +2 -2
  397. package/presets/mavis/java/commands/task.md +6 -6
  398. package/presets/mavis/java/hooks/chain-team-phases.sh +32 -3
  399. package/presets/mavis/java/rules/agent-team-intake.md +4 -0
  400. package/presets/mavis/java/rules/code-quality-and-refactoring.md +15 -0
  401. package/presets/mavis/java/rules/code-review-mr.md +9 -0
  402. package/presets/mavis/java/rules/design-guidance.md +6 -0
  403. package/presets/mavis/java/rules/mcp-usage.md +6 -0
  404. package/presets/mavis/java/rules/preset-layering.md +1 -1
  405. package/presets/mavis/java/rules/preset-pr-checklist.md +1 -1
  406. package/presets/mavis/java/rules/preset-token-budget.md +10 -10
  407. package/presets/mavis/java/rules/product-specs-authoring.md +6 -0
  408. package/presets/mavis/java/rules/product-specs.md +6 -0
  409. package/presets/mavis/java/skills/debug-investigation/SKILL.md +20 -0
  410. package/presets/mavis/mcp-ts/adapter-map.json +1 -1
  411. package/presets/mavis/mcp-ts/agents/build-verifier.md +1 -1
  412. package/presets/mavis/mcp-ts/commands/spec-start.md +2 -2
  413. package/presets/mavis/mcp-ts/commands/task.md +6 -6
  414. package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +32 -3
  415. package/presets/mavis/mcp-ts/rules/agent-team-intake.md +5 -0
  416. package/presets/mavis/mcp-ts/rules/anti-sycophancy-discipline.md +4 -0
  417. package/presets/mavis/mcp-ts/rules/code-quality-and-refactoring.md +15 -0
  418. package/presets/mavis/mcp-ts/rules/code-review-mr.md +6 -0
  419. package/presets/mavis/mcp-ts/rules/design-guidance.md +5 -0
  420. package/presets/mavis/mcp-ts/rules/mcp-usage.md +7 -0
  421. package/presets/mavis/mcp-ts/rules/preset-layering.md +1 -1
  422. package/presets/mavis/mcp-ts/rules/preset-pr-checklist.md +1 -1
  423. package/presets/mavis/mcp-ts/rules/preset-token-budget.md +10 -10
  424. package/presets/mavis/mcp-ts/rules/product-specs-authoring.md +6 -0
  425. package/presets/mavis/mcp-ts/rules/product-specs.md +6 -0
  426. package/presets/mavis/mcp-ts/skills/debug-investigation/SKILL.md +15 -0
  427. package/presets/mavis/next/adapter-map.json +1 -1
  428. package/presets/mavis/next/agents/build-verifier.md +2 -2
  429. package/presets/mavis/next/commands/spec-start.md +2 -2
  430. package/presets/mavis/next/commands/task.md +6 -6
  431. package/presets/mavis/next/hooks/chain-team-phases.sh +32 -3
  432. package/presets/mavis/next/rules/api-services.md +6 -4
  433. package/presets/mavis/next/rules/code-quality-and-refactoring.md +13 -0
  434. package/presets/mavis/next/rules/code-review-mr.md +13 -0
  435. package/presets/mavis/next/rules/design-guidance.md +5 -0
  436. package/presets/mavis/next/rules/feature-delivery-workflow.md +85 -0
  437. package/presets/mavis/next/rules/mcp-usage.md +9 -0
  438. package/presets/mavis/next/rules/mockup-review.md +4 -0
  439. package/presets/mavis/next/rules/next-app-core.md +2 -1
  440. package/presets/mavis/next/rules/preset-layering.md +1 -1
  441. package/presets/mavis/next/rules/preset-pr-checklist.md +1 -1
  442. package/presets/mavis/next/rules/preset-token-budget.md +10 -10
  443. package/presets/mavis/next/rules/product-specs-authoring.md +6 -0
  444. package/presets/mavis/next/rules/product-specs.md +6 -0
  445. package/presets/mavis/next/rules/react-ui.md +37 -1
  446. package/presets/mavis/next/rules/reference-features.md +36 -0
  447. package/presets/mavis/next/rules/store-rtk.md +6 -5
  448. package/presets/mavis/next/rules/tests-e2e-structure.md +15 -0
  449. package/presets/mavis/next/rules/tests-unit.md +33 -0
  450. package/presets/mavis/next/rules/ux-design.md +4 -0
  451. package/presets/mavis/next/skills/debug-investigation/SKILL.md +28 -0
  452. package/presets/mavis/nuxt/adapter-map.json +1 -1
  453. package/presets/mavis/nuxt/agents/build-verifier.md +2 -2
  454. package/presets/mavis/nuxt/commands/spec-start.md +2 -2
  455. package/presets/mavis/nuxt/commands/task.md +6 -6
  456. package/presets/mavis/nuxt/hooks/chain-team-phases.sh +32 -3
  457. package/presets/mavis/nuxt/rules/code-quality-and-refactoring.md +13 -0
  458. package/presets/mavis/nuxt/rules/code-review-mr.md +13 -0
  459. package/presets/mavis/nuxt/rules/design-guidance.md +5 -0
  460. package/presets/mavis/nuxt/rules/feature-delivery-workflow.md +82 -0
  461. package/presets/mavis/nuxt/rules/mcp-usage.md +9 -0
  462. package/presets/mavis/nuxt/rules/mockup-review.md +4 -0
  463. package/presets/mavis/nuxt/rules/preset-layering.md +1 -1
  464. package/presets/mavis/nuxt/rules/preset-pr-checklist.md +1 -1
  465. package/presets/mavis/nuxt/rules/preset-token-budget.md +10 -10
  466. package/presets/mavis/nuxt/rules/product-specs-authoring.md +6 -0
  467. package/presets/mavis/nuxt/rules/product-specs.md +5 -0
  468. package/presets/mavis/nuxt/rules/reference-features.md +36 -0
  469. package/presets/mavis/nuxt/rules/tests-e2e-structure.md +16 -0
  470. package/presets/mavis/nuxt/rules/tests-unit.md +11 -0
  471. package/presets/mavis/nuxt/rules/ux-design.md +4 -0
  472. package/presets/mavis/nuxt/rules/vue-ui.md +7 -0
  473. package/presets/mavis/nuxt/skills/debug-investigation/SKILL.md +30 -0
  474. package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
  475. package/presets/mavis/php-hexagonal/agents/build-verifier.md +1 -1
  476. package/presets/mavis/php-hexagonal/commands/spec-start.md +2 -2
  477. package/presets/mavis/php-hexagonal/commands/task.md +6 -6
  478. package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +32 -3
  479. package/presets/mavis/php-hexagonal/rules/agent-team-intake.md +4 -0
  480. package/presets/mavis/php-hexagonal/rules/code-quality-and-refactoring.md +15 -0
  481. package/presets/mavis/php-hexagonal/rules/code-review-mr.md +9 -0
  482. package/presets/mavis/php-hexagonal/rules/design-guidance.md +6 -0
  483. package/presets/mavis/php-hexagonal/rules/mcp-usage.md +6 -0
  484. package/presets/mavis/php-hexagonal/rules/preset-layering.md +1 -1
  485. package/presets/mavis/php-hexagonal/rules/preset-pr-checklist.md +1 -1
  486. package/presets/mavis/php-hexagonal/rules/preset-token-budget.md +10 -10
  487. package/presets/mavis/php-hexagonal/rules/product-specs-authoring.md +6 -0
  488. package/presets/mavis/php-hexagonal/rules/product-specs.md +6 -0
  489. package/presets/mavis/php-hexagonal/skills/debug-investigation/SKILL.md +20 -0
  490. package/presets/mavis/php-laravel/adapter-map.json +1 -1
  491. package/presets/mavis/php-laravel/agents/build-verifier.md +1 -1
  492. package/presets/mavis/php-laravel/commands/spec-start.md +2 -2
  493. package/presets/mavis/php-laravel/commands/task.md +6 -6
  494. package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +32 -3
  495. package/presets/mavis/php-laravel/rules/agent-team-intake.md +4 -0
  496. package/presets/mavis/php-laravel/rules/code-quality-and-refactoring.md +15 -0
  497. package/presets/mavis/php-laravel/rules/code-review-mr.md +10 -0
  498. package/presets/mavis/php-laravel/rules/design-guidance.md +6 -0
  499. package/presets/mavis/php-laravel/rules/mcp-usage.md +6 -0
  500. package/presets/mavis/php-laravel/rules/preset-layering.md +1 -1
  501. package/presets/mavis/php-laravel/rules/preset-pr-checklist.md +1 -1
  502. package/presets/mavis/php-laravel/rules/preset-token-budget.md +10 -10
  503. package/presets/mavis/php-laravel/rules/product-specs-authoring.md +6 -0
  504. package/presets/mavis/php-laravel/rules/product-specs.md +6 -0
  505. package/presets/mavis/php-laravel/skills/debug-investigation/SKILL.md +20 -0
  506. package/presets/mavis/svelte/adapter-map.json +1 -1
  507. package/presets/mavis/svelte/agents/build-verifier.md +2 -2
  508. package/presets/mavis/svelte/commands/spec-start.md +2 -2
  509. package/presets/mavis/svelte/commands/task.md +6 -6
  510. package/presets/mavis/svelte/hooks/chain-team-phases.sh +32 -3
  511. package/presets/mavis/svelte/rules/code-quality-and-refactoring.md +13 -0
  512. package/presets/mavis/svelte/rules/code-review-mr.md +13 -0
  513. package/presets/mavis/svelte/rules/design-guidance.md +5 -0
  514. package/presets/mavis/svelte/rules/feature-delivery-workflow.md +54 -0
  515. package/presets/mavis/svelte/rules/mcp-usage.md +9 -0
  516. package/presets/mavis/svelte/rules/mockup-review.md +4 -0
  517. package/presets/mavis/svelte/rules/preset-layering.md +1 -1
  518. package/presets/mavis/svelte/rules/preset-pr-checklist.md +1 -1
  519. package/presets/mavis/svelte/rules/preset-token-budget.md +10 -10
  520. package/presets/mavis/svelte/rules/product-specs-authoring.md +6 -0
  521. package/presets/mavis/svelte/rules/product-specs.md +5 -0
  522. package/presets/mavis/svelte/rules/reference-features.md +37 -0
  523. package/presets/mavis/svelte/rules/svelte-ui.md +7 -0
  524. package/presets/mavis/svelte/rules/tests-e2e-structure.md +16 -0
  525. package/presets/mavis/svelte/rules/tests-unit.md +11 -0
  526. package/presets/mavis/svelte/rules/ux-design.md +4 -0
  527. package/presets/mavis/svelte/skills/debug-investigation/SKILL.md +30 -0
  528. package/presets/opencode/android-kotlin/adapter-map.json +1 -1
  529. package/presets/opencode/android-kotlin/agents/build-verifier.md +2 -2
  530. package/presets/opencode/android-kotlin/commands/spec-start.md +1 -1
  531. package/presets/opencode/android-kotlin/commands/task-continue.md +1 -1
  532. package/presets/opencode/android-kotlin/commands/task.md +1 -1
  533. package/presets/opencode/android-kotlin/commands/technical-retro.md +1 -1
  534. package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +32 -3
  535. package/presets/opencode/android-kotlin/rules/code-quality-and-refactoring.md +14 -0
  536. package/presets/opencode/android-kotlin/rules/code-review-mr.md +39 -0
  537. package/presets/opencode/android-kotlin/rules/compose-ui.md +2 -0
  538. package/presets/opencode/android-kotlin/rules/design-guidance.md +5 -0
  539. package/presets/opencode/android-kotlin/rules/mcp-usage.md +8 -0
  540. package/presets/opencode/android-kotlin/rules/mockup-review.md +4 -0
  541. package/presets/opencode/android-kotlin/rules/preset-layering.md +1 -1
  542. package/presets/opencode/android-kotlin/rules/preset-no-cross-stack-leakage.md +4 -0
  543. package/presets/opencode/android-kotlin/rules/preset-pr-checklist.md +1 -1
  544. package/presets/opencode/android-kotlin/rules/preset-token-budget.md +10 -10
  545. package/presets/opencode/android-kotlin/rules/product-specs-authoring.md +6 -0
  546. package/presets/opencode/android-kotlin/rules/product-specs.md +5 -0
  547. package/presets/opencode/android-kotlin/rules/ux-design.md +4 -0
  548. package/presets/opencode/android-kotlin/skills/ci-investigation/SKILL.md +1 -1
  549. package/presets/opencode/android-kotlin/skills/code-review/SKILL.md +1 -1
  550. package/presets/opencode/android-kotlin/skills/debug-investigation/SKILL.md +1 -1
  551. package/presets/opencode/android-kotlin/skills/feature-delivery/SKILL.md +1 -1
  552. package/presets/opencode/android-kotlin/skills/instrumentation-ui-e2e/SKILL.md +1 -1
  553. package/presets/opencode/android-kotlin/skills/mockup-review/SKILL.md +1 -1
  554. package/presets/opencode/android-kotlin/skills/spec-authoring/SKILL.md +1 -1
  555. package/presets/opencode/android-kotlin/skills/spec-discovery/SKILL.md +1 -1
  556. package/presets/opencode/android-kotlin/skills/technical-retro/SKILL.md +1 -1
  557. package/presets/opencode/android-kotlin/skills/unit-testing/SKILL.md +1 -1
  558. package/presets/opencode/android-kotlin/skills/ux-design/SKILL.md +1 -1
  559. package/presets/opencode/android-kotlin/skills/write-adr/SKILL.md +1 -1
  560. package/presets/opencode/go/adapter-map.json +1 -1
  561. package/presets/opencode/go/agents/build-verifier.md +1 -1
  562. package/presets/opencode/go/commands/spec-start.md +1 -1
  563. package/presets/opencode/go/commands/task-continue.md +1 -1
  564. package/presets/opencode/go/commands/task.md +1 -1
  565. package/presets/opencode/go/commands/technical-retro.md +1 -1
  566. package/presets/opencode/go/hooks/chain-team-phases.sh +32 -3
  567. package/presets/opencode/go/rules/agent-team-intake.md +4 -0
  568. package/presets/opencode/go/rules/code-quality-and-refactoring.md +15 -0
  569. package/presets/opencode/go/rules/code-review-mr.md +7 -0
  570. package/presets/opencode/go/rules/design-guidance.md +5 -0
  571. package/presets/opencode/go/rules/mcp-usage.md +7 -0
  572. package/presets/opencode/go/rules/preset-layering.md +1 -1
  573. package/presets/opencode/go/rules/preset-pr-checklist.md +1 -1
  574. package/presets/opencode/go/rules/preset-token-budget.md +10 -10
  575. package/presets/opencode/go/rules/product-specs-authoring.md +6 -0
  576. package/presets/opencode/go/rules/product-specs.md +6 -0
  577. package/presets/opencode/go/skills/ci-investigation/SKILL.md +1 -1
  578. package/presets/opencode/go/skills/code-review/SKILL.md +1 -1
  579. package/presets/opencode/go/skills/debug-investigation/SKILL.md +1 -1
  580. package/presets/opencode/go/skills/feature-delivery/SKILL.md +1 -1
  581. package/presets/opencode/go/skills/integration-testing/SKILL.md +1 -1
  582. package/presets/opencode/go/skills/spec-authoring/SKILL.md +1 -1
  583. package/presets/opencode/go/skills/spec-discovery/SKILL.md +1 -1
  584. package/presets/opencode/go/skills/technical-retro/SKILL.md +1 -1
  585. package/presets/opencode/go/skills/unit-testing/SKILL.md +1 -1
  586. package/presets/opencode/go/skills/write-adr/SKILL.md +1 -1
  587. package/presets/opencode/ios-swift/adapter-map.json +1 -1
  588. package/presets/opencode/ios-swift/agents/build-verifier.md +3 -3
  589. package/presets/opencode/ios-swift/commands/spec-start.md +1 -1
  590. package/presets/opencode/ios-swift/commands/task-continue.md +1 -1
  591. package/presets/opencode/ios-swift/commands/task.md +1 -1
  592. package/presets/opencode/ios-swift/commands/technical-retro.md +1 -1
  593. package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +32 -3
  594. package/presets/opencode/ios-swift/rules/code-quality-and-refactoring.md +14 -0
  595. package/presets/opencode/ios-swift/rules/code-review-mr.md +39 -0
  596. package/presets/opencode/ios-swift/rules/design-guidance.md +5 -0
  597. package/presets/opencode/ios-swift/rules/feature-delivery-workflow.md +66 -0
  598. package/presets/opencode/ios-swift/rules/mcp-usage.md +8 -0
  599. package/presets/opencode/ios-swift/rules/mockup-review.md +4 -0
  600. package/presets/opencode/ios-swift/rules/preset-layering.md +1 -1
  601. package/presets/opencode/ios-swift/rules/preset-pr-checklist.md +1 -1
  602. package/presets/opencode/ios-swift/rules/preset-token-budget.md +10 -10
  603. package/presets/opencode/ios-swift/rules/product-specs-authoring.md +6 -0
  604. package/presets/opencode/ios-swift/rules/product-specs.md +5 -0
  605. package/presets/opencode/ios-swift/rules/reference-features.md +49 -0
  606. package/presets/opencode/ios-swift/rules/swiftui-ui.md +7 -0
  607. package/presets/opencode/ios-swift/rules/ux-design.md +4 -0
  608. package/presets/opencode/ios-swift/skills/ci-investigation/SKILL.md +1 -1
  609. package/presets/opencode/ios-swift/skills/code-review/SKILL.md +1 -1
  610. package/presets/opencode/ios-swift/skills/debug-investigation/SKILL.md +1 -1
  611. package/presets/opencode/ios-swift/skills/feature-delivery/SKILL.md +1 -1
  612. package/presets/opencode/ios-swift/skills/mockup-review/SKILL.md +1 -1
  613. package/presets/opencode/ios-swift/skills/spec-authoring/SKILL.md +1 -1
  614. package/presets/opencode/ios-swift/skills/spec-discovery/SKILL.md +1 -1
  615. package/presets/opencode/ios-swift/skills/technical-retro/SKILL.md +1 -1
  616. package/presets/opencode/ios-swift/skills/unit-testing/SKILL.md +1 -1
  617. package/presets/opencode/ios-swift/skills/ux-design/SKILL.md +1 -1
  618. package/presets/opencode/ios-swift/skills/write-adr/SKILL.md +1 -1
  619. package/presets/opencode/ios-swift/skills/xcuitest-e2e/SKILL.md +1 -1
  620. package/presets/opencode/java/adapter-map.json +1 -1
  621. package/presets/opencode/java/agents/build-verifier.md +1 -1
  622. package/presets/opencode/java/commands/spec-start.md +1 -1
  623. package/presets/opencode/java/commands/task-continue.md +1 -1
  624. package/presets/opencode/java/commands/task.md +1 -1
  625. package/presets/opencode/java/commands/technical-retro.md +1 -1
  626. package/presets/opencode/java/hooks/chain-team-phases.sh +32 -3
  627. package/presets/opencode/java/rules/agent-team-intake.md +4 -0
  628. package/presets/opencode/java/rules/code-quality-and-refactoring.md +15 -0
  629. package/presets/opencode/java/rules/code-review-mr.md +9 -0
  630. package/presets/opencode/java/rules/design-guidance.md +6 -0
  631. package/presets/opencode/java/rules/mcp-usage.md +6 -0
  632. package/presets/opencode/java/rules/preset-layering.md +1 -1
  633. package/presets/opencode/java/rules/preset-pr-checklist.md +1 -1
  634. package/presets/opencode/java/rules/preset-token-budget.md +10 -10
  635. package/presets/opencode/java/rules/product-specs-authoring.md +6 -0
  636. package/presets/opencode/java/rules/product-specs.md +6 -0
  637. package/presets/opencode/java/skills/ci-investigation/SKILL.md +1 -1
  638. package/presets/opencode/java/skills/code-review/SKILL.md +1 -1
  639. package/presets/opencode/java/skills/debug-investigation/SKILL.md +1 -1
  640. package/presets/opencode/java/skills/feature-delivery/SKILL.md +1 -1
  641. package/presets/opencode/java/skills/integration-testing/SKILL.md +1 -1
  642. package/presets/opencode/java/skills/spec-authoring/SKILL.md +1 -1
  643. package/presets/opencode/java/skills/spec-discovery/SKILL.md +1 -1
  644. package/presets/opencode/java/skills/technical-retro/SKILL.md +1 -1
  645. package/presets/opencode/java/skills/unit-testing/SKILL.md +1 -1
  646. package/presets/opencode/java/skills/write-adr/SKILL.md +1 -1
  647. package/presets/opencode/mcp-ts/adapter-map.json +1 -1
  648. package/presets/opencode/mcp-ts/agents/build-verifier.md +1 -1
  649. package/presets/opencode/mcp-ts/commands/spec-start.md +1 -1
  650. package/presets/opencode/mcp-ts/commands/task-continue.md +1 -1
  651. package/presets/opencode/mcp-ts/commands/task.md +1 -1
  652. package/presets/opencode/mcp-ts/commands/technical-retro.md +1 -1
  653. package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +32 -3
  654. package/presets/opencode/mcp-ts/rules/agent-team-intake.md +5 -0
  655. package/presets/opencode/mcp-ts/rules/anti-sycophancy-discipline.md +4 -0
  656. package/presets/opencode/mcp-ts/rules/code-quality-and-refactoring.md +15 -0
  657. package/presets/opencode/mcp-ts/rules/code-review-mr.md +6 -0
  658. package/presets/opencode/mcp-ts/rules/design-guidance.md +5 -0
  659. package/presets/opencode/mcp-ts/rules/mcp-usage.md +7 -0
  660. package/presets/opencode/mcp-ts/rules/preset-layering.md +1 -1
  661. package/presets/opencode/mcp-ts/rules/preset-pr-checklist.md +1 -1
  662. package/presets/opencode/mcp-ts/rules/preset-token-budget.md +10 -10
  663. package/presets/opencode/mcp-ts/rules/product-specs-authoring.md +6 -0
  664. package/presets/opencode/mcp-ts/rules/product-specs.md +6 -0
  665. package/presets/opencode/mcp-ts/skills/code-review/SKILL.md +1 -1
  666. package/presets/opencode/mcp-ts/skills/debug-investigation/SKILL.md +1 -1
  667. package/presets/opencode/mcp-ts/skills/feature-delivery/SKILL.md +1 -1
  668. package/presets/opencode/mcp-ts/skills/spec-authoring/SKILL.md +1 -1
  669. package/presets/opencode/mcp-ts/skills/spec-discovery/SKILL.md +1 -1
  670. package/presets/opencode/mcp-ts/skills/unit-testing/SKILL.md +1 -1
  671. package/presets/opencode/next/adapter-map.json +1 -1
  672. package/presets/opencode/next/agents/build-verifier.md +2 -2
  673. package/presets/opencode/next/commands/spec-start.md +1 -1
  674. package/presets/opencode/next/commands/task-continue.md +1 -1
  675. package/presets/opencode/next/commands/task.md +1 -1
  676. package/presets/opencode/next/commands/technical-retro.md +1 -1
  677. package/presets/opencode/next/hooks/chain-team-phases.sh +32 -3
  678. package/presets/opencode/next/rules/api-services.md +6 -4
  679. package/presets/opencode/next/rules/code-quality-and-refactoring.md +13 -0
  680. package/presets/opencode/next/rules/code-review-mr.md +13 -0
  681. package/presets/opencode/next/rules/design-guidance.md +5 -0
  682. package/presets/opencode/next/rules/feature-delivery-workflow.md +85 -0
  683. package/presets/opencode/next/rules/mcp-usage.md +9 -0
  684. package/presets/opencode/next/rules/mockup-review.md +4 -0
  685. package/presets/opencode/next/rules/next-app-core.md +2 -1
  686. package/presets/opencode/next/rules/preset-layering.md +1 -1
  687. package/presets/opencode/next/rules/preset-pr-checklist.md +1 -1
  688. package/presets/opencode/next/rules/preset-token-budget.md +10 -10
  689. package/presets/opencode/next/rules/product-specs-authoring.md +6 -0
  690. package/presets/opencode/next/rules/product-specs.md +6 -0
  691. package/presets/opencode/next/rules/react-ui.md +37 -1
  692. package/presets/opencode/next/rules/reference-features.md +36 -0
  693. package/presets/opencode/next/rules/store-rtk.md +6 -5
  694. package/presets/opencode/next/rules/tests-e2e-structure.md +15 -0
  695. package/presets/opencode/next/rules/tests-unit.md +33 -0
  696. package/presets/opencode/next/rules/ux-design.md +4 -0
  697. package/presets/opencode/next/skills/ci-investigation/SKILL.md +1 -1
  698. package/presets/opencode/next/skills/code-review/SKILL.md +1 -1
  699. package/presets/opencode/next/skills/debug-investigation/SKILL.md +1 -1
  700. package/presets/opencode/next/skills/feature-delivery/SKILL.md +1 -1
  701. package/presets/opencode/next/skills/mockup-review/SKILL.md +1 -1
  702. package/presets/opencode/next/skills/playwright-e2e/SKILL.md +1 -1
  703. package/presets/opencode/next/skills/react-performance/SKILL.md +1 -1
  704. package/presets/opencode/next/skills/spec-authoring/SKILL.md +1 -1
  705. package/presets/opencode/next/skills/spec-discovery/SKILL.md +1 -1
  706. package/presets/opencode/next/skills/technical-retro/SKILL.md +1 -1
  707. package/presets/opencode/next/skills/unit-testing/SKILL.md +1 -1
  708. package/presets/opencode/next/skills/ux-design/SKILL.md +1 -1
  709. package/presets/opencode/next/skills/write-adr/SKILL.md +1 -1
  710. package/presets/opencode/nuxt/adapter-map.json +1 -1
  711. package/presets/opencode/nuxt/agents/build-verifier.md +2 -2
  712. package/presets/opencode/nuxt/commands/spec-start.md +1 -1
  713. package/presets/opencode/nuxt/commands/task-continue.md +1 -1
  714. package/presets/opencode/nuxt/commands/task.md +1 -1
  715. package/presets/opencode/nuxt/commands/technical-retro.md +1 -1
  716. package/presets/opencode/nuxt/hooks/chain-team-phases.sh +32 -3
  717. package/presets/opencode/nuxt/rules/code-quality-and-refactoring.md +13 -0
  718. package/presets/opencode/nuxt/rules/code-review-mr.md +13 -0
  719. package/presets/opencode/nuxt/rules/design-guidance.md +5 -0
  720. package/presets/opencode/nuxt/rules/feature-delivery-workflow.md +82 -0
  721. package/presets/opencode/nuxt/rules/mcp-usage.md +9 -0
  722. package/presets/opencode/nuxt/rules/mockup-review.md +4 -0
  723. package/presets/opencode/nuxt/rules/preset-layering.md +1 -1
  724. package/presets/opencode/nuxt/rules/preset-pr-checklist.md +1 -1
  725. package/presets/opencode/nuxt/rules/preset-token-budget.md +10 -10
  726. package/presets/opencode/nuxt/rules/product-specs-authoring.md +6 -0
  727. package/presets/opencode/nuxt/rules/product-specs.md +5 -0
  728. package/presets/opencode/nuxt/rules/reference-features.md +36 -0
  729. package/presets/opencode/nuxt/rules/tests-e2e-structure.md +16 -0
  730. package/presets/opencode/nuxt/rules/tests-unit.md +11 -0
  731. package/presets/opencode/nuxt/rules/ux-design.md +4 -0
  732. package/presets/opencode/nuxt/rules/vue-ui.md +7 -0
  733. package/presets/opencode/nuxt/skills/ci-investigation/SKILL.md +1 -1
  734. package/presets/opencode/nuxt/skills/code-review/SKILL.md +1 -1
  735. package/presets/opencode/nuxt/skills/debug-investigation/SKILL.md +1 -1
  736. package/presets/opencode/nuxt/skills/feature-delivery/SKILL.md +1 -1
  737. package/presets/opencode/nuxt/skills/mockup-review/SKILL.md +1 -1
  738. package/presets/opencode/nuxt/skills/playwright-e2e/SKILL.md +1 -1
  739. package/presets/opencode/nuxt/skills/spec-authoring/SKILL.md +1 -1
  740. package/presets/opencode/nuxt/skills/spec-discovery/SKILL.md +1 -1
  741. package/presets/opencode/nuxt/skills/technical-retro/SKILL.md +1 -1
  742. package/presets/opencode/nuxt/skills/unit-testing/SKILL.md +1 -1
  743. package/presets/opencode/nuxt/skills/ux-design/SKILL.md +1 -1
  744. package/presets/opencode/nuxt/skills/vue-performance/SKILL.md +1 -1
  745. package/presets/opencode/nuxt/skills/write-adr/SKILL.md +1 -1
  746. package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
  747. package/presets/opencode/php-hexagonal/agents/build-verifier.md +1 -1
  748. package/presets/opencode/php-hexagonal/commands/spec-start.md +1 -1
  749. package/presets/opencode/php-hexagonal/commands/task-continue.md +1 -1
  750. package/presets/opencode/php-hexagonal/commands/task.md +1 -1
  751. package/presets/opencode/php-hexagonal/commands/technical-retro.md +1 -1
  752. package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +32 -3
  753. package/presets/opencode/php-hexagonal/rules/agent-team-intake.md +4 -0
  754. package/presets/opencode/php-hexagonal/rules/code-quality-and-refactoring.md +15 -0
  755. package/presets/opencode/php-hexagonal/rules/code-review-mr.md +9 -0
  756. package/presets/opencode/php-hexagonal/rules/design-guidance.md +6 -0
  757. package/presets/opencode/php-hexagonal/rules/mcp-usage.md +6 -0
  758. package/presets/opencode/php-hexagonal/rules/preset-layering.md +1 -1
  759. package/presets/opencode/php-hexagonal/rules/preset-pr-checklist.md +1 -1
  760. package/presets/opencode/php-hexagonal/rules/preset-token-budget.md +10 -10
  761. package/presets/opencode/php-hexagonal/rules/product-specs-authoring.md +6 -0
  762. package/presets/opencode/php-hexagonal/rules/product-specs.md +6 -0
  763. package/presets/opencode/php-hexagonal/skills/ci-investigation/SKILL.md +1 -1
  764. package/presets/opencode/php-hexagonal/skills/code-review/SKILL.md +1 -1
  765. package/presets/opencode/php-hexagonal/skills/debug-investigation/SKILL.md +1 -1
  766. package/presets/opencode/php-hexagonal/skills/feature-delivery/SKILL.md +1 -1
  767. package/presets/opencode/php-hexagonal/skills/integration-testing/SKILL.md +1 -1
  768. package/presets/opencode/php-hexagonal/skills/spec-authoring/SKILL.md +1 -1
  769. package/presets/opencode/php-hexagonal/skills/spec-discovery/SKILL.md +1 -1
  770. package/presets/opencode/php-hexagonal/skills/technical-retro/SKILL.md +1 -1
  771. package/presets/opencode/php-hexagonal/skills/unit-testing/SKILL.md +1 -1
  772. package/presets/opencode/php-hexagonal/skills/write-adr/SKILL.md +1 -1
  773. package/presets/opencode/php-laravel/adapter-map.json +1 -1
  774. package/presets/opencode/php-laravel/agents/build-verifier.md +1 -1
  775. package/presets/opencode/php-laravel/commands/spec-start.md +1 -1
  776. package/presets/opencode/php-laravel/commands/task-continue.md +1 -1
  777. package/presets/opencode/php-laravel/commands/task.md +1 -1
  778. package/presets/opencode/php-laravel/commands/technical-retro.md +1 -1
  779. package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +32 -3
  780. package/presets/opencode/php-laravel/rules/agent-team-intake.md +4 -0
  781. package/presets/opencode/php-laravel/rules/code-quality-and-refactoring.md +15 -0
  782. package/presets/opencode/php-laravel/rules/code-review-mr.md +10 -0
  783. package/presets/opencode/php-laravel/rules/design-guidance.md +6 -0
  784. package/presets/opencode/php-laravel/rules/mcp-usage.md +6 -0
  785. package/presets/opencode/php-laravel/rules/preset-layering.md +1 -1
  786. package/presets/opencode/php-laravel/rules/preset-pr-checklist.md +1 -1
  787. package/presets/opencode/php-laravel/rules/preset-token-budget.md +10 -10
  788. package/presets/opencode/php-laravel/rules/product-specs-authoring.md +6 -0
  789. package/presets/opencode/php-laravel/rules/product-specs.md +6 -0
  790. package/presets/opencode/php-laravel/skills/ci-investigation/SKILL.md +1 -1
  791. package/presets/opencode/php-laravel/skills/code-review/SKILL.md +1 -1
  792. package/presets/opencode/php-laravel/skills/debug-investigation/SKILL.md +1 -1
  793. package/presets/opencode/php-laravel/skills/feature-delivery/SKILL.md +1 -1
  794. package/presets/opencode/php-laravel/skills/integration-testing/SKILL.md +1 -1
  795. package/presets/opencode/php-laravel/skills/spec-authoring/SKILL.md +1 -1
  796. package/presets/opencode/php-laravel/skills/spec-discovery/SKILL.md +1 -1
  797. package/presets/opencode/php-laravel/skills/technical-retro/SKILL.md +1 -1
  798. package/presets/opencode/php-laravel/skills/unit-testing/SKILL.md +1 -1
  799. package/presets/opencode/php-laravel/skills/write-adr/SKILL.md +1 -1
  800. package/presets/opencode/svelte/adapter-map.json +1 -1
  801. package/presets/opencode/svelte/agents/build-verifier.md +2 -2
  802. package/presets/opencode/svelte/commands/spec-start.md +1 -1
  803. package/presets/opencode/svelte/commands/task-continue.md +1 -1
  804. package/presets/opencode/svelte/commands/task.md +1 -1
  805. package/presets/opencode/svelte/commands/technical-retro.md +1 -1
  806. package/presets/opencode/svelte/hooks/chain-team-phases.sh +32 -3
  807. package/presets/opencode/svelte/rules/code-quality-and-refactoring.md +13 -0
  808. package/presets/opencode/svelte/rules/code-review-mr.md +13 -0
  809. package/presets/opencode/svelte/rules/design-guidance.md +5 -0
  810. package/presets/opencode/svelte/rules/feature-delivery-workflow.md +54 -0
  811. package/presets/opencode/svelte/rules/mcp-usage.md +9 -0
  812. package/presets/opencode/svelte/rules/mockup-review.md +4 -0
  813. package/presets/opencode/svelte/rules/preset-layering.md +1 -1
  814. package/presets/opencode/svelte/rules/preset-pr-checklist.md +1 -1
  815. package/presets/opencode/svelte/rules/preset-token-budget.md +10 -10
  816. package/presets/opencode/svelte/rules/product-specs-authoring.md +6 -0
  817. package/presets/opencode/svelte/rules/product-specs.md +5 -0
  818. package/presets/opencode/svelte/rules/reference-features.md +37 -0
  819. package/presets/opencode/svelte/rules/svelte-ui.md +7 -0
  820. package/presets/opencode/svelte/rules/tests-e2e-structure.md +16 -0
  821. package/presets/opencode/svelte/rules/tests-unit.md +11 -0
  822. package/presets/opencode/svelte/rules/ux-design.md +4 -0
  823. package/presets/opencode/svelte/skills/ci-investigation/SKILL.md +1 -1
  824. package/presets/opencode/svelte/skills/code-review/SKILL.md +1 -1
  825. package/presets/opencode/svelte/skills/debug-investigation/SKILL.md +1 -1
  826. package/presets/opencode/svelte/skills/feature-delivery/SKILL.md +1 -1
  827. package/presets/opencode/svelte/skills/mockup-review/SKILL.md +1 -1
  828. package/presets/opencode/svelte/skills/playwright-e2e/SKILL.md +1 -1
  829. package/presets/opencode/svelte/skills/spec-authoring/SKILL.md +1 -1
  830. package/presets/opencode/svelte/skills/spec-discovery/SKILL.md +1 -1
  831. package/presets/opencode/svelte/skills/svelte-performance/SKILL.md +1 -1
  832. package/presets/opencode/svelte/skills/technical-retro/SKILL.md +1 -1
  833. package/presets/opencode/svelte/skills/unit-testing/SKILL.md +1 -1
  834. package/presets/opencode/svelte/skills/ux-design/SKILL.md +1 -1
  835. package/presets/opencode/svelte/skills/write-adr/SKILL.md +1 -1
  836. package/scripts/capture-cli-golden.mjs +8 -5
  837. package/scripts/check-frontmatter.mjs +83 -0
  838. package/scripts/check-generated-drift.mjs +106 -0
  839. package/scripts/check-mavis-token-budget.mjs +1 -1
  840. package/scripts/check-opencode-token-budget.mjs +1 -1
  841. package/scripts/check-preset-structure.sh +27 -0
  842. package/scripts/check-preset-token-budget.sh +16 -17
  843. package/scripts/check-shared-core-drift.sh +10 -5
  844. package/scripts/close-agent-task-human-gate.mjs +6 -4
  845. package/scripts/fixtures/cli-golden/claude/next.json +24 -18
  846. package/scripts/fixtures/cli-golden/cursor/next.json +17 -17
  847. package/scripts/fixtures/cli-golden/mavis/android-kotlin.json +18 -18
  848. package/scripts/fixtures/cli-golden/mavis/go.json +15 -15
  849. package/scripts/fixtures/cli-golden/mavis/ios-swift.json +19 -19
  850. package/scripts/fixtures/cli-golden/mavis/java.json +15 -15
  851. package/scripts/fixtures/cli-golden/mavis/mcp-ts.json +16 -16
  852. package/scripts/fixtures/cli-golden/mavis/next.json +24 -24
  853. package/scripts/fixtures/cli-golden/mavis/nuxt.json +21 -21
  854. package/scripts/fixtures/cli-golden/mavis/php-hexagonal.json +15 -15
  855. package/scripts/fixtures/cli-golden/mavis/php-laravel.json +15 -15
  856. package/scripts/fixtures/cli-golden/mavis/svelte.json +21 -21
  857. package/scripts/fixtures/cli-golden/opencode/android-kotlin.json +31 -31
  858. package/scripts/fixtures/cli-golden/opencode/go.json +26 -26
  859. package/scripts/fixtures/cli-golden/opencode/ios-swift.json +32 -32
  860. package/scripts/fixtures/cli-golden/opencode/java.json +26 -26
  861. package/scripts/fixtures/cli-golden/opencode/mcp-ts.json +23 -23
  862. package/scripts/fixtures/cli-golden/opencode/next.json +38 -38
  863. package/scripts/fixtures/cli-golden/opencode/nuxt.json +35 -35
  864. package/scripts/fixtures/cli-golden/opencode/php-hexagonal.json +26 -26
  865. package/scripts/fixtures/cli-golden/opencode/php-laravel.json +26 -26
  866. package/scripts/fixtures/cli-golden/opencode/svelte.json +35 -35
  867. package/scripts/lib/generate-adapter-common.mjs +11 -0
  868. package/scripts/lib/generate-mavis-adapter.mjs +20 -10
  869. package/scripts/lib/generate-opencode-adapter.mjs +19 -4
  870. package/scripts/test-agent-task-metrics-hooks.mjs +5 -5
  871. package/scripts/test-chain-team-phases-coverage.mjs +176 -1
  872. package/scripts/test-cli-init-clean.mjs +165 -34
  873. package/scripts/test-mavis-context-budget.mjs +1 -1
  874. package/scripts/test-opencode-context-budget.mjs +1 -1
@@ -54,3 +54,9 @@ Same-changeset INDEX updates, frontmatter v1, required body headings, templates,
54
54
  - Skill `spec-discovery` — opt-in research-before-spec (author mode only; not default consume).
55
55
  - `reference-features` — code structure mirror (how to layout files), not product behavior.
56
56
  - Consumer `.ai/context/**` when present — review/domain glossary; cross-link, do not replace.
57
+
58
+ ## Stack notes
59
+
60
+ - `routes`: MCP **tool names**. `ui` / `store`: `[]`. `api`: tools/handlers. `e2e`: contract/unit paths.
61
+ - Prefer `type: feature`. **Forbidden:** requiring `app/src/ui`, Playwright paths, or Next lint recipes.
62
+ - Requestable / `docs/specs/**` globs — not always-on / session-start.
@@ -24,3 +24,18 @@ If **three** fix attempts fail, or the same symptom returns after two supposed f
24
24
  - Broad refactor during a bugfix.
25
25
  - Fix only where the error surfaces if invalid data originates elsewhere.
26
26
  - Claim `fixApplied: true` without re-running the failing check (see `quality/verification-before-completion.md`).
27
+
28
+ ## Stack notes
29
+
30
+ ### Stack process
31
+
32
+ 1. Reproduce with unit/contract fixtures before changing code.
33
+ 2. Check schema validation vs handler logic vs registration wiring.
34
+ 3. Prefer repository tests over ad-hoc Inspector-only claims.
35
+ 4. Load `anti-sycophancy-discipline` — report what was verified.
36
+
37
+ ### MCP usage
38
+
39
+ Load requestable rule `mcp-usage` when verifying third-party library APIs (Context7) or when a local overlay MCP is present and the task fits. Discover tools at runtime; do not invent schemas. Overlay absence is not a blocker unless the user required that MCP as source of truth.
40
+
41
+ If a Sentry/Datadog (or similar) MCP is ready and the task is a production error, event, or trace, use it. Do not invent telemetry.
@@ -3,7 +3,7 @@
3
3
  "platform": "mavis",
4
4
  "stack": "next",
5
5
  "semanticSource": "cursor/next",
6
- "sourceRevision": "f0cc109df31c45d0fa768868bdc4b85af95b78683d04e78c88da1109b048061f",
6
+ "sourceRevision": "04c6021a277bc3eaa2feb108188726dbbc733cd875425ce31e8250ac5122b362",
7
7
  "entries": [
8
8
  {
9
9
  "source": "AGENTS.md",
@@ -31,12 +31,12 @@ When validating **preset packaging** changes (paths under `packages/ai-rules/pre
31
31
 
32
32
  ### FAIL (all stacks)
33
33
 
34
- 1. **Token budget:** Cursor `alwaysApply: true` count ≤ **4** (4th slot reserved for `ai-local-overlay`); Claude rules without `paths:` === **3** (**exclude `**/README.md`** — Option A). Meta `preset-*` rules must **not** be `alwaysApply: true`.
34
+ 1. **Token budget:** Cursor `alwaysApply: true` count 3–5 (extra slots reserved for `ai-local-overlay`); Claude rules without `paths:` 3–5 (**exclude `**/README.md`** — Option A). Meta `preset-*` rules must **not** be `alwaysApply: true`.
35
35
  2. **Leakage (next):** hooks/agents must not require `xcuitest-test-*` handoffs or `xcodebuild` as the default Next post-change gate. See `preset-no-cross-stack-leakage.md`.
36
36
  3. **Mapping / README:** `claude/next/rules/README.md` must include a Cursor→Claude mapping table; stack `rules/README.md` should document core→stack mapping when `_shared` consumers exist.
37
37
  4. **shared-core consumers:** if `_shared/core/**` changed, every file with matching `<!-- shared-core: … -->` in this PR must be updated (or intentional fork documented in validation-report).
38
38
  5. **Twin presence:** Cursor rule change without Claude twin same PR → **FAIL** (next, nuxt, svelte, ios-swift, go, java, mcp-ts, php-hexagonal, and php-laravel). Domain twin body ≥15 lines; thin aliases (`agent-team-intake`, `technical-retro`) may be shorter.
39
- 6. **Session-start body budget (soft→document, FAIL if grossly over):** sum body lines of the **3** intended always-on / session-start rules ≤ **140** (stretch ≤120); do **not** include `**/README.md`. Record the sum in validation-report.
39
+ 6. **Session-start body budget (soft→document, FAIL if grossly over):** sum body lines of the intended always-on / session-start rules ≤ **200** (stretch ≤170); do **not** include `**/README.md`. Record the sum in validation-report.
40
40
  7. **Embed drift (hard in `check:preset-structure`):** run `packages/ai-rules/scripts/check-shared-core-drift.sh` with `AI_RULES_DRIFT_FAIL=1` (bundled by the structure orchestrator). Lineage stems are excluded from body equality.
41
41
  8. **Dogfood (monorepo soft):** if root `.cursor/` is in the PR, prefer sync via `packages/ai-rules/scripts/sync-dogfood-cursor.sh`; mass deletion of tracked dogfood without migration doc → note as risk / FAIL for maintainers.
42
42
 
@@ -4,7 +4,7 @@ Routes intent **`spec-gen`** (or bootstrap) → **task-analyst** in **author mod
4
4
 
5
5
  ## What to do
6
6
 
7
- 1. Extract description from arguments after the spec-start procedure in `.mavis/commands/spec-start.md` (domain, page/feature ids, sources).
7
+ 1. Extract description from arguments after `/spec-start` (domain, page/feature ids, sources).
8
8
  2. Generate a **slug** (kebab-case, ≤48 chars), e.g. `spec-<domain>-<id>`.
9
9
  3. Ensure `.ai.local/team/tasks/<slug>/` exists (Write artifacts; not Shell mkdir).
10
10
  4. Write `.ai.local/team/active-task.json` → `{ "slug": "<slug>" }`.
@@ -16,7 +16,7 @@ Routes intent **`spec-gen`** (or bootstrap) → **task-analyst** in **author mod
16
16
 
17
17
  - Show created/updated spec paths and INDEX diff.
18
18
  - Ask user to approve drafts (`status: draft` → promote) or send edits.
19
- - Continue: continue `<slug>` using `.mavis/commands/task-continue.md` only after approval when implementation follows; otherwise stop after docs.
19
+ - Continue: `/task-continue <slug>` only after approval when implementation follows; otherwise stop after docs.
20
20
 
21
21
  ## Notes
22
22
 
@@ -1,10 +1,10 @@
1
1
  # Task — unified entry point (router + pipeline)
2
2
 
3
- Main command for task intake. Parent agent = orchestrator (`agent-team-orchestrator.md`). Intake for work requests without the task procedure in `.mavis/commands/task.md` — `agent-team-intake.md`.
3
+ Main command for task intake. Parent agent = orchestrator (`agent-team-orchestrator.md`). Intake for work requests without `/task` — `agent-team-intake.md`.
4
4
 
5
5
  ## Arguments
6
6
 
7
- Everything after the task procedure in `.mavis/commands/task.md` is the task description in natural language.
7
+ Everything after `/task` is the task description in natural language.
8
8
 
9
9
  Examples:
10
10
 
@@ -25,13 +25,13 @@ Examples:
25
25
  1. **Slug** — kebab-case from the description (≤48 characters). Create `.ai.local/team/tasks/<slug>/` via **Write** (e.g. placeholder `pipeline.json` or empty marker) — runtime/hook owns `status.json` — **not** via Shell `mkdir` (sandbox → `Operation not permitted`).
26
26
  2. **Router** — invoke subagent **task-router** with the task description and slug path.
27
27
  3. **Plan** — show the user the table from `pipeline.json`: intent, steps, skipped, humanGates.
28
- 4. **Intent retro** — if `intent === "retro"`, run the technical-retro procedure in `.mavis/commands/technical-retro.md` and **stop**.
28
+ 4. **Intent retro** — if `intent === "retro"`, run `/technical-retro` and **stop**.
29
29
  5. **Start** — after router:
30
30
  - confirm `pipeline.json` and `active-task.json`;
31
31
  - **do not** write lifecycle fields in `status.json` / `metrics.json` yourself — orchestration runtime/hook owns them (see **agent-artifact-contracts**). If `status.json` is missing, only minimal bootstrap is allowed (`slug`, `intent`, `pipelineIndex: 0`, `currentAgent: steps[0]`, `state: in_progress`) — **do not** increment `pipelineIndex` manually;
32
32
  - invoke subagent for `pipeline.steps[0].agent` (slug, artifact paths, scope).
33
33
  6. **After each agent** — wait for hook handoff / reconciliation terminal receipt → `status.state`; do not start the next step until `status.json` reflects handoff (or until there is a `followup_message` from the hook).
34
- 7. **Human gate** — if after the current step there is a gate in `humanGates` (`after:<agent>`), after the agent finishes **stop** and ask for continue `<slug>` using `.mavis/commands/task-continue.md`.
34
+ 7. **Human gate** — if after the current step there is a gate in `humanGates` (`after:<agent>`), after the agent finishes **stop** and ask for `/task-continue <slug>`.
35
35
 
36
36
  ## Do not
37
37
 
@@ -41,10 +41,10 @@ Examples:
41
41
 
42
42
  ## If slug is taken
43
43
 
44
- - `awaitingHumanGate` / `state: awaiting_approval` → offer artifact review or continue `<slug>` using `.mavis/commands/task-continue.md`.
44
+ - `awaitingHumanGate` / `state: awaiting_approval` → offer artifact review or `/task-continue <slug>`.
45
45
  - `in_progress` → ask: continue or new slug.
46
46
 
47
47
 
48
48
  ## Metrics
49
49
 
50
- Runtime/hook owns `metrics.json` and `status.json` attempt ledgers. Before the first invocation ensure `task_started` and one `activeAttempts[attemptId]` + `attempt_started` exist (router/runtime bootstrap — parent must not invent parallel indices). On the task-continue procedure in `.mavis/commands/task-continue.md`, run the installed chain hook `end_human_gate` action (or wrapper) so `human_gate_ended` lands before the next attempt. Do not calculate durations in agents.
50
+ Runtime/hook owns `metrics.json` and `status.json` attempt ledgers. Before the first invocation ensure `task_started` and one `activeAttempts[attemptId]` + `attempt_started` exist (router/runtime bootstrap — parent must not invent parallel indices). On `/task-continue`, run the installed chain hook `end_human_gate` action (or wrapper) so `human_gate_ended` lands before the next attempt. Do not calculate durations in agents.
@@ -42,7 +42,10 @@ try {
42
42
  }
43
43
 
44
44
  const slug = active.slug;
45
- if (!slug) {
45
+ // Reject non-kebab / traversal slugs: the runtime writes status.json and
46
+ // metrics.json under tasks/<slug>, so an unchecked slug could escape the tree.
47
+ const SLUG_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
48
+ if (typeof slug !== 'string' || slug.length > 48 || !SLUG_RE.test(slug)) {
46
49
  process.stdout.write('{}');
47
50
  process.exit(0);
48
51
  }
@@ -69,6 +72,9 @@ function waitForMetricsLock() {
69
72
  // and never blocked on the lock file, so two concurrent subagentStop events
70
73
  // could both acquire the lock and corrupt metrics.json. Retry EEXIST with a
71
74
  // 10 ms sleep up to 200 attempts (2 s ceiling). On any other error, throw.
75
+ // A lock left behind by a killed process is reclaimed once its mtime is older
76
+ // than STALE_LOCK_MS, so one crash cannot brick the task forever.
77
+ const STALE_LOCK_MS = 30000;
72
78
  for (let attempt = 0; attempt < 200; attempt += 1) {
73
79
  try {
74
80
  const fd = fs.openSync(METRICS_LOCK, 'wx');
@@ -76,6 +82,13 @@ function waitForMetricsLock() {
76
82
  return;
77
83
  } catch (error) {
78
84
  if (!error || error.code !== 'EEXIST') throw error;
85
+ try {
86
+ const lockStat = fs.statSync(METRICS_LOCK);
87
+ if (Date.now() - lockStat.mtimeMs > STALE_LOCK_MS) {
88
+ fs.unlinkSync(METRICS_LOCK);
89
+ continue;
90
+ }
91
+ } catch {}
79
92
  const until = Date.now() + 10;
80
93
  while (Date.now() < until) { /* 10 ms busy-wait */ }
81
94
  }
@@ -495,7 +508,10 @@ function legacyFlow() {
495
508
 
496
509
 
497
510
  if (hookInput.action === 'end_human_gate') {
498
- status.awaitingHumanGate = false;
511
+ // Only advance when a gate was actually open. A duplicate or retried
512
+ // end_human_gate must be a no-op, not a silent pipeline skip.
513
+ const gateWasOpen = Boolean(status.activeHumanGateEventId) || status.awaitingHumanGate === true;
514
+ status.awaitingHumanGate = false;
499
515
  // A2 (retro §8): pin a single runId per pipeline so subsequent events don't
500
516
  // fragment the metrics ledger across multiple runId sequences. Prefer
501
517
  // metrics.json.task.runId when metrics already exist, then status.metricsRunId,
@@ -522,7 +538,7 @@ if (hookInput.action === 'end_human_gate') {
522
538
  });
523
539
  delete status.activeHumanGateEventId;
524
540
  }
525
- if (hookInput.activateNext && fs.existsSync(pipelinePath)) {
541
+ if (gateWasOpen && hookInput.activateNext && fs.existsSync(pipelinePath)) {
526
542
  let resumePipeline = null;
527
543
  try { resumePipeline = JSON.parse(fs.readFileSync(pipelinePath, 'utf8')); } catch {}
528
544
  if (resumePipeline) {
@@ -544,6 +560,19 @@ if (hookInput.action === 'end_human_gate') {
544
560
  else out(handoffForAgent(resumeAgents[0], resumeNext.step.scope, resumeNext.step));
545
561
  process.exit(0);
546
562
  }
563
+ // Gate on the final step: no executable step remains. Complete the
564
+ // pipeline instead of leaving it in_progress forever.
565
+ status.state = 'completed';
566
+ completeTaskMetrics();
567
+ writeStatus({
568
+ pipelineIndex: resumeSteps.length,
569
+ phase: 'done',
570
+ state: 'completed',
571
+ currentAgent: null,
572
+ awaitingHumanGate: false,
573
+ });
574
+ out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
575
+ process.exit(0);
547
576
  }
548
577
  }
549
578
  // A2 (retro §8): if gate closes the final human gate of the pipeline
@@ -14,8 +14,8 @@
14
14
  - For each domain area (for example, orders, billing, account settings):
15
15
  - a separate directory in `app/src/api/services/<ServiceName or feature>/**` following repository convention.
16
16
  - Inside a module:
17
- - files with API calls (`index.ts` or `*.service.ts`);
18
- - mapper files (`*responseMappers.ts`);
17
+ - files with API calls — follow the repo's shape: `index.ts` / `*.service.ts`, **or** a per-domain module exporting an object (`XxxApiMethods` in `<Domain>.apiMethods.ts` with `<Domain>.endpoints.ts` and `<Domain>.responseTypes.ts`) as in neighboring services;
18
+ - mapper files (`*responseMappers.ts`) — pure `format…` / `map…` functions named as in the repo;
19
19
  - request/response-specific types (if not moved to `app/src/types/**` with export through the `@/types` barrel).
20
20
  - when needed — local `index.ts` / barrel inside the module for structure **within** `app/src/api/**`; **outside** this layer UI, store, and other code import only from the root barrel `app/src/api/index.ts` (`import … from '@/api'`, **`public-imports.md`**).
21
21
 
@@ -63,10 +63,12 @@ export const getCard = async (id: string) => {
63
63
 
64
64
  ```ts
65
65
  import type { TCard } from '@/types'
66
- import { mapCardResponse } from './cardResponseMappers'
66
+ import { formatCardResponse } from './cardResponseMappers'
67
67
 
68
68
  export const getCard = async (id: string): Promise<TCard> => {
69
69
  const { data } = await cardsClient.get(`/cards/${id}`)
70
- return mapCardResponse(data)
70
+ return formatCardResponse(data)
71
71
  }
72
72
  ```
73
+
74
+ Mapper function verb (`format…` vs `map…`) follows the repo — match neighboring mappers.
@@ -14,6 +14,12 @@
14
14
  - **CUPID:** Composable; Unix philosophy (one responsibility); Predictable; Idiomatic (repo); Domain-based.
15
15
  - **Composition over inheritance;** Law of Demeter — no `a.b.c.d` chains; via public API / facade.
16
16
 
17
+ # Over-abstraction guardrails
18
+
19
+ - **No unnecessary constants:** do not hoist a one-off literal, string, or boolean into a named constant. Inline it, or use an existing token/enum when the value is meaningful and reused. Named constants are for shared, semantic, or repeated values.
20
+ - **No invented utilities:** do not add a `utils`/helper for a single call site or a thin pass-through wrapper. Inline it or extend the existing helper; a new shared utility is justified only after the Rule of Three.
21
+ - **Decompose over conditionals:** a unit (function, component, hook) that accumulates several branches (`if` / ternary / `switch`) should be split into smaller units with one reason to change instead of piling up conditions.
22
+
17
23
  # Refactoring during changes
18
24
 
19
25
  - Light refactor is OK if it reduces duplication, improves readability, and does not break public contracts.
@@ -38,3 +44,10 @@ Essentials below. Full procedural set (~17 rules) → load **`anti-sycophancy-di
38
44
  Style enforcement (formatter / linter / post-change gate) lives in the **stack toolchain** — see each adapter’s **Stack notes**.
39
45
 
40
46
  > Stack-specific lint gates, examples, and toolchain — in the preset adapter **Stack notes** section.
47
+
48
+ ## Stack notes
49
+
50
+ - Before adding a new UI control, check existing UI code and project packages.
51
+ - Public API: index/barrel files and explicitly exported entities (`public-imports.mdc`, `layer-barrel-exports.mdc`).
52
+ - Allowed examples: shared hook/utility; typing `any`/`unknown`; splitting a large component; CSS tokens instead of “magic” values.
53
+ - Lint/stylelint — only **`post-change-lint.mdc`**; ESLint config: `app/eslint.config.mjs`. Disabling a rule (`eslint-disable`) — only **locally** (line/small block) with a short “why” comment. Style prose in domain rules stays thin — prefer ESLint/Stylelint over duplicating formatter recipes.
@@ -38,3 +38,16 @@ Procedure details live in skill `code-review`. Required shape:
38
38
  - Rank by severity: **`blocker` | `important` | `nit`** (list blocker → nit).
39
39
  - Vague («looks risky») is not a finding — cite evidence or ask for surrounding file context.
40
40
  - End with a verdict on its own line: **`Safe to merge | needs changes | reject`**.
41
+
42
+ ## Stack notes
43
+
44
+ On-demand rule for review flows. **Procedure and output format:** skill `code-review`.
45
+
46
+ ### Checklist references
47
+
48
+ - Architecture layers: `architecture-boundaries.mdc`, `next-app-core.mdc`; network: `http-client.mdc`
49
+ - Imports: `public-imports.mdc`, `layer-barrel-exports.mdc`
50
+ - UI: `react-ui.mdc`
51
+ - Security: `security-next.mdc`
52
+ - Tests: `tests-unit.mdc`, `playwright-agents.mdc`, `tests-e2e-structure.mdc`
53
+ - Lint gate before final report: `post-change-lint.mdc`
@@ -97,3 +97,8 @@ Do not introduce a second stem (`refactoring-smells` / `design-patterns-for-agen
97
97
  - Ubiquitous language: `feature-delivery-workflow` (lineage).
98
98
  - MR checklist (smells in scope; pattern name only if repo uses it): `code-review-mr`.
99
99
  - Token / twin policy for authors: `preset-token-budget`, `preset-twin-sync` (meta, not consumer always-on).
100
+
101
+ ## Stack notes
102
+
103
+ - Prefer hooks/mappers over HOC or new pattern names when the repo already extracts that way.
104
+ - Suggest Strategy/Adapter only when ports or policy branching already exist in `app/src/**`.
@@ -47,3 +47,88 @@ flowchart LR
47
47
  ## Zone → rules matrix
48
48
 
49
49
  Filled in the stack adapter: concrete globs/paths and `.mdc` / topic `.md` names.
50
+
51
+ ## Stack notes
52
+
53
+ When the prompt or `brief.md` contains a `figma.com` URL, **mockup review** (`mockup-reviewer` / skill `mockup-review`) must complete — or the user must continue past FAIL/`BLOCKED_MCP` via `/task-continue` — **before UI implementation**. Non-UI tasks no-op this gate. When required-signal and **no** `figma.com`, **`ux-design.md`** (on the analysis manifest entry) must exist and not be `INCOMPLETE` before UI work — else **blocked**, hand back to `task-analyst`. Parallel to the mockup gate.
54
+
55
+ ## Style discovery (mandatory)
56
+
57
+ Before writing a new file in a layer, open **1–2 analog files** in the same layer and mirror: export shape, name prefixes (`T` / `I` where the repo uses them), file suffixes (`.apiMethods.ts`, `.endpoints.ts`, `.data.ts`, `.hooks.ts`, `styles.ts`), mapper / selector / thunk naming, and barrel shape. Record the analogs in the handoff. Where this preset's examples differ from the repo, **the repo wins**.
58
+
59
+ Typical feature with backend data and shared state. Layer details — `architecture-boundaries.mdc`, `next-app-core.mdc`.
60
+
61
+ ## Checklist (work order)
62
+
63
+ 1. **Domain types** — `app/src/types/**`, export via barrel (`public-imports.mdc`, **`layer-barrel-exports.mdc`**); JSDoc — `types-jsdoc.mdc`.
64
+ 2. **API contract** — DTOs where the repo uses them; domain types in `@/types`.
65
+ 3. **Mappers** — DTO → domain in `*responseMappers.ts` (`api-services.mdc`).
66
+ 4. **Services** — clients `app/src/api/clients/**`, barrel `@/api` (`api-services.mdc`, `http-client.mdc`, **`layer-barrel-exports.mdc`**). No `fetch` from UI/store.
67
+ 5. **State** — `createSlice` / `createAsyncThunk` (`store-rtk.mdc`); thunk → services from `@/api`.
68
+ 6. **UI** — types from `@/types`, no DTOs (`react-ui.mdc`, `architecture-boundaries-ui.mdc`, `no-props-spread.mdc`).
69
+ 7. **Mocks** — per repo layout; register in `app/src/mocks/handlers.ts` (see below).
70
+ 8. **Tests** — unit for mappers (`tests-unit.mdc`); e2e from `*.cases.md` (`tests-e2e-structure.mdc`, `playwright-agents.mdc`).
71
+ 9. **Completion** — **`post-change-lint.mdc`**: `lint:js` + `lint:css` + `type-check`; package manager — `package-manager.mdc`. When the current WP spans **more than one** layer or module, `implementation.md` includes a **Code Map** (3–8 annotated paths) and **Suggested Review Order** (`concern | path:line | ≤15 word note`). Omit both for a single-file or single-layer WP.
72
+
73
+ ## Data flow (orientation)
74
+
75
+ ```mermaid
76
+ flowchart LR
77
+ subgraph transport [Transport]
78
+ HttpClient[HttpClient]
79
+ end
80
+ DTO[DTO] --> Mappers[Mappers]
81
+ Mappers --> Domain[Domain types]
82
+ Domain --> Service[API service]
83
+ Service --> HttpClient
84
+ Service --> Thunk[Thunk]
85
+ Thunk --> Store[Store]
86
+ Store --> UI[UI]
87
+ ```
88
+
89
+ ## Registration by layer
90
+
91
+ 1. **Types** — `app/src/types/**`; domain model is the source of truth for UI and store.
92
+ 2. **API** — `app/src/api/services/<ServiceRoot>/<Segment>/`; public exports (incl. **path constants** for mocks) → **`app/src/api/index.ts`**.
93
+ 3. **Mocks (MSW)** — `app/src/mocks/data/<feature>/`; handlers in **`app/src/mocks/handlers.ts`**. Paths from `@/api`; do not duplicate URL strings. Check browser worker and Node `setupServer` if both are used.
94
+ 4. **Store** — `app/src/store/slices/<FeatureName>/`; reducer in **`app/src/store/reducers.ts`**. Middleware → `app/src/store/middleware/**`, register in **`app/src/store/index.ts`**.
95
+ 5. **UI** — `app/src/ui/pages/<FeatureName>Page/**` and/or `components/**`; data via store/hooks.
96
+ 6. **Unit** — `*.spec.ts(x)`; mappers and non-trivial logic are required.
97
+ 7. **E2E** — `app/__tests__/e2e/<Area>/<plan>.cases.md` + `*.spec.ts`.
98
+
99
+ ## Partial scenarios
100
+
101
+ | Task | Minimum actions |
102
+ |------|-----------------|
103
+ | API + types only | Types, service, mappers, `@/api` barrel; unit for mapper. |
104
+ | Mocks only | Path in `@/api`; handlers + `mocks/handlers.ts`. |
105
+ | Store only | Thunk via `@/api`; slice + `reducers.ts`. |
106
+ | UI only | Store state; no HTTP/DTO. |
107
+ | E2E only | `*.cases.md` + spec; page object. |
108
+
109
+ ## Anti-patterns
110
+
111
+ - DTO in UI or untyped store.
112
+ - HTTP client from a component/thunk bypassing the service.
113
+ - Deep-import `@/api/services/**` from UI/store.
114
+ - `{...props}` into components — `no-props-spread.mdc`.
115
+ - **Ubiquitous language:** Domain/type names reflect the feature’s subject domain — do not mix transport/framework terms into the domain without need.
116
+ - Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
117
+ - Do not mutate pipeline `status.json` / `metrics.json`; the orchestration hook is the single writer. Skills upsert the owned terminal receipt in `artifact-manifest.json`.
118
+
119
+ ## Matrix: zone → rules
120
+
121
+ | Zone | Rules |
122
+ |------|-------|
123
+ | `app/src/api/clients/**`, `app/src/lib/clients/**` | `http-client.mdc`, `tests-unit.mdc` (behavior) |
124
+ | `app/src/api/services/**` | `api-services.mdc`, `layer-barrel-exports.mdc`, `http-client.mdc` |
125
+ | `app/src/store/**` | `store-rtk.mdc`, `architecture-boundaries.mdc`, `public-imports.mdc` |
126
+ | `app/src/ui/**` | `react-ui.mdc`, `no-props-spread.mdc`, `public-imports.mdc` |
127
+ | `app/src/types/**` | `public-imports.mdc`, `types-jsdoc.mdc`, `layer-barrel-exports.mdc` |
128
+ | `app/__tests__/e2e/**` | `tests-e2e-structure.mdc`, `playwright-agents.mdc` |
129
+
130
+ When adding or extending a feature, **walk the checklist** and the rules from the table for affected zones.
131
+
132
+ ## Related
133
+
134
+ - Product behavior discovery: requestable **`product-specs`** (`docs/specs/INDEX.md`) — do not paste the discovery algorithm here.
@@ -84,3 +84,12 @@ Policy is stack-class-specific — see adapter **Stack notes**. If a Figma **plu
84
84
  - Treating overlay absence as blocked (except user-required SoT)
85
85
  - Tracker/admin write tools without an explicit ask
86
86
  - Calling overlay MCP “just in case” on unrelated tasks
87
+
88
+ ## Stack notes
89
+
90
+ - Pipeline **`mockup-reviewer`** is the only agent that reads Figma for mockup review. See `mockup-review`.
91
+ - Shipped besides Context7: browser automation MCP (`playwright` / `playwright-test` / `user-playwright`) and `chrome-devtools`.
92
+ - **Split:** Playwright MCP → e2e agents (planner/generator/healer), selector checks, spec reproduction. Chrome DevTools MCP → `debugger` / `performance-auditor` against a **running app** (console, network, traces). Not a substitute for e2e.
93
+ - **Storybook overlay** (not shipped): aliases `storybook`, `user-storybook`, `plugin-storybook`, `storybook-mcp-addon`. Needs Storybook running (often `http://localhost:6006/mcp`). Discover docs/dev/testing toolsets. If down, read story/source files. Block only if the user required Storybook MCP as SoT.
94
+ - `init` **merges** `mcpServers`: preset keys update; extra local servers are kept. User-level MCP is never touched.
95
+ - If a Figma plugin is already connected, do not also require the project `figma` server.
@@ -105,3 +105,7 @@ PASS | PASS_WITH_NOTES | FAIL | BLOCKED_MCP
105
105
  ## AC coverage
106
106
  | Criterion | Status | Notes |
107
107
  ```
108
+
109
+ ## Stack notes
110
+
111
+ Illustrative web buckets (not enforced pixels): ~375 / ~768 / ~1280 mapped to small / medium / large.
@@ -5,8 +5,9 @@ Concrete versions come **from `package.json` and configs of the target repositor
5
5
  # Project structure
6
6
 
7
7
  - `app/` — Next.js root; `app/src/**` — code; `app/__tests__/e2e/**` — e2e.
8
- - `app/tsconfig.json`: `baseUrl: "."`, `paths: { "@/*": ["./src/*"] }`.
8
+ - `app/tsconfig.json`: `paths: { "@/*": ["./src/*"] }` (`baseUrl` may be absent with TS ≥5 / `moduleResolution: bundler` — check the file, do not add it blindly).
9
9
  - **Requirement:** `@/*` instead of relative imports that climb the tree.
10
+ - **Router mode:** detect from the repo before adding routes — App Router (`app/src/app/**`, `page.tsx`) vs Pages Router (`app/src/pages/**`, `_app.tsx`). Do **not** assume App Router; follow the mode already in use (`next-app-router.md`, `navigation-router-stack.md`).
10
11
 
11
12
  # Architectural layers
12
13
 
@@ -9,7 +9,7 @@ Rules for **preset authors** (`packages/ai-rules/presets/**`). Not always-on in
9
9
  | Layer | Where | What to put |
10
10
  |-------|-------|-------------|
11
11
  | **Core** | `presets/_shared/core/**` | Stack-agnostic prose + checklists; no frontmatter; no paths `app/**`, `Features/**`, Playwright, xcodebuild |
12
- | **Stack** | `presets/{cursor\|claude\|mavis\|opencode}/<stack>/` | Domain/tooling, stack always-on trio, stack examples in **Stack notes** |
12
+ | **Stack** | `presets/{cursor\|claude\|mavis\|opencode}/<stack>/` | Domain/tooling, stack always-on set (3–5), stack examples in **Stack notes** |
13
13
  | **Platform** | Cursor `.mdc` / Claude `.md` / Mavis `.md` / OpenCode `.md` | Frontmatter (`alwaysApply`/`globs` vs `paths:` vs OpenCode `mode`/`permission`), platform-only (`BUGBOT.md`, `CLAUDE.md`) |
14
14
 
15
15
  ## Where to put a new rule
@@ -12,7 +12,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
12
12
  - [ ] **Mavis derive:** mapped `cursor/<stack>/` change → `mavis/<stack>/` + `adapter-map.json` **same PR** when the stack is in `releasedStacks` (run `generate-mavis.mjs --stack <stack>` + `check-mavis-adapter-map.mjs`; see `preset-twin-sync` § Mavis derivation)
13
13
  - [ ] **OpenCode derive:** mapped `cursor/<stack>/` change → `opencode/<stack>/` + `adapter-map.json` **same PR** when the stack is in `releasedStacks` (run `generate-opencode.mjs --stack <stack>` + `check-opencode-adapter-map.mjs`; see `preset-twin-sync` § OpenCode derivation)
14
14
  - [ ] **Mapping:** `claude/<stack>/rules/README.md` mapping table is current
15
- - [ ] **Token budget:** Cursor `alwaysApply` ≤ 4 (4th slot reserved for `ai-local-overlay`); Claude session-start exactly 3; meta rules not always-on
15
+ - [ ] **Token budget:** Cursor `alwaysApply` and Claude session-start both **3–5** (extra slots reserved for `ai-local-overlay`); body sum ≤200 (stretch ≤170); meta rules not always-on
16
16
  - [ ] **Local overlay coverage:** every installable stack ships `ai-local-overlay.mdc` (Cursor) and `ai-local-overlay.md` (Claude) with `MANDATORY` + acknowledgement format + `docs/LOCAL-OVERLAY.md` pointer; Claude twin listed in `claude/<stack>/rules/README.md` mapping table. Run `packages/ai-rules/scripts/check-local-overlay.sh`.
17
17
  - [ ] **Leakage:** no foreign stack agent stems / handoff strings (`preset-no-cross-stack-leakage`)
18
18
  - [ ] **Hook-only lifecycle:** `status.json` / `metrics.json` writes happen only inside `hooks/`; agents read but never rewrite lifecycle fields. Run `packages/ai-rules/scripts/check-hook-only-lifecycle.sh`.
@@ -8,19 +8,19 @@ Invariants for rule loading in an **installed** preset (consumer app).
8
8
 
9
9
  | Platform | Always-on | Cap |
10
10
  |----------|-----------|-----|
11
- | Cursor | `alwaysApply: true` | **≤ 4** |
12
- | Claude | rules **without** `paths:` | **exactly 3** |
13
- | Mavis | `adapter-map` rules with `loadMode: root-entry` | **≤ 4** |
14
- | OpenCode | `adapter-map` rules with `loadMode: root-entry` | **≤ 4** |
11
+ | Cursor | `alwaysApply: true` | **3–5** |
12
+ | Claude | rules **without** `paths:` | **3–5** |
13
+ | Mavis | `adapter-map` rules with `loadMode: root-entry` | **3–5** |
14
+ | OpenCode | `adapter-map` rules with `loadMode: root-entry` | **3–5** |
15
15
 
16
- **Cursor 4th slot is reserved for `ai-local-overlay`** (consumer-owned `.ai.local/` rules). If you do not need local overlay, demote that rule to `globs: ["**/.ai.local/**"]` and revert to ≤3.
16
+ Caps are **aligned** across platforms: minimum **3** (base invariants), maximum **5**. Slots beyond the base invariants are reserved for `ai-local-overlay` (consumer-owned `.ai.local/` rules). If you do not need local overlay, demote that rule to `globs: ["**/.ai.local/**"]` / Claude `paths:`, or a non-root load mode on Mavis / OpenCode.
17
17
 
18
- **Claude Option A (README exclusion):** when counting Claude rules without `paths:` / session-start, **exclude `**/README.md`** (topic indexes are not session-start rules). The intended session-start trio remains **exactly 3**; body budget sums **only those 3** rules.
18
+ **Claude Option A (README exclusion):** when counting Claude rules without `paths:` / session-start, **exclude `**/README.md`** (topic indexes are not session-start rules). Body budget sums only the intended session-start rules (≤5).
19
19
 
20
20
  Session-start body budget:
21
- - Claude trio: ≤140 lines total (stretch ≤120).
22
- - Cursor 4-set: ≤170 lines total (4 rules including `ai-local-overlay`).
23
- - Mavis / OpenCode: ≤4 root-entry rule files; combined root `AGENTS.md` + platform entry ≤170 nonempty lines. Do not dump the full rule catalog into `AGENTS.md`.
21
+ - Claude session-start: ≤200 lines total (stretch ≤170).
22
+ - Cursor always-on: ≤200 lines total (stretch ≤170).
23
+ - Mavis / OpenCode: ≤5 root-entry rule files; combined root `AGENTS.md` + platform entry ≤200 nonempty lines. Do not dump the full rule catalog into `AGENTS.md`.
24
24
 
25
25
  ## Meta / author rules
26
26
 
@@ -36,4 +36,4 @@ Orchestrator, feature-delivery, code-review, post-change gates, domain globs —
36
36
 
37
37
  ## Verifier
38
38
 
39
- build-verifier **FAIL** if Cursor `alwaysApply` count exceeds 4, Claude session-start count exceeds 3 (Claude count **excludes `**/README.md`**), or if a `preset-*` meta rule is marked always-on.
39
+ build-verifier **FAIL** if Cursor `alwaysApply` count or Claude session-start count is outside **3–5** (Claude count **excludes `**/README.md`**), or if a `preset-*` meta rule is marked always-on.
@@ -110,3 +110,9 @@ Block handoff via `open_questions` until fixed:
110
110
  - Skill `spec-authoring` — procedural checklist
111
111
  - Skill `spec-discovery` — opt-in research-before-spec (not default)
112
112
  - Optional consumer script `scripts/check-product-specs.sh` (ships in the npm package; WARN default; `--strict` FAIL). Bash checks INDEX links, required frontmatter keys, and body headings — it does **not** evaluate `frontmatter-v1.schema.json`
113
+
114
+ ## Stack notes
115
+
116
+ - Author via skill `spec-authoring`; templates from package assets / consumer `docs/specs/_templates/`.
117
+ - Field semantics match discovery stem (`routes` = URL paths; `e2e` = Playwright).
118
+ - Requestable — not always-on / session-start.
@@ -54,3 +54,9 @@ Same-changeset INDEX updates, frontmatter v1, required body headings, templates,
54
54
  - Skill `spec-discovery` — opt-in research-before-spec (author mode only; not default consume).
55
55
  - `reference-features` — code structure mirror (how to layout files), not product behavior.
56
56
  - Consumer `.ai/context/**` when present — review/domain glossary; cross-link, do not replace.
57
+
58
+ ## Stack notes
59
+
60
+ - `routes`: app URL paths. `ui` / `store`: presentation + RTK/store paths (e.g. `app/src/ui/pages/...`). `e2e`: Playwright paths under `app/__tests__/e2e/**` (or repo equivalent).
61
+ - Dogfood example (emedcard-web AnalysisPage): `docs/specs/domains/analysis/analysis-page.md`.
62
+ - Requestable / `docs/specs/**` globs — not always-on / session-start.
@@ -1,6 +1,7 @@
1
1
  # General component rules
2
2
 
3
3
  - Use **functional components** with hooks, no classes.
4
+ - Export as `export const ComponentName = ({ ... }: IProps) => …` (arrow + props type). No `FC` / `React.FC`.
4
5
  - A component should:
5
6
  - stay as "thin" as possible on business logic;
6
7
  - delegate state to store/hooks when needed in multiple places;
@@ -9,6 +10,41 @@
9
10
  - For repeated logic, create `useSomething` hooks nearby or in `src/ui/hooks/**`.
10
11
  - When accessing store, API, shared helpers, and utilities, components and hooks must use only their **public API** (for example, `@/store`, `@/store/slices/Foo`, `@/lib/utils`), not internal implementation files of other modules.
11
12
 
13
+ # Conditional rendering
14
+
15
+ - Prefer **decomposition over conditionals**: a component with more than one or two branches (nested ternaries, long `&&` chains, several early returns) should extract each branch into a child under `./components/<Name>/`, keeping the parent a thin switch.
16
+ - Keep the condition in the parent; the child receives resolved props.
17
+ - No nested ternaries in JSX. For not-ready / empty / error, use an early return or a dedicated `EmptyState` / `ErrorState` component.
18
+ - A `variant` / `mode` flag that renders two unrelated layouts is **two** components, not one.
19
+
20
+ ## Incorrect
21
+
22
+ ```tsx
23
+ export const OrderPanel = ({ order }: Props) => (
24
+ <div>
25
+ {order == null ? (
26
+ <Spinner />
27
+ ) : order.items.length === 0 ? (
28
+ <p>No items</p>
29
+ ) : order.status === 'paid' ? (
30
+ <PaidList items={order.items} />
31
+ ) : (
32
+ <UnpaidList items={order.items} />
33
+ )}
34
+ </div>
35
+ )
36
+ ```
37
+
38
+ ## Correct
39
+
40
+ ```tsx
41
+ export const OrderPanel = ({ order }: Props) => {
42
+ if (order == null) return <Spinner />
43
+ if (order.items.length === 0) return <EmptyState />
44
+ return <OrderItems order={order} />
45
+ }
46
+ ```
47
+
12
48
  # File structure
13
49
 
14
50
  For a page/large block:
@@ -63,7 +99,7 @@ For a reusable component:
63
99
  # Props and typing
64
100
 
65
101
  - **Do not pass props via spread** (`<Foo {...x} />`). Only explicit attributes; details and exceptions — `no-props-spread.md` (in `app/src/ui` ESLint catches this too).
66
- - Describe props with `type Props = { ... }` or `interface Props { ... }`.
102
+ - Describe props with a local `interface` / `type` named as the repo does (`interface IProps` / `type TProps`); match the neighboring component. No `FC` / `React.FC`.
67
103
  - Do not use `any`; when needed:
68
104
  - generics (`<T>`), `unknown`, type predicates and user-defined type guards.
69
105
  - For domain entities use types from `@/types` (and enums from `@/types/enums`), not redefined locally (`public-imports.md`).
@@ -43,3 +43,39 @@ Path pointer and stack tables — in the preset adapter (`.ai.local/conventions.
43
43
  - skill `feature-delivery` — end-to-end scenario.
44
44
 
45
45
  > Concrete path tables, globs, and dogfood checklists live in the stack adapter **Stack notes**.
46
+
47
+ ## Stack notes
48
+
49
+ Before implementing, find a feature of the same type and **mirror its structure**; do not invent a new file organization.
50
+
51
+ Taxonomy / shared core: [`presets/_shared/README.md`](../../../_shared/README.md) · [Preset contribution guide](../../../../docs/PRESET-CONTRIBUTION.md).
52
+
53
+ ## Reference table
54
+
55
+ Replace **TBD** with real paths after team agreement (or on `ai-rules init` in the target repo):
56
+
57
+ | Layer | Reference | What to copy |
58
+ |-------|-----------|--------------|
59
+ | UI page | **TBD** `app/src/ui/pages/<Example>/` | `components/`, `*.data.ts`, `styles.ts`, barrel |
60
+ | Store slice | **TBD** `app/src/store/slices/<example>/` | slice, thunks, selectors, types |
61
+ | API service | **TBD** `app/src/api/services/<example>/` | service, mappers, barrel |
62
+ | Types module | **TBD** `app/src/types/<example>/` | domain types, JSDoc, barrel export |
63
+ | Unit tests | **TBD** mirrored under `app/__tests__/unit/<rel>` | `*.spec.ts`, describe/it naming |
64
+ | E2E area | **TBD** `app/__tests__/e2e/<Area>/` | `*.cases.md`, page objects, `_shared/` |
65
+
66
+ ## How to use
67
+
68
+ 1. Identify affected layers from `decomposition.md` or the task.
69
+ 2. Open the reference from the table (after paths are filled).
70
+ 3. Mirror naming, file order, import patterns, and tests.
71
+ 4. If there is no reference — pick the **closest** existing feature of the same layer and record the choice in the handoff.
72
+
73
+ ## Living conventions
74
+
75
+ Post-init gotchas / patterns / decisions: **`.ai.local/conventions.md`** (shared across tools; `.ai.local/team/**` is pipeline artifacts, not rules). Consumer-owned; not always-on. See root `AGENTS.md` § Living conventions.
76
+
77
+ ## Related rules
78
+
79
+ - `code-quality-and-refactoring.mdc` — repeat patterns, no deep-import.
80
+ - `feature-delivery-workflow.mdc` — layer order.
81
+ - skill `feature-delivery` — end-to-end scenario.
@@ -11,13 +11,14 @@
11
11
  # Slice structure
12
12
 
13
13
  - Each domain module — its own slice in `app/src/store/slices/**`.
14
- - A slice exports:
15
- - default `reducer`;
16
- - `actions` as named exports;
17
- - selectors `selectSomething(state: RootState): Type`.
14
+ - A slice exports — follow the repo's shape:
15
+ - a named slice (`xxxSlice`) re-exported through a per-slice barrel (`index.ts`), **or** a default `reducer`;
16
+ - actions as named exports;
17
+ - selectors named as in the repo (`selectSomething(state: RootState): Type`, or a curried `xxxSelector = (args) => (state) => …`); memoize derived values with `createSelector`.
18
18
  - State:
19
19
  - explicit state type;
20
- - careful `initialState` initialization.
20
+ - careful `initialState` initialization;
21
+ - typed root state — use the repo's `RootState` if present, otherwise the local `IRootState` interface neighboring slices use.
21
22
 
22
23
  # Async and side effects
23
24
 
@@ -70,3 +70,18 @@ Bad (no capital after period; or wrong locale for configured ESLint):
70
70
  ## E2E: keep plans and selectors in sync with UI
71
71
 
72
72
  - When changing UI: update selectors in page objects and cross-check with the scenario plan. When adding/changing tests: read the matching plan and sync scenario titles first.
73
+
74
+ ## Stack notes
75
+
76
+ - Runner: Playwright (`@playwright/test`).
77
+ - E2E folder: `app/__tests__/e2e/**`.
78
+ - Placement mirrors source paths: `app/src/<rel>` → `app/__tests__/e2e/<rel>`. Use the deepest folder of the source under test; page-wide scenarios mirror the page folder.
79
+ - Scenario plans: `*.cases.md` files — canonical source of scenarios.
80
+ - Tests: `*.spec.ts` files — Playwright scenario implementations.
81
+ - Shared utilities and abstractions: `app/__tests__/e2e/_shared/**` — constants, fluent interfaces, helpers.
82
+ - Root exceptions that do not mirror a single source module: `_shared/`, `smoke.spec.ts`, and `seed.spec.ts`.
83
+ - `data-testid` naming scheme: `{parent}__{element}` — example `history-page__title`, `history-page__recognition-banner__attach-files-button`.
84
+ - `PREFIX-XXX` example: `OrderHistory` → `OH`, `BillingReport` → `BR`; Russian example — `test('OH-001 Отображается список заказов', async ({ page }) => { ... })` <!-- i18n-keep: E5 --> (Order list is displayed).
85
+ - Page object example filename: `OrderHistoryPage.ts` (the seed test pointer lives at `app/__tests__/e2e/seed.spec.ts`).
86
+ - Cross-reference: See also **`playwright-agents.mdc`** for the e2e planner / generator / healer agents.
87
+ - `## Stack notes` content is stripped by `scripts/check-shared-core-drift.sh` before byte-comparing this file against `_shared/core/testing/testing-principles.md`; keep prose above (core content) verbatim against the core file.