@bonesofspring/ai-rules 0.2.22 → 0.2.24

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 (429) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +10 -2
  3. package/bin/cli.js +56 -9
  4. package/bin/mavis-install.js +441 -0
  5. package/bin/opencode-install.js +531 -0
  6. package/package.json +17 -3
  7. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +2 -2
  8. package/presets/_shared/core/meta/preset-layering.md +3 -3
  9. package/presets/_shared/core/meta/preset-no-cross-stack-leakage.md +1 -1
  10. package/presets/_shared/core/meta/preset-pr-checklist.md +5 -3
  11. package/presets/_shared/core/meta/preset-token-budget.md +3 -0
  12. package/presets/_shared/core/meta/preset-twin-sync.md +32 -0
  13. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-layering.md +3 -3
  14. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  15. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +5 -3
  16. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-token-budget.md +3 -0
  17. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-twin-sync.md +32 -0
  18. package/presets/claude/go/rules/tooling-and-review/preset-layering.md +3 -3
  19. package/presets/claude/go/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  20. package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +5 -3
  21. package/presets/claude/go/rules/tooling-and-review/preset-token-budget.md +3 -0
  22. package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +32 -0
  23. package/presets/claude/ios-swift/rules/tooling-and-review/preset-layering.md +3 -3
  24. package/presets/claude/ios-swift/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  25. package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +5 -3
  26. package/presets/claude/ios-swift/rules/tooling-and-review/preset-token-budget.md +3 -0
  27. package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +32 -0
  28. package/presets/claude/java/rules/tooling-and-review/preset-layering.md +3 -3
  29. package/presets/claude/java/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  30. package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +5 -3
  31. package/presets/claude/java/rules/tooling-and-review/preset-token-budget.md +3 -0
  32. package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +32 -0
  33. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-layering.md +3 -3
  34. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  35. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +5 -3
  36. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-token-budget.md +3 -0
  37. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-twin-sync.md +32 -0
  38. package/presets/claude/next/REPO_AGENTS.md +10 -5
  39. package/presets/claude/next/agents/build-verifier.md +3 -1
  40. package/presets/claude/next/rules/tooling-and-review/ai-local-overlay.md +1 -1
  41. package/presets/claude/next/rules/tooling-and-review/preset-layering.md +3 -3
  42. package/presets/claude/next/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  43. package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +5 -3
  44. package/presets/claude/next/rules/tooling-and-review/preset-token-budget.md +3 -0
  45. package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +32 -0
  46. package/presets/claude/nuxt/rules/tooling-and-review/preset-layering.md +3 -3
  47. package/presets/claude/nuxt/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  48. package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +5 -3
  49. package/presets/claude/nuxt/rules/tooling-and-review/preset-token-budget.md +3 -0
  50. package/presets/claude/nuxt/rules/tooling-and-review/preset-twin-sync.md +32 -0
  51. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-layering.md +3 -3
  52. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  53. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +5 -3
  54. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-token-budget.md +3 -0
  55. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-twin-sync.md +32 -0
  56. package/presets/claude/php-laravel/rules/tooling-and-review/preset-layering.md +3 -3
  57. package/presets/claude/php-laravel/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  58. package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +5 -3
  59. package/presets/claude/php-laravel/rules/tooling-and-review/preset-token-budget.md +3 -0
  60. package/presets/claude/php-laravel/rules/tooling-and-review/preset-twin-sync.md +32 -0
  61. package/presets/claude/svelte/rules/tooling-and-review/preset-layering.md +3 -3
  62. package/presets/claude/svelte/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  63. package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +5 -3
  64. package/presets/claude/svelte/rules/tooling-and-review/preset-token-budget.md +3 -0
  65. package/presets/claude/svelte/rules/tooling-and-review/preset-twin-sync.md +32 -0
  66. package/presets/cursor/android-kotlin/rules/preset-layering.mdc +3 -3
  67. package/presets/cursor/android-kotlin/rules/preset-no-cross-stack-leakage.mdc +1 -1
  68. package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +5 -3
  69. package/presets/cursor/android-kotlin/rules/preset-token-budget.mdc +3 -0
  70. package/presets/cursor/android-kotlin/rules/preset-twin-sync.mdc +32 -0
  71. package/presets/cursor/go/rules/preset-layering.mdc +3 -3
  72. package/presets/cursor/go/rules/preset-no-cross-stack-leakage.mdc +1 -1
  73. package/presets/cursor/go/rules/preset-pr-checklist.mdc +5 -3
  74. package/presets/cursor/go/rules/preset-token-budget.mdc +3 -0
  75. package/presets/cursor/go/rules/preset-twin-sync.mdc +32 -0
  76. package/presets/cursor/ios-swift/rules/preset-layering.mdc +3 -3
  77. package/presets/cursor/ios-swift/rules/preset-no-cross-stack-leakage.mdc +1 -1
  78. package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +5 -3
  79. package/presets/cursor/ios-swift/rules/preset-token-budget.mdc +3 -0
  80. package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +32 -0
  81. package/presets/cursor/java/rules/preset-layering.mdc +3 -3
  82. package/presets/cursor/java/rules/preset-no-cross-stack-leakage.mdc +1 -1
  83. package/presets/cursor/java/rules/preset-pr-checklist.mdc +5 -3
  84. package/presets/cursor/java/rules/preset-token-budget.mdc +3 -0
  85. package/presets/cursor/java/rules/preset-twin-sync.mdc +32 -0
  86. package/presets/cursor/mcp-ts/rules/preset-layering.mdc +3 -3
  87. package/presets/cursor/mcp-ts/rules/preset-no-cross-stack-leakage.mdc +1 -1
  88. package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +5 -3
  89. package/presets/cursor/mcp-ts/rules/preset-token-budget.mdc +3 -0
  90. package/presets/cursor/mcp-ts/rules/preset-twin-sync.mdc +32 -0
  91. package/presets/cursor/next/REPO_AGENTS.md +10 -5
  92. package/presets/cursor/next/agents/build-verifier.md +3 -1
  93. package/presets/cursor/next/rules/ai-local-overlay.mdc +1 -1
  94. package/presets/cursor/next/rules/preset-layering.mdc +3 -3
  95. package/presets/cursor/next/rules/preset-no-cross-stack-leakage.mdc +1 -1
  96. package/presets/cursor/next/rules/preset-pr-checklist.mdc +5 -3
  97. package/presets/cursor/next/rules/preset-token-budget.mdc +3 -0
  98. package/presets/cursor/next/rules/preset-twin-sync.mdc +32 -0
  99. package/presets/cursor/nuxt/rules/preset-layering.mdc +3 -3
  100. package/presets/cursor/nuxt/rules/preset-no-cross-stack-leakage.mdc +1 -1
  101. package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +5 -3
  102. package/presets/cursor/nuxt/rules/preset-token-budget.mdc +3 -0
  103. package/presets/cursor/nuxt/rules/preset-twin-sync.mdc +32 -0
  104. package/presets/cursor/php-hexagonal/rules/preset-layering.mdc +3 -3
  105. package/presets/cursor/php-hexagonal/rules/preset-no-cross-stack-leakage.mdc +1 -1
  106. package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +5 -3
  107. package/presets/cursor/php-hexagonal/rules/preset-token-budget.mdc +3 -0
  108. package/presets/cursor/php-hexagonal/rules/preset-twin-sync.mdc +32 -0
  109. package/presets/cursor/php-laravel/rules/preset-layering.mdc +3 -3
  110. package/presets/cursor/php-laravel/rules/preset-no-cross-stack-leakage.mdc +1 -1
  111. package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +5 -3
  112. package/presets/cursor/php-laravel/rules/preset-token-budget.mdc +3 -0
  113. package/presets/cursor/php-laravel/rules/preset-twin-sync.mdc +32 -0
  114. package/presets/cursor/svelte/rules/preset-layering.mdc +3 -3
  115. package/presets/cursor/svelte/rules/preset-no-cross-stack-leakage.mdc +1 -1
  116. package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +5 -3
  117. package/presets/cursor/svelte/rules/preset-token-budget.mdc +3 -0
  118. package/presets/cursor/svelte/rules/preset-twin-sync.mdc +32 -0
  119. package/presets/mavis/README.md +60 -0
  120. package/presets/mavis/next/MAVIS.md +67 -0
  121. package/presets/mavis/next/MCP.md +36 -0
  122. package/presets/mavis/next/README.md +15 -0
  123. package/presets/mavis/next/REPO_AGENTS.md +96 -0
  124. package/presets/mavis/next/adapter-map.json +959 -0
  125. package/presets/mavis/next/agents/README.md +206 -0
  126. package/presets/mavis/next/agents/accessibility-reviewer.md +61 -0
  127. package/presets/mavis/next/agents/api-contract-reviewer.md +57 -0
  128. package/presets/mavis/next/agents/build-verifier.md +112 -0
  129. package/presets/mavis/next/agents/ci-investigator.md +63 -0
  130. package/presets/mavis/next/agents/code-reviewer.md +61 -0
  131. package/presets/mavis/next/agents/codebase-analyzer.md +21 -0
  132. package/presets/mavis/next/agents/debugger.md +80 -0
  133. package/presets/mavis/next/agents/feature-developer.md +101 -0
  134. package/presets/mavis/next/agents/migration-specialist.md +67 -0
  135. package/presets/mavis/next/agents/mockup-reviewer.md +53 -0
  136. package/presets/mavis/next/agents/openspec-author.md +157 -0
  137. package/presets/mavis/next/agents/performance-auditor.md +68 -0
  138. package/presets/mavis/next/agents/playwright-test-generator.md +28 -0
  139. package/presets/mavis/next/agents/playwright-test-healer.md +28 -0
  140. package/presets/mavis/next/agents/playwright-test-planner.md +21 -0
  141. package/presets/mavis/next/agents/qa-tester.md +52 -0
  142. package/presets/mavis/next/agents/security-reviewer.md +54 -0
  143. package/presets/mavis/next/agents/solution-architect.md +68 -0
  144. package/presets/mavis/next/agents/task-analyst.md +166 -0
  145. package/presets/mavis/next/agents/task-router.md +178 -0
  146. package/presets/mavis/next/agents/tech-writer.md +57 -0
  147. package/presets/mavis/next/agents/unit-test-generator.md +31 -0
  148. package/presets/mavis/next/agents/unit-test-healer.md +32 -0
  149. package/presets/mavis/next/agents/unit-test-planner.md +54 -0
  150. package/presets/mavis/next/commands/README.md +49 -0
  151. package/presets/mavis/next/commands/spec-start.md +24 -0
  152. package/presets/mavis/next/commands/task-continue.md +50 -0
  153. package/presets/mavis/next/commands/task.md +50 -0
  154. package/presets/mavis/next/commands/technical-retro.md +80 -0
  155. package/presets/mavis/next/hooks/README.md +22 -0
  156. package/presets/mavis/next/hooks/chain-team-phases.sh +845 -0
  157. package/presets/mavis/next/mcp.json +19 -0
  158. package/presets/mavis/next/rules/README.md +16 -0
  159. package/presets/mavis/next/rules/agent-team-intake.md +11 -0
  160. package/presets/mavis/next/rules/agent-team-orchestrator.md +210 -0
  161. package/presets/mavis/next/rules/ai-local-overlay.md +37 -0
  162. package/presets/mavis/next/rules/anti-sycophancy-discipline.md +23 -0
  163. package/presets/mavis/next/rules/api-services.md +72 -0
  164. package/presets/mavis/next/rules/architecture-boundaries-ui.md +9 -0
  165. package/presets/mavis/next/rules/architecture-boundaries.md +86 -0
  166. package/presets/mavis/next/rules/arrow-functions.md +25 -0
  167. package/presets/mavis/next/rules/code-quality-and-refactoring.md +40 -0
  168. package/presets/mavis/next/rules/code-review-mr.md +40 -0
  169. package/presets/mavis/next/rules/css-property-order-stylelint.md +5 -0
  170. package/presets/mavis/next/rules/design-guidance.md +99 -0
  171. package/presets/mavis/next/rules/feature-delivery-workflow.md +49 -0
  172. package/presets/mavis/next/rules/http-client.md +55 -0
  173. package/presets/mavis/next/rules/layer-barrel-exports.md +68 -0
  174. package/presets/mavis/next/rules/mcp-usage.md +86 -0
  175. package/presets/mavis/next/rules/mockup-review.md +107 -0
  176. package/presets/mavis/next/rules/navigation-router-stack.md +56 -0
  177. package/presets/mavis/next/rules/navigation-router-ui.md +10 -0
  178. package/presets/mavis/next/rules/next-app-core.md +29 -0
  179. package/presets/mavis/next/rules/next-app-router.md +44 -0
  180. package/presets/mavis/next/rules/no-props-spread.md +56 -0
  181. package/presets/mavis/next/rules/no-type-assertion-as-import-export.md +51 -0
  182. package/presets/mavis/next/rules/package-manager.md +11 -0
  183. package/presets/mavis/next/rules/playwright-agents.md +67 -0
  184. package/presets/mavis/next/rules/post-change-lint.md +35 -0
  185. package/presets/mavis/next/rules/preset-layering.md +27 -0
  186. package/presets/mavis/next/rules/preset-no-cross-stack-leakage.md +90 -0
  187. package/presets/mavis/next/rules/preset-pr-checklist.md +36 -0
  188. package/presets/mavis/next/rules/preset-token-budget.md +39 -0
  189. package/presets/mavis/next/rules/preset-twin-sync.md +81 -0
  190. package/presets/mavis/next/rules/product-specs-authoring.md +112 -0
  191. package/presets/mavis/next/rules/product-specs.md +56 -0
  192. package/presets/mavis/next/rules/public-imports.md +50 -0
  193. package/presets/mavis/next/rules/react-a11y-coding.md +31 -0
  194. package/presets/mavis/next/rules/react-next-anti-hallucination.md +60 -0
  195. package/presets/mavis/next/rules/react-ui.md +105 -0
  196. package/presets/mavis/next/rules/reference-features.md +45 -0
  197. package/presets/mavis/next/rules/security-next.md +45 -0
  198. package/presets/mavis/next/rules/store-rtk.md +78 -0
  199. package/presets/mavis/next/rules/technical-retro.md +11 -0
  200. package/presets/mavis/next/rules/tests-e2e-structure.md +72 -0
  201. package/presets/mavis/next/rules/tests-unit.md +72 -0
  202. package/presets/mavis/next/rules/types-jsdoc.md +43 -0
  203. package/presets/mavis/next/rules/ux-design.md +99 -0
  204. package/presets/mavis/next/skills/README.md +21 -0
  205. package/presets/mavis/next/skills/ci-investigation/SKILL.md +39 -0
  206. package/presets/mavis/next/skills/code-review/SKILL.md +39 -0
  207. package/presets/mavis/next/skills/debug-investigation/SKILL.md +26 -0
  208. package/presets/mavis/next/skills/feature-delivery/SKILL.md +34 -0
  209. package/presets/mavis/next/skills/mockup-review/SKILL.md +24 -0
  210. package/presets/mavis/next/skills/playwright-e2e/SKILL.md +28 -0
  211. package/presets/mavis/next/skills/react-performance/SKILL.md +39 -0
  212. package/presets/mavis/next/skills/spec-authoring/SKILL.md +21 -0
  213. package/presets/mavis/next/skills/spec-discovery/SKILL.md +53 -0
  214. package/presets/mavis/next/skills/technical-retro/SKILL.md +49 -0
  215. package/presets/mavis/next/skills/unit-testing/SKILL.md +29 -0
  216. package/presets/mavis/next/skills/ux-design/SKILL.md +31 -0
  217. package/presets/mavis/next/skills/write-adr/SKILL.md +36 -0
  218. package/presets/mavis/next/team/README.md +148 -0
  219. package/presets/mavis/next/team/conventions.md +21 -0
  220. package/presets/mavis/next/team/fixtures/artifact-manifest.example.json +79 -0
  221. package/presets/mavis/next/team/fixtures/bugfix-standard.json +25 -0
  222. package/presets/mavis/next/team/fixtures/feature-full.json +29 -0
  223. package/presets/mavis/next/team/fixtures/feature-light.json +27 -0
  224. package/presets/mavis/next/team/fixtures/feature-with-figma-url.json +17 -0
  225. package/presets/mavis/next/team/fixtures/feature-with-ux-no-figma.json +17 -0
  226. package/presets/mavis/next/team/fixtures/memlog.example.md +9 -0
  227. package/presets/mavis/next/team/fixtures/metrics-scenarios/tasks/human-gate/metrics.json +69 -0
  228. package/presets/mavis/next/team/fixtures/metrics-scenarios/tasks/missing-ledger/status.json +5 -0
  229. package/presets/mavis/next/team/fixtures/metrics-scenarios/tasks/parallel-receipts/metrics.json +79 -0
  230. package/presets/mavis/next/team/fixtures/metrics-scenarios/tasks/serial-retry/metrics.json +124 -0
  231. package/presets/mavis/next/team/fixtures/metrics-scenarios/tasks/validation-failed/metrics.json +124 -0
  232. package/presets/mavis/next/team/fixtures/metrics.example.json +54 -0
  233. package/presets/mavis/next/team/fixtures/mockup-review-fail-embedded-status.json +8 -0
  234. package/presets/mavis/next/team/fixtures/mockup-review-standalone.json +14 -0
  235. package/presets/mavis/next/team/fixtures/ux-design-standalone.json +15 -0
  236. package/presets/mavis/next/team/tasks/.gitkeep +0 -0
  237. package/presets/mavis/platform-contract.json +131 -0
  238. package/presets/opencode/README.md +61 -0
  239. package/presets/opencode/next/MCP.md +36 -0
  240. package/presets/opencode/next/OPENCODE.md +65 -0
  241. package/presets/opencode/next/README.md +16 -0
  242. package/presets/opencode/next/REPO_AGENTS.md +97 -0
  243. package/presets/opencode/next/adapter-map.json +959 -0
  244. package/presets/opencode/next/agents/README.md +201 -0
  245. package/presets/opencode/next/agents/accessibility-reviewer.md +73 -0
  246. package/presets/opencode/next/agents/api-contract-reviewer.md +69 -0
  247. package/presets/opencode/next/agents/build-verifier.md +124 -0
  248. package/presets/opencode/next/agents/ci-investigator.md +71 -0
  249. package/presets/opencode/next/agents/code-reviewer.md +73 -0
  250. package/presets/opencode/next/agents/codebase-analyzer.md +33 -0
  251. package/presets/opencode/next/agents/debugger.md +88 -0
  252. package/presets/opencode/next/agents/feature-developer.md +109 -0
  253. package/presets/opencode/next/agents/migration-specialist.md +79 -0
  254. package/presets/opencode/next/agents/mockup-reviewer.md +65 -0
  255. package/presets/opencode/next/agents/openspec-author.md +169 -0
  256. package/presets/opencode/next/agents/performance-auditor.md +80 -0
  257. package/presets/opencode/next/agents/playwright-test-generator.md +36 -0
  258. package/presets/opencode/next/agents/playwright-test-healer.md +36 -0
  259. package/presets/opencode/next/agents/playwright-test-planner.md +33 -0
  260. package/presets/opencode/next/agents/qa-tester.md +60 -0
  261. package/presets/opencode/next/agents/security-reviewer.md +66 -0
  262. package/presets/opencode/next/agents/solution-architect.md +80 -0
  263. package/presets/opencode/next/agents/task-analyst.md +178 -0
  264. package/presets/opencode/next/agents/task-router.md +190 -0
  265. package/presets/opencode/next/agents/tech-writer.md +69 -0
  266. package/presets/opencode/next/agents/unit-test-generator.md +39 -0
  267. package/presets/opencode/next/agents/unit-test-healer.md +40 -0
  268. package/presets/opencode/next/agents/unit-test-planner.md +66 -0
  269. package/presets/opencode/next/commands/README.md +49 -0
  270. package/presets/opencode/next/commands/spec-start.md +32 -0
  271. package/presets/opencode/next/commands/task-continue.md +58 -0
  272. package/presets/opencode/next/commands/task.md +58 -0
  273. package/presets/opencode/next/commands/technical-retro.md +88 -0
  274. package/presets/opencode/next/hooks/README.md +22 -0
  275. package/presets/opencode/next/hooks/chain-team-phases.sh +845 -0
  276. package/presets/opencode/next/opencode.json +33 -0
  277. package/presets/opencode/next/rules/README.md +20 -0
  278. package/presets/opencode/next/rules/agent-team-intake.md +11 -0
  279. package/presets/opencode/next/rules/agent-team-orchestrator.md +214 -0
  280. package/presets/opencode/next/rules/ai-local-overlay.md +37 -0
  281. package/presets/opencode/next/rules/anti-sycophancy-discipline.md +23 -0
  282. package/presets/opencode/next/rules/api-services.md +72 -0
  283. package/presets/opencode/next/rules/architecture-boundaries-ui.md +9 -0
  284. package/presets/opencode/next/rules/architecture-boundaries.md +86 -0
  285. package/presets/opencode/next/rules/arrow-functions.md +25 -0
  286. package/presets/opencode/next/rules/code-quality-and-refactoring.md +40 -0
  287. package/presets/opencode/next/rules/code-review-mr.md +40 -0
  288. package/presets/opencode/next/rules/css-property-order-stylelint.md +5 -0
  289. package/presets/opencode/next/rules/design-guidance.md +99 -0
  290. package/presets/opencode/next/rules/feature-delivery-workflow.md +49 -0
  291. package/presets/opencode/next/rules/http-client.md +55 -0
  292. package/presets/opencode/next/rules/layer-barrel-exports.md +68 -0
  293. package/presets/opencode/next/rules/mcp-usage.md +86 -0
  294. package/presets/opencode/next/rules/mockup-review.md +107 -0
  295. package/presets/opencode/next/rules/navigation-router-stack.md +56 -0
  296. package/presets/opencode/next/rules/navigation-router-ui.md +10 -0
  297. package/presets/opencode/next/rules/next-app-core.md +29 -0
  298. package/presets/opencode/next/rules/next-app-router.md +44 -0
  299. package/presets/opencode/next/rules/no-props-spread.md +56 -0
  300. package/presets/opencode/next/rules/no-type-assertion-as-import-export.md +51 -0
  301. package/presets/opencode/next/rules/package-manager.md +11 -0
  302. package/presets/opencode/next/rules/playwright-agents.md +67 -0
  303. package/presets/opencode/next/rules/post-change-lint.md +35 -0
  304. package/presets/opencode/next/rules/preset-layering.md +27 -0
  305. package/presets/opencode/next/rules/preset-no-cross-stack-leakage.md +90 -0
  306. package/presets/opencode/next/rules/preset-pr-checklist.md +36 -0
  307. package/presets/opencode/next/rules/preset-token-budget.md +39 -0
  308. package/presets/opencode/next/rules/preset-twin-sync.md +81 -0
  309. package/presets/opencode/next/rules/product-specs-authoring.md +112 -0
  310. package/presets/opencode/next/rules/product-specs.md +56 -0
  311. package/presets/opencode/next/rules/public-imports.md +50 -0
  312. package/presets/opencode/next/rules/react-a11y-coding.md +31 -0
  313. package/presets/opencode/next/rules/react-next-anti-hallucination.md +60 -0
  314. package/presets/opencode/next/rules/react-ui.md +105 -0
  315. package/presets/opencode/next/rules/reference-features.md +45 -0
  316. package/presets/opencode/next/rules/security-next.md +45 -0
  317. package/presets/opencode/next/rules/store-rtk.md +78 -0
  318. package/presets/opencode/next/rules/technical-retro.md +11 -0
  319. package/presets/opencode/next/rules/tests-e2e-structure.md +72 -0
  320. package/presets/opencode/next/rules/tests-unit.md +72 -0
  321. package/presets/opencode/next/rules/types-jsdoc.md +43 -0
  322. package/presets/opencode/next/rules/ux-design.md +99 -0
  323. package/presets/opencode/next/skills/README.md +21 -0
  324. package/presets/opencode/next/skills/ci-investigation/SKILL.md +44 -0
  325. package/presets/opencode/next/skills/code-review/SKILL.md +44 -0
  326. package/presets/opencode/next/skills/debug-investigation/SKILL.md +59 -0
  327. package/presets/opencode/next/skills/feature-delivery/SKILL.md +39 -0
  328. package/presets/opencode/next/skills/mockup-review/SKILL.md +29 -0
  329. package/presets/opencode/next/skills/playwright-e2e/SKILL.md +33 -0
  330. package/presets/opencode/next/skills/react-performance/SKILL.md +44 -0
  331. package/presets/opencode/next/skills/spec-authoring/SKILL.md +26 -0
  332. package/presets/opencode/next/skills/spec-discovery/SKILL.md +58 -0
  333. package/presets/opencode/next/skills/technical-retro/SKILL.md +54 -0
  334. package/presets/opencode/next/skills/unit-testing/SKILL.md +34 -0
  335. package/presets/opencode/next/skills/ux-design/SKILL.md +36 -0
  336. package/presets/opencode/next/skills/write-adr/SKILL.md +41 -0
  337. package/presets/opencode/next/team/README.md +148 -0
  338. package/presets/opencode/next/team/conventions.md +21 -0
  339. package/presets/opencode/next/team/fixtures/artifact-manifest.example.json +79 -0
  340. package/presets/opencode/next/team/fixtures/bugfix-standard.json +25 -0
  341. package/presets/opencode/next/team/fixtures/feature-full.json +29 -0
  342. package/presets/opencode/next/team/fixtures/feature-light.json +27 -0
  343. package/presets/opencode/next/team/fixtures/feature-with-figma-url.json +17 -0
  344. package/presets/opencode/next/team/fixtures/feature-with-ux-no-figma.json +17 -0
  345. package/presets/opencode/next/team/fixtures/memlog.example.md +9 -0
  346. package/presets/opencode/next/team/fixtures/metrics-scenarios/tasks/human-gate/metrics.json +69 -0
  347. package/presets/opencode/next/team/fixtures/metrics-scenarios/tasks/missing-ledger/status.json +5 -0
  348. package/presets/opencode/next/team/fixtures/metrics-scenarios/tasks/parallel-receipts/metrics.json +79 -0
  349. package/presets/opencode/next/team/fixtures/metrics-scenarios/tasks/serial-retry/metrics.json +124 -0
  350. package/presets/opencode/next/team/fixtures/metrics-scenarios/tasks/validation-failed/metrics.json +124 -0
  351. package/presets/opencode/next/team/fixtures/metrics.example.json +54 -0
  352. package/presets/opencode/next/team/fixtures/mockup-review-fail-embedded-status.json +8 -0
  353. package/presets/opencode/next/team/fixtures/mockup-review-standalone.json +14 -0
  354. package/presets/opencode/next/team/fixtures/ux-design-standalone.json +15 -0
  355. package/presets/opencode/next/team/tasks/.gitkeep +0 -0
  356. package/presets/opencode/platform-contract.json +131 -0
  357. package/scripts/capture-cli-golden.mjs +48 -0
  358. package/scripts/check-chain-hook-coverage.sh +2 -0
  359. package/scripts/check-mavis-adapter-map.mjs +294 -0
  360. package/scripts/check-mavis-local-overlay.mjs +56 -0
  361. package/scripts/check-mavis-platform-contract.mjs +388 -0
  362. package/scripts/check-mavis-token-budget.mjs +48 -0
  363. package/scripts/check-opencode-adapter-map.mjs +294 -0
  364. package/scripts/check-opencode-local-overlay.mjs +56 -0
  365. package/scripts/check-opencode-platform-contract.mjs +388 -0
  366. package/scripts/check-opencode-token-budget.mjs +48 -0
  367. package/scripts/check-preset-leakage.sh +64 -3
  368. package/scripts/check-preset-structure.sh +108 -0
  369. package/scripts/check-shared-core-drift.sh +18 -0
  370. package/scripts/check-task-router-intents.sh +15 -2
  371. package/scripts/fixtures/cli-golden/claude/next.json +130 -0
  372. package/scripts/fixtures/cli-golden/cursor/next.json +132 -0
  373. package/scripts/fixtures/cli-golden/mavis/next.json +125 -0
  374. package/scripts/fixtures/cli-golden/opencode/next.json +125 -0
  375. package/scripts/fixtures/mavis-adapter-map/invalid-unmapped/cursor/AGENTS.md +1 -0
  376. package/scripts/fixtures/mavis-adapter-map/invalid-unmapped/cursor/rules/extra.mdc +1 -0
  377. package/scripts/fixtures/mavis-adapter-map/invalid-unmapped/cursor/rules/sample.mdc +2 -0
  378. package/scripts/fixtures/mavis-adapter-map/invalid-unmapped/mavis/MAVIS.md +1 -0
  379. package/scripts/fixtures/mavis-adapter-map/invalid-unmapped/mavis/adapter-map.json +26 -0
  380. package/scripts/fixtures/mavis-adapter-map/invalid-unmapped/mavis/rules/sample.md +2 -0
  381. package/scripts/fixtures/mavis-adapter-map/valid/cursor/AGENTS.md +1 -0
  382. package/scripts/fixtures/mavis-adapter-map/valid/cursor/rules/sample.mdc +2 -0
  383. package/scripts/fixtures/mavis-adapter-map/valid/mavis/MAVIS.md +1 -0
  384. package/scripts/fixtures/mavis-adapter-map/valid/mavis/adapter-map.json +26 -0
  385. package/scripts/fixtures/mavis-adapter-map/valid/mavis/rules/sample.md +2 -0
  386. package/scripts/fixtures/mavis-platform-contract/invalid-minimax-destination.json +131 -0
  387. package/scripts/fixtures/mavis-platform-contract/invalid-missing-capability.json +126 -0
  388. package/scripts/fixtures/mavis-platform-contract/invalid-released-unknown-stack.json +133 -0
  389. package/scripts/fixtures/mavis-platform-contract/invalid-unknown-native-path.json +131 -0
  390. package/scripts/fixtures/mavis-platform-contract/invalid-version-pin.json +132 -0
  391. package/scripts/fixtures/mavis-platform-contract/valid.json +131 -0
  392. package/scripts/fixtures/mavis-probe/AGENTS.md +6 -0
  393. package/scripts/fixtures/mavis-probe/agents/probe-agent.md +6 -0
  394. package/scripts/fixtures/mavis-probe/fake-mcode.mjs +98 -0
  395. package/scripts/fixtures/mavis-probe/output.schema.json +28 -0
  396. package/scripts/fixtures/mavis-probe/rules/probe.md +5 -0
  397. package/scripts/fixtures/mavis-probe/skills/probe/SKILL.md +11 -0
  398. package/scripts/fixtures/opencode-adapter-map/invalid-unmapped/cursor/AGENTS.md +1 -0
  399. package/scripts/fixtures/opencode-adapter-map/invalid-unmapped/cursor/rules/extra.mdc +1 -0
  400. package/scripts/fixtures/opencode-adapter-map/invalid-unmapped/cursor/rules/sample.mdc +2 -0
  401. package/scripts/fixtures/opencode-adapter-map/invalid-unmapped/opencode/OPENCODE.md +1 -0
  402. package/scripts/fixtures/opencode-adapter-map/invalid-unmapped/opencode/adapter-map.json +26 -0
  403. package/scripts/fixtures/opencode-adapter-map/invalid-unmapped/opencode/rules/sample.md +2 -0
  404. package/scripts/fixtures/opencode-adapter-map/valid/cursor/AGENTS.md +1 -0
  405. package/scripts/fixtures/opencode-adapter-map/valid/cursor/rules/sample.mdc +2 -0
  406. package/scripts/fixtures/opencode-adapter-map/valid/opencode/OPENCODE.md +1 -0
  407. package/scripts/fixtures/opencode-adapter-map/valid/opencode/adapter-map.json +26 -0
  408. package/scripts/fixtures/opencode-adapter-map/valid/opencode/rules/sample.md +2 -0
  409. package/scripts/fixtures/opencode-platform-contract/invalid-home-destination.json +131 -0
  410. package/scripts/fixtures/opencode-platform-contract/invalid-missing-capability.json +126 -0
  411. package/scripts/fixtures/opencode-platform-contract/invalid-released-unknown-stack.json +133 -0
  412. package/scripts/fixtures/opencode-platform-contract/invalid-unknown-native-path.json +131 -0
  413. package/scripts/fixtures/opencode-platform-contract/invalid-version-pin.json +132 -0
  414. package/scripts/fixtures/opencode-platform-contract/valid.json +131 -0
  415. package/scripts/generate-mavis-next.mjs +706 -0
  416. package/scripts/generate-opencode-next.mjs +831 -0
  417. package/scripts/lib/cli-golden.mjs +50 -0
  418. package/scripts/lib/discover-hooks.mjs +94 -0
  419. package/scripts/probe-mavis-capabilities.mjs +480 -0
  420. package/scripts/sync-dogfood-mavis.sh +90 -0
  421. package/scripts/sync-dogfood-opencode.sh +85 -0
  422. package/scripts/test-agent-task-metrics-hooks.mjs +25 -16
  423. package/scripts/test-chain-team-phases-coverage.mjs +15 -7
  424. package/scripts/test-cli-init-clean.mjs +367 -0
  425. package/scripts/test-cli-mcp-merge.mjs +23 -0
  426. package/scripts/test-mavis-context-budget.mjs +55 -0
  427. package/scripts/test-mavis-orchestration.mjs +649 -0
  428. package/scripts/test-opencode-context-budget.mjs +53 -0
  429. package/scripts/test-probe-mavis-capabilities.mjs +205 -0
