@bonesofspring/ai-rules 0.2.4 → 0.2.6

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 (327) hide show
  1. package/CHANGELOG.md +22 -5
  2. package/README.md +13 -1
  3. package/bin/cli.js +2 -0
  4. package/package.json +8 -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 +31 -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 +58 -0
  16. package/presets/_shared/core/quality/design-guidance.md +97 -0
  17. package/presets/_shared/core/review/code-review-mr.md +29 -0
  18. package/presets/_shared/core/review/technical-retro.md +7 -0
  19. package/presets/claude/go/CLAUDE.md +10 -0
  20. package/presets/claude/go/MCP.md +16 -0
  21. package/presets/claude/go/README.md +34 -0
  22. package/presets/claude/go/agents/README.md +15 -0
  23. package/presets/claude/go/agents/api-contract-reviewer.md +23 -0
  24. package/presets/claude/go/agents/build-verifier.md +30 -0
  25. package/presets/claude/go/agents/ci-investigator.md +17 -0
  26. package/presets/claude/go/agents/code-reviewer.md +40 -0
  27. package/presets/claude/go/agents/debugger.md +25 -0
  28. package/presets/claude/go/agents/feature-developer.md +30 -0
  29. package/presets/claude/go/agents/integration-test-generator.md +22 -0
  30. package/presets/claude/go/agents/integration-test-healer.md +22 -0
  31. package/presets/claude/go/agents/integration-test-planner.md +22 -0
  32. package/presets/claude/go/agents/migration-specialist.md +31 -0
  33. package/presets/claude/go/agents/performance-auditor.md +22 -0
  34. package/presets/claude/go/agents/qa-tester.md +24 -0
  35. package/presets/claude/go/agents/security-reviewer.md +20 -0
  36. package/presets/claude/go/agents/solution-architect.md +28 -0
  37. package/presets/claude/go/agents/task-analyst.md +25 -0
  38. package/presets/claude/go/agents/task-router.md +69 -0
  39. package/presets/claude/go/agents/tech-writer.md +15 -0
  40. package/presets/claude/go/agents/unit-test-generator.md +21 -0
  41. package/presets/claude/go/agents/unit-test-healer.md +13 -0
  42. package/presets/claude/go/agents/unit-test-planner.md +26 -0
  43. package/presets/claude/go/commands/README.md +13 -0
  44. package/presets/claude/go/commands/feature-continue.md +51 -0
  45. package/presets/claude/go/commands/feature-start.md +30 -0
  46. package/presets/claude/go/commands/task-continue.md +49 -0
  47. package/presets/claude/go/commands/task.md +49 -0
  48. package/presets/claude/go/commands/technical-retro.md +58 -0
  49. package/presets/claude/go/hooks/README.md +10 -0
  50. package/presets/claude/go/hooks/chain-team-phases.sh +381 -0
  51. package/presets/claude/go/hooks/guard-shell-command.sh +79 -0
  52. package/presets/claude/go/mcp.json +12 -0
  53. package/presets/claude/go/rules/README.md +60 -0
  54. package/presets/claude/go/rules/api-and-data/README.md +14 -0
  55. package/presets/claude/go/rules/api-and-data/adapters-driven.md +34 -0
  56. package/presets/claude/go/rules/api-and-data/adapters-driving.md +35 -0
  57. package/presets/claude/go/rules/api-and-data/api-grpc.md +27 -0
  58. package/presets/claude/go/rules/api-and-data/api-http.md +26 -0
  59. package/presets/claude/go/rules/api-and-data/messaging-adapters.md +21 -0
  60. package/presets/claude/go/rules/api-and-data/persistence-adapters.md +28 -0
  61. package/presets/claude/go/rules/architecture/README.md +16 -0
  62. package/presets/claude/go/rules/architecture/application-usecases.md +29 -0
  63. package/presets/claude/go/rules/architecture/boundaries.md +29 -0
  64. package/presets/claude/go/rules/architecture/composition-root.md +28 -0
  65. package/presets/claude/go/rules/architecture/domain-layer.md +32 -0
  66. package/presets/claude/go/rules/architecture/feature-delivery.md +51 -0
  67. package/presets/claude/go/rules/architecture/module-public-api.md +23 -0
  68. package/presets/claude/go/rules/architecture/ports-interfaces.md +34 -0
  69. package/presets/claude/go/rules/architecture/reference-features.md +30 -0
  70. package/presets/claude/go/rules/stack/README.md +10 -0
  71. package/presets/claude/go/rules/stack/go-app-core.md +31 -0
  72. package/presets/claude/go/rules/stack/go-conventions.md +24 -0
  73. package/presets/claude/go/rules/testing/README.md +11 -0
  74. package/presets/claude/go/rules/testing/e2e.md +18 -0
  75. package/presets/claude/go/rules/testing/integration.md +23 -0
  76. package/presets/claude/go/rules/testing/unit.md +24 -0
  77. package/presets/claude/go/rules/tooling-and-review/README.md +21 -0
  78. package/presets/claude/go/rules/tooling-and-review/agent-team-intake.md +25 -0
  79. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +161 -0
  80. package/presets/claude/go/rules/tooling-and-review/code-quality.md +72 -0
  81. package/presets/claude/go/rules/tooling-and-review/code-review.md +48 -0
  82. package/presets/claude/go/rules/tooling-and-review/design-guidance.md +110 -0
  83. package/presets/claude/go/rules/tooling-and-review/go-tooling.md +38 -0
  84. package/presets/claude/go/rules/tooling-and-review/post-change-test.md +32 -0
  85. package/presets/claude/go/rules/tooling-and-review/preset-layering.md +36 -0
  86. package/presets/claude/go/rules/tooling-and-review/preset-no-cross-stack-leakage.md +58 -0
  87. package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +39 -0
  88. package/presets/claude/go/rules/tooling-and-review/preset-token-budget.md +41 -0
  89. package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +42 -0
  90. package/presets/claude/go/rules/tooling-and-review/security-go.md +22 -0
  91. package/presets/claude/go/rules/tooling-and-review/technical-retro.md +19 -0
  92. package/presets/claude/go/rules/ui-and-accessibility/README.md +3 -0
  93. package/presets/claude/go/skills/README.md +5 -0
  94. package/presets/claude/go/skills/ci-investigation/SKILL.md +11 -0
  95. package/presets/claude/go/skills/code-review/SKILL.md +16 -0
  96. package/presets/claude/go/skills/debug-investigation/SKILL.md +15 -0
  97. package/presets/claude/go/skills/feature-delivery/SKILL.md +26 -0
  98. package/presets/claude/go/skills/integration-testing/SKILL.md +15 -0
  99. package/presets/claude/go/skills/technical-retro/SKILL.md +10 -0
  100. package/presets/claude/go/skills/unit-testing/SKILL.md +14 -0
  101. package/presets/claude/go/team/README.md +27 -0
  102. package/presets/claude/go/team/fixtures/bugfix-standard.json +37 -0
  103. package/presets/claude/go/team/fixtures/feature-full.json +43 -0
  104. package/presets/claude/go/team/fixtures/feature-light.json +17 -0
  105. package/presets/claude/ios-swift/README.md +7 -0
  106. package/presets/claude/ios-swift/agents/README.md +16 -2
  107. package/presets/claude/ios-swift/agents/build-verifier.md +17 -8
  108. package/presets/claude/ios-swift/agents/code-reviewer.md +4 -0
  109. package/presets/claude/ios-swift/agents/debugger.md +4 -0
  110. package/presets/claude/ios-swift/agents/feature-developer.md +4 -0
  111. package/presets/claude/ios-swift/agents/migration-specialist.md +5 -1
  112. package/presets/claude/ios-swift/agents/performance-auditor.md +5 -1
  113. package/presets/claude/ios-swift/agents/qa-tester.md +4 -0
  114. package/presets/claude/ios-swift/agents/security-reviewer.md +1 -1
  115. package/presets/claude/ios-swift/agents/solution-architect.md +5 -1
  116. package/presets/claude/ios-swift/agents/task-analyst.md +4 -0
  117. package/presets/claude/ios-swift/agents/task-router.md +9 -0
  118. package/presets/claude/ios-swift/agents/unit-test-generator.md +4 -0
  119. package/presets/claude/ios-swift/agents/unit-test-healer.md +4 -0
  120. package/presets/claude/ios-swift/agents/unit-test-planner.md +4 -0
  121. package/presets/claude/ios-swift/rules/README.md +24 -2
  122. package/presets/claude/ios-swift/rules/architecture/feature-delivery.md +5 -0
  123. package/presets/claude/ios-swift/rules/architecture/reference-features.md +5 -0
  124. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-intake.md +2 -2
  125. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +15 -0
  126. package/presets/claude/ios-swift/rules/tooling-and-review/code-quality.md +53 -20
  127. package/presets/claude/ios-swift/rules/tooling-and-review/code-review.md +29 -35
  128. package/presets/claude/ios-swift/rules/tooling-and-review/design-guidance.md +110 -0
  129. package/presets/claude/ios-swift/rules/tooling-and-review/preset-layering.md +36 -0
  130. package/presets/claude/ios-swift/rules/tooling-and-review/preset-no-cross-stack-leakage.md +54 -0
  131. package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +39 -0
  132. package/presets/claude/ios-swift/rules/tooling-and-review/preset-token-budget.md +41 -0
  133. package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +42 -0
  134. package/presets/claude/ios-swift/rules/tooling-and-review/technical-retro.md +5 -3
  135. package/presets/claude/ios-swift/skills/code-review/SKILL.md +4 -0
  136. package/presets/claude/ios-swift/skills/debug-investigation/SKILL.md +4 -0
  137. package/presets/claude/ios-swift/skills/feature-delivery/SKILL.md +4 -0
  138. package/presets/claude/ios-swift/team/fixtures/feature-full.json +8 -25
  139. package/presets/claude/ios-swift/team/fixtures/feature-light.json +5 -20
  140. package/presets/claude/next/README.md +9 -1
  141. package/presets/claude/next/agents/README.md +38 -4
  142. package/presets/claude/next/agents/build-verifier.md +24 -0
  143. package/presets/claude/next/agents/code-reviewer.md +4 -0
  144. package/presets/claude/next/agents/debugger.md +4 -0
  145. package/presets/claude/next/agents/feature-developer.md +4 -0
  146. package/presets/claude/next/agents/migration-specialist.md +5 -1
  147. package/presets/claude/next/agents/performance-auditor.md +5 -1
  148. package/presets/claude/next/agents/qa-tester.md +4 -0
  149. package/presets/claude/next/agents/security-reviewer.md +1 -1
  150. package/presets/claude/next/agents/solution-architect.md +5 -1
  151. package/presets/claude/next/agents/task-analyst.md +4 -0
  152. package/presets/claude/next/agents/task-router.md +15 -1
  153. package/presets/claude/next/agents/unit-test-generator.md +4 -0
  154. package/presets/claude/next/agents/unit-test-healer.md +4 -0
  155. package/presets/claude/next/agents/unit-test-planner.md +4 -0
  156. package/presets/claude/next/rules/README.md +74 -21
  157. package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +5 -0
  158. package/presets/claude/next/rules/architecture/reference-features.md +5 -0
  159. package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +2 -0
  160. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +18 -1
  161. package/presets/claude/next/rules/tooling-and-review/code-quality.md +48 -20
  162. package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +17 -8
  163. package/presets/claude/next/rules/tooling-and-review/design-guidance.md +110 -0
  164. package/presets/claude/next/rules/tooling-and-review/preset-layering.md +36 -0
  165. package/presets/claude/next/rules/tooling-and-review/preset-no-cross-stack-leakage.md +54 -0
  166. package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +39 -0
  167. package/presets/claude/next/rules/tooling-and-review/preset-token-budget.md +41 -0
  168. package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +42 -0
  169. package/presets/claude/next/rules/tooling-and-review/technical-retro.md +16 -0
  170. package/presets/claude/next/skills/code-review/SKILL.md +4 -0
  171. package/presets/claude/next/skills/debug-investigation/SKILL.md +4 -0
  172. package/presets/claude/next/skills/feature-delivery/SKILL.md +4 -0
  173. package/presets/claude/next/team/fixtures/feature-full.json +4 -2
  174. package/presets/claude/next/team/fixtures/feature-light.json +2 -2
  175. package/presets/cursor/go/AGENTS.md +24 -0
  176. package/presets/cursor/go/BUGBOT.md +9 -0
  177. package/presets/cursor/go/MCP.md +16 -0
  178. package/presets/cursor/go/README.md +38 -0
  179. package/presets/cursor/go/agents/README.md +15 -0
  180. package/presets/cursor/go/agents/api-contract-reviewer.md +23 -0
  181. package/presets/cursor/go/agents/build-verifier.md +30 -0
  182. package/presets/cursor/go/agents/ci-investigator.md +17 -0
  183. package/presets/cursor/go/agents/code-reviewer.md +40 -0
  184. package/presets/cursor/go/agents/debugger.md +25 -0
  185. package/presets/cursor/go/agents/feature-developer.md +30 -0
  186. package/presets/cursor/go/agents/integration-test-generator.md +22 -0
  187. package/presets/cursor/go/agents/integration-test-healer.md +22 -0
  188. package/presets/cursor/go/agents/integration-test-planner.md +22 -0
  189. package/presets/cursor/go/agents/migration-specialist.md +31 -0
  190. package/presets/cursor/go/agents/performance-auditor.md +22 -0
  191. package/presets/cursor/go/agents/qa-tester.md +24 -0
  192. package/presets/cursor/go/agents/security-reviewer.md +20 -0
  193. package/presets/cursor/go/agents/solution-architect.md +28 -0
  194. package/presets/cursor/go/agents/task-analyst.md +25 -0
  195. package/presets/cursor/go/agents/task-router.md +69 -0
  196. package/presets/cursor/go/agents/tech-writer.md +15 -0
  197. package/presets/cursor/go/agents/unit-test-generator.md +21 -0
  198. package/presets/cursor/go/agents/unit-test-healer.md +13 -0
  199. package/presets/cursor/go/agents/unit-test-planner.md +26 -0
  200. package/presets/cursor/go/commands/README.md +54 -0
  201. package/presets/cursor/go/commands/feature-continue.md +19 -0
  202. package/presets/cursor/go/commands/feature-start.md +33 -0
  203. package/presets/cursor/go/commands/task-continue.md +49 -0
  204. package/presets/cursor/go/commands/task.md +49 -0
  205. package/presets/cursor/go/commands/technical-retro.md +81 -0
  206. package/presets/cursor/go/hooks/README.md +8 -0
  207. package/presets/cursor/go/hooks/chain-team-phases.sh +381 -0
  208. package/presets/cursor/go/hooks/guard-shell-command.sh +79 -0
  209. package/presets/cursor/go/hooks.json +17 -0
  210. package/presets/cursor/go/mcp.json +11 -0
  211. package/presets/cursor/go/rules/README.md +89 -0
  212. package/presets/cursor/go/rules/adapters-driven.mdc +35 -0
  213. package/presets/cursor/go/rules/adapters-driving.mdc +36 -0
  214. package/presets/cursor/go/rules/agent-team-intake.mdc +20 -0
  215. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +156 -0
  216. package/presets/cursor/go/rules/api-grpc.mdc +28 -0
  217. package/presets/cursor/go/rules/api-http.mdc +27 -0
  218. package/presets/cursor/go/rules/application-usecases.mdc +30 -0
  219. package/presets/cursor/go/rules/architecture-boundaries.mdc +30 -0
  220. package/presets/cursor/go/rules/code-quality-and-refactoring.mdc +73 -0
  221. package/presets/cursor/go/rules/code-review-mr.mdc +43 -0
  222. package/presets/cursor/go/rules/composition-root.mdc +29 -0
  223. package/presets/cursor/go/rules/design-guidance.mdc +111 -0
  224. package/presets/cursor/go/rules/domain-layer.mdc +33 -0
  225. package/presets/cursor/go/rules/feature-delivery-workflow.mdc +46 -0
  226. package/presets/cursor/go/rules/go-app-core.mdc +32 -0
  227. package/presets/cursor/go/rules/go-conventions.mdc +25 -0
  228. package/presets/cursor/go/rules/go-tooling.mdc +33 -0
  229. package/presets/cursor/go/rules/messaging-adapters.mdc +22 -0
  230. package/presets/cursor/go/rules/module-public-api.mdc +24 -0
  231. package/presets/cursor/go/rules/persistence-adapters.mdc +29 -0
  232. package/presets/cursor/go/rules/ports-interfaces.mdc +35 -0
  233. package/presets/cursor/go/rules/post-change-test.mdc +27 -0
  234. package/presets/cursor/go/rules/preset-layering.mdc +36 -0
  235. package/presets/cursor/go/rules/preset-no-cross-stack-leakage.mdc +58 -0
  236. package/presets/cursor/go/rules/preset-pr-checklist.mdc +39 -0
  237. package/presets/cursor/go/rules/preset-token-budget.mdc +41 -0
  238. package/presets/cursor/go/rules/preset-twin-sync.mdc +42 -0
  239. package/presets/cursor/go/rules/reference-features.mdc +31 -0
  240. package/presets/cursor/go/rules/security-go.mdc +23 -0
  241. package/presets/cursor/go/rules/technical-retro.mdc +14 -0
  242. package/presets/cursor/go/rules/tests-e2e.mdc +19 -0
  243. package/presets/cursor/go/rules/tests-integration.mdc +24 -0
  244. package/presets/cursor/go/rules/tests-unit.mdc +25 -0
  245. package/presets/cursor/go/skills/README.md +5 -0
  246. package/presets/cursor/go/skills/ci-investigation/SKILL.md +11 -0
  247. package/presets/cursor/go/skills/code-review/SKILL.md +16 -0
  248. package/presets/cursor/go/skills/debug-investigation/SKILL.md +15 -0
  249. package/presets/cursor/go/skills/feature-delivery/SKILL.md +26 -0
  250. package/presets/cursor/go/skills/integration-testing/SKILL.md +15 -0
  251. package/presets/cursor/go/skills/technical-retro/SKILL.md +10 -0
  252. package/presets/cursor/go/skills/unit-testing/SKILL.md +14 -0
  253. package/presets/cursor/go/team/README.md +31 -0
  254. package/presets/cursor/go/team/fixtures/bugfix-standard.json +37 -0
  255. package/presets/cursor/go/team/fixtures/feature-full.json +43 -0
  256. package/presets/cursor/go/team/fixtures/feature-light.json +17 -0
  257. package/presets/cursor/ios-swift/README.md +7 -0
  258. package/presets/cursor/ios-swift/agents/README.md +16 -2
  259. package/presets/cursor/ios-swift/agents/build-verifier.md +17 -8
  260. package/presets/cursor/ios-swift/agents/code-reviewer.md +4 -0
  261. package/presets/cursor/ios-swift/agents/debugger.md +4 -0
  262. package/presets/cursor/ios-swift/agents/feature-developer.md +4 -0
  263. package/presets/cursor/ios-swift/agents/migration-specialist.md +5 -1
  264. package/presets/cursor/ios-swift/agents/performance-auditor.md +5 -1
  265. package/presets/cursor/ios-swift/agents/qa-tester.md +4 -0
  266. package/presets/cursor/ios-swift/agents/security-reviewer.md +1 -1
  267. package/presets/cursor/ios-swift/agents/solution-architect.md +5 -1
  268. package/presets/cursor/ios-swift/agents/task-analyst.md +4 -0
  269. package/presets/cursor/ios-swift/agents/task-router.md +9 -0
  270. package/presets/cursor/ios-swift/agents/unit-test-generator.md +4 -0
  271. package/presets/cursor/ios-swift/agents/unit-test-healer.md +4 -0
  272. package/presets/cursor/ios-swift/agents/unit-test-planner.md +4 -0
  273. package/presets/cursor/ios-swift/rules/README.md +23 -2
  274. package/presets/cursor/ios-swift/rules/agent-team-intake.mdc +2 -2
  275. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +16 -2
  276. package/presets/cursor/ios-swift/rules/code-quality-and-refactoring.mdc +53 -20
  277. package/presets/cursor/ios-swift/rules/code-review-mr.mdc +32 -0
  278. package/presets/cursor/ios-swift/rules/design-guidance.mdc +111 -0
  279. package/presets/cursor/ios-swift/rules/feature-delivery-workflow.mdc +6 -0
  280. package/presets/cursor/ios-swift/rules/preset-layering.mdc +36 -0
  281. package/presets/cursor/ios-swift/rules/preset-no-cross-stack-leakage.mdc +54 -0
  282. package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +39 -0
  283. package/presets/cursor/ios-swift/rules/preset-token-budget.mdc +41 -0
  284. package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +42 -0
  285. package/presets/cursor/ios-swift/rules/reference-features.mdc +6 -0
  286. package/presets/cursor/ios-swift/rules/technical-retro.mdc +4 -2
  287. package/presets/cursor/ios-swift/skills/code-review/SKILL.md +4 -0
  288. package/presets/cursor/ios-swift/skills/debug-investigation/SKILL.md +4 -0
  289. package/presets/cursor/ios-swift/skills/feature-delivery/SKILL.md +4 -0
  290. package/presets/cursor/ios-swift/team/fixtures/feature-full.json +8 -25
  291. package/presets/cursor/ios-swift/team/fixtures/feature-light.json +6 -25
  292. package/presets/cursor/next/README.md +46 -0
  293. package/presets/cursor/next/agents/README.md +39 -4
  294. package/presets/cursor/next/agents/build-verifier.md +24 -0
  295. package/presets/cursor/next/agents/code-reviewer.md +4 -0
  296. package/presets/cursor/next/agents/debugger.md +4 -0
  297. package/presets/cursor/next/agents/feature-developer.md +4 -0
  298. package/presets/cursor/next/agents/migration-specialist.md +5 -1
  299. package/presets/cursor/next/agents/performance-auditor.md +5 -1
  300. package/presets/cursor/next/agents/qa-tester.md +4 -0
  301. package/presets/cursor/next/agents/security-reviewer.md +1 -1
  302. package/presets/cursor/next/agents/solution-architect.md +5 -1
  303. package/presets/cursor/next/agents/task-analyst.md +4 -0
  304. package/presets/cursor/next/agents/task-router.md +15 -1
  305. package/presets/cursor/next/agents/unit-test-generator.md +4 -0
  306. package/presets/cursor/next/agents/unit-test-healer.md +4 -0
  307. package/presets/cursor/next/agents/unit-test-planner.md +4 -0
  308. package/presets/cursor/next/commands/README.md +1 -1
  309. package/presets/cursor/next/rules/README.md +21 -1
  310. package/presets/cursor/next/rules/agent-team-intake.mdc +2 -0
  311. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +18 -2
  312. package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +45 -18
  313. package/presets/cursor/next/rules/code-review-mr.mdc +32 -0
  314. package/presets/cursor/next/rules/design-guidance.mdc +111 -0
  315. package/presets/cursor/next/rules/feature-delivery-workflow.mdc +6 -0
  316. package/presets/cursor/next/rules/preset-layering.mdc +36 -0
  317. package/presets/cursor/next/rules/preset-no-cross-stack-leakage.mdc +54 -0
  318. package/presets/cursor/next/rules/preset-pr-checklist.mdc +39 -0
  319. package/presets/cursor/next/rules/preset-token-budget.mdc +41 -0
  320. package/presets/cursor/next/rules/preset-twin-sync.mdc +42 -0
  321. package/presets/cursor/next/rules/reference-features.mdc +6 -0
  322. package/presets/cursor/next/rules/technical-retro.mdc +5 -3
  323. package/presets/cursor/next/skills/code-review/SKILL.md +4 -0
  324. package/presets/cursor/next/skills/debug-investigation/SKILL.md +4 -0
  325. package/presets/cursor/next/skills/feature-delivery/SKILL.md +4 -0
  326. package/presets/cursor/next/team/fixtures/feature-full.json +4 -2
  327. package/presets/cursor/next/team/fixtures/feature-light.json +2 -2
