@bonesofspring/ai-rules 0.2.6 → 0.2.8

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 (405) hide show
  1. package/CHANGELOG.md +65 -1
  2. package/README.md +13 -5
  3. package/bin/cli.js +30 -1
  4. package/package.json +3 -2
  5. package/presets/_shared/README.md +1 -1
  6. package/presets/_shared/core/agent-team/agent-team-intake.md +1 -1
  7. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +1 -1
  8. package/presets/_shared/core/architecture/reference-features.template.md +12 -0
  9. package/presets/_shared/core/meta/preset-layering.md +1 -1
  10. package/presets/_shared/core/meta/preset-no-cross-stack-leakage.md +6 -4
  11. package/presets/_shared/core/meta/preset-pr-checklist.md +1 -1
  12. package/presets/_shared/core/meta/preset-twin-sync.md +2 -0
  13. package/presets/_shared/core/quality/code-quality-and-refactoring.md +11 -0
  14. package/presets/_shared/core/review/code-review-mr.md +9 -0
  15. package/presets/claude/go/CLAUDE.md +5 -1
  16. package/presets/claude/go/README.md +5 -1
  17. package/presets/claude/go/REPO_AGENTS.md +48 -0
  18. package/presets/claude/go/agents/README.md +19 -2
  19. package/presets/claude/go/agents/build-verifier.md +6 -1
  20. package/presets/claude/go/agents/codebase-analyzer.md +28 -0
  21. package/presets/claude/go/agents/feature-developer.md +13 -0
  22. package/presets/claude/go/hooks/README.md +6 -0
  23. package/presets/claude/go/hooks/examples/README.md +18 -0
  24. package/presets/claude/go/hooks/examples/format-edited.example.sh +9 -0
  25. package/presets/claude/go/hooks/examples/secret-guard.example.sh +10 -0
  26. package/presets/claude/go/hooks/examples/test-on-save.example.sh +11 -0
  27. package/presets/claude/go/rules/api-and-data/api-http.md +10 -3
  28. package/presets/claude/go/rules/architecture/reference-features.md +4 -0
  29. package/presets/claude/go/rules/stack/go-conventions.md +30 -3
  30. package/presets/claude/go/rules/tooling-and-review/agent-team-intake.md +1 -1
  31. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  32. package/presets/claude/go/rules/tooling-and-review/code-quality.md +12 -1
  33. package/presets/claude/go/rules/tooling-and-review/code-review.md +9 -0
  34. package/presets/claude/go/rules/tooling-and-review/preset-layering.md +1 -1
  35. package/presets/claude/go/rules/tooling-and-review/preset-no-cross-stack-leakage.md +6 -8
  36. package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  37. package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +2 -0
  38. package/presets/claude/go/skills/README.md +2 -2
  39. package/presets/claude/go/skills/code-review/SKILL.md +11 -2
  40. package/presets/claude/go/skills/feature-delivery/SKILL.md +4 -0
  41. package/presets/claude/go/skills/technical-retro/SKILL.md +46 -2
  42. package/presets/claude/go/skills/write-adr/SKILL.md +41 -0
  43. package/presets/claude/go/team/conventions.md +21 -0
  44. package/presets/claude/go/team/fixtures/feature-full.json +5 -23
  45. package/presets/claude/ios-swift/CLAUDE.md +4 -1
  46. package/presets/claude/ios-swift/README.md +5 -1
  47. package/presets/claude/ios-swift/REPO_AGENTS.md +46 -0
  48. package/presets/claude/ios-swift/agents/README.md +3 -2
  49. package/presets/claude/ios-swift/agents/build-verifier.md +7 -2
  50. package/presets/claude/ios-swift/agents/codebase-analyzer.md +28 -0
  51. package/presets/claude/ios-swift/agents/feature-developer.md +13 -0
  52. package/presets/claude/ios-swift/hooks/README.md +6 -0
  53. package/presets/claude/ios-swift/hooks/examples/README.md +18 -0
  54. package/presets/claude/ios-swift/hooks/examples/format-edited.example.sh +13 -0
  55. package/presets/claude/ios-swift/hooks/examples/secret-guard.example.sh +10 -0
  56. package/presets/claude/ios-swift/hooks/examples/test-on-save.example.sh +8 -0
  57. package/presets/claude/ios-swift/rules/architecture/reference-features.md +4 -0
  58. package/presets/claude/ios-swift/rules/stack/ios-app-core.md +5 -28
  59. package/presets/claude/ios-swift/rules/stack/swift-conventions.md +12 -2
  60. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-intake.md +1 -1
  61. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  62. package/presets/claude/ios-swift/rules/tooling-and-review/code-quality.md +12 -1
  63. package/presets/claude/ios-swift/rules/tooling-and-review/code-review.md +47 -0
  64. package/presets/claude/ios-swift/rules/tooling-and-review/preset-layering.md +1 -1
  65. package/presets/claude/ios-swift/rules/tooling-and-review/preset-no-cross-stack-leakage.md +6 -4
  66. package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  67. package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +2 -0
  68. package/presets/claude/ios-swift/rules/ui-and-accessibility/swiftui.md +8 -0
  69. package/presets/claude/ios-swift/skills/README.md +1 -0
  70. package/presets/claude/ios-swift/skills/code-review/SKILL.md +10 -2
  71. package/presets/claude/ios-swift/skills/feature-delivery/SKILL.md +4 -0
  72. package/presets/claude/ios-swift/skills/technical-retro/SKILL.md +46 -2
  73. package/presets/claude/ios-swift/skills/write-adr/SKILL.md +41 -0
  74. package/presets/claude/ios-swift/team/conventions.md +21 -0
  75. package/presets/claude/java/CLAUDE.md +29 -0
  76. package/presets/claude/java/MCP.md +13 -0
  77. package/presets/claude/java/README.md +26 -0
  78. package/presets/claude/java/REPO_AGENTS.md +45 -0
  79. package/presets/claude/java/agents/README.md +32 -0
  80. package/presets/claude/java/agents/api-contract-reviewer.md +23 -0
  81. package/presets/claude/java/agents/build-verifier.md +45 -0
  82. package/presets/claude/java/agents/ci-investigator.md +17 -0
  83. package/presets/claude/java/agents/code-reviewer.md +40 -0
  84. package/presets/claude/java/agents/codebase-analyzer.md +28 -0
  85. package/presets/claude/java/agents/debugger.md +25 -0
  86. package/presets/claude/java/agents/feature-developer.md +43 -0
  87. package/presets/claude/java/agents/integration-test-generator.md +22 -0
  88. package/presets/claude/java/agents/integration-test-healer.md +22 -0
  89. package/presets/claude/java/agents/integration-test-planner.md +22 -0
  90. package/presets/claude/java/agents/migration-specialist.md +31 -0
  91. package/presets/claude/java/agents/performance-auditor.md +22 -0
  92. package/presets/claude/java/agents/qa-tester.md +24 -0
  93. package/presets/claude/java/agents/security-reviewer.md +20 -0
  94. package/presets/claude/java/agents/solution-architect.md +28 -0
  95. package/presets/claude/java/agents/task-analyst.md +25 -0
  96. package/presets/claude/java/agents/task-router.md +69 -0
  97. package/presets/claude/java/agents/tech-writer.md +15 -0
  98. package/presets/claude/java/agents/unit-test-generator.md +21 -0
  99. package/presets/claude/java/agents/unit-test-healer.md +13 -0
  100. package/presets/claude/java/agents/unit-test-planner.md +26 -0
  101. package/presets/claude/java/commands/README.md +13 -0
  102. package/presets/claude/java/commands/feature-continue.md +51 -0
  103. package/presets/claude/java/commands/feature-start.md +30 -0
  104. package/presets/claude/java/commands/task-continue.md +49 -0
  105. package/presets/claude/java/commands/task.md +49 -0
  106. package/presets/claude/java/commands/technical-retro.md +58 -0
  107. package/presets/claude/java/hooks/README.md +16 -0
  108. package/presets/claude/java/hooks/chain-team-phases.sh +381 -0
  109. package/presets/claude/java/hooks/examples/README.md +18 -0
  110. package/presets/claude/java/hooks/examples/format-edited.example.sh +11 -0
  111. package/presets/claude/java/hooks/examples/secret-guard.example.sh +10 -0
  112. package/presets/claude/java/hooks/examples/test-on-save.example.sh +18 -0
  113. package/presets/claude/java/hooks/guard-shell-command.sh +80 -0
  114. package/presets/claude/java/mcp.json +11 -0
  115. package/presets/claude/java/rules/README.md +60 -0
  116. package/presets/claude/java/rules/api-and-data/README.md +14 -0
  117. package/presets/claude/java/rules/api-and-data/adapters-driven.md +38 -0
  118. package/presets/claude/java/rules/api-and-data/adapters-driving.md +38 -0
  119. package/presets/claude/java/rules/api-and-data/api-grpc.md +29 -0
  120. package/presets/claude/java/rules/api-and-data/api-http.md +36 -0
  121. package/presets/claude/java/rules/api-and-data/messaging-adapters.md +24 -0
  122. package/presets/claude/java/rules/api-and-data/persistence-adapters.md +33 -0
  123. package/presets/claude/java/rules/architecture/README.md +16 -0
  124. package/presets/claude/java/rules/architecture/application-usecases.md +32 -0
  125. package/presets/claude/java/rules/architecture/boundaries.md +29 -0
  126. package/presets/claude/java/rules/architecture/composition-root.md +31 -0
  127. package/presets/claude/java/rules/architecture/domain-layer.md +38 -0
  128. package/presets/claude/java/rules/architecture/feature-delivery.md +52 -0
  129. package/presets/claude/java/rules/architecture/module-public-api.md +31 -0
  130. package/presets/claude/java/rules/architecture/ports-interfaces.md +34 -0
  131. package/presets/claude/java/rules/architecture/reference-features.md +34 -0
  132. package/presets/claude/java/rules/stack/README.md +10 -0
  133. package/presets/claude/java/rules/stack/java-app-core.md +32 -0
  134. package/presets/claude/java/rules/stack/java-conventions.md +52 -0
  135. package/presets/claude/java/rules/testing/README.md +11 -0
  136. package/presets/claude/java/rules/testing/e2e.md +22 -0
  137. package/presets/claude/java/rules/testing/integration.md +27 -0
  138. package/presets/claude/java/rules/testing/unit.md +33 -0
  139. package/presets/claude/java/rules/tooling-and-review/README.md +21 -0
  140. package/presets/claude/java/rules/tooling-and-review/agent-team-intake.md +26 -0
  141. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +179 -0
  142. package/presets/claude/java/rules/tooling-and-review/code-quality.md +83 -0
  143. package/presets/claude/java/rules/tooling-and-review/code-review.md +59 -0
  144. package/presets/claude/java/rules/tooling-and-review/design-guidance.md +110 -0
  145. package/presets/claude/java/rules/tooling-and-review/java-tooling.md +36 -0
  146. package/presets/claude/java/rules/tooling-and-review/post-change-test.md +32 -0
  147. package/presets/claude/java/rules/tooling-and-review/preset-layering.md +36 -0
  148. package/presets/claude/java/rules/tooling-and-review/preset-no-cross-stack-leakage.md +56 -0
  149. package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +39 -0
  150. package/presets/claude/java/rules/tooling-and-review/preset-token-budget.md +41 -0
  151. package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +44 -0
  152. package/presets/claude/java/rules/tooling-and-review/security-java.md +29 -0
  153. package/presets/claude/java/rules/tooling-and-review/technical-retro.md +20 -0
  154. package/presets/claude/java/rules/ui-and-accessibility/README.md +5 -0
  155. package/presets/claude/java/skills/README.md +5 -0
  156. package/presets/claude/java/skills/ci-investigation/SKILL.md +11 -0
  157. package/presets/claude/java/skills/code-review/SKILL.md +25 -0
  158. package/presets/claude/java/skills/debug-investigation/SKILL.md +15 -0
  159. package/presets/claude/java/skills/feature-delivery/SKILL.md +30 -0
  160. package/presets/claude/java/skills/integration-testing/SKILL.md +15 -0
  161. package/presets/claude/java/skills/technical-retro/SKILL.md +54 -0
  162. package/presets/claude/java/skills/unit-testing/SKILL.md +14 -0
  163. package/presets/claude/java/skills/write-adr/SKILL.md +41 -0
  164. package/presets/claude/java/team/README.md +27 -0
  165. package/presets/claude/java/team/conventions.md +21 -0
  166. package/presets/claude/java/team/fixtures/bugfix-standard.json +37 -0
  167. package/presets/claude/java/team/fixtures/feature-full.json +25 -0
  168. package/presets/claude/java/team/fixtures/feature-light.json +17 -0
  169. package/presets/claude/next/CLAUDE.md +5 -1
  170. package/presets/claude/next/README.md +6 -1
  171. package/presets/claude/next/REPO_AGENTS.md +48 -0
  172. package/presets/claude/next/agents/README.md +7 -1
  173. package/presets/claude/next/agents/build-verifier.md +7 -2
  174. package/presets/claude/next/agents/codebase-analyzer.md +28 -0
  175. package/presets/claude/next/agents/feature-developer.md +13 -0
  176. package/presets/claude/next/agents/security-reviewer.md +4 -2
  177. package/presets/claude/next/hooks/README.md +6 -0
  178. package/presets/claude/next/hooks/examples/README.md +18 -0
  179. package/presets/claude/next/hooks/examples/format-edited.example.sh +11 -0
  180. package/presets/claude/next/hooks/examples/secret-guard.example.sh +10 -0
  181. package/presets/claude/next/hooks/examples/test-on-save.example.sh +8 -0
  182. package/presets/claude/next/rules/README.md +2 -1
  183. package/presets/claude/next/rules/api-and-data/api-services.md +22 -0
  184. package/presets/claude/next/rules/api-and-data/http-client.md +21 -0
  185. package/presets/claude/next/rules/api-and-data/store-rtk.md +20 -0
  186. package/presets/claude/next/rules/architecture/architecture-boundaries.md +28 -0
  187. package/presets/claude/next/rules/architecture/layer-barrel-exports.md +15 -0
  188. package/presets/claude/next/rules/architecture/public-imports.md +14 -0
  189. package/presets/claude/next/rules/architecture/reference-features.md +4 -0
  190. package/presets/claude/next/rules/stack/arrow-functions.md +13 -28
  191. package/presets/claude/next/rules/stack/next-app-router.md +13 -1
  192. package/presets/claude/next/rules/testing/tests-unit.md +13 -0
  193. package/presets/claude/next/rules/tooling-and-review/README.md +2 -1
  194. package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +1 -1
  195. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
  196. package/presets/claude/next/rules/tooling-and-review/code-quality.md +12 -2
  197. package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +22 -0
  198. package/presets/claude/next/rules/tooling-and-review/preset-layering.md +1 -1
  199. package/presets/claude/next/rules/tooling-and-review/preset-no-cross-stack-leakage.md +6 -4
  200. package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  201. package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +2 -0
  202. package/presets/claude/next/rules/tooling-and-review/security-next.md +57 -0
  203. package/presets/claude/next/rules/ui-and-accessibility/react-ui.md +21 -0
  204. package/presets/claude/next/skills/README.md +2 -0
  205. package/presets/claude/next/skills/code-review/SKILL.md +10 -2
  206. package/presets/claude/next/skills/feature-delivery/SKILL.md +4 -0
  207. package/presets/claude/next/skills/react-performance/SKILL.md +44 -0
  208. package/presets/claude/next/skills/technical-retro/SKILL.md +19 -5
  209. package/presets/claude/next/skills/write-adr/SKILL.md +41 -0
  210. package/presets/claude/next/team/conventions.md +21 -0
  211. package/presets/cursor/go/AGENTS.md +6 -0
  212. package/presets/cursor/go/README.md +6 -5
  213. package/presets/cursor/go/REPO_AGENTS.md +48 -0
  214. package/presets/cursor/go/agents/README.md +23 -2
  215. package/presets/cursor/go/agents/build-verifier.md +6 -1
  216. package/presets/cursor/go/agents/codebase-analyzer.md +28 -0
  217. package/presets/cursor/go/agents/feature-developer.md +13 -0
  218. package/presets/cursor/go/commands/README.md +1 -1
  219. package/presets/cursor/go/hooks/README.md +4 -0
  220. package/presets/cursor/go/hooks/examples/README.md +18 -0
  221. package/presets/cursor/go/hooks/examples/format-edited.example.sh +9 -0
  222. package/presets/cursor/go/hooks/examples/secret-guard.example.sh +10 -0
  223. package/presets/cursor/go/hooks/examples/test-on-save.example.sh +11 -0
  224. package/presets/cursor/go/rules/README.md +2 -2
  225. package/presets/cursor/go/rules/agent-team-intake.mdc +1 -1
  226. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +1 -1
  227. package/presets/cursor/go/rules/api-http.mdc +10 -3
  228. package/presets/cursor/go/rules/code-quality-and-refactoring.mdc +12 -1
  229. package/presets/cursor/go/rules/code-review-mr.mdc +9 -0
  230. package/presets/cursor/go/rules/go-conventions.mdc +30 -3
  231. package/presets/cursor/go/rules/preset-layering.mdc +1 -1
  232. package/presets/cursor/go/rules/preset-no-cross-stack-leakage.mdc +6 -8
  233. package/presets/cursor/go/rules/preset-pr-checklist.mdc +1 -1
  234. package/presets/cursor/go/rules/preset-twin-sync.mdc +2 -0
  235. package/presets/cursor/go/rules/reference-features.mdc +4 -0
  236. package/presets/cursor/go/skills/README.md +2 -2
  237. package/presets/cursor/go/skills/code-review/SKILL.md +10 -1
  238. package/presets/cursor/go/skills/feature-delivery/SKILL.md +4 -0
  239. package/presets/cursor/go/skills/technical-retro/SKILL.md +46 -2
  240. package/presets/cursor/go/skills/write-adr/SKILL.md +41 -0
  241. package/presets/cursor/go/team/conventions.md +21 -0
  242. package/presets/cursor/go/team/fixtures/feature-full.json +5 -23
  243. package/presets/cursor/ios-swift/AGENTS.md +5 -2
  244. package/presets/cursor/ios-swift/README.md +6 -5
  245. package/presets/cursor/ios-swift/REPO_AGENTS.md +46 -0
  246. package/presets/cursor/ios-swift/agents/README.md +3 -2
  247. package/presets/cursor/ios-swift/agents/build-verifier.md +7 -2
  248. package/presets/cursor/ios-swift/agents/codebase-analyzer.md +28 -0
  249. package/presets/cursor/ios-swift/agents/feature-developer.md +13 -0
  250. package/presets/cursor/ios-swift/commands/README.md +1 -1
  251. package/presets/cursor/ios-swift/hooks/README.md +4 -0
  252. package/presets/cursor/ios-swift/hooks/examples/README.md +18 -0
  253. package/presets/cursor/ios-swift/hooks/examples/format-edited.example.sh +13 -0
  254. package/presets/cursor/ios-swift/hooks/examples/secret-guard.example.sh +10 -0
  255. package/presets/cursor/ios-swift/hooks/examples/test-on-save.example.sh +8 -0
  256. package/presets/cursor/ios-swift/rules/agent-team-intake.mdc +1 -1
  257. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +1 -1
  258. package/presets/cursor/ios-swift/rules/code-quality-and-refactoring.mdc +12 -1
  259. package/presets/cursor/ios-swift/rules/code-review-mr.mdc +9 -0
  260. package/presets/cursor/ios-swift/rules/ios-app-core.mdc +5 -28
  261. package/presets/cursor/ios-swift/rules/preset-layering.mdc +1 -1
  262. package/presets/cursor/ios-swift/rules/preset-no-cross-stack-leakage.mdc +6 -4
  263. package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +1 -1
  264. package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +2 -0
  265. package/presets/cursor/ios-swift/rules/reference-features.mdc +4 -0
  266. package/presets/cursor/ios-swift/rules/swift-conventions.mdc +12 -2
  267. package/presets/cursor/ios-swift/rules/swiftui-ui.mdc +8 -0
  268. package/presets/cursor/ios-swift/skills/README.md +1 -0
  269. package/presets/cursor/ios-swift/skills/code-review/SKILL.md +10 -2
  270. package/presets/cursor/ios-swift/skills/feature-delivery/SKILL.md +4 -0
  271. package/presets/cursor/ios-swift/skills/technical-retro/SKILL.md +46 -2
  272. package/presets/cursor/ios-swift/skills/write-adr/SKILL.md +41 -0
  273. package/presets/cursor/ios-swift/team/conventions.md +21 -0
  274. package/presets/cursor/java/AGENTS.md +37 -0
  275. package/presets/cursor/java/BUGBOT.md +11 -0
  276. package/presets/cursor/java/MCP.md +15 -0
  277. package/presets/cursor/java/README.md +26 -0
  278. package/presets/cursor/java/REPO_AGENTS.md +45 -0
  279. package/presets/cursor/java/agents/README.md +36 -0
  280. package/presets/cursor/java/agents/api-contract-reviewer.md +23 -0
  281. package/presets/cursor/java/agents/build-verifier.md +45 -0
  282. package/presets/cursor/java/agents/ci-investigator.md +17 -0
  283. package/presets/cursor/java/agents/code-reviewer.md +40 -0
  284. package/presets/cursor/java/agents/codebase-analyzer.md +28 -0
  285. package/presets/cursor/java/agents/debugger.md +25 -0
  286. package/presets/cursor/java/agents/feature-developer.md +43 -0
  287. package/presets/cursor/java/agents/integration-test-generator.md +22 -0
  288. package/presets/cursor/java/agents/integration-test-healer.md +22 -0
  289. package/presets/cursor/java/agents/integration-test-planner.md +22 -0
  290. package/presets/cursor/java/agents/migration-specialist.md +31 -0
  291. package/presets/cursor/java/agents/performance-auditor.md +22 -0
  292. package/presets/cursor/java/agents/qa-tester.md +24 -0
  293. package/presets/cursor/java/agents/security-reviewer.md +20 -0
  294. package/presets/cursor/java/agents/solution-architect.md +28 -0
  295. package/presets/cursor/java/agents/task-analyst.md +25 -0
  296. package/presets/cursor/java/agents/task-router.md +69 -0
  297. package/presets/cursor/java/agents/tech-writer.md +15 -0
  298. package/presets/cursor/java/agents/unit-test-generator.md +21 -0
  299. package/presets/cursor/java/agents/unit-test-healer.md +13 -0
  300. package/presets/cursor/java/agents/unit-test-planner.md +26 -0
  301. package/presets/cursor/java/commands/README.md +54 -0
  302. package/presets/cursor/java/commands/feature-continue.md +19 -0
  303. package/presets/cursor/java/commands/feature-start.md +33 -0
  304. package/presets/cursor/java/commands/task-continue.md +49 -0
  305. package/presets/cursor/java/commands/task.md +49 -0
  306. package/presets/cursor/java/commands/technical-retro.md +81 -0
  307. package/presets/cursor/java/hooks/README.md +12 -0
  308. package/presets/cursor/java/hooks/chain-team-phases.sh +381 -0
  309. package/presets/cursor/java/hooks/examples/README.md +18 -0
  310. package/presets/cursor/java/hooks/examples/format-edited.example.sh +11 -0
  311. package/presets/cursor/java/hooks/examples/secret-guard.example.sh +10 -0
  312. package/presets/cursor/java/hooks/examples/test-on-save.example.sh +18 -0
  313. package/presets/cursor/java/hooks/guard-shell-command.sh +80 -0
  314. package/presets/cursor/java/hooks.json +17 -0
  315. package/presets/cursor/java/mcp.json +11 -0
  316. package/presets/cursor/java/rules/README.md +97 -0
  317. package/presets/cursor/java/rules/adapters-driven.mdc +40 -0
  318. package/presets/cursor/java/rules/adapters-driving.mdc +40 -0
  319. package/presets/cursor/java/rules/agent-team-intake.mdc +20 -0
  320. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +173 -0
  321. package/presets/cursor/java/rules/api-grpc.mdc +31 -0
  322. package/presets/cursor/java/rules/api-http.mdc +38 -0
  323. package/presets/cursor/java/rules/application-usecases.mdc +34 -0
  324. package/presets/cursor/java/rules/architecture-boundaries.mdc +30 -0
  325. package/presets/cursor/java/rules/code-quality-and-refactoring.mdc +84 -0
  326. package/presets/cursor/java/rules/code-review-mr.mdc +54 -0
  327. package/presets/cursor/java/rules/composition-root.mdc +33 -0
  328. package/presets/cursor/java/rules/design-guidance.mdc +112 -0
  329. package/presets/cursor/java/rules/domain-layer.mdc +40 -0
  330. package/presets/cursor/java/rules/feature-delivery-workflow.mdc +47 -0
  331. package/presets/cursor/java/rules/java-app-core.mdc +33 -0
  332. package/presets/cursor/java/rules/java-conventions.mdc +54 -0
  333. package/presets/cursor/java/rules/java-tooling.mdc +34 -0
  334. package/presets/cursor/java/rules/messaging-adapters.mdc +26 -0
  335. package/presets/cursor/java/rules/module-public-api.mdc +33 -0
  336. package/presets/cursor/java/rules/persistence-adapters.mdc +35 -0
  337. package/presets/cursor/java/rules/ports-interfaces.mdc +36 -0
  338. package/presets/cursor/java/rules/post-change-test.mdc +30 -0
  339. package/presets/cursor/java/rules/preset-layering.mdc +36 -0
  340. package/presets/cursor/java/rules/preset-no-cross-stack-leakage.mdc +56 -0
  341. package/presets/cursor/java/rules/preset-pr-checklist.mdc +39 -0
  342. package/presets/cursor/java/rules/preset-token-budget.mdc +41 -0
  343. package/presets/cursor/java/rules/preset-twin-sync.mdc +44 -0
  344. package/presets/cursor/java/rules/reference-features.mdc +36 -0
  345. package/presets/cursor/java/rules/security-java.mdc +31 -0
  346. package/presets/cursor/java/rules/technical-retro.mdc +14 -0
  347. package/presets/cursor/java/rules/tests-e2e.mdc +24 -0
  348. package/presets/cursor/java/rules/tests-integration.mdc +29 -0
  349. package/presets/cursor/java/rules/tests-unit.mdc +35 -0
  350. package/presets/cursor/java/skills/README.md +5 -0
  351. package/presets/cursor/java/skills/ci-investigation/SKILL.md +11 -0
  352. package/presets/cursor/java/skills/code-review/SKILL.md +25 -0
  353. package/presets/cursor/java/skills/debug-investigation/SKILL.md +15 -0
  354. package/presets/cursor/java/skills/feature-delivery/SKILL.md +30 -0
  355. package/presets/cursor/java/skills/integration-testing/SKILL.md +15 -0
  356. package/presets/cursor/java/skills/technical-retro/SKILL.md +54 -0
  357. package/presets/cursor/java/skills/unit-testing/SKILL.md +14 -0
  358. package/presets/cursor/java/skills/write-adr/SKILL.md +41 -0
  359. package/presets/cursor/java/team/README.md +31 -0
  360. package/presets/cursor/java/team/conventions.md +21 -0
  361. package/presets/cursor/java/team/fixtures/bugfix-standard.json +37 -0
  362. package/presets/cursor/java/team/fixtures/feature-full.json +25 -0
  363. package/presets/cursor/java/team/fixtures/feature-light.json +17 -0
  364. package/presets/cursor/next/AGENTS.md +5 -2
  365. package/presets/cursor/next/README.md +7 -6
  366. package/presets/cursor/next/REPO_AGENTS.md +48 -0
  367. package/presets/cursor/next/agents/README.md +7 -1
  368. package/presets/cursor/next/agents/build-verifier.md +7 -2
  369. package/presets/cursor/next/agents/codebase-analyzer.md +28 -0
  370. package/presets/cursor/next/agents/feature-developer.md +13 -0
  371. package/presets/cursor/next/agents/security-reviewer.md +4 -2
  372. package/presets/cursor/next/commands/README.md +1 -1
  373. package/presets/cursor/next/hooks/README.md +4 -0
  374. package/presets/cursor/next/hooks/examples/README.md +18 -0
  375. package/presets/cursor/next/hooks/examples/format-edited.example.sh +11 -0
  376. package/presets/cursor/next/hooks/examples/secret-guard.example.sh +10 -0
  377. package/presets/cursor/next/hooks/examples/test-on-save.example.sh +8 -0
  378. package/presets/cursor/next/rules/README.md +4 -3
  379. package/presets/cursor/next/rules/agent-team-intake.mdc +1 -1
  380. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +1 -1
  381. package/presets/cursor/next/rules/api-services.mdc +21 -0
  382. package/presets/cursor/next/rules/architecture-boundaries.mdc +27 -0
  383. package/presets/cursor/next/rules/arrow-functions.mdc +13 -28
  384. package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +12 -2
  385. package/presets/cursor/next/rules/code-review-mr.mdc +11 -13
  386. package/presets/cursor/next/rules/http-client.mdc +21 -0
  387. package/presets/cursor/next/rules/layer-barrel-exports.mdc +15 -0
  388. package/presets/cursor/next/rules/next-app-router.mdc +13 -1
  389. package/presets/cursor/next/rules/preset-layering.mdc +1 -1
  390. package/presets/cursor/next/rules/preset-no-cross-stack-leakage.mdc +6 -4
  391. package/presets/cursor/next/rules/preset-pr-checklist.mdc +1 -1
  392. package/presets/cursor/next/rules/preset-twin-sync.mdc +2 -0
  393. package/presets/cursor/next/rules/public-imports.mdc +14 -0
  394. package/presets/cursor/next/rules/react-ui.mdc +20 -0
  395. package/presets/cursor/next/rules/reference-features.mdc +4 -0
  396. package/presets/cursor/next/rules/security-next.mdc +57 -0
  397. package/presets/cursor/next/rules/store-rtk.mdc +19 -0
  398. package/presets/cursor/next/rules/tests-unit.mdc +12 -0
  399. package/presets/cursor/next/skills/README.md +2 -0
  400. package/presets/cursor/next/skills/code-review/SKILL.md +10 -2
  401. package/presets/cursor/next/skills/feature-delivery/SKILL.md +4 -0
  402. package/presets/cursor/next/skills/react-performance/SKILL.md +44 -0
  403. package/presets/cursor/next/skills/technical-retro/SKILL.md +19 -5
  404. package/presets/cursor/next/skills/write-adr/SKILL.md +41 -0
  405. package/presets/cursor/next/team/conventions.md +21 -0
