@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,48 @@
1
+ # Go — agent instructions
2
+
3
+ Cross-tool repo-root guide. Tool-specific maps stay under `.cursor/AGENTS.md` and `.claude/CLAUDE.md`.
4
+
5
+ ## Cross-tool setup
6
+
7
+ - Treat this file as the **shared** entry for any agent (Cursor, Claude Code, or other).
8
+ - Tool maps live in `.cursor/AGENTS.md` / `.claude/CLAUDE.md` when that tool is installed.
9
+ - Install:
10
+
11
+ ```bash
12
+ npx @bonesofspring/ai-rules init cursor --preset go
13
+ npx @bonesofspring/ai-rules init claude --preset go
14
+ ```
15
+
16
+ `init` overwrites this file from the preset (`REPO_AGENTS.md` → `AGENTS.md`). Living gotchas belong in `team/conventions.md`, not here.
17
+
18
+ ## Commands (test / lint / build)
19
+
20
+ Prefer hexagonal / ports-and-adapters layout from stack rules (`go-app-core`, `architecture-boundaries`).
21
+
22
+ | Gate | Typical command |
23
+ |------|-----------------|
24
+ | Test | `go test ./...` (or package-scoped) |
25
+ | Vet | `go vet ./...` |
26
+ | Lint | **golangci-lint** when configured |
27
+ | Format | `gofmt` / `goimports` |
28
+
29
+ After code edits: invoke **`post-change-test`** (requestable). Full gate: agent `build-verifier`.
30
+
31
+ ## Security basics
32
+
33
+ - Do not commit secrets (tokens, `.env`, private keys).
34
+ - Review destructive git before running; respect shell hooks.
35
+ - Do not weaken CI or skip hooks unless the user explicitly asks.
36
+
37
+ ## Tool entry points
38
+
39
+ | Tool | Map |
40
+ |------|-----|
41
+ | Cursor | `.cursor/AGENTS.md` (optional if Cursor not installed) |
42
+ | Claude Code | `.claude/CLAUDE.md` (optional if Claude not installed) |
43
+
44
+ Rules: `.cursor/rules/` or `.claude/rules/`. Skills: `.cursor/skills/` or `.claude/skills/`.
45
+
46
+ ## Living conventions
47
+
48
+ Gotchas, local patterns, and team decisions: **`.cursor/team/conventions.md`** and/or **`.claude/team/conventions.md`** (fill after init).
@@ -1,8 +1,19 @@
1
1
  # `.cursor/agents` (preset go)
2
2
 
3
+ Ролевые subagents для командного пайплайна Cursor (Go hexagonal).
4
+
5
+ ## Analysis (on-demand)
6
+
7
+ | Agent | Файл | Production-код |
8
+ |-------|------|----------------|
9
+ | Codebase analyzer | `codebase-analyzer.md` | no (explain-as-is only) |
10
+
11
+ ## Roster (21)
12
+
3
13
  | Agent | Production writes |
4
14
  |-------|-------------------|
5
15
  | task-router, task-analyst, solution-architect | team only |
16
+ | codebase-analyzer | no (explain-as-is only) |
6
17
  | feature-developer | yes (Go sources) |
7
18
  | build-verifier | no (report only) |
8
19
  | debugger, ci-investigator | minimal |
@@ -10,6 +21,16 @@
10
21
  | migration-specialist, api-contract-reviewer, tech-writer | team / docs |
11
22
  | qa-tester, unit-test-*, integration-test-* | tests |
12
23
 
13
- **Roster:** 20 agents. **No** `accessibility-reviewer`, Playwright, or XCUITest stems.
24
+ **No** `accessibility-reviewer`, Playwright, or XCUITest stems. Replace those intents with **`integration-test-*`**.
25
+
26
+ ## Frontmatter `readonly`
27
+
28
+ Все agents — **`readonly: false`** (нужна запись в `.cursor/team/**`). Ограничения production — в теле промпта.
29
+
30
+ ## Model matrix (frontmatter `model`)
14
31
 
15
- Replace Playwright/XCUITest intents with **`integration-test-*`**.
32
+ | Tier | Frontmatter | Agents |
33
+ |------|-------------|--------|
34
+ | **cheap** | `fast` | router, analyst, build-verifier, code-reviewer, tech-writer, codebase-analyzer |
35
+ | **standard** | `inherit` | developer, debugger, ci-investigator, api-contract, qa, unit-*, integration-* |
36
+ | **strong** | `claude-opus-4-8[effort=high]` | solution-architect, migration-specialist, security-reviewer, performance-auditor |
@@ -25,6 +25,11 @@ From `packages/ai-rules/`:
25
25
  yarn check:preset-structure