@@ -0,0 +1,99 @@
1
+ <!-- shared-core: quality/design-guidance.md -->
2
+
3
+ # Design guidance (smells & patterns)
4
+
5
+ Glossary of **code smells** (Fowler) and **design patterns** (GoF) for agents during implement / review / debug.
6
+
7
+ Apply only within the task or MR scope. Light refactor — yes; a “big” rewrite without an explicit request — no.
8
+
9
+ Name a pattern **only if** the repository already does it that way or the match is minimal. Otherwise — extract/split/move without a GoF label.
10
+
11
+ Does not replace always-on Principles in `code-quality-and-refactoring` (KISS, DRY + Rule of Three, YAGNI, SOLID, CUPID, composition, Demeter).
12
+
13
+ ## When to load
14
+
15
+ - **Feature delivery / implement** — assess module structure, boundaries, and duplication.
16
+ - **Code review** — smells and pattern fit **in the MR diff**, not across the whole repo.
17
+ - **Debug** — root cause looks like wrong abstraction, Feature Envy, Message Chains, Shotgun Surgery.
18
+ - **Light refactor only** — improvements within boy-scout / MR scope; do not expand the task for the catalog.
19
+
20
+ Agents and skills load this stem via one-liner wiring — do not copy this catalog into the agent prompt.
21
+
22
+ ## How to use (agent rules of thumb)
23
+
24
+ 1. First check against Principles (always-on): is the solution simpler, is there no premature abstraction, is the public API respected.
25
+ 2. Then mark smells **in the changed files** of the task/MR; propose a fix only if it fits a light refactor.
26
+ 3. A GoF pattern is an optional label after the structure is already clear; do not start design by picking a pattern.
27
+ 4. If a smell or pattern conflicts with stack layer boundaries — stack boundaries and existing repo patterns win.
28
+ 5. Do not require renaming “for GoF” if behavior is already correct and readable.
29
+
30
+ ## Code smells (Fowler, curated ≤12)
31
+
32
+ Table: smell → detect hint → fix hint (one line each). No mechanical refactoring menus.
33
+
34
+ | # | Smell | Detect | Fix hint |
35
+ |---|-------|--------|----------|
36
+ | 1 | Duplicate Code | same logic in ≥2 places | dedupe after Rule of Three |
37
+ | 2 | Long Method / Long Module | unit does too much | extract within scope; no big rewrite |
38
+ | 3 | Feature Envy | method touches foreign data more than its own | move logic toward the data / public API |
39
+ | 4 | Data Clumps | the same argument groups travel together | group into a type / value object |
40
+ | 5 | Primitive Obsession | raw string/int instead of domain concepts | typed ids / value objects when the domain needs them |
41
+ | 6 | Speculative Generality | unused hooks, flags, “for later” abstractions | remove (YAGNI) |
42
+ | 7 | Message Chains | `a.b.c.d` chains | Demeter; facade / module public API |
43
+ | 8 | Middle Man | class almost only forwards calls | remove pass-through **or** keep as a boundary |
44
+ | 9 | Divergent Change | one module changes for different reasons | split by reasons to change |
45
+ | 10 | Shotgun Surgery | one semantic change spreads across many files | consolidate responsibility |
46
+ | 11 | Inappropriate Intimacy | access to foreign internals / private details | public API / ports / facades only |
47
+ | 12 | Refused Bequest / Parallel Inheritance | subtype ignores base; mirrored class hierarchies | composition; do not grow parallel trees |
48
+
49
+ **Skip Fowler (not in core):** Lazy Class, Incomplete Library Class, Comments-as-smell dogma, full 70+ catalog, step-by-step recipe menus.
50
+
51
+ Smell conflict priority: Inappropriate Intimacy and Message Chains (module boundaries) > Duplicate Code (after Rule of Three) > Long Method inside an already correct module.
52
+
53
+ ## Design patterns (GoF, curated ≤8)
54
+
55
+ Suggest only when repo already uses the shape or the match is minimal. Prefer extract-function over naming Strategy for the label alone.
56
+
57
+ Patterns below are the **allowed minimum** for agents; the rest of GoF is Skip by default.
58
+
59
+ | Pattern | When to suggest | Anti-trigger |
60
+ |---------|-----------------|--------------|
61
+ | Strategy | interchangeable algorithms already (or clearly soon) chosen by policy | one algorithm with no policy branching |
62
+ | Adapter | wrap external / foreign API under a local port | extra wrapper around your own API |
63
+ | Facade | simplify a multi-step subsystem behind a public API | facade turns into a god-object |
64
+ | Factory Method | polymorphic creation already accepted in repo style | factory for every trivial `new` |
65
+ | Decorator | additive behavior without exploding subclass hierarchies | decorator “for layers” with no real need |
66
+ | Observer | events / subscriptions already exist in the architecture | homemade pub/sub with no repo precedent |
67
+ | Template Method | shared algorithm skeleton + variable hooks | inheritance for a couple of differing lines |
68
+ | Composite | tree of homogeneous nodes (UI/domain), as already in the repo | Composite on a flat list with no hierarchy |
69
+
70
+ If unsure between two patterns — choose the simpler extract/compose without a name; the label may be added on review if the repo already speaks that way.
71
+
72
+ ## Skip / avoid by default
73
+
74
+ | Catalog | Skip |
75
+ |---------|------|
76
+ | GoF | Singleton, Abstract Factory, Flyweight, Memento, Interpreter, Visitor, Bridge, Prototype |
77
+ | GoF (conditional) | Command, Chain of Responsibility, State — mention **only if** the repo already uses them |
78
+ | Fowler | everything beyond the 12 smells above |
79
+ | DDD | Aggregates, bounded-context maps, event sourcing, CQRS — **not in core** |
80
+ | DDD (pointer) | ubiquitous language anti-pattern — expand in `feature-delivery-workflow`, not here |
81
+ | GRASP | Larman list as separate rules — skip (covered by SOLID/CUPID) |
82
+ | Clean Code dogma | hard caps on function lines / “exactly one assert” — skip |
83
+
84
+ Do not introduce a second stem (`refactoring-smells` / `design-patterns-for-agents`) — one catalog: `design-guidance`.
85
+
86
+ ## Out of scope for this stem
87
+
88
+ - Full GoF (23) and full Fowler catalog.
89
+ - Stack-specific recipes (module paths, lint commands) — only in the adapter **Stack notes**.
90
+ - Security, a11y, perf — separate review rules; here only structural smells/patterns.
91
+ - A fourth always-on rule — forbidden; this stem is requestable / agent-load only.
92
+
93
+ ## Cross-refs
94
+
95
+ - Always-on Principles: `code-quality-and-refactoring`.
96
+ - DIP / ports vs adapters: stack `architecture-boundaries` (stack details — in adapter Stack notes).
97
+ - Ubiquitous language: `feature-delivery-workflow` (lineage).
98
+ - MR checklist (smells in scope; pattern name only if repo uses it): `code-review-mr`.
99
+ - Token / twin policy for authors: `preset-token-budget`, `preset-twin-sync` (meta, not consumer always-on).
@@ -0,0 +1,49 @@
1
+ <!-- shared-core: architecture/feature-delivery-workflow.md -->
2
+
3
+ # Feature delivery (end-to-end order)
4
+
5
+ Typical feature with data and UI. Concrete directories and rule stems — in the adapter **Stack notes**.
6
+
7
+ ## Checklist (abstract order)
8
+
9
+ 1. **Domain / types** — Domain/types-layer entities and contracts; layer public API.
10
+ 2. **Transport / DTO** — DTOs and mappers Domain ↔ transport (must not leak into UI).
11
+ 3. **Services / Data** — repository / API-service implementations via the stack’s public clients.
12
+ 4. **State** — store / ViewModel / use cases; no direct HTTP and no DTOs in UI.
13
+ 5. **UI** — thin views/components; data via state; design system. If the prompt or `brief.md` contains a `figma.com` URL, **mockup review must complete** (or the user must continue past FAIL/`BLOCKED_MCP` via `/task-continue`) **before UI work**. When required-signal and **no** `figma.com`, **`ux-design.md` must exist** (not `INCOMPLETE`) before UI work — else blocked, hand back to analyst. Non-UI tasks no-op these gates.
14
+ 6. **Tests** — unit for mappers / non-trivial logic; e2e/UI per stack convention.
15
+ 7. **Completion** — stack post-change gate (lint/build) + package/toolchain rules. When the current WP spans **more than one** layer or module, `implementation.md` includes a **Code Map** (3–8 annotated repo-relative paths) and **Suggested Review Order** (`concern | path:line | ≤15 word note`). Omit both for a single-file or single-layer WP.
16
+
17
+ ## Data flow (orientation)
18
+
19
+ ```mermaid
20
+ flowchart LR
21
+ DTO[DTO] --> Mappers[Mappers]
22
+ Mappers --> Domain[Domain]
23
+ Domain --> Service[Service / Repo]
24
+ Service --> State[Store / VM]
25
+ State --> UI[UI]
26
+ ```
27
+
28
+ ## Partial scenarios
29
+
30
+ | Task | Minimum |
31
+ |------|---------|
32
+ | API / model only | Domain + DTO + mapper + service/repo; unit for mapper |
33
+ | State only | Protocols/services; no HTTP in UI |
34
+ | UI only | Existing state; no DTOs |
35
+ | Tests only | Specs per convention; do not change production without need |
36
+
37
+ ## Anti-patterns (shared)
38
+
39
+ - DTO / transport types in UI or presentation state.
40
+ - Low-level HTTP / concrete client from UI bypassing the service.
41
+ - Deep-import of another module/feature’s internal files.
42
+ - Breaking layer boundaries for brevity.
43
+ - **Ubiquitous language:** Domain/type names and boundaries reflect the feature’s subject domain — do not mix transport/framework terms into the domain without need; presentation must not dictate the model vocabulary.
44
+ - When assessing structure, smells, or pattern choice — load requestable **`design-guidance`** (not always-on); do not copy the catalog into the feature checklist.
45
+ - 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`.
46
+
47
+ ## Zone → rules matrix
48
+
49
+ Filled in the stack adapter: concrete globs/paths and `.mdc` / topic `.md` names.
@@ -0,0 +1,55 @@
1
+ # HTTP transport
2
+
3
+ **Names** of factories, error classes, response types, and config — **as in the current repo code** and in the barrel `app/src/types/index.ts`. Below are **architectural rules**, not a rename specification.
4
+
5
+ ## Layer role
6
+
7
+ - Ordinary REST calls to the backend go through **one implementation** in `app/src/lib/clients/**` (shared client module) and **preconfigured instances** in `app/src/api/clients/**`, following the pattern already adopted in the project.
8
+ - Where transport sits in the overall **ports and adapters** picture — see `architecture-boundaries.md` (section **“Ports and adapters”**).
9
+ - **Do not** call `fetch` directly from `app/src/api/services/**`, store, or UI (see `architecture-boundaries.md`, `api-services.md`); from store/UI — only calls through services from `@/api` (`public-imports.md`).
10
+ - **Exceptions** (narrow protocols, separate transport) — only where the repo already has an example; repeat it, do not invent arbitrary bypasses of the shared client.
11
+
12
+ ## Types
13
+
14
+ - Everything related to the **request/response/error contract** of the app and re-exported for the HTTP layer must be imported **only** from the `@/types` barrel, without deep imports from internal `app/src/types/**` files (see `public-imports.md`).
15
+ - Do not introduce **types or dependencies on an external HTTP client** the project has moved away from; use **`package.json`** and existing calls as the guide.
16
+
17
+ ## Error contract
18
+
19
+ - Network and HTTP errors must arrive in the **single shape** defined by the shared client (usually a class/wrapper with a field like `response` for body and status).
20
+ - In **`catch`**, align with the **actual error shape** in this repo (as in neighboring slices/services): access body, status, diagnostic code — **via fields of the current implementation**, without inventing a second format.
21
+
22
+ ## Behavior that stays in the client
23
+
24
+ - Common headers, `credentials`, file uploads (**FormData** / stripping extra headers), binary responses (**blob** and equivalents), uniform parsing of JSON and other bodies.
25
+ - Intercepting **401 / refresh**, handling **404**, etc. — **centrally**, if the client already does so; do not duplicate the same logic in every service.
26
+
27
+ ## Store relationship
28
+
29
+ - A thunk may return the **successful response wrapper type** if the service is structured that way; in **state**, prefer **domain** types after mapping. See `store-rtk.md`.
30
+
31
+ ## Agent requirement
32
+
33
+ - When changing the shared client implementation — **update or add behavior tests** under the mirrored `app/__tests__/unit/lib/clients/**` path (`tests-unit.md`).
34
+ - Do not introduce a **second full HTTP stack** without an explicit task and alignment with repo architecture.
35
+
36
+ ## Incorrect
37
+
38
+ ```ts
39
+ // Inside api/services — ad-hoc fetch bypasses shared client
40
+ export const getSettings = async () => {
41
+ const res = await fetch('/api/settings')
42
+ return res.json()
43
+ }
44
+ ```
45
+
46
+ ## Correct
47
+
48
+ ```ts
49
+ import { appHttpClient } from '@/api/clients/appHttpClient'
50
+
51
+ export const getSettings = async () => {
52
+ const { data } = await appHttpClient.get('/settings')
53
+ return mapSettingsResponse(data)
54
+ }
55
+ ```
@@ -0,0 +1,68 @@
1
+ # Layer barrel exports with public API
2
+
3
+ ## When to apply
4
+
5
+ For **any layer** (directory, package, bounded context) that has:
6
+
7
+ - a **root barrel** — single import entry for external consumers;
8
+ - deep imports inside the layer **forbidden** from outside (ESLint `no-restricted-imports`, `public-imports.md` rules).
9
+
10
+ Example alias/entry points in different projects: `@/api`, `@/types`, `@/core`, `@/store`, `packages/foo`.
11
+
12
+ ## Two barrel levels
13
+
14
+ 1. **Local** — module/feature `index.ts` inside the layer.
15
+ 2. **Root public API** — layer barrel (e.g. `src/<layer>/index.ts`).
16
+
17
+ **Inside** the layer — relative imports and paths between submodules. **Outside** — only the root barrel and **explicitly allowed** secondary entry points (if fixed in project rules, e.g. `@/types/enums`).
18
+
19
+ ## What to re-export externally
20
+
21
+ Only symbols that **must be available** to layer consumers: public functions/services/facades, contract types, constants and helpers needed by other layers or tests.
22
+
23
+ **Do not re-export:** internal adapters, mappers, transport details, intermediate objects used to assemble a facade inside the layer.
24
+
25
+ Grouping in the root barrel — **per repo convention** (guide — neighboring modules in the same layer).
26
+
27
+ ## Agent checklist (must)
28
+
29
+ When adding or substantially extending a **module inside a regulated layer**:
30
+
31
+ 1. Identify the layer, its **root barrel**, and additional entry points (`public-imports.md`).
32
+ 2. Create/update **local** `index.ts` — public symbols only.
33
+ 3. If the layer has a **facade/aggregator** (`*ApiService.ts`, `rootReducer`, …) — wire the module there.
34
+ 4. Add **re-export** of new public symbols in the layer **root barrel**.
35
+ 5. **Check:** grep for the symbol name or path `./<Module>` in the root barrel; no deep imports from outside the layer.
36
+
37
+ The module is **not done** until the checklist passes.
38
+
39
+ ## How to find regulated layers in the repo
40
+
41
+ 1. `public-imports.md` rules in `.mavis/rules/`.
42
+ 2. ESLint `no-restricted-imports` — patterns `@/<layer>/*` with barrel exception.
43
+ 3. `architecture-boundaries.md`, project README.
44
+
45
+ ## In this repo
46
+
47
+ | Layer | Root barrel | Import rule |
48
+ |------|-------------------|------------------|
49
+ | API | `app/src/api/index.ts` | `public-imports.md` |
50
+ | Types | `app/src/types/index.ts` | `public-imports.md` (+ `@/types/enums`) |
51
+ | Core | `app/src/core/index.ts` | ESLint: `@/core/index` |
52
+
53
+ Two-level illustration (API): local `services/.../<Feature>/index.ts` → facade `*ApiService.ts` → `app/src/api/index.ts`.
54
+
55
+ ## Incorrect
56
+
57
+ ```ts
58
+ // app/src/api/index.ts — leaking internals
59
+ export { mapCardResponse } from './services/CardsApi/cardResponseMappers'
60
+ export { rawCardsClient } from './clients/rawCardsClient'
61
+ ```
62
+
63
+ ## Correct
64
+
65
+ ```ts
66
+ // app/src/api/index.ts — public facade only
67
+ export { cardsApi } from './services/CardsApi'
68
+ ```
@@ -0,0 +1,86 @@
1
+ <!-- shared-core: quality/mcp-usage.md -->
2
+
3
+ # MCP usage
4
+
5
+ Requestable protocol for **shipped** and **local-overlay** MCP servers. Agents load this stem via one-liner wiring — do not copy tool schemas into prompts; discover them at runtime.
6
+
7
+ Does not replace Figma mockup-review (that checklist stays on `mockup-review`). Does not add pipeline agents or required handoff stems.
8
+
9
+ ## Presence (runtime catalog is SoT)
10
+
11
+ 1. Inspect the **session MCP catalog** (server names + `serverStatus`). Project `mcp.json` / `.mcp.json` is a hint, not proof the server is up (user-level and plugin servers never appear there).
12
+ 2. Treat `error`, `needsAuth`, and `loading` as **unavailable**. Authenticate only when this task needs that server.
13
+ 3. **Discover tool schemas before calling.** Never invent tool names or arguments from memory.
14
+ 4. Match overlay servers by **documented aliases** or exact catalog ids. Prefer a ready `plugin-*` id over an unknown similarly named server; if several match, ask rather than guessing.
15
+ 5. If two servers expose the same product (plugin + project entry), use the **ready** one; do not call both.
16
+
17
+ ## Classes
18
+
19
+ | Class | Who adds it | Policy |
20
+ |-------|-------------|--------|
21
+ | **Shipped** | Preset `mcp.json` | Assume it should be there; call when the task fits; degrade if down (do not block unless noted below) |
22
+ | **Local overlay** | Consumer project or user MCP | Use only when present **and** the task fits. Never a required pipeline step |
23
+
24
+ Shipped in every preset: **Context7** (library docs). Other shipped servers are stack-specific — see adapter **Stack notes**.
25
+
26
+ ## Context7 (shipped)
27
+
28
+ **When to call** (after lockfile / manifest + sibling files still do not confirm the symbol):
29
+
30
+ - Third-party API that would otherwise get `// VERIFY: lib.symbol @ version`
31
+ - Version-sensitive framework or SDK APIs
32
+ - Migrations / major upgrades
33
+ - Library is in the lockfile but the signature is unclear
34
+
35
+ **When not to call:** repo public API; a sibling file already imports the symbol; a trivial call already in this module.
36
+
37
+ **Flow:**
38
+
39
+ 1. Discover server `context7`.
40
+ 2. Resolve a library id, then query docs (read the live schema; typical names `resolve-library-id` then `query-docs`).
41
+ 3. Put the **installed major** from the project manifest into the query.
42
+ 4. Cap: **≤3 doc queries per question**.
43
+ 5. Source priority: lockfile / sibling code **>** Context7 **>** training data. If docs disagree with the installed major, keep the installed API.
44
+ 6. If Context7 is down: `// VERIFY` (or stack equivalent) and say MCP was unavailable. **Do not block** the task.
45
+
46
+ ## Local overlay protocol
47
+
48
+ If a matching server is ready and a **task signal** fires → discover and use. Otherwise continue from files / native tools (`gh`, repo docs, source).
49
+
50
+ Absence of an overlay is **not** `BLOCKED` unless the user required that MCP as source of truth.
51
+
52
+ ### Observability (Sentry, Datadog, similar)
53
+
54
+ **Signal:** production error, event/trace id, APM / latency, pasted dashboard or issue URL.
55
+
56
+ Use the **first ready** observability MCP. Do not invent metrics or stack traces. Do not require two observability servers.
57
+
58
+ ### Tickets (Linear, Jira, Notion, similar)
59
+
60
+ **Signal:** ticket/page URL in the prompt or brief, or an explicit “pull from \<tracker\>”.
61
+
62
+ Read-only by default. Task-folder artifacts (`brief.md`, `decomposition.md`) remain SoT — do not replace them with a tracker page. Write back to the tracker **only** if the user asked.
63
+
64
+ ### Component-library overlay
65
+
66
+ **Signal:** UI component public API, stories, controls, or explicit component-docs MCP.
67
+
68
+ If such a server is ready, use it for documented props/variants instead of inventing them. If it is down, read story/source files. **Block** only when the user required that MCP as SoT.
69
+
70
+ Usual aliases and runtime needs live in frontend **Stack notes**. Do not ship this server in preset `mcp.json`.
71
+
72
+ ### GitHub MCP
73
+
74
+ Native `gh` / git remain SoT for PRs and checks. A GitHub MCP may be used when present; do not require it.
75
+
76
+ ## Figma
77
+
78
+ Policy is stack-class-specific — see adapter **Stack notes**. If a Figma **plugin** and a project `figma` server are both present, use the ready one and do not duplicate calls.
79
+
80
+ ## Forbidden
81
+
82
+ - Secrets in `mcp.json` / `.mcp.json`
83
+ - New pipeline agents or required handoffs for overlay MCP
84
+ - Treating overlay absence as blocked (except user-required SoT)
85
+ - Tracker/admin write tools without an explicit ask
86
+ - Calling overlay MCP “just in case” on unrelated tasks
@@ -0,0 +1,107 @@
1
+ <!-- shared-core: review/mockup-review.md -->
2
+
3
+ # Mockup review checklist
4
+
5
+ On-demand reviewer checklist for Figma mockups. **Procedure:** skill `mockup-review`. **Agent:** `mockup-reviewer`. Do not inline this checklist into the agent prompt.
6
+
7
+ Stack-agnostic: no app-source globs, Playwright, or `xcodebuild`. Breakpoint **examples** live in adapter **Stack notes** only — do not FAIL on exact pixels.
8
+
9
+ ## When to load
10
+
11
+ - Pipeline step `mockup-reviewer` (standalone intent `mockup-review` or embedded after analyst)
12
+ - Prompt or `brief.md` contains a `figma.com` URL on a UI-capable stack
13
+ - User asks to review a mockup / Figma file (not a code MR)
14
+
15
+ ## Inputs
16
+
17
+ 1. Task `artifact-manifest.json`, then prompt Figma URL(s); `brief.md` / `decomposition.md` when present
18
+ 2. Skill `mockup-review` + this rule
19
+ 3. If plugin skills `figma-use` / `figma-design-to-code` are installed: **reference** them for URL parse and MCP invocation only — do not copy their bodies; do not run design-to-code
20
+
21
+ ## MCP-first
22
+
23
+ Required when MCP is up: `get_metadata`, `get_design_context`, `search_design_system`, `get_variable_defs`, `get_screenshot`. Optional: `get_libraries`, `get_code_connect_map`.
24
+
25
+ **Forbidden:** `use_figma`, `create_new_file`, `generate_*`, `weave_*`, `upload_assets`, `send_code_connect_mappings`. FigJam URL → `BLOCKED_MCP` / out of scope (do not call `get_figjam` unless the URL is a FigJam board — then still `BLOCKED_MCP`).
26
+
27
+ Cite `fileKey` + node IDs. Screenshots are supporting evidence, not a second reviewer. No screenshot-only path.
28
+
29
+ **Node caps:** ≤12 screen-level frames; `get_metadata` depth ≤3 named-frame levels; ≤3 screenshots (prefer one per small/medium/large). `search_design_system` once; `get_variable_defs` once per file. No node-id on URL: pick top-level frames matching the feature name; if still unbounded → `BLOCKED_MCP` (or `PASS_WITH_NOTES` only if MCP returned a tiny file) — do not dump the whole file.
30
+
31
+ **Degradation:** MCP unavailable or OAuth fail → verdict `BLOCKED_MCP`. Do **not** invent DS compliance claims.
32
+
33
+ ## Review dimensions
34
+
35
+ ### DS components (AC-4)
36
+
37
+ When an attached library is detectable (`search_design_system` / `get_metadata`): list **library component instances vs custom frames** with file/node references. Flag substitutions where a DS equivalent exists.
38
+
39
+ - Critical DS reimplementation (custom frame where an attached-library component exists) → **FAIL**
40
+ - One-off frame, no DS equivalent; mixed/unpublished library → WARN or notes (`PASS_WITH_NOTES`)
41
+ - No attached library detectable → notes only; do not invent DS claims (`PASS_WITH_NOTES`)
42
+
43
+ Confidence: `high` (MCP library match) / `low` (unpublished or mixed) — prefer `PASS_WITH_NOTES` over FAIL when confidence is low.
44
+
45
+ ### Tokens (AC-5)
46
+
47
+ When variables/styles are available (`get_variable_defs`, style metadata): flag fills, strokes, spacing, or typography that use raw values instead of bound variables/styles.
48
+
49
+ - Isolated unbound values → **WARN** (`PASS_WITH_NOTES`)
50
+ - Wholesale token ignore on a library-attached file (systemic; treat as critical DS with AC-4) → **FAIL**
51
+
52
+ ### Quality (AC-6)
53
+
54
+ Cover at minimum, each item PASS / WARN / FAIL eligible:
55
+
56
+ - Layer/frame naming hygiene
57
+ - Auto-layout vs absolute positioning for responsive regions
58
+ - Text style usage
59
+ - Component variant/property correctness
60
+ - Detached or orphaned component instances
61
+
62
+ Naming hygiene, minor detached instances, text-style drift → **WARN**. Detached **core** DS component that is a substitution → **FAIL** (same as AC-4 critical). Absolute layout on a region that is the only «responsive» evidence → WARN unless it also fails viewports.
63
+
64
+ ### Feature coverage (AC-7)
65
+
66
+ Map **flows → screens/frames**, **actions → interactive elements**, and **states** (empty, loading, error, success, disabled/validation). List explicit **missing** items. Label scope **`inferred`** when only a URL is provided (no brief AC).
67
+
68
+ - Missing **core** flow or primary action from brief AC (or labeled `inferred` primary flow from the URL) → **FAIL**
69
+ - Missing empty/loading/error/success on a form/list called out in AC → **FAIL**
70
+ - Missing secondary states (disabled/validation) not in AC → **WARN**
71
+
72
+ ### Viewports (AC-8)
73
+
74
+ Verify **≥3 viewport representations** (small / medium / large) via dedicated frames, Figma viewport presets, or responsive component variants.
75
+
76
+ - Fewer than 3 → **FAIL**
77
+ - 3 exist but sizes ≠ stack example buckets → **WARN** only (no exact pixel enforcement in core)
78
+
79
+ ## Severity (v1)
80
+
81
+ Isolated **WARN** never blocks. Overall verdict = worst FAIL > BLOCKED_MCP > PASS_WITH_NOTES > PASS. Multiple WARNs without FAIL → `PASS_WITH_NOTES`, not FAIL.
82
+
83
+ ## Report headings
84
+
85
+ Write `mockup-review.md` with these headings (must match the agent template):
86
+
87
+ ```markdown
88
+ # Mockup review: <slug>
89
+
90
+ ## Verdict
91
+ PASS | PASS_WITH_NOTES | FAIL | BLOCKED_MCP
92
+
93
+ ## Scope
94
+ - Figma fileKey / node IDs
95
+ - MCP: available | unavailable (reason)
96
+ - Feature scope source: brief AC | prompt | inferred
97
+
98
+ ## Critical (must fix)
99
+ ## Warnings (should fix)
100
+ ## Suggestions
101
+ ## DS compliance (AC-4, AC-5)
102
+ ## Quality (AC-6)
103
+ ## Feature coverage (AC-7)
104
+ ## Viewport matrix (AC-8)
105
+ ## AC coverage
106
+ | Criterion | Status | Notes |
107
+ ```
@@ -0,0 +1,56 @@
1
+ # Navigation and routing: project stack first
2
+
3
+ **For any task involving navigation, page transitions, URLs, redirects, breadcrumbs, protected routes, or programmatic route changes** — before proposing code or imports you **must not** default to “typical React”. **Explicitly verify the target repo stack** and use **one** mechanism consistent with the project.
4
+
5
+ ## Dependencies: what to check first
6
+
7
+ 1. **`package.json`** at the app root (e.g. `app/package.json` in a monorepo — the package that is actually built and deployed). Check **`dependencies`** and if needed **`peerDependencies`**:
8
+ - **`next`** — Next.js; version matters for API nuances (cross-check docs for that major).
9
+ - **`react-router-dom`**, **`@remix-run/*`**, **`@tanstack/react-router`**, etc. — separate routing; do not substitute their API with Next calls without verifying that stack is actually used.
10
+ - **`next`** and **`react-router-dom`** together — possible legacy or hybrid; **do not** pick API by default — see “Implementation in code” below.
11
+
12
+ 2. **Monorepo / workspaces** — routing may live outside the root `package.json`. Open the **`package.json` of the workspace** where pages and `next.config.*` / SPA entry live.
13
+
14
+ 3. **Actual installation** — when in doubt, check the lockfile (`bun.lock`, `package-lock.json`, `pnpm-lock.yaml`, `yarn.lock`) or `node_modules` for the relevant package: confirm the declared package is installed, not only documented.
15
+
16
+ ## Routing implementation in the project (code and structure)
17
+
18
+ Before proposing a navigation pattern **align with how the repo already does it**:
19
+
20
+ 1. **Route tree**
21
+ - Next **App Router**: **`app/`** (or `src/app/`) with `layout.tsx`, `page.tsx`, segments `[id]`, etc.
22
+ - Next **Pages Router**: **`pages/`** with `_app`, dynamic `[slug].tsx`.
23
+ - Both **`app/`** and **`pages/`** present — clarify via `next.config` and project docs which layer is primary.
24
+
25
+ 2. **Entry points and wrappers**
26
+ - Code search for imports: **`from 'next/navigation'`**, **`from 'next/router'`**, **`from 'next/link'`**, **`from 'react-router-dom'`**, **`createBrowserRouter`**, **`RouterProvider`**, **`BrowserRouter`**.
27
+ - Where routes are declared (Next file structure vs SPA route config / `routes.tsx`).
28
+
29
+ 3. **Project abstractions**
30
+ - Link wrappers (`@/ui/...`, design-system `Link`), path helpers, route constants — **use them**, do not duplicate raw router.
31
+
32
+ 4. **Neighboring feature files**
33
+ - New navigation code — same style as pages/hooks in that area (`next/navigation` vs `react-router-dom` as in neighboring imports).
34
+
35
+ ## How to decide what to use (summary)
36
+
37
+ 1. **Dependencies** — see above; they define the allowed package set.
38
+ 2. **Structure** — App Router vs Pages vs SPA by directories and config.
39
+ 3. **Actual code** — which imports and wrappers dominate in the app.
40
+
41
+ ## What to use (quick matrix)
42
+
43
+ | Stack | Programmatic navigation / path read | Links |
44
+ |------|-------------------------------------|--------|
45
+ | **Next.js App Router** | `next/navigation` (`useRouter`, `usePathname`, `useSearchParams`, `redirect`, etc. per Next docs for your version) | `next/link` |
46
+ | **Next.js Pages Router** | `next/router` | `next/link` |
47
+ | **SPA + React Router** | `react-router-dom` (`useNavigate`, `useParams`, `useLocation`, …) | `<Link>` from `react-router-dom` |
48
+
49
+ **Do not:** add `react-router-dom` to a Next.js project “by habit”; import hooks from `next/router` in App Router components without checking; mix two routers in one app without an explicit architectural reason in the codebase.
50
+
51
+ ## Agent requirement
52
+
53
+ - Before generating or reviewing navigation code **briefly record the conclusion** (e.g. “dependencies: `next` without `react-router-dom`; code uses `next/navigation` everywhere → use the same”) and follow it.
54
+ - **Mandatory check:** current **`dependencies`** in the relevant workspace `package.json` + **how routes and imports are already implemented** (repo search, neighboring files). Do not rely on a single signal alone (e.g. only the presence of an `app/` folder).
55
+ - If the stack is unclear (two routers in dependencies, hybrid) — **cross-check lockfile / installed packages** and **dominant imports** in `src`/`app`, then choose the API.
56
+ - For **this** repo the baseline guide is **`next-app-core.md`**: Next.js; prefer **`next/navigation`** and **`next/link`** where App Router is used.
@@ -0,0 +1,10 @@
1
+ # Navigation in UI components
2
+
3
+ Before links, programmatic navigation, or URL work in UI:
4
+
5
+ 1. **`package.json`** of the app workspace — `next` vs `react-router-dom`.
6
+ 2. **Neighboring imports** in the same feature (`next/navigation`, `next/link` vs `react-router-dom`).
7
+ 3. **Project wrappers** (`@/ui/...` Link) — preferred over raw router API.
8
+ 4. **Default (preset):** Next.js App Router → `next/navigation` + `next/link` (`next-app-core.md`, `next-app-router.md`).
9
+
10
+ Full audit (route tree, hybrids, lockfile): **`navigation-router-stack.md`** — when editing `app/src/app/**`.
@@ -0,0 +1,29 @@
1
+ # Stack and environment
2
+
3
+ Concrete versions come **from `package.json` and configs of the target repository**. Preset frame: Next.js, React, TypeScript; runner/e2e/mocks/UI/APM — as established in the repo.
4
+
5
+ # Project structure
6
+
7
+ - `app/` — Next.js root; `app/src/**` — code; `app/__tests__/e2e/**` — e2e.
8
+ - `app/tsconfig.json`: `baseUrl: "."`, `paths: { "@/*": ["./src/*"] }`.
9
+ - **Requirement:** `@/*` instead of relative imports that climb the tree.
10
+
11
+ # Architectural layers
12
+
13
+ | Layer | Directory | Details |
14
+ |-------|-----------|---------|
15
+ | UI | `app/src/ui/**` (pages, components) | `react-ui.md`, `architecture-boundaries-ui.md` |
16
+ | Store | `app/src/store/**` (slices, middleware) | `store-rtk.md` |
17
+ | API | `app/src/api/**` (services, clients, barrel) | `api-services.md`, `http-client.md` |
18
+ | HTTP | `app/src/lib/clients/**`, `app/src/api/clients/**` | `http-client.md` |
19
+ | Types | `app/src/types/**` | `public-imports.md`, `types-jsdoc.md` |
20
+ | Mocks | `app/src/mocks/**` | per repository layout |
21
+
22
+ Layer boundaries, ports/adapters, UI→API — **`architecture-boundaries.md`**. Imports of `@/types`, `@/api` — **`public-imports.md`**.
23
+
24
+ # Agent work
25
+
26
+ - Architecture and imports: `architecture-boundaries.md`, `public-imports.md`
27
+ - Features: `feature-delivery-workflow.md` + skill `feature-delivery`
28
+ - After edits: **invoke** `post-change-lint.md` (requestable, required after code edits); package manager: `package-manager.md`
29
+ - Copy patterns from neighboring files in the target layer; do not use `any` (prefer `unknown` + narrowing)
@@ -0,0 +1,44 @@
1
+ # Next.js App Router
2
+
3
+ Apply when working with `app/src/app/**` or App Router routes in the target repo.
4
+
5
+ ## Server vs Client
6
+
7
+ - **Server Components by default** — no `'use client'` unless hooks, browser APIs, or event handlers are required.
8
+ - **`'use client'`** — only for interactivity, `useState`/`useEffect`, and browser-only APIs.
9
+ - Do not pull store/RTK and heavy client state into Server Components without need.
10
+
11
+ ## Data fetching
12
+
13
+ - Prefer fetch/data-loader on the **server** (RSC, route handlers, server actions — per the repo’s established pattern).
14
+ - **Do not duplicate** the same request in RSC and client without reason.
15
+ - Cache and revalidate — match existing pages in the repo (`fetch` options, `revalidate`, tags).
16
+
17
+ ## Routes and UX
18
+
19
+ - For async data routes, sibling **`loading.tsx`** and **`error.tsx`** are **required** (and `not-found.tsx` where appropriate) — follow neighboring routes.
20
+ - **Suspense** — for slow client/server sections; fallback aligned with the design system.
21
+ - Navigation — `navigation-router-stack.md` + project router/link patterns.
22
+
23
+ ## Layer boundaries
24
+
25
+ - RSC/route handlers **must not import UI components with client-only dependencies** directly into the server tree without a `'use client'` boundary.
26
+ - Domain types — `@/types`; backend calls — via `@/api` / services, not raw `fetch` from `page.tsx` without an API layer.
27
+
28
+ ## Anti-hallucination (App Router)
29
+
30
+ Less guessed code is better than more. Cross-check APIs against the Next version in `package.json` and neighboring routes.
31
+
32
+ | ❌ Avoid | ✅ Prefer |
33
+ |---------|----------|
34
+ | Sync `params` / `searchParams` / `cookies()` / `headers()` when the installed Next treats them as async | `await params` / `await cookies()` / patterns from existing pages |
35
+ | Invented `getSession()`-only server auth without project verify | Server session verify used by the repo (`security-next.md`) |
36
+ | Auth enforcement only in Edge middleware | Layout/page/Server Action checks + middleware refresh if present |
37
+ | New App Router APIs not in the installed Next major | Copy from a sibling route; mark `VERIFY` if unsure |
38
+ | Client `fetch` in `page.tsx` bypassing `@/api` | Services via `@/api` / established data loaders |
39
+
40
+ See also: **`react-next-anti-hallucination`** — broader React / RTK / Next phantom-import banlist (requestable).
41
+
42
+ ## Reference
43
+
44
+ Look at an existing route of similar complexity in `app/src/app/**` and repeat its structure (`reference-features.md`).