@@ -0,0 +1,112 @@
1
+ ---
2
+ description: Design smells (Fowler) and curated GoF patterns for agents. Load when assessing structure, smells, or pattern fit.
3
+ globs:
4
+ - "**/*.java"
5
+ alwaysApply: false
6
+ ---
7
+
8
+ <!-- shared-core: quality/design-guidance.md -->
9
+
10
+ # Design guidance (smells & patterns)
11
+
12
+ Словарь **code smells** (Fowler) и **design patterns** (GoF) для агентов при implement / review / debug.
13
+
14
+ Применять только в scope задачи или MR. Лёгкий refactor — да; «большой» rewrite без явного запроса — нет.
15
+
16
+ Называть паттерн **только если** репозиторий уже так делает или это минимальный match. Иначе — extract/split/move без ярлыка GoF.
17
+
18
+ Не заменяет always-on Principles в `code-quality-and-refactoring` (KISS, DRY + Rule of Three, YAGNI, SOLID, CUPID, composition, Demeter).
19
+
20
+ ## When to load
21
+
22
+ - **Feature delivery / implement** — оценка структуры модулей, границ и дублирования.
23
+ - **Code review** — smells и pattern fit **в диффе MR**, не по всему репо.
24
+ - **Debug** — root-cause похож на wrong abstraction, Feature Envy, Message Chains, Shotgun Surgery.
25
+ - **Light refactor only** — улучшения в рамках boy-scout / MR scope; не расширять задачу ради каталога.
26
+
27
+ Агенты и skills подгружают stem по one-liner wiring — не копировать этот каталог в промпт агента.
28
+
29
+ ## How to use (agent rules of thumb)
30
+
31
+ 1. Сначала сверить с Principles (always-on): проще ли решение, нет ли ранней абстракции, соблюдён ли public API.
32
+ 2. Затем отметить smells **в изменённых файлах** задачи/MR; предложить fix только если он укладывается в light refactor.
33
+ 3. Паттерн GoF — опциональный ярлык после того, как структура уже ясна; не начинать дизайн с выбора паттерна.
34
+ 4. Если smell и паттерн конфликтуют с границами слоёв стека — побеждают stack boundaries и existing repo patterns.
35
+ 5. Не требовать переименования «под GoF», если поведение уже корректно и читаемо.
36
+
37
+ ## Code smells (Fowler, curated ≤12)
38
+
39
+ Таблица: smell → detect hint → fix hint (одна линия каждый). Без механических меню рефакторинга.
40
+
41
+ | # | Smell | Detect | Fix hint |
42
+ |---|-------|--------|----------|
43
+ | 1 | Duplicate Code | одинаковая логика в ≥2 местах | dedupe после Rule of Three |
44
+ | 2 | Long Method / Long Module | единица делает слишком много | extract в рамках scope; без big rewrite |
45
+ | 3 | Feature Envy | метод чаще трогает чужие данные, чем свои | сдвинуть логику к данным / public API |
46
+ | 4 | Data Clumps | одни и те же группы аргументов кочуют вместе | сгруппировать в type / value object |
47
+ | 5 | Primitive Obsession | сырые string/int вместо доменных понятий | typed ids / value objects при нужде домена |
48
+ | 6 | Speculative Generality | неиспользуемые хуки, флаги, абстракции «на будущее» | удалить (YAGNI) |
49
+ | 7 | Message Chains | цепочки `a.b.c.d` | Demeter; facade / public API модуля |
50
+ | 8 | Middle Man | класс почти только прокидывает вызовы | убрать pass-through **или** оставить как boundary |
51
+ | 9 | Divergent Change | один модуль меняется по разным причинам | split по поводам изменения |
52
+ | 10 | Shotgun Surgery | одно смысловое изменение разъезжается по многим файлам | consolidate ответственность |
53
+ | 11 | Inappropriate Intimacy | доступ к чужим internals / private деталям | только public API / ports / facades |
54
+ | 12 | Refused Bequest / Parallel Inheritance | подтип игнорирует базу; зеркальные иерархии классов | composition; не плодить параллельные деревья |
55
+
56
+ **Skip Fowler (не в core):** Lazy Class, Incomplete Library Class, Comments-as-smell dogma, полный каталог 70+, пошаговые recipe-меню.
57
+
58
+ Приоритет при конфликте smells: Inappropriate Intimacy и Message Chains (границы модулей) > Duplicate Code (после Rule of Three) > Long Method внутри уже правильного модуля.
59
+
60
+ ## Design patterns (GoF, curated ≤8)
61
+
62
+ Suggest only when repo already uses the shape or the match is minimal. Prefer extract-function over naming Strategy ради ярлыка.
63
+
64
+ Паттерны ниже — **разрешённый минимум** для агентов; остальной GoF по умолчанию в Skip.
65
+
66
+ | Pattern | When to suggest | Anti-trigger |
67
+ |---------|-----------------|--------------|
68
+ | Strategy | взаимозаменяемые алгоритмы уже (или явно скоро) выбираются политикой | один алгоритм без ветвления политики |
69
+ | Adapter | обернуть внешний / чужой API под локальный port | лишняя обёртка вокруг своего же API |
70
+ | Facade | упростить multi-step subsystem за public API | facade превращается в god-object |
71
+ | Factory Method | полиморфное создание уже принято в стиле репо | factory на каждый тривиальный `new` |
72
+ | Decorator | аддитивное поведение без взрыва subclass-иерархий | decorator «для слоёв» без реальной нужды |
73
+ | Observer | events / subscriptions уже есть в архитектуре | самодельный pub/sub без прецедента в репо |
74
+ | Template Method | общий algorithm skeleton + вариативные hooks | наследование ради пары отличающихся строк |
75
+ | Composite | дерево однородных узлов (UI/domain), как уже в репо | Composite на плоский список без иерархии |
76
+
77
+ Если сомневаешься между двумя паттернами — выбери более простой extract/compose без имени; ярлык можно добавить на review, если репо уже так говорит.
78
+
79
+ ## Skip / avoid by default
80
+
81
+ | Catalog | Skip |
82
+ |---------|------|
83
+ | GoF | Singleton, Abstract Factory, Flyweight, Memento, Interpreter, Visitor, Bridge, Prototype |
84
+ | GoF (conditional) | Command, Chain of Responsibility, State — упоминать **только если** репо уже использует |
85
+ | Fowler | всё сверх 12 smells выше |
86
+ | DDD | Aggregates, bounded-context maps, event sourcing, CQRS — **не в core** |
87
+ | DDD (pointer) | ubiquitous language anti-pattern — расширять в `feature-delivery-workflow`, не здесь |
88
+ | GRASP | список Larman как отдельные правила — skip (перекрывается SOLID/CUPID) |
89
+ | Clean Code dogma | жёсткие caps на строки функции / «ровно один assert» — skip |
90
+
91
+ Не вводить второй stem (`refactoring-smells` / `design-patterns-for-agents`) — один каталог: `design-guidance`.
92
+
93
+ ## Out of scope for this stem
94
+
95
+ - Полный GoF (23) и полный Fowler catalog.
96
+ - Stack-specific рецепты (пути модулей, lint-команды) — только в **Stack notes** адаптера.
97
+ - Security, a11y, perf — отдельные review-правила; здесь только структурные smells/patterns.
98
+ - Четвёртое always-on правило — запрещено; этот stem только requestable / agent-load.
99
+
100
+ ## Cross-refs
101
+
102
+ - Always-on Principles: `code-quality-and-refactoring`.
103
+ - DIP / ports vs adapters: stack `architecture-boundaries` (детали стека — в Stack notes адаптеров).
104
+ - Ubiquitous language: `feature-delivery-workflow` (lineage).
105
+ - MR checklist (smells in scope; pattern name only if repo uses it): `code-review-mr`.
106
+ - Token / twin policy for authors: `preset-token-budget`, `preset-twin-sync` (meta, not consumer always-on).
107
+
108
+ ## Stack notes
109
+
110
+ - Strategy via small interfaces at **ports**; adapters (Spring/JPA/HTTP) implement, domain stays free of frameworks.
111
+ - Suggest Facade at package public API; avoid Singleton in favor of composition root / `@Configuration` wiring.
112
+ - Prefer records / immutable VOs for Strategy inputs when the repo already uses them — do not invent patterns mid-module.
@@ -0,0 +1,40 @@
1
+ ---
2
+ description: Domain layer invariants for Java hexagonal services
3
+ globs:
4
+ - domain/**/*
5
+ - "**/domain/**/*"
6
+ alwaysApply: false
7
+ ---
8
+
9
+
10
+ # Domain layer
11
+
12
+ - Pure business types and rules; **no I/O**, no Spring, no JPA, no HTTP.
13
+ - Prefer small value objects with validation factories (`of` / `parse` / package-private constructors) that throw typed **domain** exceptions.
14
+ - Domain errors are typed (`RuntimeException` subtypes or a small sealed hierarchy); map to HTTP/gRPC statuses **only** in adapters.
15
+ - Domain services orchestrate entities/VOs without calling outbound ports (ports live in **application**).
16
+ - Keep invariants close to the type that owns them; avoid anemic bags of fields with all logic in use cases.
17
+ - Prefer `record` / immutable types when the repo already uses them; do not invent a new VO style mid-module.
18
+
19
+ ## Forbidden imports
20
+
21
+ - Spring (`org.springframework.*`), Jakarta Servlet / JAX-RS resource types, Spring MVC / WebFlux.
22
+ - JPA (`jakarta.persistence.*`, `EntityManager`), Spring Data repositories, JDBC templates as domain deps.
23
+ - Redis/Kafka/HTTP clients, Jackson `@Json*` / OpenAPI annotations that mirror wire contracts.
24
+ - Framework request-scope / security-context plumbing as a substitute for domain deadlines (prefer explicit types).
25
+
26
+ ## Allowed
27
+
28
+ - JDK: `java.time`, collections, `Optional` sparingly, custom exceptions, pure utilities.
29
+ - Cross-aggregate references by **ID**, not by loading other aggregates via ports.
30
+ - Deadline/time primitives only when the domain API genuinely needs them (prefer application to pass values).
31
+
32
+ ## Plain-Java / alternate frameworks
33
+
34
+ Same rules: domain stays framework-free whether the edge is Spring Boot, Quarkus, Micronaut, or plain JDK.
35
+
36
+ ## Tests
37
+
38
+ - JUnit 5 unit tests (parameterized when covering many cases); **no** DB, `MockMvc`, Testcontainers, or Spring contexts.
39
+ - Cover invalid factory inputs and invariant violations explicitly.
40
+ - Prefer AssertJ when the repo already depends on it.
@@ -0,0 +1,47 @@
1
+ ---
2
+ description: End-to-end delivery checklist for Java hexagonal features
3
+ alwaysApply: false
4
+ ---
5
+
6
+ <!-- shared-core: architecture/feature-delivery-workflow.md -->
7
+
8
+ # Feature delivery (Java hexagonal)
9
+
10
+ Order of work:
11
+
12
+ 1. **Domain** — entities/VOs/errors (`domain-layer`).
13
+ 2. **Application + ports** — use case + outbound interfaces (`application-usecases`, `ports-interfaces`).
14
+ 3. **Driven adapters** — persistence/cache/messaging implementing ports (`adapters-driven`, `persistence-adapters`).
15
+ 4. **Driving adapters** — HTTP/gRPC/CLI mapping DTOs (`adapters-driving`, `api-http`; stubs for gRPC/messaging).
16
+ 5. **Composition root** — wire in `configuration/` / `*Application.java` (`composition-root`).
17
+ 6. **Tests** — unit (domain/app) → integration (adapters) → optional e2e smoke.
18
+ 7. **Gate** — `post-change-test` (+ `java-tooling`).
19
+
20
+ ```mermaid
21
+ flowchart LR
22
+ D[Domain] --> A[Application+Ports]
23
+ A --> Drv[Driven adapters]
24
+ Drv --> A
25
+ HTTP[Driving HTTP] --> A
26
+ CR[Composition root] --> HTTP
27
+ CR --> A
28
+ CR --> Drv
29
+ ```
30
+
31
+ ## Matrix
32
+
33
+ | Path | Rules |
34
+ |------|-------|
35
+ | `**/domain/**` | `domain-layer`, `architecture-boundaries` |
36
+ | `**/application/**` | `application-usecases`, `ports-interfaces` |
37
+ | `**/adapters/inbound/**`, `**/adapters/http/**` | `adapters-driving`, `api-http` / `api-grpc` |
38
+ | `**/adapters/outbound/**`, `**/adapters/persistence/**` | `adapters-driven`, `persistence-adapters` / `messaging-adapters` |
39
+ | `**/configuration/**`, `**/*Application.java` | `composition-root` |
40
+ | After `*.java` edits | `post-change-test` (+ `java-tooling`) |
41
+
42
+ ## Anti-patterns
43
+
44
+ - Framework types in domain; SQL/JPQL in use cases; DI inside controllers; skipping port interfaces “for speed”; returning JPA entities as HTTP bodies.
45
+ - **Ubiquitous language:** Domain names/boundaries reflect the feature domain — do not mix transport/framework terms into domain without need.
46
+ - Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
47
+ - Spring Boot is the default edge; plain Java / Quarkus / Micronaut keep the same layer order with different wiring.
@@ -0,0 +1,33 @@
1
+ ---
2
+ description: Java/Spring Boot hexagonal stack, module layout, and agent entry points
3
+ alwaysApply: true
4
+ ---
5
+
6
+
7
+ # Стек и окружение
8
+
9
+ Версии JDK, Spring Boot и зависимостей — **из `pom.xml` / `build.gradle(.kts)` целевого репозитория**. Рамка preset:
10
+
11
+ - **Язык / платформа:** Java (Maven или Gradle; wrappers `./mvnw` / `./gradlew` предпочтительны).
12
+ - **Default:** Spring Boot **hexagonal** (ports & adapters); domain не знает Spring/JPA/HTTP.
13
+ - **Variants (documented):** plain Java, Quarkus, Micronaut, Jakarta EE — те же границы пакетов.
14
+ - **Layout default:** layer-first single-module; multi-module — documented variant.
15
+ - **Тесты:** JUnit 5 + AssertJ; integration — Testcontainers; REST Assured — optional smoke.
16
+ - **HTTP:** Spring MVC / Jakarta at the edge (примеры, не жёсткий мандат framework).
17
+ - **Static analysis:** discover from repo/CI — do not mandate Checkstyle/SpotBugs/Error Prone.
18
+
19
+ # Структура (default: layer-first)
20
+
21
+ ```text
22
+ src/main/java/<base>/
23
+ domain/
24
+ application/ # use cases + ports
25
+ adapters/inbound/http/
26
+ adapters/outbound/persistence|messaging|external/
27
+ configuration/ # Spring @Configuration / plain composition
28
+ src/test/java/<base>/
29
+ ```
30
+
31
+ **Feature-first variant:** `<feature>/{domain,application,adapters}` — same dependency direction.
32
+
33
+ Границы — **`architecture-boundaries.mdc`**. Tooling — requestable **`java-tooling.mdc`**. После правок Java — **`post-change-test.mdc`**.
@@ -0,0 +1,54 @@
1
+ ---
2
+ description: Idiomatic Java conventions for this hexagonal preset
3
+ globs:
4
+ - "**/*.java"
5
+ alwaysApply: false
6
+ ---
7
+
8
+
9
+ # Java conventions
10
+
11
+ - Follow Effective Java and the repository's formatter / static-analysis config when present.
12
+ - Prefer `record` / immutable value types for DTOs and domain VOs when the repo already uses them.
13
+ - Naming: `PascalCase` types, `camelCase` methods/fields, lowercase package segments; match neighboring packages.
14
+ - Prefer package-private by default; expose only what other modules need via public types.
15
+ - Prefer parameterized JUnit 5 tests (`@ParameterizedTest`) when covering multiple cases.
16
+ - Do not invent library APIs — verify symbols against `pom.xml` / `build.gradle(.kts)` and existing imports (`// VERIFY:` when unsure).
17
+
18
+ ## Errors / exceptions
19
+
20
+ - Prefer unchecked exceptions (`RuntimeException` subtypes) for domain/application failures unless the repo's public API requires checked exceptions.
21
+ - Chain causes (`new X(msg, cause)`); never empty-catch without logging or rethrowing.
22
+ - Prefer domain-specific exception types for structured cases; avoid broad `catch (Exception)`.
23
+ - Map to HTTP/gRPC statuses only in adapters — do not throw `ResponseStatusException` from domain.
24
+
25
+ ## Interfaces / ports
26
+
27
+ - Depend on interfaces (ports) at the call site; return concrete types from factories when simple.
28
+ - Keep interfaces small (ISP); define ports in application, not on every adapter class «just in case».
29
+
30
+ ## Packages
31
+
32
+ - Avoid `util`/`common` dumping grounds — name by domain capability.
33
+ - Keep `@SpringBootApplication` / configuration / `main` thin (see `composition-root`).
34
+ - No static mutable request state; no business logic in static initializers.
35
+
36
+ ## Concurrency
37
+
38
+ - Prefer executor / structured patterns already used in the repo; document cancellation (interrupt, reactive cancel, request-scoped cancel).
39
+ - Do not start unbounded threads/executors from handlers without a shutdown/supervision story.
40
+ - Match existing package patterns for locks / concurrent collections — do not invent frameworks.
41
+
42
+ ## Anti-hallucination
43
+
44
+ | ❌ Avoid | ✅ Prefer |
45
+ |---------|----------|
46
+ | Empty `catch` / ignored failures | Handle, wrap with cause, or declare |
47
+ | Interfaces on every class «just in case» | Ports at consumer / call site |
48
+ | Invented modules not in `pom.xml` / `build.gradle` | Add dependency explicitly or copy existing import |
49
+ | Raw `Object` / untyped `Map` where a typed type fits | Generics / records / domain types used by the repo |
50
+ | Business logic in static initializers | Wire in composition root / Spring config |
51
+
52
+ ## Agent requirement
53
+
54
+ New Java code must stay idiomatic and verifiable against `pom.xml` / `build.gradle` and neighboring packages. Less guessed code is better than more.
@@ -0,0 +1,34 @@
1
+ ---
2
+ description: Java toolchain commands (Maven/Gradle test, verify) — requestable
3
+ globs:
4
+ - "**/*.java"
5
+ - "**/pom.xml"
6
+ - "**/build.gradle"
7
+ - "**/build.gradle.kts"
8
+ alwaysApply: false
9
+ ---
10
+
11
+ # Java tooling (requestable)
12
+
13
+ Before running commands, detect the build tool from the repository:
14
+
15
+ 1. Prefer wrappers when present: `./mvnw`, `./gradlew`.
16
+ 2. `pom.xml` → Maven; `build.gradle` / `build.gradle.kts` → Gradle.
17
+ 3. If both descriptors exist, follow CI/README — do not guess.
18
+ 4. JDK version — from toolchain plugin, `maven.compiler.release` / Gradle toolchain, or CI image.
19
+
20
+ ## Typical commands
21
+
22
+ | Goal | Maven | Gradle |
23
+ |------|-------|--------|
24
+ | Unit/integration tests | `./mvnw test` or `mvn test` | `./gradlew test` |
25
+ | Packaged verify (if configured) | `./mvnw verify` | `./gradlew check` |
26
+ | Compile only | `./mvnw -DskipTests compile` | `./gradlew classes` |
27
+
28
+ Static analysis / formatters (Checkstyle, SpotBugs, Error Prone, Spotless, etc.) — **run only if the repo/CI already configures them**. Do not introduce a new tool as a hard gate.
29
+
30
+ ## Agent requirements
31
+
32
+ - Mandatory after Java edits: **`post-change-test.mdc`**.
33
+ - Never require Playwright, XCUITest, `lint:js`, `lint:css`, or `xcodebuild` as Java handoffs.
34
+ - Integration tests: prefer Testcontainers / Spring test slices — agents `integration-test-*`.
@@ -0,0 +1,26 @@
1
+ ---
2
+ description: Messaging driven/driving adapters for Java hexagonal services (stub)
3
+ globs:
4
+ - "**/adapters/outbound/messaging/**/*"
5
+ - "**/adapters/inbound/messaging/**/*"
6
+ - "**/adapters/messaging/**/*"
7
+ alwaysApply: false
8
+ ---
9
+
10
+
11
+ # Messaging adapters (documented stub)
12
+
13
+ > **Stub (v1):** Light guidance only — not a full Kafka/Rabbit/JMS cookbook. **When to use:** editing `adapters/**/messaging/**` or adding broker publishers/consumers. Prefer expanding this rule when the consumer repo standardizes on a broker.
14
+
15
+ - **Publisher** (driven): implements outbound port; serializes domain events / integration events.
16
+ - **Consumer** (driving): deserializes → calls use case / inbound port; ack/nack policy here.
17
+ - Idempotency keys and retry/DLQ are adapter concerns; document at-least-once assumptions.
18
+ - Do not put broker client types (`KafkaTemplate`, JMS sessions, etc.) in domain or application signatures.
19
+
20
+ ## Event shapes
21
+
22
+ - Prefer explicit event types in application or a small `events` package used by ports — map to wire format in the adapter.
23
+
24
+ ## Tests
25
+
26
+ - Unit-test mapping with fakes; integration against embedded/broker Testcontainers when the repo has them.
@@ -0,0 +1,33 @@
1
+ ---
2
+ description: Public module API and package boundaries for Java services
3
+ globs:
4
+ - "**/api/**/*.java"
5
+ - "**/module-info.java"
6
+ - pom.xml
7
+ - "**/build.gradle*"
8
+ alwaysApply: false
9
+ ---
10
+
11
+
12
+ # Module public API
13
+
14
+ - Published types under a module's public packages are a compatibility surface — change carefully; prefer additive APIs.
15
+ - Service-private code stays in implementation packages — do not treat every package as public API.
16
+ - Prefer package-private by default; expose only what other modules/features need.
17
+ - Do not deep-import another module's internal packages; depend on its published API / facade only.
18
+ - Document breaking Java API changes in CHANGELOG when the repo publishes libraries.
19
+
20
+ ## Single-module default / multi-module variant
21
+
22
+ - **Default:** one deployable module with layer-first packages under `src/main/java/<base>/`.
23
+ - **Multi-module (Maven/Gradle):** each module exposes a narrow public API; application ports may live in an `application-api` module; adapters depend inward. Do not invent multi-module scaffolding unless the repo already uses it.
24
+
25
+ ## pom.xml / build.gradle
26
+
27
+ - Module coordinates and JDK version are SoT for toolchain.
28
+ - Prefer minimal direct deps; pin via BOM / lockfile the repo already uses (`pom.xml`, `build.gradle(.kts)`).
29
+
30
+ ## Cross-feature
31
+
32
+ - Inside one module, features communicate via application ports or small public facades — not by importing sibling feature adapter packages.
33
+ - JPMS `module-info.java` (when present): export only public packages; keep adapters non-exported when possible.
@@ -0,0 +1,35 @@
1
+ ---
2
+ description: Persistence driven adapters (JPA/JDBC/repos) for Java hexagonal services
3
+ globs:
4
+ - "**/adapters/outbound/persistence/**/*"
5
+ - "**/adapters/persistence/**/*"
6
+ - "**/*Repository*.java"
7
+ - "**/*repository*.java"
8
+ alwaysApply: false
9
+ ---
10
+
11
+
12
+ # Persistence adapters
13
+
14
+ - Implement outbound repository ports from application.
15
+ - Use parameterized queries / JPA Criteria / Spring Data methods — **never** string-concatenated SQL with untrusted input.
16
+ - Map rows / JPA entities → **domain** inside the adapter; entities stay private to the adapter package when possible.
17
+ - Transactions: use cases own the boundary (`@Transactional` on application services, or a `UnitOfWork` port). Adapters must not start ad-hoc transactions that hide business atomicity.
18
+ - Migrations live with infra (`db/migration`, Flyway/Liquibase dirs) — **not** in domain.
19
+
20
+ ## Mapping
21
+
22
+ - JPA `@Entity` / JDBC row mappers are adapter-local; do not pass them through port signatures or up into application/domain.
23
+ - Nullability and DB defaults convert to domain values explicitly (no silent nulls into invariants).
24
+ - Spring Data repositories may be used **inside** the adapter as helpers; the application still depends on the port interface, not on `JpaRepository`.
25
+
26
+ ## Forbidden
27
+
28
+ - Importing persistence from domain, or leaking `EntityManager` / `@Entity` / `JdbcTemplate` through port APIs.
29
+ - Building SQL/JPQL strings in use cases.
30
+ - Returning JPA entities from REST controllers “because lazy loading”.
31
+
32
+ ## Tests
33
+
34
+ - Integration tests with Testcontainers / test DB preferred for repos; unit-test mappers with fixtures.
35
+ - Spring `@DataJpaTest` / JDBC slices only when needed — prefer testing through the port implementation.
@@ -0,0 +1,36 @@
1
+ ---
2
+ description: Inbound and outbound port interfaces for Java hexagonal services
3
+ globs:
4
+ - "**/ports/**/*"
5
+ - application/**/*port*
6
+ - "**/application/**/*port*"
7
+ alwaysApply: false
8
+ ---
9
+
10
+
11
+ # Ports (interfaces)
12
+
13
+ ## Outbound (driven)
14
+
15
+ - Repository, cache, publisher, clock, ID generator, external client — defined by **application** (owner of the need).
16
+ - Signatures use **domain** types (or small application DTOs), never JPA `@Entity`, JDBC `ResultSet`, or broker message types.
17
+ - Keep interfaces small (ISP); prefer role interfaces over god-repos (`OrderRepository` vs `EverythingRepository`).
18
+ - Do not put Spring Data / JPA repository interfaces in domain; if Spring Data is used, it stays in the outbound adapter and implements (or is wrapped by) the application port.
19
+
20
+ ## Inbound (driving)
21
+
22
+ - Optional interface wrapping use cases for multiple drivers (HTTP + gRPC + CLI + messaging consumer).
23
+ - Drivers depend on inbound ports / use-case APIs — not on each other.
24
+ - Prefer a concrete use-case class when only one driver exists; extract an interface when a second driver appears (Rule of Three / YAGNI).
25
+
26
+ ## Naming
27
+
28
+ - `saveOrder`, `findOrderById`, `publishOrderPlaced` — verb-oriented; match neighboring package style.
29
+ - Implementation types live in adapters (`JpaOrderRepository`, `JdbcOrderRepository`), not beside the interface in domain.
30
+
31
+ ## Anti-patterns
32
+
33
+ - Ports returning untyped `Map<String, Object>`, raw `JsonNode`, or framework entities.
34
+ - Putting port interfaces inside adapter packages (wrong owner — adapters implement, application defines).
35
+ - Leakage of `EntityManager`, `@Entity`, `JdbcTemplate`, or Redis types through port method signatures.
36
+ - One mega-port “for convenience” that every use case depends on.
@@ -0,0 +1,30 @@
1
+ ---
2
+ description: Mandatory verification after Java code edits (Maven/Gradle test + repo static gates)
3
+ globs:
4
+ - "**/*.java"
5
+ - "**/pom.xml"
6
+ - "**/build.gradle"
7
+ - "**/build.gradle.kts"
8
+ alwaysApply: false
9
+ ---
10
+
11
+ # Post-change test (requestable, mandatory after Java edits)
12
+
13
+ After changing Java sources or build descriptors:
14
+
15
+ 1. Detect Maven vs Gradle via **`java-tooling.mdc`** (wrappers preferred).
16
+ 2. Run the repository test task (`mvn test` / `./gradlew test`, or the CI-documented equivalent).
17
+ 3. If the repo defines a verify/check profile (Failsafe, `check`, Spotless, etc.), run that next.
18
+ 4. Apply **only** formatter/static-analysis steps already wired in the project or CI — do not mandate Checkstyle, SpotBugs, or Error Prone.
19
+
20
+ ## Pass / fail
21
+
22
+ - **PASS:** tests green; configured static gates green (when present).
23
+ - **FAIL:** red tests or configured gate failures — fix before handoff.
24
+ - Do **not** substitute yarn `lint:js`/`lint:css`, Playwright, XCUITest, or `xcodebuild`.
25
+
26
+ ## Related
27
+
28
+ - Tooling discovery: `java-tooling.mdc`
29
+ - Unit: `tests-unit.mdc` (JUnit 5)
30
+ - Integration: `tests-integration.mdc` + `integration-test-*` agents
@@ -0,0 +1,36 @@
1
+ ---
2
+ description: Preset authoring meta-rule (preset-layering)
3
+ globs:
4
+ - packages/ai-rules/presets/**/*
5
+ - .cursor/rules/**/*
6
+ - .cursor/team/tasks/**/*
7
+ alwaysApply: false
8
+ ---
9
+
10
+ <!-- shared-core: meta/preset-layering.md -->
11
+
12
+ # Preset layering
13
+
14
+ Правила для **авторов пресетов** (`packages/ai-rules/presets/**`). Не always-on в consumer apps.
15
+
16
+ ## Слои
17
+
18
+ | Слой | Где | Что класть |
19
+ |------|-----|------------|
20
+ | **Core** | `presets/_shared/core/**` | Stack-agnostic prose + checklists; без frontmatter; без путей `app/**`, `Features/**`, Playwright, xcodebuild |
21
+ | **Stack** | `presets/{cursor\|claude}/<stack>/` | Domain/tooling, always-on trio стека, stack examples в **Stack notes** |
22
+ | **Platform** | Cursor `.mdc` / Claude `.md` | Frontmatter (`alwaysApply`/`globs` vs `paths:`), platform-only (`BUGBOT.md`, `CLAUDE.md`) |
23
+
24
+ ## Куда класть новое правило
25
+
26
+ 1. Общие принципы для всех стеков → **core** + адаптеры с `<!-- shared-core: … -->`.
27
+ 2. Только один из installable стеков (`next` / `ios-swift` / `go` / `java`) → **stack-specific** (не в `_shared`).
28
+ 3. Только Cursor или только Claude packaging → platform artifact / frontmatter, не дублировать семантику.
29
+
30
+ ## SoT
31
+
32
+ - Packages path — SoT; root `.cursor/` — dogfood sync.
33
+ - Per stack: **Cursor** `presets/cursor/<stack>/` → Claude twin same PR.
34
+ - `_shared` **не** `--preset` и не копируется CLI `init`.
35
+
36
+ См. также: `preset-twin-sync`, `preset-token-budget`, `preset-pr-checklist`, `preset-no-cross-stack-leakage`.
@@ -0,0 +1,56 @@
1
+ ---
2
+ description: Preset authoring meta-rule (preset-no-cross-stack-leakage)
3
+ globs:
4
+ - packages/ai-rules/presets/**/*
5
+ - .cursor/rules/**/*
6
+ - .cursor/team/tasks/**/*
7
+ alwaysApply: false
8
+ ---
9
+
10
+ <!-- shared-core: meta/preset-no-cross-stack-leakage.md -->
11
+
12
+ # Preset no cross-stack leakage
13
+
14
+ Запрет протекания stack-specific имён, путей и handoff stems между пресетами.
15
+
16
+ ## Principles
17
+
18
+ - `next` must not require iOS-only agents/tooling (`xcuitest-*`, `xcodebuild` as required handoff, Keychain-only rules).
19
+ - `ios-swift` must not ship Playwright handoffs or Next lint recipes as required commands.
20
+ - `go` / `java` must not ship Playwright, XCUITest, Next lint recipes, or `xcodebuild`/`SwiftLint` as required handoffs.
21
+ - Shared core must not embed stack paths (`app/src/**`, `Features/**`, `playwright`, `xcodebuild`).
22
+
23
+ ## Forbidden in ios-swift hooks/agents (FAIL)
24
+
25
+ In ios-swift `chain-team-phases.sh` / agent handoffs (Cursor + Claude):
26
+
27
+ - `playwright-test-`, `playwright-agents`, `playwright-e2e`, `user-playwright`
28
+ - `app/__tests__/e2e` as a required path
29
+ - Positive yarn recipes `lint:js` / `lint:css` as commands to run (negation prose alone is weak — prefer zero occurrences)
30
+
31
+ Required instead: `xcuitest-test-*` stems; build-verifier mentions `xcodebuild` or `post-change-build` / `xcode-tooling`.
32
+
33
+ ## Forbidden in next hooks/agents (FAIL when present as required)
34
+
35
+ - `xcuitest-test-` as handoff stems
36
+ - Requiring `xcodebuild` / SwiftLint as the default post-change gate for Next app work
37
+
38
+ ## Forbidden in go / java hooks/agents (FAIL)
39
+
40
+ Shared backend-stack bans (both `go` and `java`):
41
+
42
+ - `playwright-test-`, `playwright-e2e`, `user-playwright`, `app/__tests__/e2e`
43
+ - Positive yarn recipes `lint:js` / `lint:css`
44
+ - `xcuitest-test-`, `xcodebuild`, `SwiftLint` as required handoffs
45
+ - Agent file `accessibility-reviewer` (no UI surface)
46
+
47
+ Required instead: `integration-test-*`; build-verifier / `post-change-test` plus stack tooling — `go-tooling` (`go test`, `go vet`) or `java-tooling` (`mvn test` / `./gradlew test`).
48
+
49
+ ## Soft / document
50
+
51
+ - Mentioning the other stack in **docs** comparing presets is OK.
52
+ - `build-verifier` may reference other stacks when validating **preset packaging** (`scope: preset-structure-validation`).
53
+
54
+ ## Chain fork
55
+
56
+ `hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `ios-swift`, `go`, and `java` (per platform).
@@ -0,0 +1,39 @@
1
+ ---
2
+ description: Preset authoring meta-rule (preset-pr-checklist)
3
+ globs:
4
+ - packages/ai-rules/presets/**/*
5
+ - .cursor/rules/**/*
6
+ - .cursor/team/tasks/**/*
7
+ alwaysApply: false
8
+ ---
9
+
10
+ <!-- shared-core: meta/preset-pr-checklist.md -->
11
+
12
+ # Preset PR checklist
13
+
14
+ Чеклист для PR, затрагивающих `packages/ai-rules/presets/**` (и dogfood `.cursor/` sync).
15
+
16
+ ## Before merge
17
+
18
+ - [ ] **SoT:** правки в `packages/…` (не только root `.cursor/`)
19
+ - [ ] **Core:** если менялся `_shared/core/**` — обновлены все `<!-- shared-core: … -->` consumers (или documented intentional fork)
20
+ - [ ] **Twin:** Cursor change → Claude twin **same PR** (**FAIL** if missing on next, ios-swift, go, and java — см. `preset-twin-sync`)
21
+ - [ ] **Mapping:** `claude/<stack>/rules/README.md` mapping table актуален
22
+ - [ ] **Token budget:** alwaysApply / session-start ≤ 3; meta rules not always-on
23
+ - [ ] **Leakage:** нет чужих stack agent stems / handoff strings (`preset-no-cross-stack-leakage`)
24
+ - [ ] **Twin depth:** domain ≥15 lines; thin aliases documented
25
+ - [ ] **README:** stack `rules/README.md` core→stack mapping / catalog updated if stems added
26
+ - [ ] **CHANGELOG / package README:** note when public preset paths or install surface change
27
+ - [ ] **Dogfood:** run `packages/ai-rules/scripts/sync-dogfood-cursor.sh` (or document intentional skip) when maintaining this monorepo
28
+ - [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
29
+
30
+ ## Pointers
31
+
32
+ - Layering: `preset-layering`
33
+ - Sync: `preset-twin-sync`
34
+ - Budget: `preset-token-budget`
35
+ - Leakage: `preset-no-cross-stack-leakage`
36
+ - Validation: stack `agents/build-verifier.md` → preset-structure section
37
+ - Dogfood script: `packages/ai-rules/scripts/sync-dogfood-cursor.sh`
38
+ - Drift script: `packages/ai-rules/scripts/check-shared-core-drift.sh`
39
+ - Orchestrator: when editing presets, load this checklist + twin-sync