@bonesofspring/ai-rules 0.2.5 → 0.2.7

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 (407) hide show
  1. package/CHANGELOG.md +68 -4
  2. package/README.md +21 -3
  3. package/bin/cli.js +30 -1
  4. package/package.json +9 -1
  5. package/presets/_shared/README.md +47 -0
  6. package/presets/_shared/core/agent-team/agent-team-intake.md +9 -0
  7. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +142 -0
  8. package/presets/_shared/core/architecture/feature-delivery-workflow.md +46 -0
  9. package/presets/_shared/core/architecture/reference-features.template.md +43 -0
  10. package/presets/_shared/core/meta/preset-layering.md +25 -0
  11. package/presets/_shared/core/meta/preset-no-cross-stack-leakage.md +43 -0
  12. package/presets/_shared/core/meta/preset-pr-checklist.md +28 -0
  13. package/presets/_shared/core/meta/preset-token-budget.md +30 -0
  14. package/presets/_shared/core/meta/preset-twin-sync.md +31 -0
  15. package/presets/_shared/core/quality/code-quality-and-refactoring.md +69 -0
  16. package/presets/_shared/core/quality/design-guidance.md +97 -0
  17. package/presets/_shared/core/review/code-review-mr.md +38 -0
  18. package/presets/_shared/core/review/technical-retro.md +7 -0
  19. package/presets/claude/go/CLAUDE.md +14 -0
  20. package/presets/claude/go/MCP.md +16 -0
  21. package/presets/claude/go/README.md +38 -0
  22. package/presets/claude/go/REPO_AGENTS.md +48 -0
  23. package/presets/claude/go/agents/README.md +32 -0
  24. package/presets/claude/go/agents/api-contract-reviewer.md +23 -0
  25. package/presets/claude/go/agents/build-verifier.md +35 -0
  26. package/presets/claude/go/agents/ci-investigator.md +17 -0
  27. package/presets/claude/go/agents/code-reviewer.md +40 -0
  28. package/presets/claude/go/agents/codebase-analyzer.md +28 -0
  29. package/presets/claude/go/agents/debugger.md +25 -0
  30. package/presets/claude/go/agents/feature-developer.md +43 -0
  31. package/presets/claude/go/agents/integration-test-generator.md +22 -0
  32. package/presets/claude/go/agents/integration-test-healer.md +22 -0
  33. package/presets/claude/go/agents/integration-test-planner.md +22 -0
  34. package/presets/claude/go/agents/migration-specialist.md +31 -0
  35. package/presets/claude/go/agents/performance-auditor.md +22 -0
  36. package/presets/claude/go/agents/qa-tester.md +24 -0
  37. package/presets/claude/go/agents/security-reviewer.md +20 -0
  38. package/presets/claude/go/agents/solution-architect.md +28 -0
  39. package/presets/claude/go/agents/task-analyst.md +25 -0
  40. package/presets/claude/go/agents/task-router.md +69 -0
  41. package/presets/claude/go/agents/tech-writer.md +15 -0
  42. package/presets/claude/go/agents/unit-test-generator.md +21 -0
  43. package/presets/claude/go/agents/unit-test-healer.md +13 -0
  44. package/presets/claude/go/agents/unit-test-planner.md +26 -0
  45. package/presets/claude/go/commands/README.md +13 -0
  46. package/presets/claude/go/commands/feature-continue.md +51 -0
  47. package/presets/claude/go/commands/feature-start.md +30 -0
  48. package/presets/claude/go/commands/task-continue.md +49 -0
  49. package/presets/claude/go/commands/task.md +49 -0
  50. package/presets/claude/go/commands/technical-retro.md +58 -0
  51. package/presets/claude/go/hooks/README.md +16 -0
  52. package/presets/claude/go/hooks/chain-team-phases.sh +381 -0
  53. package/presets/claude/go/hooks/examples/README.md +18 -0
  54. package/presets/claude/go/hooks/examples/format-edited.example.sh +9 -0
  55. package/presets/claude/go/hooks/examples/secret-guard.example.sh +10 -0
  56. package/presets/claude/go/hooks/examples/test-on-save.example.sh +11 -0
  57. package/presets/claude/go/hooks/guard-shell-command.sh +79 -0
  58. package/presets/claude/go/mcp.json +12 -0
  59. package/presets/claude/go/rules/README.md +60 -0
  60. package/presets/claude/go/rules/api-and-data/README.md +14 -0
  61. package/presets/claude/go/rules/api-and-data/adapters-driven.md +34 -0
  62. package/presets/claude/go/rules/api-and-data/adapters-driving.md +35 -0
  63. package/presets/claude/go/rules/api-and-data/api-grpc.md +27 -0
  64. package/presets/claude/go/rules/api-and-data/api-http.md +33 -0
  65. package/presets/claude/go/rules/api-and-data/messaging-adapters.md +21 -0
  66. package/presets/claude/go/rules/api-and-data/persistence-adapters.md +28 -0
  67. package/presets/claude/go/rules/architecture/README.md +16 -0
  68. package/presets/claude/go/rules/architecture/application-usecases.md +29 -0
  69. package/presets/claude/go/rules/architecture/boundaries.md +29 -0
  70. package/presets/claude/go/rules/architecture/composition-root.md +28 -0
  71. package/presets/claude/go/rules/architecture/domain-layer.md +32 -0
  72. package/presets/claude/go/rules/architecture/feature-delivery.md +51 -0
  73. package/presets/claude/go/rules/architecture/module-public-api.md +23 -0
  74. package/presets/claude/go/rules/architecture/ports-interfaces.md +34 -0
  75. package/presets/claude/go/rules/architecture/reference-features.md +34 -0
  76. package/presets/claude/go/rules/stack/README.md +10 -0
  77. package/presets/claude/go/rules/stack/go-app-core.md +31 -0
  78. package/presets/claude/go/rules/stack/go-conventions.md +51 -0
  79. package/presets/claude/go/rules/testing/README.md +11 -0
  80. package/presets/claude/go/rules/testing/e2e.md +18 -0
  81. package/presets/claude/go/rules/testing/integration.md +23 -0
  82. package/presets/claude/go/rules/testing/unit.md +24 -0
  83. package/presets/claude/go/rules/tooling-and-review/README.md +21 -0
  84. package/presets/claude/go/rules/tooling-and-review/agent-team-intake.md +25 -0
  85. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +161 -0
  86. package/presets/claude/go/rules/tooling-and-review/code-quality.md +83 -0
  87. package/presets/claude/go/rules/tooling-and-review/code-review.md +57 -0
  88. package/presets/claude/go/rules/tooling-and-review/design-guidance.md +110 -0
  89. package/presets/claude/go/rules/tooling-and-review/go-tooling.md +38 -0
  90. package/presets/claude/go/rules/tooling-and-review/post-change-test.md +32 -0
  91. package/presets/claude/go/rules/tooling-and-review/preset-layering.md +36 -0
  92. package/presets/claude/go/rules/tooling-and-review/preset-no-cross-stack-leakage.md +58 -0
  93. package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +39 -0
  94. package/presets/claude/go/rules/tooling-and-review/preset-token-budget.md +41 -0
  95. package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +42 -0
  96. package/presets/claude/go/rules/tooling-and-review/security-go.md +22 -0
  97. package/presets/claude/go/rules/tooling-and-review/technical-retro.md +19 -0
  98. package/presets/claude/go/rules/ui-and-accessibility/README.md +3 -0
  99. package/presets/claude/go/skills/README.md +5 -0
  100. package/presets/claude/go/skills/ci-investigation/SKILL.md +11 -0
  101. package/presets/claude/go/skills/code-review/SKILL.md +25 -0
  102. package/presets/claude/go/skills/debug-investigation/SKILL.md +15 -0
  103. package/presets/claude/go/skills/feature-delivery/SKILL.md +30 -0
  104. package/presets/claude/go/skills/integration-testing/SKILL.md +15 -0
  105. package/presets/claude/go/skills/technical-retro/SKILL.md +54 -0
  106. package/presets/claude/go/skills/unit-testing/SKILL.md +14 -0
  107. package/presets/claude/go/skills/write-adr/SKILL.md +41 -0
  108. package/presets/claude/go/team/README.md +27 -0
  109. package/presets/claude/go/team/conventions.md +21 -0
  110. package/presets/claude/go/team/fixtures/bugfix-standard.json +37 -0
  111. package/presets/claude/go/team/fixtures/feature-full.json +43 -0
  112. package/presets/claude/go/team/fixtures/feature-light.json +17 -0
  113. package/presets/claude/ios-swift/CLAUDE.md +4 -1
  114. package/presets/claude/ios-swift/README.md +12 -1
  115. package/presets/claude/ios-swift/REPO_AGENTS.md +46 -0
  116. package/presets/claude/ios-swift/agents/README.md +3 -2
  117. package/presets/claude/ios-swift/agents/build-verifier.md +23 -8
  118. package/presets/claude/ios-swift/agents/code-reviewer.md +4 -0
  119. package/presets/claude/ios-swift/agents/codebase-analyzer.md +28 -0
  120. package/presets/claude/ios-swift/agents/debugger.md +4 -0
  121. package/presets/claude/ios-swift/agents/feature-developer.md +17 -0
  122. package/presets/claude/ios-swift/agents/migration-specialist.md +4 -0
  123. package/presets/claude/ios-swift/agents/performance-auditor.md +4 -0
  124. package/presets/claude/ios-swift/agents/qa-tester.md +4 -0
  125. package/presets/claude/ios-swift/agents/solution-architect.md +4 -0
  126. package/presets/claude/ios-swift/agents/task-analyst.md +4 -0
  127. package/presets/claude/ios-swift/agents/unit-test-generator.md +4 -0
  128. package/presets/claude/ios-swift/agents/unit-test-healer.md +4 -0
  129. package/presets/claude/ios-swift/agents/unit-test-planner.md +4 -0
  130. package/presets/claude/ios-swift/hooks/README.md +6 -0
  131. package/presets/claude/ios-swift/hooks/examples/README.md +18 -0
  132. package/presets/claude/ios-swift/hooks/examples/format-edited.example.sh +13 -0
  133. package/presets/claude/ios-swift/hooks/examples/secret-guard.example.sh +10 -0
  134. package/presets/claude/ios-swift/hooks/examples/test-on-save.example.sh +8 -0
  135. package/presets/claude/ios-swift/rules/README.md +24 -2
  136. package/presets/claude/ios-swift/rules/architecture/feature-delivery.md +5 -0
  137. package/presets/claude/ios-swift/rules/architecture/reference-features.md +9 -0
  138. package/presets/claude/ios-swift/rules/stack/swift-conventions.md +12 -2
  139. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-intake.md +3 -3
  140. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +8 -1
  141. package/presets/claude/ios-swift/rules/tooling-and-review/code-quality.md +64 -20
  142. package/presets/claude/ios-swift/rules/tooling-and-review/code-review.md +42 -1
  143. package/presets/claude/ios-swift/rules/tooling-and-review/design-guidance.md +110 -0
  144. package/presets/claude/ios-swift/rules/tooling-and-review/preset-layering.md +36 -0
  145. package/presets/claude/ios-swift/rules/tooling-and-review/preset-no-cross-stack-leakage.md +54 -0
  146. package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +39 -0
  147. package/presets/claude/ios-swift/rules/tooling-and-review/preset-token-budget.md +41 -0
  148. package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +42 -0
  149. package/presets/claude/ios-swift/rules/tooling-and-review/technical-retro.md +5 -3
  150. package/presets/claude/ios-swift/rules/ui-and-accessibility/swiftui.md +8 -0
  151. package/presets/claude/ios-swift/skills/README.md +1 -0
  152. package/presets/claude/ios-swift/skills/code-review/SKILL.md +14 -2
  153. package/presets/claude/ios-swift/skills/debug-investigation/SKILL.md +4 -0
  154. package/presets/claude/ios-swift/skills/feature-delivery/SKILL.md +8 -0
  155. package/presets/claude/ios-swift/skills/technical-retro/SKILL.md +46 -2
  156. package/presets/claude/ios-swift/skills/write-adr/SKILL.md +41 -0
  157. package/presets/claude/ios-swift/team/conventions.md +21 -0
  158. package/presets/claude/next/CLAUDE.md +5 -1
  159. package/presets/claude/next/README.md +14 -1
  160. package/presets/claude/next/REPO_AGENTS.md +48 -0
  161. package/presets/claude/next/agents/README.md +7 -1
  162. package/presets/claude/next/agents/build-verifier.md +29 -0
  163. package/presets/claude/next/agents/code-reviewer.md +4 -0
  164. package/presets/claude/next/agents/codebase-analyzer.md +28 -0
  165. package/presets/claude/next/agents/debugger.md +4 -0
  166. package/presets/claude/next/agents/feature-developer.md +17 -0
  167. package/presets/claude/next/agents/migration-specialist.md +4 -0
  168. package/presets/claude/next/agents/performance-auditor.md +4 -0
  169. package/presets/claude/next/agents/qa-tester.md +4 -0
  170. package/presets/claude/next/agents/security-reviewer.md +4 -2
  171. package/presets/claude/next/agents/solution-architect.md +4 -0
  172. package/presets/claude/next/agents/task-analyst.md +4 -0
  173. package/presets/claude/next/agents/unit-test-generator.md +4 -0
  174. package/presets/claude/next/agents/unit-test-healer.md +4 -0
  175. package/presets/claude/next/agents/unit-test-planner.md +4 -0
  176. package/presets/claude/next/hooks/README.md +6 -0
  177. package/presets/claude/next/hooks/examples/README.md +18 -0
  178. package/presets/claude/next/hooks/examples/format-edited.example.sh +11 -0
  179. package/presets/claude/next/hooks/examples/secret-guard.example.sh +10 -0
  180. package/presets/claude/next/hooks/examples/test-on-save.example.sh +8 -0
  181. package/presets/claude/next/rules/README.md +75 -21
  182. package/presets/claude/next/rules/api-and-data/api-services.md +22 -0
  183. package/presets/claude/next/rules/api-and-data/http-client.md +21 -0
  184. package/presets/claude/next/rules/api-and-data/store-rtk.md +20 -0
  185. package/presets/claude/next/rules/architecture/architecture-boundaries.md +28 -0
  186. package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +5 -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 +9 -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 +3 -1
  195. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +8 -1
  196. package/presets/claude/next/rules/tooling-and-review/code-quality.md +58 -20
  197. package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +39 -8
  198. package/presets/claude/next/rules/tooling-and-review/design-guidance.md +110 -0
  199. package/presets/claude/next/rules/tooling-and-review/preset-layering.md +36 -0
  200. package/presets/claude/next/rules/tooling-and-review/preset-no-cross-stack-leakage.md +54 -0
  201. package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +39 -0
  202. package/presets/claude/next/rules/tooling-and-review/preset-token-budget.md +41 -0
  203. package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +42 -0
  204. package/presets/claude/next/rules/tooling-and-review/security-next.md +57 -0
  205. package/presets/claude/next/rules/tooling-and-review/technical-retro.md +16 -0
  206. package/presets/claude/next/rules/ui-and-accessibility/react-ui.md +21 -0
  207. package/presets/claude/next/skills/README.md +2 -0
  208. package/presets/claude/next/skills/code-review/SKILL.md +14 -2
  209. package/presets/claude/next/skills/debug-investigation/SKILL.md +4 -0
  210. package/presets/claude/next/skills/feature-delivery/SKILL.md +8 -0
  211. package/presets/claude/next/skills/react-performance/SKILL.md +44 -0
  212. package/presets/claude/next/skills/technical-retro/SKILL.md +19 -5
  213. package/presets/claude/next/skills/write-adr/SKILL.md +41 -0
  214. package/presets/claude/next/team/conventions.md +21 -0
  215. package/presets/cursor/go/AGENTS.md +30 -0
  216. package/presets/cursor/go/BUGBOT.md +9 -0
  217. package/presets/cursor/go/MCP.md +16 -0
  218. package/presets/cursor/go/README.md +39 -0
  219. package/presets/cursor/go/REPO_AGENTS.md +48 -0
  220. package/presets/cursor/go/agents/README.md +36 -0
  221. package/presets/cursor/go/agents/api-contract-reviewer.md +23 -0
  222. package/presets/cursor/go/agents/build-verifier.md +35 -0
  223. package/presets/cursor/go/agents/ci-investigator.md +17 -0
  224. package/presets/cursor/go/agents/code-reviewer.md +40 -0
  225. package/presets/cursor/go/agents/codebase-analyzer.md +28 -0
  226. package/presets/cursor/go/agents/debugger.md +25 -0
  227. package/presets/cursor/go/agents/feature-developer.md +43 -0
  228. package/presets/cursor/go/agents/integration-test-generator.md +22 -0
  229. package/presets/cursor/go/agents/integration-test-healer.md +22 -0
  230. package/presets/cursor/go/agents/integration-test-planner.md +22 -0
  231. package/presets/cursor/go/agents/migration-specialist.md +31 -0
  232. package/presets/cursor/go/agents/performance-auditor.md +22 -0
  233. package/presets/cursor/go/agents/qa-tester.md +24 -0
  234. package/presets/cursor/go/agents/security-reviewer.md +20 -0
  235. package/presets/cursor/go/agents/solution-architect.md +28 -0
  236. package/presets/cursor/go/agents/task-analyst.md +25 -0
  237. package/presets/cursor/go/agents/task-router.md +69 -0
  238. package/presets/cursor/go/agents/tech-writer.md +15 -0
  239. package/presets/cursor/go/agents/unit-test-generator.md +21 -0
  240. package/presets/cursor/go/agents/unit-test-healer.md +13 -0
  241. package/presets/cursor/go/agents/unit-test-planner.md +26 -0
  242. package/presets/cursor/go/commands/README.md +54 -0
  243. package/presets/cursor/go/commands/feature-continue.md +19 -0
  244. package/presets/cursor/go/commands/feature-start.md +33 -0
  245. package/presets/cursor/go/commands/task-continue.md +49 -0
  246. package/presets/cursor/go/commands/task.md +49 -0
  247. package/presets/cursor/go/commands/technical-retro.md +81 -0
  248. package/presets/cursor/go/hooks/README.md +12 -0
  249. package/presets/cursor/go/hooks/chain-team-phases.sh +381 -0
  250. package/presets/cursor/go/hooks/examples/README.md +18 -0
  251. package/presets/cursor/go/hooks/examples/format-edited.example.sh +9 -0
  252. package/presets/cursor/go/hooks/examples/secret-guard.example.sh +10 -0
  253. package/presets/cursor/go/hooks/examples/test-on-save.example.sh +11 -0
  254. package/presets/cursor/go/hooks/guard-shell-command.sh +79 -0
  255. package/presets/cursor/go/hooks.json +17 -0
  256. package/presets/cursor/go/mcp.json +11 -0
  257. package/presets/cursor/go/rules/README.md +89 -0
  258. package/presets/cursor/go/rules/adapters-driven.mdc +35 -0
  259. package/presets/cursor/go/rules/adapters-driving.mdc +36 -0
  260. package/presets/cursor/go/rules/agent-team-intake.mdc +20 -0
  261. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +156 -0
  262. package/presets/cursor/go/rules/api-grpc.mdc +28 -0
  263. package/presets/cursor/go/rules/api-http.mdc +34 -0
  264. package/presets/cursor/go/rules/application-usecases.mdc +30 -0
  265. package/presets/cursor/go/rules/architecture-boundaries.mdc +30 -0
  266. package/presets/cursor/go/rules/code-quality-and-refactoring.mdc +84 -0
  267. package/presets/cursor/go/rules/code-review-mr.mdc +52 -0
  268. package/presets/cursor/go/rules/composition-root.mdc +29 -0
  269. package/presets/cursor/go/rules/design-guidance.mdc +111 -0
  270. package/presets/cursor/go/rules/domain-layer.mdc +33 -0
  271. package/presets/cursor/go/rules/feature-delivery-workflow.mdc +46 -0
  272. package/presets/cursor/go/rules/go-app-core.mdc +32 -0
  273. package/presets/cursor/go/rules/go-conventions.mdc +52 -0
  274. package/presets/cursor/go/rules/go-tooling.mdc +33 -0
  275. package/presets/cursor/go/rules/messaging-adapters.mdc +22 -0
  276. package/presets/cursor/go/rules/module-public-api.mdc +24 -0
  277. package/presets/cursor/go/rules/persistence-adapters.mdc +29 -0
  278. package/presets/cursor/go/rules/ports-interfaces.mdc +35 -0
  279. package/presets/cursor/go/rules/post-change-test.mdc +27 -0
  280. package/presets/cursor/go/rules/preset-layering.mdc +36 -0
  281. package/presets/cursor/go/rules/preset-no-cross-stack-leakage.mdc +58 -0
  282. package/presets/cursor/go/rules/preset-pr-checklist.mdc +39 -0
  283. package/presets/cursor/go/rules/preset-token-budget.mdc +41 -0
  284. package/presets/cursor/go/rules/preset-twin-sync.mdc +42 -0
  285. package/presets/cursor/go/rules/reference-features.mdc +35 -0
  286. package/presets/cursor/go/rules/security-go.mdc +23 -0
  287. package/presets/cursor/go/rules/technical-retro.mdc +14 -0
  288. package/presets/cursor/go/rules/tests-e2e.mdc +19 -0
  289. package/presets/cursor/go/rules/tests-integration.mdc +24 -0
  290. package/presets/cursor/go/rules/tests-unit.mdc +25 -0
  291. package/presets/cursor/go/skills/README.md +5 -0
  292. package/presets/cursor/go/skills/ci-investigation/SKILL.md +11 -0
  293. package/presets/cursor/go/skills/code-review/SKILL.md +25 -0
  294. package/presets/cursor/go/skills/debug-investigation/SKILL.md +15 -0
  295. package/presets/cursor/go/skills/feature-delivery/SKILL.md +30 -0
  296. package/presets/cursor/go/skills/integration-testing/SKILL.md +15 -0
  297. package/presets/cursor/go/skills/technical-retro/SKILL.md +54 -0
  298. package/presets/cursor/go/skills/unit-testing/SKILL.md +14 -0
  299. package/presets/cursor/go/skills/write-adr/SKILL.md +41 -0
  300. package/presets/cursor/go/team/README.md +31 -0
  301. package/presets/cursor/go/team/conventions.md +21 -0
  302. package/presets/cursor/go/team/fixtures/bugfix-standard.json +37 -0
  303. package/presets/cursor/go/team/fixtures/feature-full.json +43 -0
  304. package/presets/cursor/go/team/fixtures/feature-light.json +17 -0
  305. package/presets/cursor/ios-swift/AGENTS.md +5 -2
  306. package/presets/cursor/ios-swift/README.md +13 -5
  307. package/presets/cursor/ios-swift/REPO_AGENTS.md +46 -0
  308. package/presets/cursor/ios-swift/agents/README.md +3 -2
  309. package/presets/cursor/ios-swift/agents/build-verifier.md +23 -8
  310. package/presets/cursor/ios-swift/agents/code-reviewer.md +4 -0
  311. package/presets/cursor/ios-swift/agents/codebase-analyzer.md +28 -0
  312. package/presets/cursor/ios-swift/agents/debugger.md +4 -0
  313. package/presets/cursor/ios-swift/agents/feature-developer.md +17 -0
  314. package/presets/cursor/ios-swift/agents/migration-specialist.md +4 -0
  315. package/presets/cursor/ios-swift/agents/performance-auditor.md +4 -0
  316. package/presets/cursor/ios-swift/agents/qa-tester.md +4 -0
  317. package/presets/cursor/ios-swift/agents/solution-architect.md +4 -0
  318. package/presets/cursor/ios-swift/agents/task-analyst.md +4 -0
  319. package/presets/cursor/ios-swift/agents/unit-test-generator.md +4 -0
  320. package/presets/cursor/ios-swift/agents/unit-test-healer.md +4 -0
  321. package/presets/cursor/ios-swift/agents/unit-test-planner.md +4 -0
  322. package/presets/cursor/ios-swift/commands/README.md +1 -1
  323. package/presets/cursor/ios-swift/hooks/README.md +4 -0
  324. package/presets/cursor/ios-swift/hooks/examples/README.md +18 -0
  325. package/presets/cursor/ios-swift/hooks/examples/format-edited.example.sh +13 -0
  326. package/presets/cursor/ios-swift/hooks/examples/secret-guard.example.sh +10 -0
  327. package/presets/cursor/ios-swift/hooks/examples/test-on-save.example.sh +8 -0
  328. package/presets/cursor/ios-swift/rules/README.md +23 -2
  329. package/presets/cursor/ios-swift/rules/agent-team-intake.mdc +3 -3
  330. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +9 -3
  331. package/presets/cursor/ios-swift/rules/code-quality-and-refactoring.mdc +64 -20
  332. package/presets/cursor/ios-swift/rules/code-review-mr.mdc +41 -0
  333. package/presets/cursor/ios-swift/rules/design-guidance.mdc +111 -0
  334. package/presets/cursor/ios-swift/rules/feature-delivery-workflow.mdc +6 -0
  335. package/presets/cursor/ios-swift/rules/preset-layering.mdc +36 -0
  336. package/presets/cursor/ios-swift/rules/preset-no-cross-stack-leakage.mdc +54 -0
  337. package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +39 -0
  338. package/presets/cursor/ios-swift/rules/preset-token-budget.mdc +41 -0
  339. package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +42 -0
  340. package/presets/cursor/ios-swift/rules/reference-features.mdc +10 -0
  341. package/presets/cursor/ios-swift/rules/swift-conventions.mdc +12 -2
  342. package/presets/cursor/ios-swift/rules/swiftui-ui.mdc +8 -0
  343. package/presets/cursor/ios-swift/rules/technical-retro.mdc +4 -2
  344. package/presets/cursor/ios-swift/skills/README.md +1 -0
  345. package/presets/cursor/ios-swift/skills/code-review/SKILL.md +14 -2
  346. package/presets/cursor/ios-swift/skills/debug-investigation/SKILL.md +4 -0
  347. package/presets/cursor/ios-swift/skills/feature-delivery/SKILL.md +8 -0
  348. package/presets/cursor/ios-swift/skills/technical-retro/SKILL.md +46 -2
  349. package/presets/cursor/ios-swift/skills/write-adr/SKILL.md +41 -0
  350. package/presets/cursor/ios-swift/team/conventions.md +21 -0
  351. package/presets/cursor/next/AGENTS.md +5 -2
  352. package/presets/cursor/next/README.md +47 -0
  353. package/presets/cursor/next/REPO_AGENTS.md +48 -0
  354. package/presets/cursor/next/agents/README.md +7 -1
  355. package/presets/cursor/next/agents/build-verifier.md +29 -0
  356. package/presets/cursor/next/agents/code-reviewer.md +4 -0
  357. package/presets/cursor/next/agents/codebase-analyzer.md +28 -0
  358. package/presets/cursor/next/agents/debugger.md +4 -0
  359. package/presets/cursor/next/agents/feature-developer.md +17 -0
  360. package/presets/cursor/next/agents/migration-specialist.md +4 -0
  361. package/presets/cursor/next/agents/performance-auditor.md +4 -0
  362. package/presets/cursor/next/agents/qa-tester.md +4 -0
  363. package/presets/cursor/next/agents/security-reviewer.md +4 -2
  364. package/presets/cursor/next/agents/solution-architect.md +4 -0
  365. package/presets/cursor/next/agents/task-analyst.md +4 -0
  366. package/presets/cursor/next/agents/unit-test-generator.md +4 -0
  367. package/presets/cursor/next/agents/unit-test-healer.md +4 -0
  368. package/presets/cursor/next/agents/unit-test-planner.md +4 -0
  369. package/presets/cursor/next/commands/README.md +1 -1
  370. package/presets/cursor/next/hooks/README.md +4 -0
  371. package/presets/cursor/next/hooks/examples/README.md +18 -0
  372. package/presets/cursor/next/hooks/examples/format-edited.example.sh +11 -0
  373. package/presets/cursor/next/hooks/examples/secret-guard.example.sh +10 -0
  374. package/presets/cursor/next/hooks/examples/test-on-save.example.sh +8 -0
  375. package/presets/cursor/next/rules/README.md +24 -3
  376. package/presets/cursor/next/rules/agent-team-intake.mdc +3 -1
  377. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +9 -3
  378. package/presets/cursor/next/rules/api-services.mdc +21 -0
  379. package/presets/cursor/next/rules/architecture-boundaries.mdc +27 -0
  380. package/presets/cursor/next/rules/arrow-functions.mdc +13 -28
  381. package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +55 -18
  382. package/presets/cursor/next/rules/code-review-mr.mdc +39 -9
  383. package/presets/cursor/next/rules/design-guidance.mdc +111 -0
  384. package/presets/cursor/next/rules/feature-delivery-workflow.mdc +6 -0
  385. package/presets/cursor/next/rules/http-client.mdc +21 -0
  386. package/presets/cursor/next/rules/layer-barrel-exports.mdc +15 -0
  387. package/presets/cursor/next/rules/next-app-router.mdc +13 -1
  388. package/presets/cursor/next/rules/preset-layering.mdc +36 -0
  389. package/presets/cursor/next/rules/preset-no-cross-stack-leakage.mdc +54 -0
  390. package/presets/cursor/next/rules/preset-pr-checklist.mdc +39 -0
  391. package/presets/cursor/next/rules/preset-token-budget.mdc +41 -0
  392. package/presets/cursor/next/rules/preset-twin-sync.mdc +42 -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 +10 -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/technical-retro.mdc +5 -3
  399. package/presets/cursor/next/rules/tests-unit.mdc +12 -0
  400. package/presets/cursor/next/skills/README.md +2 -0
  401. package/presets/cursor/next/skills/code-review/SKILL.md +14 -2
  402. package/presets/cursor/next/skills/debug-investigation/SKILL.md +4 -0
  403. package/presets/cursor/next/skills/feature-delivery/SKILL.md +8 -0
  404. package/presets/cursor/next/skills/react-performance/SKILL.md +44 -0
  405. package/presets/cursor/next/skills/technical-retro/SKILL.md +19 -5
  406. package/presets/cursor/next/skills/write-adr/SKILL.md +41 -0
  407. package/presets/cursor/next/team/conventions.md +21 -0