26
26
  ```
27
27
 
28
- Hard gates: twin-map (stacks include **go**), token-budget (alwaysApply/session-start = 3), leakage (`GO_FORBIDDEN_*`, chain forks go≠next≠ios-swift).
28
+ Hard gates: twin-map (stacks include **go**), token-budget (alwaysApply/session-start = 3), leakage (`GO_FORBIDDEN_*`, chain forks go≠next≠ios-swift≠java), shared-core drift (`AI_RULES_DRIFT_FAIL=1` via `check:preset-structure`).
29
29
 
30
30
  Document PASS/FAIL in `validation-report.md`.
31
+
32
+ 1. **Root AGENTS template:** each installable preset (`cursor|claude` × `next|ios-swift|go|java`) must ship `REPO_AGENTS.md` when validating preset packaging → **FAIL** if missing.
33
+ 2. **Hooks cookbook:** default `hooks.json` must **not** reference `hooks/examples/` → **FAIL** if it does.
34
+ 3. **No react-performance on ios/go/java:** skill directory / required handoff must be absent under ios-swift, go, and java → **FAIL** (leakage). Prefer `check:preset-leakage`.
35
+ 4. **Rule eval (WARN):** `scripts/check-rule-eval.mjs` / `yarn check:rule-eval` should exist for maintainers; smoke optional. Hard fail only when the opt-in eval job runs — not part of default `check:preset-structure`.
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: codebase-analyzer
3
+ description: Explains HOW existing Go code works as-is. Use when the user asks how something works, to trace ports/adapters, or document architecture — without suggesting changes. Prefer over /task for pure questions.
4
+ readonly: false
5
+ model: fast
6
+ ---
7
+
8
+ You are a specialist at understanding HOW this Go hexagonal service works. Document implementation details with precise `path:line` references.
9
+
10
+ ## CRITICAL — explain as-is only
11
+
12
+ - DO NOT suggest improvements, refactors, or "better approaches" unless the user explicitly asks.
13
+ - DO NOT perform root-cause analysis or bug hunts unless asked.
14
+ - DO NOT critique quality, performance, or security unless asked.
15
+ - ONLY describe what exists, how it works, and how components interact.
16
+
17
+ ## Workflow
18
+
19
+ 1. Start from entry points the user named (`cmd/`, handlers, use cases, ports).
20
+ 2. Trace domain → application/ports → adapters → composition root as applicable.
21
+ 3. Summarize: purpose, flow, port contracts, adapter placement, conventions observed.
22
+ 4. End with open questions only if facts are missing — not with a wishlist of changes.
23
+
24
+ ## Will / Will not
25
+
26
+ **Will:** map packages, call chains, ports/adapters as they exist today.
27
+
28
+ **Will not:** edit production code; open `/task` pipelines; propose PRs or refactors unprompted; require Next/iOS gates.
@@ -19,6 +19,19 @@ Implement Go features following hexagonal boundaries.
19
19
  - **Don't** import frameworks into domain; don't use SQL in use cases.
20
20
  - **Don't** require Playwright, XCUITest, or yarn lint gates.
21
21
 
22
+ ## Zero improvisation
23
+
24
+ - Implement **only** what the brief / AC / current decomposition task require.
25
+ - If requirements are ambiguous, conflicting, or multi-way — **ask** before coding; do not guess extras as "best practices".
26
+ - Forbidden without explicit AC/task: unrelated security hardening, extra validation, observability, drive-by refactors, new config/env.
27
+ - Boy scout / `design-guidance` improvements stay **within** touched files and must not expand task scope.
28
+
29
+ ## Will / Will not
30
+
31
+ **Will:** follow hexagonal order; add required tests; run `post-change-test` (+ `go-tooling`); update task artifacts.
32
+
33
+ **Will not:** formal code review; invent AC; pull Next/iOS gates; auto-continue the next WP when the pipeline expects a human gate or handoff.
34
+
22
35
  ## Preset packaging
23
36
 
24
37
  When editing ai-rules `presets/**/go/**`, keep Cursor/Claude twins in sync and preserve chain fork ≠ next/ios-swift.
@@ -45,7 +45,7 @@ Slash-команды копируются в `.cursor/commands/` при `ai-rule
45
45
 
46
46
  ## Связанные файлы
47
47
 
48
- - Subagents: `../agents/` (**20** ролей, включая `task-router.md` и `integration-test-{planner,generator,healer}`; без `accessibility-reviewer` / Playwright / XCUITest)
48
+ - Subagents: `../agents/` (**21** ролей, включая `task-router.md`, `codebase-analyzer.md` и `integration-test-{planner,generator,healer}`; без `accessibility-reviewer` / Playwright / XCUITest)
49
49
  - Оркестратор: `../rules/agent-team-orchestrator.mdc`
50
50
  - Skills: `../skills/` (`feature-delivery`, `code-review`, `debug-investigation`, `ci-investigation`, `unit-testing`, `integration-testing`, `technical-retro`)
51
51
  - Артефакты: `../team/README.md` (`pipeline.json`, `status.json`)
@@ -6,3 +6,7 @@
6
6
  | `chain-team-phases.sh` | Auto-chain pipeline steps on `subagentStop` |
7
7
 
8
8
  See root `hooks.json` for registration (`beforeShellExecution`, `subagentStop`).
9
+
10
+ ## Optional cookbook
11
+
12
+ See `hooks/examples/README.md` — secret-guard / format-edited / test-on-save. **Not** in default `hooks.json`.
@@ -0,0 +1,18 @@
1
+ # Hooks cookbook (examples)
2
+
3
+ Optional scripts under `hooks/examples/`. **Not** referenced from default `hooks.json` (only `guard-shell-command.sh` + `chain-team-phases.sh`).
4
+
5
+ | Script | Purpose |
6
+ |--------|---------|
7
+ | `secret-guard.example.sh` | Fail if staged diff looks like secrets |
8
+ | `format-edited.example.sh` | Stack formatter / linter on edited files |
9
+ | `test-on-save.example.sh` | Scoped tests for the stack |
10
+
11
+ ## Wiring (Cursor)
12
+
13
+ 1. Copy an example into `hooks/` (drop `.example` suffix), e.g. `cp hooks/examples/secret-guard.example.sh hooks/secret-guard.sh`.
14
+ 2. `chmod +x hooks/secret-guard.sh`.
15
+ 3. Add a hook entry in `.cursor/hooks.json` (e.g. `beforeShellExecution` or `afterFileEdit` — see Cursor hooks docs).
16
+ 4. Keep cookbook scripts **out** of the default preset `hooks.json` when contributing back upstream.
17
+
18
+ Stack: **go** — recipes must stay stack-safe (no cross-stack lint/test commands).
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+ # Optional: gofmt / golangci-lint on edited packages.
3
+ # NOT in default hooks.json.
4
+ set -euo pipefail
5
+ gofmt -w $(git diff --name-only --diff-filter=ACMR HEAD 2>/dev/null | grep '\.go$' || true) 2>/dev/null || true
6
+ if command -v golangci-lint >/dev/null 2>&1; then
7
+ golangci-lint run ./... 2>/dev/null || true
8
+ fi
9
+ exit 0
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env bash
2
+ # Optional cookbook: block committing likely secrets in staged diffs.
3
+ # NOT wired in default hooks.json — copy to hooks/ and register manually.
4
+ set -euo pipefail
5
+ PATTERN='(AKIA[0-9A-Z]{16}|-----BEGIN (RSA |OPENSSH )?PRIVATE KEY-----|api[_-]?key\s*[:=]\s*['\''\"][^'\''\"]{12,})'
6
+ if git diff --cached -U0 2>/dev/null | grep -Eiq "$PATTERN"; then
7
+ echo "secret-guard: possible secret in staged diff — review before commit" >&2
8
+ exit 1
9
+ fi
10
+ exit 0
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env bash
2
+ # Optional: package-scoped go test for changed packages.
3
+ # NOT in default hooks.json.
4
+ set -euo pipefail
5
+ pkgs=$(git diff --name-only --diff-filter=ACMR HEAD 2>/dev/null | grep '\.go$' | xargs -n1 dirname 2>/dev/null | sort -u | sed 's|^|./|' || true)
6
+ if [[ -n "${pkgs:-}" ]]; then
7
+ go test $pkgs 2>/dev/null || true
8
+ else
9
+ go test ./... 2>/dev/null || true
10
+ fi
11
+ exit 0
@@ -74,11 +74,11 @@ Claude twins + Cursor→Claude map: `presets/claude/go/rules/README.md`. Cross-s
74
74
  | `adapters-driven` | full | high-traffic hexagonal |
75
75
  | `adapters-driving` | full | high-traffic hexagonal |
76
76
  | `composition-root` | stub | |
77
- | `api-http` | stub | |
77
+ | `api-http` | full | thin handlers, resilience, idempotency/bulkhead |
78
78
  | `persistence-adapters` | stub | |
79
79
  | `messaging-adapters` | stub | |
80
80
  | `module-public-api` | stub | |
81
- | `go-conventions` | stub | |
81
+ | `go-conventions` | full | errors, interfaces at call site, anti-hallucination |
82
82
  | `go-tooling` | full | requestable toolchain |
83
83
  | `post-change-test` | full | requestable gate |
84
84
  | `security-go` | stub | |
@@ -11,7 +11,7 @@ When the user message looks like a **work request** (implement, add, fix, refact
11
11
 
12
12
  1. Prefer **`/task <their request>`** or invoke **task-router** first.
13
13
  2. Do not jump straight to coding without router + pipeline when scope is non-trivial.
14
- 3. Pure questions («как работает X», «объясни») — answer normally, no `/task`.
14
+ 3. Pure questions («как работает X», «объясни») — prefer agent **`codebase-analyzer`** (explain-as-is); trivial one-liners may be answered inline. Do not open `/task`.
15
15
 
16
16
  Exceptions: user explicitly says «без pipeline», «просто сделай», or continues an active slug.
17
17
 
@@ -133,7 +133,7 @@ If `pipeline.json` is missing (old `/feature-start` tasks), fall back to fixed p
133
133
 
134
134
  Do **not** run `/task` + router for:
135
135
 
136
- - Pure questions («как работает X», «объясни»).
136
+ - Pure questions («как работает X», «объясни») — prefer agent **`codebase-analyzer`** for deep traces; inline OK for trivial one-liners.
137
137
  - Typo / one-file fix / trivial config with no architecture risk.
138
138
  - User explicitly says «без pipeline», «просто сделай», or continues an active slug.
139
139
  - Single-line `docs-only` with no code impact.
@@ -7,15 +7,21 @@ globs:
7
7
  alwaysApply: false
8
8
  ---
9
9
 
10
-
11
10
  # HTTP API adapters
12
11
 
13
- - Handlers call inbound ports / use cases; return mapped status + body.
14
- - Use consistent error envelope; map domain errors centrally.
12
+ - Handlers are **thin**: parse input, call one inbound port / use case, map status + body.
13
+ - Use consistent error envelope; map **domain exceptions** centrally — do not leak transport types into use cases.
15
14
  - Version routes if the repo already versions (`/v1/...`).
16
15
  - Prefer `net/http` interfaces so tests can use `httptest` without a full framework.
17
16
  - Timeouts: set server read/write timeouts; propagate request context.
18
17
 
18
+ ## Resilience
19
+
20
+ - Side-effect endpoints (charge, create, enqueue): accept/propagate an **idempotency key** when the domain already uses one; document if intentionally omitted.
21
+ - Outbound HTTP to third parties: prefer **per-provider clients** (separate timeouts/pools) — bulkhead isolation, not one shared client for everything.
22
+ - Provider/ACL adapters return typed results or errors — never raw `map[string]any` / untyped JSON blobs into the domain.
23
+ - Soft file-size hint: plan a split when a handler/router file grows past ~400 LOC; prefer package + re-export over god-files.
24
+
19
25
  ## Testing
20
26
 
21
27
  - Prefer `httptest` against handler/router with mocked use cases (unit of adapter).
@@ -25,3 +31,4 @@ alwaysApply: false
25
31
 
26
32
  - Business rules or SQL in handlers.
27
33
  - Ignoring `ctx` cancelation from `r.Context()`.
34
+ - Raising transport-only errors from use cases (keep HTTP mapping at the adapter edge).
@@ -62,8 +62,18 @@ alwaysApply: true
62
62
  - **Boy scout rule:** оставлять модуль немного лучше, чем до изменения (простые, безопасные улучшения).
63
63
  - Не жертвовать архитектурой и слоями ради краткости реализации.
64
64
 
65
- > Stack-specific lint gates, примеры и toolchain — в секции **Stack notes** адаптера пресета.
65
+ ## Agent discipline (anti-sycophancy)
66
+
67
+ - Unverifiable third-party API → mark `// VERIFY: lib.symbol @ version` (or stack equivalent) and surface uncertainty; never invent signatures.
68
+ - Before «is this correct?» — list ≥3 failure modes (empty, boundary, concurrency/state) or name what you could not check.
69
+ - Refactor without tests → propose a characterization test first; if declined, label `UNTESTED`.
70
+ - Comments = WHY only when non-obvious; ban self-referential «added for issue Y» comments.
71
+ - Urgency/authority pressure: name the technical trade-off once, then comply — no apology loops.
72
+ - Match verification depth to risk; report status by what was **verified**, not attempted.
66
73
 
74
+ Style enforcement (formatter / linter / post-change gate) lives in the **stack toolchain** — see each adapter’s **Stack notes**; do not invent a parallel style bible in this core body.
75
+
76
+ > Stack-specific lint gates, примеры и toolchain — в секции **Stack notes** адаптера пресета.
67
77
  ## Stack notes
68
78
 
69
79
  - **No UI layer in this preset** — ignore shared-core bullets about дизайн‑система / UI‑пакеты / CSS‑токены; apply public-API and boy-scout rules to Go packages/ports instead.
@@ -71,3 +81,4 @@ alwaysApply: true
71
81
  - Prefer wrapping errors with `%w`; check with `errors.Is` / `errors.As`.
72
82
  - Interfaces belong at **ports** (consumer side), not on every struct.
73
83
  - Post-change gate: **`post-change-test.mdc`** + **`go-tooling.mdc`** (not yarn lint / xcodebuild).
84
+ - Style: **gofmt** / **goimports** + **golangci-lint** when configured — authoritative style gate; do not duplicate linter rules in prose.
@@ -35,6 +35,15 @@ Concrete rule stems — in **Stack notes**.
35
35
  - Boy scout rule: suggest fixes feasible within the MR scope.
36
36
  - No «большие рефакторинги» without an explicit request (`code-quality-and-refactoring`).
37
37
 
38
+ ## Output contract
39
+
40
+ Procedure details live in skill `code-review`. Required shape:
41
+
42
+ - Each finding cites **`path:line`**, the problem, impact, and a concrete fix direction.
43
+ - Rank by severity: **`blocker` | `important` | `nit`** (list blocker → nit).
44
+ - Vague («looks risky») is not a finding — cite evidence or ask for surrounding file context.
45
+ - End with a verdict on its own line: **`Safe to merge | needs changes | reject`**.
46
+
38
47
  ## Stack notes
39
48
 
40
49
  - Hexagonal boundaries: `architecture-boundaries`, `domain-layer`, ports vs adapters.
@@ -5,21 +5,48 @@ globs:
5
5
  alwaysApply: false
6
6
  ---
7
7
 
8
-
9
8
  # Go conventions
10
9
 
11
10
  - Follow [Effective Go](https://go.dev/doc/effective_go) and repo `golangci-lint` / `staticcheck` when present.
12
11
  - Accept `context.Context` as first param on I/O and use-case methods.
13
- - Wrap errors: `fmt.Errorf("…: %w", err)`; avoid panics in library/service code.
14
12
  - Prefer `camelCase` unexported, `PascalCase` exported; package names short and lowercase.
15
13
  - Do not expose `internal/` outside the module.
16
14
  - Prefer table-driven tests; use `t.Parallel` only when safe.
17
15
 
16
+ ## Errors
17
+
18
+ - Always handle errors — never `_ = err`.
19
+ - Wrap with `fmt.Errorf("…: %w", err)`; check with `errors.Is` / `errors.As`.
20
+ - Prefer domain/custom error types for structured cases; avoid panics in library/service code.
21
+
22
+ ## Interfaces
23
+
24
+ - Accept interfaces, return concrete types.
25
+ - Define interfaces at the **call site** (ports / consumers), not on every implementation.
26
+ - Prefer small, single-method interfaces when they match the use.
27
+
18
28
  ## Packages
19
29
 
20
30
  - Avoid `util`/`common` dumping grounds — name by domain capability.
21
31
  - Keep `main` packages thin (see composition-root).
32
+ - No `init()` for business logic; no package-level mutable state for request data.
22
33
 
23
34
  ## Concurrency
24
35
 
25
- - Document cancelation; do not start unbounded goroutines from handlers without supervision.
36
+ - Document cancelation; `defer cancel()` after creating a derived context.
37
+ - Do not start unbounded goroutines from handlers without a termination condition / supervision (`WaitGroup`, errgroup, or context cancel).
38
+ - Channels for communication, mutexes for shared state — match existing package patterns.
39
+
40
+ ## Anti-hallucination
41
+
42
+ | ❌ Avoid | ✅ Prefer |
43
+ |---------|----------|
44
+ | `_ = err` / ignored errors | Handle or wrap with `%w` |
45
+ | Interfaces on every struct «just in case» | Ports at consumer / call site |
46
+ | Invented modules not in `go.mod` | Add dependency explicitly or copy existing import |
47
+ | `interface{}` where generics or a concrete type fit | Generics / concrete types used by the repo |
48
+ | Business logic in `init()` | Wire in composition root / `main` |
49
+
50
+ ## Agent requirement
51
+
52
+ New Go code must stay idiomatic and verifiable against `go.mod` and neighboring packages. Less guessed code is better than more.
@@ -24,7 +24,7 @@ alwaysApply: false
24
24
  ## Куда класть новое правило
25
25
 
26
26
  1. Общие принципы для всех стеков → **core** + адаптеры с `<!-- shared-core: … -->`.
27
- 2. Только один из installable стеков (`next` / `ios-swift` / `go`) → **stack-specific** (не в `_shared`).
27
+ 2. Только один из installable стеков (`next` / `ios-swift` / `go` / `java`) → **stack-specific** (не в `_shared`).
28
28
  3. Только Cursor или только Claude packaging → platform artifact / frontmatter, не дублировать семантику.
29
29
 
30
30
  ## SoT
@@ -17,7 +17,7 @@ alwaysApply: false
17
17
 
18
18
  - `next` must not require iOS-only agents/tooling (`xcuitest-*`, `xcodebuild` as required handoff, Keychain-only rules).
19
19
  - `ios-swift` must not ship Playwright handoffs or Next lint recipes as required commands.
20
- - `go` must not ship Playwright, XCUITest, Next lint recipes, or `xcodebuild`/`SwiftLint` as required handoffs.
20
+ - `go` / `java` must not ship Playwright, XCUITest, Next lint recipes, or `xcodebuild`/`SwiftLint` as required handoffs.
21
21
  - Shared core must not embed stack paths (`app/src/**`, `Features/**`, `playwright`, `xcodebuild`).
22
22
 
23
23
  ## Forbidden in ios-swift hooks/agents (FAIL)
@@ -35,14 +35,16 @@ Required instead: `xcuitest-test-*` stems; build-verifier mentions `xcodebuild`
35
35
  - `xcuitest-test-` as handoff stems
36
36
  - Requiring `xcodebuild` / SwiftLint as the default post-change gate for Next app work
37
37
 
38
- ## Forbidden in go hooks/agents (FAIL)
38
+ ## Forbidden in go / java hooks/agents (FAIL)
39
+
40
+ Shared backend-stack bans (both `go` and `java`):
39
41
 
40
42
  - `playwright-test-`, `playwright-e2e`, `user-playwright`, `app/__tests__/e2e`
41
43
  - Positive yarn recipes `lint:js` / `lint:css`
42
44
  - `xcuitest-test-`, `xcodebuild`, `SwiftLint` as required handoffs
43
45
  - Agent file `accessibility-reviewer` (no UI surface)
44
46
 
45
- Required instead: `integration-test-*`; build-verifier / `post-change-test` / `go-tooling` (`go test`, `go vet`).
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`).
46
48
 
47
49
  ## Soft / document
48
50
 
@@ -51,8 +53,4 @@ Required instead: `integration-test-*`; build-verifier / `post-change-test` / `g
51
53
 
52
54
  ## Chain fork
53
55
 
54
- `hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `ios-swift`, and `go` (per platform).
55
-
56
- ## Stack notes
57
-
58
- Forbidden positive handoffs on this stack are listed in core § go. Prefer `integration-test-*` and `post-change-test`.
56
+ `hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `ios-swift`, `go`, and `java` (per platform).
@@ -17,7 +17,7 @@ alwaysApply: false
17
17
 
18
18
  - [ ] **SoT:** правки в `packages/…` (не только root `.cursor/`)
19
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, and go — см. `preset-twin-sync`)
20
+ - [ ] **Twin:** Cursor change → Claude twin **same PR** (**FAIL** if missing on next, ios-swift, go, and java — см. `preset-twin-sync`)
21
21
  - [ ] **Mapping:** `claude/<stack>/rules/README.md` mapping table актуален
22
22
  - [ ] **Token budget:** alwaysApply / session-start ≤ 3; meta rules not always-on
23
23
  - [ ] **Leakage:** нет чужих stack agent stems / handoff strings (`preset-no-cross-stack-leakage`)
@@ -20,6 +20,7 @@ Cursor `.mdc` — **SoT per stack**. Claude topic `.md` — derived twin.
20
20
  | `next` | `presets/cursor/next/rules/*.mdc` | `presets/claude/next/rules/<topic>/` | **Required** in `claude/next/rules/README.md` |
21
21
  | `ios-swift` | `presets/cursor/ios-swift/rules/*.mdc` | `presets/claude/ios-swift/rules/<topic>/` | Keep in `claude/ios-swift/rules/README.md` |
22
22
  | `go` | `presets/cursor/go/rules/*.mdc` | `presets/claude/go/rules/<topic>/` | Keep in `claude/go/rules/README.md` |
23
+ | `java` | `presets/cursor/java/rules/*.mdc` | `presets/claude/java/rules/<topic>/` | Keep in `claude/java/rules/README.md` |
23
24
 
24
25
  ## Same-PR checklist
25
26
 
@@ -38,5 +39,6 @@ Cursor `.mdc` — **SoT per stack**. Claude topic `.md` — derived twin.
38
39
  - **next:** missing Claude twin for a changed Cursor rule → **FAIL** (mapping table required).
39
40
  - **ios-swift:** missing Claude twin for a changed Cursor rule → **FAIL**.
40
41
  - **go:** missing Claude twin for a changed Cursor rule → **FAIL** (same as next / ios-swift; mapping table required).
42
+ - **java:** missing Claude twin for a changed Cursor rule → **FAIL** (same as next / ios-swift / go; mapping table required).
41
43
 
42
44
  Dogfood: sync packages → root `.cursor/` after Cursor SoT changes (not the reverse). Use `packages/ai-rules/scripts/sync-dogfood-cursor.sh`.
@@ -22,6 +22,10 @@ Fill TBD paths after adopting this preset in a real service repo.
22
22
  | Unit tests | `*_test.go` beside packages | `**/*_test.go` |
23
23
  | Integration | `**/integration/` | `**/*_integration_test.go` |
24
24
 
25
+ ## Living conventions
26
+
27
+ Post-init gotchas / patterns / decisions: **`.cursor/team/conventions.md`** (and the twin tool path if both Cursor and Claude are installed). Consumer-owned; not always-on. See root `AGENTS.md` § Living conventions.
28
+
25
29
  ## Dogfood scenarios
26
30
 
27
31
  1. `/task` new use case — domain → ports → adapters → wire → `post-change-test`.
@@ -1,5 +1,5 @@
1
1
  # Skills (preset go)
2
2
 
3
- 7 skills: `feature-delivery`, `unit-testing`, `integration-testing`, `ci-investigation`, `debug-investigation`, `code-review`, `technical-retro`.
3
+ 8 skills: `feature-delivery`, `unit-testing`, `integration-testing`, `ci-investigation`, `debug-investigation`, `code-review`, `technical-retro`, `write-adr`.
4
4
 
5
- No `playwright-e2e` / `xcuitest-e2e`.
5
+ No `playwright-e2e` / `xcuitest-e2e` / `react-performance`.
@@ -7,7 +7,16 @@ description: Reviews pull requests and branch diffs for Go hexagonal services us
7
7
 
8
8
  1. Diff-first; load `code-review-mr.mdc` + hexagonal rules.
9
9
  2. Check layer leaks, port ownership, composition root purity, tests, security-sensitive bits.
10
- 3. Write `review.md` with APPROVE or REQUEST_CHANGES.
10
+ 3. **Reuse lens:** flag new helpers that duplicate existing packages/utilities; prefer shared adapters over copy-paste.
11
+ 4. **Efficiency lens:** unnecessary allocations, N+1 I/O, sequential work that should be concurrent, hot-path bloat, missing context cancellation.
12
+ 5. Write `review.md` using the output contract below.
13
+
14
+ ## Output
15
+
16
+ - Each finding: **`path:line`** — problem — impact — concrete fix direction.
17
+ - Severity: **`blocker` | `important` | `nit`** (list blocker → nit).
18
+ - End with a verdict line: **`Safe to merge | needs changes | reject`**.
19
+ - Map agent status: Safe to merge → `completed`; needs changes / reject → `changes_requested`.
11
20
 
12
21
  Never require iOS/Next-only gates (XCUITest, Playwright, `lint:js`).
13
22
 
@@ -17,6 +17,10 @@ description: Delivers Go hexagonal backend features end-to-end across domain, ap
17
17
  - **Don't** put SQL/business rules in HTTP handlers or frameworks in domain.
18
18
  - **Don't** use Playwright, XCUITest, or yarn lint as this stack's gate.
19
19
 
20
+ ## Scope discipline
21
+
22
+ Implement only the current AC / decomposition task. Clarify ambiguity before coding; do not add unrelated hardening or drive-by refactors. See `feature-developer` → **Zero improvisation**.
23
+
20
24
  ## Handoff
21
25
 
22
26
  Summarize by layer + validation. Update `.cursor/team/tasks/<slug>/status.json`.
@@ -5,6 +5,50 @@ description: Facilitates technical retrospectives for tasks, sprints, incidents,
5
5
 
6
6
  # Technical Retro
7
7
 
8
- Same structure as next technical-retro skill. For `/task` pipelines include router, analyst, developer, **build-verifier** (go test), reviewer, QA/integration tests, hooks, rules.
8
+ ## Inputs
9
9
 
10
- Preset feedback: propose updates to `.cursor/rules|agents|skills` do not apply without approval.
10
+ Ask for missing period, focus, task slug, participants, or format constraints. If a slug is provided, read `.cursor/team/tasks/<slug>/` artifacts and local git status/diff. Do not invent facts not present in artifacts or the user's message.
11
+
12
+ ## Facilitation Principles
13
+
14
+ - Focus on process and system behavior, not blame.
15
+ - Separate facts, interpretations, and proposed actions.
16
+ - Balance what worked with what slowed delivery.
17
+ - Keep action items concrete, owned, and measurable.
18
+
19
+ ## Default Structure
20
+
21
+ 1. Goal and scope.
22
+ 2. Timeline or factual observations.
23
+ 3. What worked.
24
+ 4. What hurt quality, speed, or confidence.
25
+ 5. Root causes for the top one or two issues.
26
+ 6. Experiments and action items.
27
+
28
+ ## Agent Team Block
29
+
30
+ For `/task` pipelines, include router, analyst, developer, **build-verifier** (go test), reviewer, QA/integration tests, hooks, and rules.
31
+
32
+ ## Wrong-turn taxonomy (optional)
33
+
34
+ When artifacts or the user mention agent mistakes, tag incidents:
35
+
36
+ | Kind | Signal |
37
+ |------|--------|
38
+ | `correction` | User pushback («no», «don't», «actually») |
39
+ | `retry` | Same tool/approach 2+ times before success |
40
+ | `waste` | Many searches before the right file |
41
+ | `reversal` | Edit then revert / delete |
42
+ | `dead-end` | Env/tool failure (missing binary, wrong path) |
43
+
44
+ Severity: **high** (explicit correction / large waste) · **med** · **low**. Confidence 0–100 — be honest; low-confidence items are optional.
45
+
46
+ ## Preset feedback loop
47
+
48
+ If the same issue appeared in **2+** tasks (or **3+** for packaging a new rule/skill — Rule of Three), add section **Preset updates**:
49
+
50
+ - Proposed change to `.cursor/rules/`, `.cursor/agents/`, `.cursor/skills/`, or **`.cursor/team/conventions.md`** (prefer conventions for project gotchas)
51
+ - One concrete snippet or file path
52
+ - Whether it belongs in always-on vs globs vs skill vs conventions (see `PRESET-CONTRIBUTION` → Building blocks)
53
+
54
+ Do not apply preset or conventions changes without user approval.
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: write-adr
3
+ description: Author an Architecture Decision Record (ADR) with Context, Decision, Consequences, and Links. Use when capturing a durable technical choice for the team.
4
+ ---
5
+
6
+ # Write ADR
7
+
8
+ On-demand skill for durable architecture decisions. Stack-agnostic sections — fill with project-specific paths and links.
9
+
10
+ ## When to use
11
+
12
+ - Choosing between non-trivial alternatives (storage, layering, library, API shape).
13
+ - Recording a decision that future agents/humans should not silently reverse.
14
+ - User asks for an ADR, decision log, or “why did we pick X”.
15
+
16
+ ## Template
17
+
18
+ Create (or append) a short markdown ADR in the repo’s agreed location (e.g. `docs/adr/`, `.cursor/team/`, wiki). Suggested filename: `NNNN-short-title.md`.
19
+
20
+ ```markdown
21
+ # ADR NNNN: <Title>
22
+
23
+ ## Context
24
+ What problem / constraint / force requires a decision?
25
+
26
+ ## Decision
27
+ What we chose (one clear option). Include rejected alternatives briefly if useful.
28
+
29
+ ## Consequences
30
+ Positive and negative outcomes; follow-up work; what becomes harder.
31
+
32
+ ## Links
33
+ Related PRs, issues, rules, prior ADRs, diagrams.
34
+ ```
35
+
36
+ ## Guidelines
37
+
38
+ - Prefer one decision per ADR.
39
+ - Keep Context factual; Decision imperative and short.
40
+ - Link living gotchas to `team/conventions.md` when the decision becomes a recurring local pattern.
41
+ - Do not put ADR bodies only in root `AGENTS.md` (overwrite on init).
@@ -0,0 +1,21 @@
1
+ # Living conventions (team)
2
+
3
+ Consumer-owned store for post-init gotchas, patterns, and decisions. **Not** always-on. Fill after `ai-rules init`. Root `AGENTS.md` only points here.
4
+
5
+ ## Gotchas
6
+
7
+ <!-- e.g. fragile flows, “never do X in this repo” -->
8
+
9
+ -
10
+
11
+ ## Patterns
12
+
13
+ <!-- local patterns beyond reference-features table -->
14
+
15
+ -
16
+
17
+ ## Decisions
18
+
19
+ <!-- short pointers to ADRs / product choices that affect code -->
20
+
21
+ -