@@ -0,0 +1,17 @@
1
+ {
2
+ "version": 1,
3
+ "hooks": {
4
+ "beforeShellExecution": [
5
+ {
6
+ "command": ".cursor/hooks/guard-shell-command.sh",
7
+ "failClosed": true
8
+ }
9
+ ],
10
+ "subagentStop": [
11
+ {
12
+ "command": ".cursor/hooks/chain-team-phases.sh",
13
+ "loop_limit": 15
14
+ }
15
+ ]
16
+ }
17
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "mcpServers": {
3
+ "context7": {
4
+ "command": "npx",
5
+ "args": ["-y", "@upstash/context7-mcp"]
6
+ },
7
+ "figma": {
8
+ "url": "https://mcp.figma.com/mcp"
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,89 @@
1
+ # Rules (preset go)
2
+
3
+ ## alwaysApply (3)
4
+
5
+ | Rule | Role |
6
+ |------|------|
7
+ | `go-app-core` | Stack + layout |
8
+ | `architecture-boundaries` | Hexagonal invariants |
9
+ | `code-quality-and-refactoring` | Shared quality + Go notes |
10
+
11
+ **Session-start body budget:** sum of the 3 always-on bodies ≤ **120** lines (stretch ≤100).
12
+
13
+ ## Twin depth (Cursor↔Claude)
14
+
15
+ - **Domain** rules: target ≥15 non-empty body lines (FAIL soft when undocumented stubs).
16
+ - **Thin aliases** (may be shorter): `agent-team-intake`, `technical-retro`.
17
+ - **Documented stubs** (checklist-style, expand in consumer Stack notes / target repo): see Catalog **Depth** column (`stub`). High-traffic stems (`domain-layer`, `ports-interfaces`, `adapters-*`, `post-change-test`, `go-tooling`) are expanded to **full** depth.
18
+
19
+ ## Loading strategy
20
+
21
+ - **`alwaysApply: true`** (Cursor) / **без `paths:`** (Claude) — только базовые инварианты (**3**): `go-app-core`, `architecture-boundaries`, `code-quality-and-refactoring`
22
+ - **On-demand / requestable** — `post-change-test`, `go-tooling`, `agent-team-intake`, `agent-team-orchestrator`, hexagonal domain/adapters, tests, feature-delivery-workflow, reference-features, `technical-retro`
23
+ - **Preset author meta** (globs `packages/ai-rules/presets/**`, never alwaysApply): `preset-layering`, `preset-twin-sync`, `preset-token-budget`, `preset-pr-checklist`, `preset-no-cross-stack-leakage`
24
+ - **Skills** — длинные процедуры (`feature-delivery`, `code-review`, `integration-testing`, …)
25
+
26
+ ### Hexagonal edit bundles
27
+
28
+ | When editing | Load |
29
+ |--------------|------|
30
+ | `**/domain/**` | `domain-layer` + `architecture-boundaries` |
31
+ | `**/application/**` | `application-usecases` + `ports-interfaces` |
32
+ | `**/adapters/http/**` (or gRPC/CLI driving) | `adapters-driving` + `api-http` / `api-grpc` + `architecture-boundaries` |
33
+ | `**/adapters/persistence/**` (or messaging/cache) | `adapters-driven` + `persistence-adapters` / `messaging-adapters` |
34
+ | `cmd/**`, `internal/app/**` | `composition-root` |
35
+ | After `*.go` edits | `post-change-test` (+ `go-tooling`) |
36
+
37
+ ## Shared core → stack mapping
38
+
39
+ SoT prose: `packages/ai-rules/presets/_shared/core/**` (see `_shared/README.md`). Adapters carry `<!-- shared-core: … -->`.
40
+
41
+ | Shared core | This stack adapter | Mode | Delta |
42
+ |-------------|--------------------|------|-------|
43
+ | `quality/code-quality-and-refactoring.md` | `code-quality-and-refactoring.mdc` | embed | Stack notes: Go errors/`%w`, ports, `post-change-test` |
44
+ | `quality/design-guidance.md` | `design-guidance.mdc` | embed | requestable smells/GoF |
45
+ | `agent-team/agent-team-orchestrator.md` | `agent-team-orchestrator.mdc` | lineage | Roles (`integration-test-*`); preset PR pointer |
46
+ | `agent-team/agent-team-intake.md` | `agent-team-intake.mdc` | embed | thin alias |
47
+ | `architecture/feature-delivery-workflow.md` | `feature-delivery-workflow.mdc` | lineage | Go hexagonal checklist (stack-native body; core = abstract SoT) |
48
+ | `architecture/reference-features.template.md` | `reference-features.mdc` | lineage | `internal/**` / `cmd/**` table + dogfood |
49
+ | `review/code-review-mr.md` | `code-review-mr.mdc` | embed | Go checklist |
50
+ | `review/technical-retro.md` | `technical-retro.mdc` | embed | thin alias |
51
+ | `meta/preset-*.md` | `preset-*.mdc` | embed | author-only globs (incl. `preset-no-cross-stack-leakage`) |
52
+
53
+ Claude twins + Cursor→Claude map: `presets/claude/go/rules/README.md`. Cross-stack leakage policy: `preset-no-cross-stack-leakage`.
54
+
55
+ ## Catalog
56
+
57
+ | Stem | Depth | Notes |
58
+ |------|-------|-------|
59
+ | `go-app-core` | full | always-on |
60
+ | `architecture-boundaries` | full | always-on |
61
+ | `code-quality-and-refactoring` | full | always-on + shared embed |
62
+ | `design-guidance` | full | requestable embed |
63
+ | `feature-delivery-workflow` | full | lineage |
64
+ | `reference-features` | full | lineage |
65
+ | `agent-team-orchestrator` | full | lineage |
66
+ | `code-review-mr` | full | embed |
67
+ | `preset-*` (×5) | full | author meta |
68
+ | `agent-team-intake` | thin-alias | |
69
+ | `technical-retro` | thin-alias | |
70
+ | `api-grpc` | stub | optional transport; expand when repo uses gRPC |
71
+ | `domain-layer` | full | high-traffic hexagonal |
72
+ | `application-usecases` | stub | |
73
+ | `ports-interfaces` | full | high-traffic hexagonal |
74
+ | `adapters-driven` | full | high-traffic hexagonal |
75
+ | `adapters-driving` | full | high-traffic hexagonal |
76
+ | `composition-root` | stub | |
77
+ | `api-http` | stub | |
78
+ | `persistence-adapters` | stub | |
79
+ | `messaging-adapters` | stub | |
80
+ | `module-public-api` | stub | |
81
+ | `go-conventions` | stub | |
82
+ | `go-tooling` | full | requestable toolchain |
83
+ | `post-change-test` | full | requestable gate |
84
+ | `security-go` | stub | |
85
+ | `tests-unit` | stub | |
86
+ | `tests-integration` | stub | |
87
+ | `tests-e2e` | stub | optional smoke; prefer integration-test-* |
88
+
89
+ **Всего topic `.mdc`:** 27 domain + 5 preset-meta (без README) = 32.
@@ -0,0 +1,35 @@
1
+ ---
2
+ description: Driven adapters (persistence, cache, messaging) for Go hexagonal services
3
+ globs:
4
+ - internal/adapters/persistence/**/*
5
+ - "**/adapters/persistence/**/*"
6
+ - "**/adapters/cache/**/*"
7
+ - "**/adapters/messaging/**/*"
8
+ alwaysApply: false
9
+ ---
10
+
11
+
12
+ # Driven adapters
13
+
14
+ - Implement application **outbound ports**.
15
+ - Map storage/broker models → domain at the boundary; never return ORM structs to application.
16
+ - Handle retries/timeouts/idempotency here when infrastructure-specific.
17
+ - Wrap driver errors with context; translate to domain/application errors when meaningful.
18
+ - Honor `context.Context` cancellation and deadlines from the application call.
19
+
20
+ ## Persistence
21
+
22
+ - See `persistence-adapters.mdc` for SQL/transactions.
23
+ - Keep SQL/query builders inside the adapter package; application sees only port methods.
24
+
25
+ ## Cache / messaging
26
+
27
+ - Cache keys and serialization are adapter concerns.
28
+ - Publishers implement port `PublishX`; consumers are driving adapters if they trigger use cases.
29
+ - Prefer idempotent publish/consume handlers when brokers may redeliver.
30
+
31
+ ## Forbidden
32
+
33
+ - Calling other driven adapters bypassing application (hidden coupling).
34
+ - Leaking `*sql.Rows` / Redis types through port signatures.
35
+ - Embedding business invariants that belong in domain (e.g. discount rules in SQL only).
@@ -0,0 +1,36 @@
1
+ ---
2
+ description: Driving adapters (HTTP, gRPC, CLI) for Go hexagonal services
3
+ globs:
4
+ - internal/adapters/http/**/*
5
+ - "**/adapters/http/**/*"
6
+ - "**/adapters/grpc/**/*"
7
+ - cmd/**/*
8
+ alwaysApply: false
9
+ ---
10
+
11
+
12
+ # Driving adapters
13
+
14
+ - Translate transport → application calls → transport response.
15
+ - Map request/response DTOs at the edge; do not pass framework types into use cases.
16
+ - AuthN/AuthZ and validation of wire format belong here (or dedicated middleware); domain validation stays in domain.
17
+ - Errors: map domain/application errors to status codes once (central mapper preferred).
18
+ - Keep handlers thin: decode → call use case → encode; no multi-step workflows in the adapter.
19
+
20
+ ## HTTP
21
+
22
+ - See `api-http.mdc`. Prefer thin handlers; routing table in one place.
23
+ - Framework examples (chi/gin/echo) are optional — match the repo.
24
+ - Bind path/query/body into request DTOs before calling application.
25
+
26
+ ## gRPC / CLI
27
+
28
+ - Same mapping rules; see thin `api-grpc.mdc` for protobuf notes.
29
+ - CLI `cmd` tools may call composition root or inbound ports — no SQL in `main`.
30
+ - Propagate cancellation from the transport `context` into use-case calls.
31
+
32
+ ## Forbidden
33
+
34
+ - SQL or business invariants inside handlers.
35
+ - Importing persistence packages from HTTP handlers (wire via application).
36
+ - Swallowing errors without mapping to a transport status / log field.
@@ -0,0 +1,20 @@
1
+ ---
2
+ description: Suggest /task for Go backend work requests
3
+ alwaysApply: false
4
+ ---
5
+
6
+ <!-- shared-core: agent-team/agent-team-intake.md -->
7
+
8
+ # Agent team intake
9
+
10
+ When the user message looks like a **work request** (implement, add, fix, refactor, review MR, write tests, spike) — not a question about how code works:
11
+
12
+ 1. Prefer **`/task <their request>`** or invoke **task-router** first.
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`.
15
+
16
+ Exceptions: user explicitly says «без pipeline», «просто сделай», or continues an active slug.
17
+
18
+ ## Stack notes
19
+
20
+ - Scope: Go services (`cmd/`, `internal/**`) — hexagonal ports/adapters — not Playwright/XCUITest UI flows.
@@ -0,0 +1,156 @@
1
+ ---
2
+ description: Orchestrates the agent team via task-router and pipeline.json for Go presets
3
+ alwaysApply: false
4
+ ---
5
+
6
+ <!-- shared-core: agent-team/agent-team-orchestrator.md -->
7
+
8
+ # Agent team orchestrator
9
+
10
+ Parent agent = **manager**. Router plans; specialists execute. Artifacts: `.cursor/team/tasks/<slug>/` (Claude: `.claude/team/tasks/<slug>/`).
11
+
12
+ Work request без `/task` — см. **agent-team-intake** (когда предлагать router вместо прямого кодинга).
13
+
14
+ ## Entry points
15
+
16
+ | Command | When |
17
+ |---------|------|
18
+ | **`/task <desc>`** | **Preferred** — router → dynamic pipeline → first agent |
19
+ | `/task-continue <slug>` | After human gate or pause |
20
+ | `/feature-start <desc>` | Legacy: analyst-only start (no router) |
21
+ | `/feature-continue <slug>` | Alias of task-continue |
22
+ | `/technical-retro [slug]` | Retro with agent team block |
23
+
24
+ ## Roles (shared catalog)
25
+
26
+ Roster of specialists is **stack-specific** (agent names and write scopes differ). See **Stack notes** in the stack adapter for the live Roles table. Common patterns:
27
+
28
+ | Kind | Examples (names vary by stack) |
29
+ |------|--------------------------------|
30
+ | Planning | `task-router`, `task-analyst`, `solution-architect`, `migration-specialist` |
31
+ | Implementation | `feature-developer`, `debugger`, `ci-investigator` |
32
+ | Gates / review | `build-verifier`, `code-reviewer`, `security-reviewer`, `performance-auditor` (no `accessibility-reviewer`) |
33
+ | Tests | unit planner/generator/healer; e2e/UI planner/generator/healer (stack-native) |
34
+ | Docs | `tech-writer` |
35
+
36
+ **Cursor frontmatter:** all team pipeline agents use `readonly: false` so they can write team artifacts. Production/app restrictions live in the agent prompt body — do **not** set `readonly: true`.
37
+
38
+ Full prompts: stack `agents/*.md`. Artifact conventions: stack `team/README.md`.
39
+
40
+ ## Dynamic pipeline
41
+
42
+ ```mermaid
43
+ flowchart TD
44
+ task["/task prompt"]
45
+ router["task-router"]
46
+ pipeline["pipeline.json"]
47
+ step0["steps 0..N"]
48
+ gate{"humanGates?"}
49
+ hook["subagentStop hook"]
50
+ retro["/technical-retro"]
51
+
52
+ task --> router
53
+ router --> pipeline
54
+ pipeline --> step0
55
+ step0 --> gate
56
+ gate -->|"/task-continue"| step0
57
+ step0 --> hook
58
+ hook --> step0
59
+ step0 --> retro
60
+ ```
61
+
62
+ **Source of truth for order:** `pipeline.json` → `steps[]`. Never hardcode analyst → dev → review → QA when `pipeline.json` exists.
63
+
64
+ ## status.json (pipeline mode)
65
+
66
+ ```json
67
+ {
68
+ "slug": "...",
69
+ "intent": "feature",
70
+ "pipelineIndex": 0,
71
+ "currentAgent": "task-analyst",
72
+ "phase": "executing",
73
+ "state": "in_progress",
74
+ "awaitingHumanGate": false
75
+ }
76
+ ```
77
+
78
+ | state | Meaning |
79
+ |-------|---------|
80
+ | `in_progress` | Current step running |
81
+ | `completed` | Current step done; hook advances |
82
+ | `awaiting_approval` | Human gate; wait for `/task-continue` |
83
+ | `changes_requested` | Reviewer blocked; re-run developer (`retryAfterFix`) |
84
+ | `validation_failed` | build-verifier failed; re-run developer then build-verifier |
85
+
86
+ ## Pipeline step options
87
+
88
+ | Field | Use |
89
+ |-------|-----|
90
+ | `skipIf` | `debugger.fixed` / `ci-investigator.resolved` — hook skips step when artifact says fix applied |
91
+ | `parallel: true` | `agent` is array — invoke **all** agents in one parent turn; each appends to `parallelCompleted` |
92
+ | `scope` | e.g. `unit-in-dev`, `e2e-only`, `preset-artifacts-only` — passed to developer/qa |
93
+ | `model` | `cheap` \| `standard` \| `strong` — optional tier override |
94
+
95
+ ## Rules (strict)
96
+
97
+ 1. **`/task` always starts with task-router** (except user says "skip router" with documented pipeline).
98
+ 2. Read `pipeline.json` before every subagent invocation.
99
+ 3. One role per Task call — **except** parallel steps: multiple Task calls in one message.
100
+ 4. **Never** skip `humanGates` without `/task-continue` or explicit user approval.
101
+ 5. Persist handoffs to disk (`brief.md`, `decomposition.md`, `debug-report.md`, `validation-report.md`, `architecture.md`, `migration-plan.md`, `ci-report.md`, `a11y-review.md`, `perf-report.md`, `security-review.md`, `api-contract-review.md`, `unit-test-plan.md`, `documentation.md`, `review.md`).
102
+ 6. On `changes_requested` from reviewers: hook sets `retryAfterFix` → developer → same reviewer.
103
+ 7. On `validation_failed` from `build-verifier`: hook sets `retryAfterFix: build-verifier` → developer → build-verifier.
104
+ 8. When all steps complete, suggest `/technical-retro <slug>`.
105
+ 9. If `autoChain: false` in pipeline, do not rely on hook — manual step only.
106
+
107
+ ## Team artifact I/O (Cursor Shell sandbox)
108
+
109
+ - Create/update team task dirs with the **Write** tool (parents are created automatically). Do **not** bootstrap slug dirs with Shell `mkdir -p` — default sandbox returns `Operation not permitted` (worse on macOS Desktop/Documents with TCC).
110
+ - If Shell must touch team paths and fails with EPERM, retry with `required_permissions: ["all"]`. Prefer Write for artifacts.
111
+ - Prefer repo under `~/Projects` / `WebstormProjects` over `~/Desktop` when using agent team heavily.
112
+
113
+ ## Invoking agents
114
+
115
+ Use Task tool or `/agent-name`. Pass: slug, artifact paths, step `scope` if set.
116
+
117
+ ### Model when invoking (Task)
118
+
119
+ 1. Read `steps[i].model` if present; else use the agent’s frontmatter `model` (see `agents/README.md` matrix).
120
+ 2. Map abstract tiers:
121
+ - **`cheap`** → pass Task `model: "fast"` when the tool accepts it (or rely on agent `fast`).
122
+ - **`standard`** → omit Task `model` (frontmatter `inherit` / mid default).
123
+ - **`strong`** → **never** pass `fast`; rely on agent pin or parent Max model.
124
+ 3. Parallel steps: apply the step-level `model` to **each** agent in the array (or omit → each agent’s own frontmatter).
125
+
126
+ After each agent completes, ensure `status.json` has `state: completed` (or `awaiting_approval` if gate applies).
127
+
128
+ ## Legacy mode
129
+
130
+ If `pipeline.json` is missing (old `/feature-start` tasks), fall back to fixed phases: analysis → development → review → testing. Hook supports both.
131
+
132
+ ## Skip pipeline when
133
+
134
+ Do **not** run `/task` + router for:
135
+
136
+ - Pure questions («как работает X», «объясни»).
137
+ - Typo / one-file fix / trivial config with no architecture risk.
138
+ - User explicitly says «без pipeline», «просто сделай», or continues an active slug.
139
+ - Single-line `docs-only` with no code impact.
140
+
141
+ Borderline work requests — см. **agent-team-intake**.
142
+
143
+ ## Auto-detection (optional)
144
+
145
+ When user describes a **non-trivial task** (not a question), suggest `/task <message>` or run router if they agree.
146
+
147
+ ## Preset authoring
148
+
149
+ When the work edits `packages/ai-rules/presets/**` (or dogfood `.cursor/` sync of presets), follow meta-rules: **preset-pr-checklist**, **preset-twin-sync**, **preset-layering**, **preset-token-budget**, **preset-no-cross-stack-leakage**.
150
+
151
+ ## Stack notes
152
+
153
+ - Scope: Go hexagonal modules (`internal/`, `cmd/`) — not Next `app/src` or iOS `Features/`.
154
+ - **No `accessibility-reviewer`** agent (no UI surface) — do not schedule it; `task-router` bans it. Gates: `build-verifier`, `code-reviewer`, `security-reviewer`, `performance-auditor`.
155
+ - E2E/integration intents use **`integration-test-*`** agents — never Playwright or XCUITest.
156
+ - After Go code changes, pipeline includes **build-verifier** with `go test` / `post-change-test`.
@@ -0,0 +1,28 @@
1
+ ---
2
+ description: Thin gRPC/protobuf extension notes for Go hexagonal services (HTTP-first v1)
3
+ globs:
4
+ - "**/*.proto"
5
+ - "**/adapters/grpc/**/*"
6
+ alwaysApply: false
7
+ ---
8
+
9
+
10
+ # gRPC adapters (extension stub)
11
+
12
+ HTTP is the **v1 SoT** for this preset. gRPC is supported as an optional driving adapter with the same hexagonal rules.
13
+
14
+ ## Requirements when adding gRPC
15
+
16
+ 1. Keep protobuf messages in the adapter (or `api/proto`); map to domain/application at the edge.
17
+ 2. Implement the same inbound ports / use cases as HTTP — do not fork business logic.
18
+ 3. Map gRPC status codes from domain/application errors (parity with HTTP mapper).
19
+ 4. Generate code via repo-standard `buf` / `protoc` scripts — do not hand-edit `*.pb.go` unless the repo requires it.
20
+
21
+ ## Non-goals (v1)
22
+
23
+ - Full protobuf style guide and streaming patterns — extend this rule when the consumer repo adopts gRPC widely.
24
+ - Mandating gRPC over HTTP.
25
+
26
+ ## Ports
27
+
28
+ - Prefer shared application use cases; gRPC service struct is a driving adapter only.
@@ -0,0 +1,27 @@
1
+ ---
2
+ description: HTTP API adapter conventions for Go hexagonal services
3
+ globs:
4
+ - "**/adapters/http/**/*"
5
+ - "**/*handler*.go"
6
+ - "**/*router*.go"
7
+ alwaysApply: false
8
+ ---
9
+
10
+
11
+ # HTTP API adapters
12
+
13
+ - Handlers call inbound ports / use cases; return mapped status + body.
14
+ - Use consistent error envelope; map domain errors centrally.
15
+ - Version routes if the repo already versions (`/v1/...`).
16
+ - Prefer `net/http` interfaces so tests can use `httptest` without a full framework.
17
+ - Timeouts: set server read/write timeouts; propagate request context.
18
+
19
+ ## Testing
20
+
21
+ - Prefer `httptest` against handler/router with mocked use cases (unit of adapter).
22
+ - Integration: real router + test doubles or testcontainers behind driven ports.
23
+
24
+ ## Forbidden
25
+
26
+ - Business rules or SQL in handlers.
27
+ - Ignoring `ctx` cancelation from `r.Context()`.
@@ -0,0 +1,30 @@
1
+ ---
2
+ description: Application use cases and orchestration in Go hexagonal services
3
+ globs:
4
+ - internal/application/**/*
5
+ - "**/application/**/*"
6
+ alwaysApply: false
7
+ ---
8
+
9
+
10
+ # Application / use cases
11
+
12
+ - One use case ≈ one application service method (command/query).
13
+ - Depend on **outbound ports** (interfaces), not concrete repos/clients.
14
+ - Orchestrate domain; transaction boundaries via ports (`UnitOfWork`) when needed — still no SQL here.
15
+ - Accept `context.Context` on public methods; propagate to ports.
16
+
17
+ ## Forbidden
18
+
19
+ - Importing `adapters/*`, SQL drivers, HTTP frameworks.
20
+ - Embedding `*sql.DB`, Redis clients, or handler types in use-case structs.
21
+ - Business rules that belong in domain entities (keep use cases thin).
22
+
23
+ ## Structure
24
+
25
+ - Prefer `application/<usecase>.go` + `ports.go` (or `ports/`) colocated.
26
+ - Inbound port = interface the driving adapter calls (optional if use-case struct is the API).
27
+
28
+ ## Tests
29
+
30
+ - Mock outbound ports; assert domain outcomes and port interactions — no real DB.
@@ -0,0 +1,30 @@
1
+ ---
2
+ description: Hexagonal layer boundaries for Go backends (domain, application, ports, adapters)
3
+ alwaysApply: true
4
+ ---
5
+
6
+
7
+ # Границы слоёв (hexagonal)
8
+
9
+ - **Domain** (`internal/domain`, `**/domain`):
10
+ - Может: entities, value objects, domain services, domain errors; stdlib / same BC domain.
11
+ - Не должен: HTTP/gRPC/CLI frameworks, SQL/ORM/drivers, Redis/Kafka clients, transport DTO/`encoding/json` API shapes.
12
+ - **Application** (`internal/application`, `**/application`):
13
+ - Может: use cases; **define ports** (inbound/outbound interfaces) with domain types in signatures.
14
+ - Не должен: concrete adapters, SQL strings, framework handler types (`gin.Context`, `http.Request` as domain input).
15
+ - **Ports**: interfaces only — no adapter implementations in port packages.
16
+ - **Driving adapters** (`adapters/http|grpc`, CLI): map DTO ↔ application/domain at the edge; no business rules/SQL in handlers.
17
+ - **Driven adapters** (`persistence|cache|messaging|external`): implement outbound ports; map rows/messages → domain; do not leak persistence models upward.
18
+ - **Composition root** (`cmd/`, `internal/app`): wires the graph; no business logic.
19
+
20
+ # Зависимости
21
+
22
+ - Направление: **adapters → application → domain**.
23
+ - Driven adapters implement outbound ports defined by application.
24
+ - Domain never imports adapters or frameworks.
25
+ - Cross-feature access — only via public ports / `pkg` API, not deep imports of another feature's internals.
26
+
27
+ # Требование к агенту
28
+
29
+ - Класть файлы в правильный слой; не «коротить» слои ради скорости.
30
+ - DI только в composition root.
@@ -0,0 +1,73 @@
1
+ ---
2
+ description: Code quality and light refactoring for Go hexagonal services
3
+ alwaysApply: true
4
+ ---
5
+
6
+ <!-- shared-core: quality/code-quality-and-refactoring.md -->
7
+
8
+ # Поддержка существующего стиля
9
+
10
+ - Новые изменения должны:
11
+ - следовать существующим паттернам (имена, структура, типизация / DI / error handling стека);
12
+ - минимизировать «стилистический шум» (лишние правки форматирования, rename без нужды).
13
+ - Перед добавлением нового решения:
14
+ - искать аналогичное в коде и **повторять подход**, а не изобретать новый;
15
+ - проверять, нет ли уже подходящего компонента или паттерна в дизайн‑системе / UI‑пакетах проекта, прежде чем добавлять новый кастомный контрол;
16
+ - использовать при обращении к чужим модулям только их **public API** (barrel / протоколы / facades), а deep‑импорты внутренних файлов рассматривать как повод для рефакторинга.
17
+
18
+ # Принципы
19
+
20
+ - **KISS:** выбирать самое простое изменение, которое совпадает с паттернами репозитория; не изобретать новый стиль «с нуля».
21
+ - **DRY + Rule of Three:** устранять дублирование логики; выносить общее **только после 3-го** повторения — ошибочная абстракция дороже дублирования.
22
+ - **YAGNI:** не добавлять API, флаги, слои и обобщения «на будущее» без текущего требования.
23
+ - **SOLID** (agent-actionable, не эссе):
24
+ - **S** — один модуль / один повод менять; дробить god-файлы в рамках лёгкого refactor.
25
+ - **O** — расширять через композицию/новые реализации, не раздувая существующие ветки «на всякий случай».
26
+ - **L** — подтип не ломает контракт базового типа/протокола.
27
+ - **I** — узкие порты/интерфейсы; не заставлять клиента зависеть от неиспользуемого.
28
+ - **D** — зависеть от абстракций (порты); детали — в адаптерах стека (не дублировать stack boundaries).
29
+ - **CUPID** (компактный блок, Milanov):
30
+ - **Composable** — маленькие части стыкуются без скрытого глобального состояния.
31
+ - **Unix philosophy** — одна чёткая ответственность на единицу; пайплайн простых шагов.
32
+ - **Predictable** — одинаковый вход → одинаковый выход; минимум сюрпризов для вызывающего.
33
+ - **Idiomatic** — следовать идиомам языка и **существующим** конвенциям репо.
34
+ - **Domain-based** — имена и границы отражают предметную область фичи (не транспорт/фреймворк).
35
+ - **Composition over inheritance:** предпочитать композицию / делегирование наследованию иерархий.
36
+ - **Law of Demeter (hint):** не строить цепочки `a.b.c.d`; ходить через public API / facade модуля.
37
+
38
+ # Рефакторинг при изменениях
39
+
40
+ - Разрешён лёгкий refactor, если он:
41
+ - уменьшает дублирование;
42
+ - повышает читаемость;
43
+ - не ломает публичные контракты модулей.
44
+ - Примеры допустимых улучшений (абстрактно):
45
+ - вынести дублирующуюся логику в общую утилиту / хук / mapper / use case;
46
+ - сузить небезопасные типы и unsafe-операции стека;
47
+ - разделить слишком крупный модуль на несколько более простых;
48
+ - заменить локальные «магические» значения на токены/примитивы дизайн‑системы;
49
+ - заменить deep‑импорты внутренних файлов других модулей на обращения к их public API.
50
+
51
+ # Ограничения
52
+
53
+ - Не выполнять «большой» рефакторинг, если задача точечная и не про архитектуру:
54
+ - не менять структуру директорий / модулей / таргетов без нужды;
55
+ - не менять названия публичных типов/функций/API без явного запроса.
56
+ - При необходимости крупного изменения:
57
+ - сначала локально улучшить архитектуру минимальными шагами;
58
+ - оставить код в консистентном (собираемом) состоянии.
59
+
60
+ # Требование к агенту
61
+
62
+ - **Boy scout rule:** оставлять модуль немного лучше, чем до изменения (простые, безопасные улучшения).
63
+ - Не жертвовать архитектурой и слоями ради краткости реализации.
64
+
65
+ > Stack-specific lint gates, примеры и toolchain — в секции **Stack notes** адаптера пресета.
66
+
67
+ ## Stack notes
68
+
69
+ - **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.
70
+ - Public API between packages: exported types/funcs in `pkg/` or explicit ports — avoid deep imports of another feature's `internal`.
71
+ - Prefer wrapping errors with `%w`; check with `errors.Is` / `errors.As`.
72
+ - Interfaces belong at **ports** (consumer side), not on every struct.
73
+ - Post-change gate: **`post-change-test.mdc`** + **`go-tooling.mdc`** (not yarn lint / xcodebuild).
@@ -0,0 +1,43 @@
1
+ ---
2
+ description: Code review checklist for Go hexagonal merge requests
3
+ alwaysApply: false
4
+ ---
5
+
6
+ <!-- shared-core: review/code-review-mr.md -->
7
+
8
+ # Code review merge requests
9
+
10
+ On-demand rule for review flows. **Procedure and output format:** skill `code-review`.
11
+
12
+ ## When to load
13
+
14
+ - User asks for review/MR/diff
15
+ - Pipeline step `code-reviewer`
16
+ - Platform automated review (e.g. BUGBOT) when present
17
+
18
+ ## Checklist references (abstract)
19
+
20
+ - Architecture layers and stack core rules
21
+ - Public imports / module boundaries
22
+ - UI conventions of the stack
23
+ - Unit and e2e/UI test conventions
24
+ - Post-change lint/build gate before final report
25
+ - Design smells **in MR diff scope** — load `design-guidance`; не разворачивать полный каталог Fowler вне диффа
26
+ - Pattern name (GoF) — только если репозиторий уже использует эту форму или match минимален
27
+ - Principles (KISS / DRY+Ro3 / YAGNI / SOLID / CUPID) — через always-on `code-quality-and-refactoring`, не дублировать эссе в review
28
+
29
+ Concrete rule stems — in **Stack notes**.
30
+
31
+ ## Constraints
32
+
33
+ - Focus on MR diff, not the whole repo.
34
+ - Use local `git diff` — do not invent hosting metadata.
35
+ - Boy scout rule: suggest fixes feasible within the MR scope.
36
+ - No «большие рефакторинги» without an explicit request (`code-quality-and-refactoring`).
37
+
38
+ ## Stack notes
39
+
40
+ - Hexagonal boundaries: `architecture-boundaries`, `domain-layer`, ports vs adapters.
41
+ - HTTP/persistence mapping only at edges; composition root has no business logic.
42
+ - Tests: `tests-unit`, `tests-integration`; post-change: `post-change-test` / `go-tooling`.
43
+ - Never require Playwright, XCUITest, `lint:js`, or `xcodebuild` for Go MRs.
@@ -0,0 +1,29 @@
1
+ ---
2
+ description: Composition root and DI wiring for Go hexagonal services
3
+ globs:
4
+ - cmd/**/*
5
+ - internal/app/**/*
6
+ alwaysApply: false
7
+ ---
8
+
9
+
10
+ # Composition root
11
+
12
+ - Construct adapters, use cases, and servers in `cmd/<service>` and/or `internal/app`.
13
+ - Wire interfaces to implementations explicitly (manual DI preferred unless repo already uses a container).
14
+ - Load config once; fail fast on missing required settings.
15
+ - Lifecycle: graceful shutdown via `context` cancel + server `Shutdown`.
16
+
17
+ ## Allowed here
18
+
19
+ - Import all layers for wiring only.
20
+ - Process-wide loggers/metrics providers.
21
+
22
+ ## Forbidden
23
+
24
+ - Business rules, SQL queries, HTTP routing tables with domain logic.
25
+ - Global mutable singletons for repos without clear init (prefer explicit deps).
26
+
27
+ ## Tests
28
+
29
+ - Optional smoke that wiring builds (compile-time / construction test); heavy logic stays in unit/integration tests.