@@ -0,0 +1,14 @@
1
+ # API and data
2
+
3
+ Driving/driven adapters. Index only.
4
+
5
+ | File | Cursor SoT |
6
+ |------|------------|
7
+ | [`adapters-driving.md`](./adapters-driving.md) | `adapters-driving.mdc` |
8
+ | [`adapters-driven.md`](./adapters-driven.md) | `adapters-driven.mdc` |
9
+ | [`api-http.md`](./api-http.md) | `api-http.mdc` |
10
+ | [`api-grpc.md`](./api-grpc.md) | `api-grpc.mdc` |
11
+ | [`persistence-adapters.md`](./persistence-adapters.md) | `persistence-adapters.mdc` |
12
+ | [`messaging-adapters.md`](./messaging-adapters.md) | `messaging-adapters.mdc` |
13
+
14
+ Full map: [`../README.md`](../README.md).
@@ -0,0 +1,34 @@
1
+ ---
2
+ description: Driven adapters (persistence, cache, messaging) for Go hexagonal services
3
+ paths:
4
+ - internal/adapters/persistence/**/*
5
+ - **/adapters/persistence/**/*
6
+ - **/adapters/cache/**/*
7
+ - **/adapters/messaging/**/*
8
+ ---
9
+
10
+
11
+ # Driven adapters
12
+
13
+ - Implement application **outbound ports**.
14
+ - Map storage/broker models → domain at the boundary; never return ORM structs to application.
15
+ - Handle retries/timeouts/idempotency here when infrastructure-specific.
16
+ - Wrap driver errors with context; translate to domain/application errors when meaningful.
17
+ - Honor `context.Context` cancellation and deadlines from the application call.
18
+
19
+ ## Persistence
20
+
21
+ - See `persistence-adapters.md` for SQL/transactions.
22
+ - Keep SQL/query builders inside the adapter package; application sees only port methods.
23
+
24
+ ## Cache / messaging
25
+
26
+ - Cache keys and serialization are adapter concerns.
27
+ - Publishers implement port `PublishX`; consumers are driving adapters if they trigger use cases.
28
+ - Prefer idempotent publish/consume handlers when brokers may redeliver.
29
+
30
+ ## Forbidden
31
+
32
+ - Calling other driven adapters bypassing application (hidden coupling).
33
+ - Leaking `*sql.Rows` / Redis types through port signatures.
34
+ - Embedding business invariants that belong in domain (e.g. discount rules in SQL only).
@@ -0,0 +1,35 @@
1
+ ---
2
+ description: Driving adapters (HTTP, gRPC, CLI) for Go hexagonal services
3
+ paths:
4
+ - internal/adapters/http/**/*
5
+ - **/adapters/http/**/*
6
+ - **/adapters/grpc/**/*
7
+ - cmd/**/*
8
+ ---
9
+
10
+
11
+ # Driving adapters
12
+
13
+ - Translate transport → application calls → transport response.
14
+ - Map request/response DTOs at the edge; do not pass framework types into use cases.
15
+ - AuthN/AuthZ and validation of wire format belong here (or dedicated middleware); domain validation stays in domain.
16
+ - Errors: map domain/application errors to status codes once (central mapper preferred).
17
+ - Keep handlers thin: decode → call use case → encode; no multi-step workflows in the adapter.
18
+
19
+ ## HTTP
20
+
21
+ - See `api-http.md`. Prefer thin handlers; routing table in one place.
22
+ - Framework examples (chi/gin/echo) are optional — match the repo.
23
+ - Bind path/query/body into request DTOs before calling application.
24
+
25
+ ## gRPC / CLI
26
+
27
+ - Same mapping rules; see thin `api-grpc.md` for protobuf notes.
28
+ - CLI `cmd` tools may call composition root or inbound ports — no SQL in `main`.
29
+ - Propagate cancellation from the transport `context` into use-case calls.
30
+
31
+ ## Forbidden
32
+
33
+ - SQL or business invariants inside handlers.
34
+ - Importing persistence packages from HTTP handlers (wire via application).
35
+ - Swallowing errors without mapping to a transport status / log field.
@@ -0,0 +1,27 @@
1
+ ---
2
+ description: Thin gRPC/protobuf extension notes for Go hexagonal services (HTTP-first v1)
3
+ paths:
4
+ - **/*.proto
5
+ - **/adapters/grpc/**/*
6
+ ---
7
+
8
+
9
+ # gRPC adapters (extension stub)
10
+
11
+ HTTP is the **v1 SoT** for this preset. gRPC is supported as an optional driving adapter with the same hexagonal rules.
12
+
13
+ ## Requirements when adding gRPC
14
+
15
+ 1. Keep protobuf messages in the adapter (or `api/proto`); map to domain/application at the edge.
16
+ 2. Implement the same inbound ports / use cases as HTTP — do not fork business logic.
17
+ 3. Map gRPC status codes from domain/application errors (parity with HTTP mapper).
18
+ 4. Generate code via repo-standard `buf` / `protoc` scripts — do not hand-edit `*.pb.go` unless the repo requires it.
19
+
20
+ ## Non-goals (v1)
21
+
22
+ - Full protobuf style guide and streaming patterns — extend this rule when the consumer repo adopts gRPC widely.
23
+ - Mandating gRPC over HTTP.
24
+
25
+ ## Ports
26
+
27
+ - Prefer shared application use cases; gRPC service struct is a driving adapter only.
@@ -0,0 +1,33 @@
1
+ ---
2
+ description: HTTP API adapter conventions for Go hexagonal services
3
+ paths:
4
+ - **/adapters/http/**/*
5
+ - **/*handler*.go
6
+ - **/*router*.go
7
+ ---
8
+
9
+ # HTTP API adapters
10
+
11
+ - Handlers are **thin**: parse input, call one inbound port / use case, map status + body.
12
+ - Use consistent error envelope; map **domain exceptions** centrally — do not leak transport types into use cases.
13
+ - Version routes if the repo already versions (`/v1/...`).
14
+ - Prefer `net/http` interfaces so tests can use `httptest` without a full framework.
15
+ - Timeouts: set server read/write timeouts; propagate request context.
16
+
17
+ ## Resilience
18
+
19
+ - Side-effect endpoints (charge, create, enqueue): accept/propagate an **idempotency key** when the domain already uses one; document if intentionally omitted.
20
+ - Outbound HTTP to third parties: prefer **per-provider clients** (separate timeouts/pools) — bulkhead isolation, not one shared client for everything.
21
+ - Provider/ACL adapters return typed results or errors — never raw `map[string]any` / untyped JSON blobs into the domain.
22
+ - Soft file-size hint: plan a split when a handler/router file grows past ~400 LOC; prefer package + re-export over god-files.
23
+
24
+ ## Testing
25
+
26
+ - Prefer `httptest` against handler/router with mocked use cases (unit of adapter).
27
+ - Integration: real router + test doubles or testcontainers behind driven ports.
28
+
29
+ ## Forbidden
30
+
31
+ - Business rules or SQL in handlers.
32
+ - Ignoring `ctx` cancelation from `r.Context()`.
33
+ - Raising transport-only errors from use cases (keep HTTP mapping at the adapter edge).
@@ -0,0 +1,21 @@
1
+ ---
2
+ description: Messaging driven/driving adapters for Go hexagonal services
3
+ paths:
4
+ - **/adapters/messaging/**/*
5
+ ---
6
+
7
+
8
+ # Messaging adapters
9
+
10
+ - **Publisher** (driven): implements outbound port; serializes domain events / integration events.
11
+ - **Consumer** (driving): deserializes → calls use case / inbound port; ack/nack policy here.
12
+ - Idempotency keys and retry/DLQ are adapter concerns; document at-least-once assumptions.
13
+ - Do not put broker client types in domain or application signatures.
14
+
15
+ ## Event shapes
16
+
17
+ - Prefer explicit event structs in application or a small `events` package used by ports — map to wire format in the adapter.
18
+
19
+ ## Tests
20
+
21
+ - Unit-test mapping with fakes; integration against embedded/broker test duals when the repo has them.
@@ -0,0 +1,28 @@
1
+ ---
2
+ description: Persistence driven adapters (SQL/repos) for Go hexagonal services
3
+ paths:
4
+ - **/adapters/persistence/**/*
5
+ - **/*repository*.go
6
+ ---
7
+
8
+
9
+ # Persistence adapters
10
+
11
+ - Implement outbound repository ports from application.
12
+ - Use parameterized queries; map rows → domain entities inside the adapter.
13
+ - Transactions: expose via port (`Transactional`, `UnitOfWork`) implemented here — use cases call the port, not `*sql.Tx` directly.
14
+ - Migrations live with infra (separate package/dir) — not in domain.
15
+
16
+ ## Mapping
17
+
18
+ - Persistence models (db tags) stay private to the adapter package when possible.
19
+ - Nullability and DB defaults converted to domain values explicitly.
20
+
21
+ ## Forbidden
22
+
23
+ - Importing persistence from domain or leaking `*sql.DB` through port APIs.
24
+ - Building SQL strings in use cases.
25
+
26
+ ## Tests
27
+
28
+ - Integration tests with testcontainers / test DB preferred for repos; unit-test mappers with fixtures.
@@ -0,0 +1,16 @@
1
+ # Architecture
2
+
3
+ Hexagonal boundaries and delivery. Index only.
4
+
5
+ | File | Cursor SoT |
6
+ |------|------------|
7
+ | [`boundaries.md`](./boundaries.md) | `architecture-boundaries.mdc` |
8
+ | [`feature-delivery.md`](./feature-delivery.md) | `feature-delivery-workflow.mdc` |
9
+ | [`reference-features.md`](./reference-features.md) | `reference-features.mdc` |
10
+ | [`domain-layer.md`](./domain-layer.md) | `domain-layer.mdc` |
11
+ | [`application-usecases.md`](./application-usecases.md) | `application-usecases.mdc` |
12
+ | [`ports-interfaces.md`](./ports-interfaces.md) | `ports-interfaces.mdc` |
13
+ | [`composition-root.md`](./composition-root.md) | `composition-root.mdc` |
14
+ | [`module-public-api.md`](./module-public-api.md) | `module-public-api.mdc` |
15
+
16
+ Full map: [`../README.md`](../README.md).
@@ -0,0 +1,29 @@
1
+ ---
2
+ description: Application use cases and orchestration in Go hexagonal services
3
+ paths:
4
+ - internal/application/**/*
5
+ - **/application/**/*
6
+ ---
7
+
8
+
9
+ # Application / use cases
10
+
11
+ - One use case ≈ one application service method (command/query).
12
+ - Depend on **outbound ports** (interfaces), not concrete repos/clients.
13
+ - Orchestrate domain; transaction boundaries via ports (`UnitOfWork`) when needed — still no SQL here.
14
+ - Accept `context.Context` on public methods; propagate to ports.
15
+
16
+ ## Forbidden
17
+
18
+ - Importing `adapters/*`, SQL drivers, HTTP frameworks.
19
+ - Embedding `*sql.DB`, Redis clients, or handler types in use-case structs.
20
+ - Business rules that belong in domain entities (keep use cases thin).
21
+
22
+ ## Structure
23
+
24
+ - Prefer `application/<usecase>.go` + `ports.go` (or `ports/`) colocated.
25
+ - Inbound port = interface the driving adapter calls (optional if use-case struct is the API).
26
+
27
+ ## Tests
28
+
29
+ - Mock outbound ports; assert domain outcomes and port interactions — no real DB.
@@ -0,0 +1,29 @@
1
+ ---
2
+ description: Hexagonal layer boundaries for Go backends (domain, application, ports, adapters)
3
+ ---
4
+
5
+
6
+ # Границы слоёв (hexagonal)
7
+
8
+ - **Domain** (`internal/domain`, `**/domain`):
9
+ - Может: entities, value objects, domain services, domain errors; stdlib / same BC domain.
10
+ - Не должен: HTTP/gRPC/CLI frameworks, SQL/ORM/drivers, Redis/Kafka clients, transport DTO/`encoding/json` API shapes.
11
+ - **Application** (`internal/application`, `**/application`):
12
+ - Может: use cases; **define ports** (inbound/outbound interfaces) with domain types in signatures.
13
+ - Не должен: concrete adapters, SQL strings, framework handler types (`gin.Context`, `http.Request` as domain input).
14
+ - **Ports**: interfaces only — no adapter implementations in port packages.
15
+ - **Driving adapters** (`adapters/http|grpc`, CLI): map DTO ↔ application/domain at the edge; no business rules/SQL in handlers.
16
+ - **Driven adapters** (`persistence|cache|messaging|external`): implement outbound ports; map rows/messages → domain; do not leak persistence models upward.
17
+ - **Composition root** (`cmd/`, `internal/app`): wires the graph; no business logic.
18
+
19
+ # Зависимости
20
+
21
+ - Направление: **adapters → application → domain**.
22
+ - Driven adapters implement outbound ports defined by application.
23
+ - Domain never imports adapters or frameworks.
24
+ - Cross-feature access — only via public ports / `pkg` API, not deep imports of another feature's internals.
25
+
26
+ # Требование к агенту
27
+
28
+ - Класть файлы в правильный слой; не «коротить» слои ради скорости.
29
+ - DI только в composition root.
@@ -0,0 +1,28 @@
1
+ ---
2
+ description: Composition root and DI wiring for Go hexagonal services
3
+ paths:
4
+ - cmd/**/*
5
+ - internal/app/**/*
6
+ ---
7
+
8
+
9
+ # Composition root
10
+
11
+ - Construct adapters, use cases, and servers in `cmd/<service>` and/or `internal/app`.
12
+ - Wire interfaces to implementations explicitly (manual DI preferred unless repo already uses a container).
13
+ - Load config once; fail fast on missing required settings.
14
+ - Lifecycle: graceful shutdown via `context` cancel + server `Shutdown`.
15
+
16
+ ## Allowed here
17
+
18
+ - Import all layers for wiring only.
19
+ - Process-wide loggers/metrics providers.
20
+
21
+ ## Forbidden
22
+
23
+ - Business rules, SQL queries, HTTP routing tables with domain logic.
24
+ - Global mutable singletons for repos without clear init (prefer explicit deps).
25
+
26
+ ## Tests
27
+
28
+ - Optional smoke that wiring builds (compile-time / construction test); heavy logic stays in unit/integration tests.
@@ -0,0 +1,32 @@
1
+ ---
2
+ description: Domain layer invariants for Go hexagonal services
3
+ paths:
4
+ - internal/domain/**/*
5
+ - **/domain/**/*
6
+ ---
7
+
8
+
9
+ # Domain layer
10
+
11
+ - Pure business types and rules; no I/O.
12
+ - Prefer small value objects with validation constructors (`NewX` / `ParseX` that return typed errors).
13
+ - Domain errors are typed (sentinel or structured); map to HTTP/gRPC statuses only in adapters.
14
+ - Domain services orchestrate entities without calling outbound ports (ports live in application).
15
+ - Keep invariants close to the type that owns them; avoid anemic bags of fields with all logic in use cases.
16
+
17
+ ## Forbidden imports
18
+
19
+ - `net/http`, `database/sql`, ORM packages, Redis/Kafka clients, router frameworks (`gin`, `chi` as handler deps).
20
+ - Transport DTOs and `json` tags that mirror API contracts (keep API shapes in adapters).
21
+ - Framework `context` cancellation plumbing as a substitute for domain deadlines (prefer explicit types).
22
+
23
+ ## Allowed
24
+
25
+ - `context` only if domain API genuinely needs deadlines (prefer application to pass primitives).
26
+ - Stdlib: `time`, `errors`, `fmt`, `slices`, `maps`, etc.
27
+ - Cross-aggregate references by ID, not by loading other aggregates via ports.
28
+
29
+ ## Tests
30
+
31
+ - Table-driven unit tests; no DB, no `httptest`, no framework contexts.
32
+ - Cover invalid constructor inputs and invariant violations explicitly.
@@ -0,0 +1,51 @@
1
+ ---
2
+ description: End-to-end delivery checklist for Go hexagonal features
3
+ paths:
4
+ - .cursor/team/**/*
5
+ - .claude/team/**/*
6
+ - **/*.go
7
+ - internal/**/*
8
+ - cmd/**/*
9
+ ---
10
+
11
+ <!-- shared-core: architecture/feature-delivery-workflow.md -->
12
+
13
+ # Feature delivery (Go hexagonal)
14
+
15
+ Order of work:
16
+
17
+ 1. **Domain** — entities/VOs/errors (`domain-layer`).
18
+ 2. **Application + ports** — use case + outbound interfaces (`application-usecases`, `ports-interfaces`).
19
+ 3. **Driven adapters** — persistence/cache/messaging implementing ports.
20
+ 4. **Driving adapters** — HTTP/gRPC/CLI mapping DTOs.
21
+ 5. **Composition root** — wire in `cmd/` / `internal/app`.
22
+ 6. **Tests** — unit (domain/app) → integration (adapters) → optional e2e smoke.
23
+ 7. **Gate** — `post-change-test` (+ `go-tooling`).
24
+
25
+ ```mermaid
26
+ flowchart LR
27
+ D[Domain] --> A[Application+Ports]
28
+ A --> Drv[Driven adapters]
29
+ Drv --> A
30
+ HTTP[Driving HTTP] --> A
31
+ CR[Composition root] --> HTTP
32
+ CR --> A
33
+ CR --> Drv
34
+ ```
35
+
36
+ ## Matrix
37
+
38
+ | Path | Rules |
39
+ |------|-------|
40
+ | `**/domain/**` | `domain-layer`, `architecture-boundaries` |
41
+ | `**/application/**` | `application-usecases`, `ports-interfaces` |
42
+ | `**/adapters/http/**` | `adapters-driving`, `api-http` |
43
+ | `**/adapters/persistence/**` | `adapters-driven`, `persistence-adapters` |
44
+ | `cmd/**`, `internal/app/**` | `composition-root` |
45
+ | After `*.go` edits | `post-change-test` |
46
+
47
+ ## Anti-patterns
48
+
49
+ - Framework types in domain; SQL in use cases; DI inside handlers; skipping port interfaces “for speed”.
50
+ - **Ubiquitous language:** Domain names/boundaries reflect the feature domain — do not mix transport/framework terms into domain without need.
51
+ - Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: Public module API (pkg/) and internal boundaries for Go services
3
+ paths:
4
+ - pkg/**/*
5
+ - go.mod
6
+ ---
7
+
8
+
9
+ # Module public API
10
+
11
+ - Anything under `pkg/` is a compatibility surface — change carefully; prefer additive APIs.
12
+ - Service-private code stays in `internal/`.
13
+ - Do not import another module's `internal/` (compiler enforces for separate modules).
14
+ - Document breaking Go API changes in CHANGELOG when the repo publishes libraries.
15
+
16
+ ## go.mod
17
+
18
+ - Module path and Go version are SoT for toolchain.
19
+ - Prefer minimal direct deps; pin via `go.mod` / `go.sum`.
20
+
21
+ ## Cross-feature
22
+
23
+ - Inside one module, features communicate via application ports or small `pkg` facades — not by importing sibling feature adapter packages.
@@ -0,0 +1,34 @@
1
+ ---
2
+ description: Inbound and outbound port interfaces for Go hexagonal services
3
+ paths:
4
+ - **/ports/**/*
5
+ - internal/application/**/*port*
6
+ - **/application/**/*port*
7
+ ---
8
+
9
+
10
+ # Ports (interfaces)
11
+
12
+ ## Outbound (driven)
13
+
14
+ - Repository, cache, publisher, clock, ID generator, external client — defined by **application**.
15
+ - Signatures use **domain** types (or small application DTOs), never ORM models.
16
+ - Keep interfaces small (ISP); prefer role interfaces over god-repos.
17
+ - Accept `context.Context` as the first parameter when the call may block or cancel.
18
+
19
+ ## Inbound (driving)
20
+
21
+ - Optional interface wrapping use cases for multiple drivers (HTTP + gRPC + CLI).
22
+ - Drivers depend on inbound ports / use-case APIs — not on each other.
23
+ - Prefer a concrete use-case struct when only one driver exists; extract an interface when a second driver appears.
24
+
25
+ ## Naming
26
+
27
+ - `SaveOrder`, `FindOrderByID`, `PublishOrderPlaced` — verb-oriented.
28
+ - Implementation types live in adapters (`PostgresOrderRepository`), not beside the interface in domain.
29
+
30
+ ## Anti-patterns
31
+
32
+ - Ports returning `map[string]any` or `json.RawMessage` without need.
33
+ - Putting port interfaces inside adapter packages (wrong owner).
34
+ - Leakage of SQL/`driver.Valuer` types through port method signatures.
@@ -0,0 +1,34 @@
1
+ ---
2
+ description: Reference paths for Go hexagonal layout (fill after init)
3
+ paths:
4
+ - internal/**/*
5
+ - cmd/**/*
6
+ ---
7
+
8
+ <!-- shared-core: architecture/reference-features.template.md -->
9
+
10
+ # Reference features (Go)
11
+
12
+ Fill TBD paths after adopting this preset in a real service repo.
13
+
14
+ | Area | Example path (TBD) | Glob hint |
15
+ |------|--------------------|-----------|
16
+ | Domain | `internal/domain/` | `**/domain/**` |
17
+ | Application / ports | `internal/application/` | `**/application/**` |
18
+ | HTTP adapter | `internal/adapters/http/` | `**/adapters/http/**` |
19
+ | Persistence | `internal/adapters/persistence/` | `**/adapters/persistence/**` |
20
+ | Composition root | `cmd/<service>/`, `internal/app/` | `cmd/**`, `internal/app/**` |
21
+ | Unit tests | `*_test.go` beside packages | `**/*_test.go` |
22
+ | Integration | `**/integration/` | `**/*_integration_test.go` |
23
+
24
+ ## Living conventions
25
+
26
+ Post-init gotchas / patterns / decisions: **`.claude/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.
27
+
28
+ ## Dogfood scenarios
29
+
30
+ 1. `/task` new use case — domain → ports → adapters → wire → `post-change-test`.
31
+ 2. Bug in handler mapping — debugger + httptest unit.
32
+ 3. Repository contract — integration-test trio.
33
+ 4. OpenAPI/proto drift — api-contract-reviewer.
34
+ 5. Secrets in logs — security-reviewer + `security-go`.
@@ -0,0 +1,10 @@
1
+ # Stack
2
+
3
+ Язык, платформа и базовый каркас сервиса. Index only — тела в topic `.md`.
4
+
5
+ | File | Cursor SoT |
6
+ |------|------------|
7
+ | [`go-app-core.md`](./go-app-core.md) | `go-app-core.mdc` |
8
+ | [`go-conventions.md`](./go-conventions.md) | `go-conventions.mdc` |
9
+
10
+ Sync: change Cursor → update Claude twin same PR. Full map: [`../README.md`](../README.md).
@@ -0,0 +1,31 @@
1
+ ---
2
+ description: Go backend stack, module layout, and agent entry points (hexagonal preset)
3
+ ---
4
+
5
+
6
+ # Стек и окружение
7
+
8
+ Версии Go, toolchain и зависимостей — **из `go.mod` / `go.work` целевого репозитория**. Рамка preset:
9
+
10
+ - **Язык / платформа:** Go (module mode); min version — из `go` directive в `go.mod`.
11
+ - **Архитектура:** hexagonal (ports & adapters); слой domain не знает HTTP/SQL/брокеры.
12
+ - **Точки входа:** `cmd/<service>/main.go` → composition root.
13
+ - **Concurrency:** `context.Context` в API границ; не хранить Context в структурах дольше запроса.
14
+ - **Тесты:** `testing` + table-driven; integration за адаптерами; e2e HTTP smoke — по необходимости.
15
+ - **HTTP:** framework-agnostic (`net/http`, chi/gin/echo — примеры, не мандат).
16
+ - **Наблюдаемость:** только если уже в репо — централизованно (логи/metrics/tracing).
17
+
18
+ # Структура (default: layer-first)
19
+
20
+ ```text
21
+ cmd/<service>/main.go
22
+ internal/domain/
23
+ internal/application/ # use cases + ports
24
+ internal/adapters/http|grpc|persistence|cache|messaging/
25
+ internal/app/ # optional DI wiring
26
+ pkg/ # optional public library API
27
+ ```
28
+
29
+ **Feature-first variant** allowed: `internal/<feature>/{domain,application,adapters}` — same dependency direction.
30
+
31
+ Границы — **`architecture-boundaries.mdc`**. Tooling — requestable **`go-tooling.mdc`**. После правок Go — **`post-change-test.mdc`**.
@@ -0,0 +1,51 @@
1
+ ---
2
+ description: Idiomatic Go conventions for this hexagonal preset
3
+ paths:
4
+ - **/*.go
5
+ ---
6
+
7
+ # Go conventions
8
+
9
+ - Follow [Effective Go](https://go.dev/doc/effective_go) and repo `golangci-lint` / `staticcheck` when present.
10
+ - Accept `context.Context` as first param on I/O and use-case methods.
11
+ - Prefer `camelCase` unexported, `PascalCase` exported; package names short and lowercase.
12
+ - Do not expose `internal/` outside the module.
13
+ - Prefer table-driven tests; use `t.Parallel` only when safe.
14
+
15
+ ## Errors
16
+
17
+ - Always handle errors — never `_ = err`.
18
+ - Wrap with `fmt.Errorf("…: %w", err)`; check with `errors.Is` / `errors.As`.
19
+ - Prefer domain/custom error types for structured cases; avoid panics in library/service code.
20
+
21
+ ## Interfaces
22
+
23
+ - Accept interfaces, return concrete types.
24
+ - Define interfaces at the **call site** (ports / consumers), not on every implementation.
25
+ - Prefer small, single-method interfaces when they match the use.
26
+
27
+ ## Packages
28
+
29
+ - Avoid `util`/`common` dumping grounds — name by domain capability.
30
+ - Keep `main` packages thin (see composition-root).
31
+ - No `init()` for business logic; no package-level mutable state for request data.
32
+
33
+ ## Concurrency
34
+
35
+ - Document cancelation; `defer cancel()` after creating a derived context.
36
+ - Do not start unbounded goroutines from handlers without a termination condition / supervision (`WaitGroup`, errgroup, or context cancel).
37
+ - Channels for communication, mutexes for shared state — match existing package patterns.
38
+
39
+ ## Anti-hallucination
40
+
41
+ | ❌ Avoid | ✅ Prefer |
42
+ |---------|----------|
43
+ | `_ = err` / ignored errors | Handle or wrap with `%w` |
44
+ | Interfaces on every struct «just in case» | Ports at consumer / call site |
45
+ | Invented modules not in `go.mod` | Add dependency explicitly or copy existing import |
46
+ | `interface{}` where generics or a concrete type fit | Generics / concrete types used by the repo |
47
+ | Business logic in `init()` | Wire in composition root / `main` |
48
+
49
+ ## Agent requirement
50
+
51
+ New Go code must stay idiomatic and verifiable against `go.mod` and neighboring packages. Less guessed code is better than more.
@@ -0,0 +1,11 @@
1
+ # Testing
2
+
3
+ Unit, integration, e2e smoke. Index only.
4
+
5
+ | File | Cursor SoT |
6
+ |------|------------|
7
+ | [`unit.md`](./unit.md) | `tests-unit.mdc` |
8
+ | [`integration.md`](./integration.md) | `tests-integration.mdc` |
9
+ | [`e2e.md`](./e2e.md) | `tests-e2e.mdc` |
10
+
11
+ Full map: [`../README.md`](../README.md).
@@ -0,0 +1,18 @@
1
+ ---
2
+ description: End-to-end HTTP smoke tests for Go services
3
+ paths:
4
+ - **/e2e/**/*_test.go
5
+ - **/*_e2e_test.go
6
+ ---
7
+
8
+
9
+ # E2E / HTTP smoke
10
+
11
+ - Black-box against a running server (httptest with full composition root, or localhost in CI).
12
+ - Cover critical paths only; prefer integration + unit for breadth.
13
+ - Stable test data; avoid depending on wall-clock flakiness.
14
+ - Do not use browser/Playwright tooling in this preset.
15
+
16
+ ## Placement
17
+
18
+ - `e2e/` package or `*_e2e_test.go` with build tags if needed.
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: Integration / adapter contract tests for Go hexagonal services
3
+ paths:
4
+ - **/integration/**/*_test.go
5
+ - **/*_integration_test.go
6
+ ---
7
+
8
+
9
+ # Integration tests
10
+
11
+ - Exercise driven adapters against real infra doubles (testcontainers, docker compose test DB, miniredis, etc.).
12
+ - Or exercise HTTP adapter with `httptest` + wired use case + fake/real ports — still no full prod cluster required.
13
+ - Build tags (`//go:build integration`) if the repo separates CI jobs.
14
+ - Keep fixtures deterministic; clean up data between tests.
15
+
16
+ ## Scope
17
+
18
+ - Contract of a port implementation (repo save/load roundtrip).
19
+ - Not a substitute for domain unit tests.
20
+
21
+ ## Agents
22
+
23
+ - Planning/generation: `integration-test-{planner,generator,healer}` + skill `integration-testing`.
@@ -0,0 +1,24 @@
1
+ ---
2
+ description: Unit testing conventions for Go hexagonal services
3
+ paths:
4
+ - **/*_test.go
5
+ ---
6
+
7
+
8
+ # Unit tests
9
+
10
+ - Table-driven tests; clear arrange/act/assert.
11
+ - Domain and application: mock/fake **ports** only — no real DB/network.
12
+ - Prefer fakes over heavy mocking frameworks when simple.
13
+ - Skip integration/e2e files matching `*_integration_test.go`, `*_e2e_test.go`, or dirs `integration/`, `e2e/` — those use other rules.
14
+
15
+ ## Forbidden smells
16
+
17
+ - `gin.Context` / `http.Request` in domain tests.
18
+ - SQL or live HTTP in use-case unit tests.
19
+ - Brittle tests on unexported adapter internals without need.
20
+ - Structural smells vocabulary (Feature Envy, Message Chains, …): see requestable `design-guidance` — do not duplicate the catalog here.
21
+
22
+ ## Naming
23
+
24
+ - `TestUseCase_DoX` / `TestEntity_Invariant`.