@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,58 @@
1
+ ---
2
+ name: technical-retro
3
+ description: Facilitate a technical retrospective for a period, incident, release, or completed agent-team task slug.
4
+ ---
5
+
6
+ # Техническое ретро — роль агента
7
+
8
+ Агент выступает как **нейтральный фасилитатор технической ретроспективы**, а не как ревьюер кода или оценщик людей. Цель — вынести уроки, согласовать действия и улучшить процесс разработки. Используй skill **`technical-retro`** как основной сценарий.
9
+
10
+ ## Когда включать
11
+
12
+ - Пользователь просит: «ретро», «техническое ретро», «разбор спринта/итерации», «что пошло хорошо / плохо», «action items после релиза».
13
+ - Есть контекст: период (спринт, квартал), тема (релиз, инцидент, миграция), или приложены заметки/линки.
14
+
15
+ ## Входные данные (запросить при нехватке)
16
+
17
+ - **Период и фокус** (например: две недели, релиз X, постмортем).
18
+ - **Участники/роли** (если важно для формулировок): только разработка или весь кросс‑функциональный поток.
19
+ - **Ограничения**: время (15 / 30 / 60 мин), формат (async в чате vs синхронная повестка).
20
+ - По желанию: список deliverables, метрики, ссылки на тикеты/MR — **без выдумывания** фактов, которых нет в сообщении или репозитории.
21
+
22
+ Если контекста мало — задать **1–3 коротких уточняющих вопроса**, затем продолжить с явными допущениями в шапке вывода.
23
+
24
+ ## Принципы фасилитации
25
+
26
+ - **Безопасность и нейтральность**: формулировки про процесс и систему, не про «виноватых»; избегать ярлыков к людям.
27
+ - **Конкретика**: от абстрактного «надо лучше общаться» — к наблюдаемым событиям и договорённостям.
28
+ - **Баланс**: зафиксировать и позитив (что усилить), и зоны роста.
29
+ - **Один владелец и срок** у каждого action item; избегать списка «сделает команда» без имени/роли.
30
+ - **Не смешивать с code review**: ретро не заменяет построчный разбор диффа; при запросе «и ретро, и ревью» — развести два блока в ответе.
31
+
32
+ ## Рекомендуемая структура сессии (по умолчанию)
33
+
34
+ Подстроить под указанное время. Для короткого async‑формата — сжать до шагов 2–4.
35
+
36
+ 1. **Цель и рамки** (1–2 предложения): зачем встреча, что в фокусе / что вне скоупа.
37
+ 2. **Сбор фактов** (молча в чате — списком от пользователя; агент структурирует):
38
+ - что шло хорошо,
39
+ - что мешало / вызывало риски,
40
+ - сюрпризы (технический долг, узкие места, зависимости).
41
+ 3. **Группировка тем**: объединить дубли, выделить 3–7 тем для обсуждения (приоритет — влияние × изменяемость).
42
+ 4. **Корневые причины (легко)**: для 1–2 самых болезненных тем — кратко «5 почему» или «что в процессе/артефактах позволило этому случиться», без морализаторства.
43
+ 5. **Эксперименты на следующий цикл**: не больше 1–3 изменений процесса/инструментов; каждое — измеримое или с явным критерием «успех/не успех».
44
+ 6. **Action items**: таблица или список с **что / владелец / до когда / как поймём, что сработало**.
45
+
46
+ ## Формат ответа агента
47
+
48
+ - Краткая **шапка**: период, фокус, допущения (если были).
49
+ - **Повестка** или итог по этапам выше.
50
+ - **Темы** — буллеты; по спорным местам — **вопросы команде**, а не окончательные выводы без данных.
51
+ - **Решения и эксперименты** отдельным блоком.
52
+ - **Action items** — в конце, каждый пункт с владельцем и дедлайном (или пометка «нужно назначить на встрече»).
53
+
54
+ ## Ограничения
55
+
56
+ - Не приписывать команде цитаты или факты, которых не было во входе.
57
+ - Не выдавать юридические/HR‑рекомендации; при явных конфликтах или токсичности — мягко предложить эскалацию человеку, ответственному за команду, без детализации «наказаний».
58
+ - Если пользователь просит только шаблон — выдать **шаблон повестки и доски** (колонки, таймбоксы) без выдуманного контента.
@@ -0,0 +1,16 @@
1
+ # `.claude/hooks` (preset go)
2
+
3
+ | File | Purpose |
4
+ |------|---------|
5
+ | `chain-team-phases.sh` | Pipeline chaining after subagent stop (`TEAM_ROOT=.claude/team`) |
6
+ | `guard-shell-command.sh` | Destructive git / JS package-manager guard; **allows** `go test` / `go vet` / `golangci-lint` / `staticcheck` |
7
+
8
+ Claude Code may not use Cursor `hooks.json`. Wire scripts per project docs when enabling agent-team auto-chain.
9
+
10
+ **No `hooks.json` in Claude preset** (platform limit — same as next Claude).
11
+
12
+ ## Optional cookbook
13
+
14
+ Example scripts live in `hooks/examples/` (secret-guard, format-edited, test-on-save). They are **not** auto-enabled.
15
+
16
+ To wire in Claude Code: copy an `.example.sh` into `hooks/`, make executable, and register per [Claude Code hooks](https://code.claude.com/docs/en/hooks) for your project. Keep stack-safe recipes (this preset: **go**). Cursor twin examples under `presets/cursor/go/hooks/examples/` are the same allowlist forks.
@@ -0,0 +1,381 @@
1
+ #!/usr/bin/env bash
2
+ # preset: go (hexagonal) — chain handoffs use integration-test-* + go test
3
+ # Chains agent team steps from pipeline.json after subagentStop.
4
+ # Falls back to legacy phase-based flow when pipeline.json is absent.
5
+
6
+ set -euo pipefail
7
+
8
+ input=$(cat)
9
+
10
+ INPUT="$input" node <<'NODE'
11
+ const fs = require('fs');
12
+ const path = require('path');
13
+
14
+ const TEAM_ROOT = path.join(process.cwd(), '.claude', 'team');
15
+
16
+ const inputRaw = process.env.INPUT || '';
17
+ let hookInput;
18
+ try {
19
+ hookInput = JSON.parse(inputRaw);
20
+ } catch {
21
+ process.stdout.write('{}');
22
+ process.exit(0);
23
+ }
24
+
25
+ if (hookInput.status !== 'completed') {
26
+ process.stdout.write('{}');
27
+ process.exit(0);
28
+ }
29
+
30
+ const activePath = path.join(TEAM_ROOT, 'active-task.json');
31
+
32
+ if (!fs.existsSync(activePath)) {
33
+ process.stdout.write('{}');
34
+ process.exit(0);
35
+ }
36
+
37
+ let active;
38
+ try {
39
+ active = JSON.parse(fs.readFileSync(activePath, 'utf8'));
40
+ } catch {
41
+ process.stdout.write('{}');
42
+ process.exit(0);
43
+ }
44
+
45
+ const slug = active.slug;
46
+ if (!slug) {
47
+ process.stdout.write('{}');
48
+ process.exit(0);
49
+ }
50
+
51
+ const taskDir = path.join(TEAM_ROOT, 'tasks', slug);
52
+ const statusPath = path.join(taskDir, 'status.json');
53
+ const pipelinePath = path.join(taskDir, 'pipeline.json');
54
+
55
+ if (!fs.existsSync(statusPath)) {
56
+ process.stdout.write('{}');
57
+ process.exit(0);
58
+ }
59
+
60
+ let status;
61
+ try {
62
+ status = JSON.parse(fs.readFileSync(statusPath, 'utf8'));
63
+ } catch {
64
+ process.stdout.write('{}');
65
+ process.exit(0);
66
+ }
67
+
68
+ const now = new Date().toISOString();
69
+
70
+ function writeStatus(next) {
71
+ status = { ...status, ...next, slug, updatedAt: now };
72
+ fs.writeFileSync(statusPath, JSON.stringify(status, null, 2) + '\n');
73
+ }
74
+
75
+ function out(message) {
76
+ process.stdout.write(JSON.stringify({ followup_message: message }));
77
+ }
78
+
79
+ function readArtifact(name) {
80
+ const p = path.join(taskDir, name);
81
+ if (!fs.existsSync(p)) return '';
82
+ try {
83
+ return fs.readFileSync(p, 'utf8');
84
+ } catch {
85
+ return '';
86
+ }
87
+ }
88
+
89
+ function getStepAgents(step) {
90
+ if (!step) return [];
91
+ return Array.isArray(step.agent) ? step.agent : [step.agent];
92
+ }
93
+
94
+ function skipIfMatches(skipIf, dir) {
95
+ if (!skipIf) return false;
96
+ if (skipIf === 'debugger.fixed') {
97
+ const text = readArtifact('debug-report.md');
98
+ return /fixApplied:\s*true/i.test(text) || /\*\*Fix applied:\*\*\s*true/i.test(text);
99
+ }
100
+ if (skipIf === 'ci-investigator.resolved') {
101
+ const text = readArtifact('ci-report.md');
102
+ return /fixApplied:\s*true/i.test(text) || /## Verdict\s*\nPASS/i.test(text);
103
+ }
104
+ return false;
105
+ }
106
+
107
+ function findNextExecutableStep(steps, startIdx, dir) {
108
+ for (let i = startIdx; i < steps.length; i++) {
109
+ if (!skipIfMatches(steps[i].skipIf, dir)) {
110
+ return { step: steps[i], index: i };
111
+ }
112
+ }
113
+ return null;
114
+ }
115
+
116
+ const AGENT_HANDOFF = {
117
+ 'task-analyst': (s) =>
118
+ `Invoke task-analyst for slug "${s}". Write brief.md and decomposition.md under .claude/team/tasks/${s}/. ` +
119
+ `Set status.json: phase executing, state awaiting_approval if human gate applies. Do not use legacy phase analysis.`,
120
+ debugger: (s) =>
121
+ `Invoke debugger subagent for slug "${s}". Investigate root cause with go test/logs; write debug-report.md with fixApplied: true/false. ` +
122
+ `Update status.json when done.`,
123
+ 'solution-architect': (s) =>
124
+ `Invoke solution-architect for slug "${s}". Read brief.md; write architecture.md for Go hexagonal layers. Update status.json when done.`,
125
+ 'migration-specialist': (s) =>
126
+ `Invoke migration-specialist for slug "${s}". Read brief.md; write migration-plan.md for Go module/toolchain. Update status.json when done.`,
127
+ 'api-contract-reviewer': (s) =>
128
+ `Invoke api-contract-reviewer (readonly) for slug "${s}". Review OpenAPI/Protobuf vs adapters; write api-contract-review.md. Update status.json when done.`,
129
+ 'ci-investigator': (s) =>
130
+ `Invoke ci-investigator for slug "${s}". Diagnose CI failure (go test/vet/lint or preset-structure); write ci-report.md; apply minimal fix. ` +
131
+ `Use ci-investigation skill. Update status.json when done.`,
132
+ 'feature-developer': (s) =>
133
+ `Invoke feature-developer for slug "${s}". Read brief.md, decomposition.md, validation-report.md, review.md, architecture.md, migration-plan.md, api-contract-review.md, debug-report.md if present. ` +
134
+ `Follow feature-delivery-workflow.mdc and reference-features.mdc. Prefer internal/domain|application|adapters and cmd/ composition root. ` +
135
+ `Include table-driven go test coverage for domain/use cases before handoff. Update status.json when done.`,
136
+ 'build-verifier': (s) =>
137
+ `Invoke build-verifier (readonly) for slug "${s}". Follow go-tooling.mdc and post-change-test.mdc. ` +
138
+ `Run go test ./..., go vet ./..., and golangci-lint/staticcheck if configured — never yarn/ESLint/Stylelint. ` +
139
+ `For preset packaging: yarn check:preset-structure. Write validation-report.md. Set state completed or validation_failed. Do not edit production code.`,
140
+ 'performance-auditor': (s) =>
141
+ `Invoke performance-auditor (readonly) for slug "${s}". Audit Go hot paths/allocs/DB N+1/pprof risks; write perf-report.md. Update status.json when done.`,
142
+ 'code-reviewer': (s) =>
143
+ `Invoke code-reviewer subagent (readonly) for slug "${s}". Review git diff vs brief.md per code-review-mr.mdc (hexagonal boundaries). ` +
144
+ `Update status.json when done.`,
145
+ 'security-reviewer': (s) =>
146
+ `Invoke security-reviewer (readonly) for slug "${s}". Follow security-go.mdc; write security-review.md. Update status.json when done.`,
147
+ 'qa-tester': (s, scope) =>
148
+ `Invoke qa-tester for slug "${s}"${scope ? ` (scope: ${scope})` : ''}. ` +
149
+ `Add/update go unit and integration tests per brief. Follow tests-unit.mdc, tests-integration.mdc, and skill integration-testing. Update status.json when done.`,
150
+ 'unit-test-planner': (s) =>
151
+ `Invoke unit-test-planner for slug "${s}". Write unit-test-plan.md for table-driven go test. Use unit-testing skill. Update status.json when done.`,
152
+ 'unit-test-generator': (s) =>
153
+ `Invoke unit-test-generator for slug "${s}". Implement *_test.go from unit-test-plan.md. Use unit-testing skill. Update status.json when done.`,
154
+ 'unit-test-healer': (s) =>
155
+ `Invoke unit-test-healer for slug "${s}". Fix failing unit tests. Use unit-testing and debug-investigation skills. Update status.json when done.`,
156
+ 'integration-test-planner': (s) =>
157
+ `Invoke integration-test-planner for slug "${s}". Create/update integration test plans (httptest/testcontainers/adapter contracts). ` +
158
+ `Follow tests-integration.mdc and the integration-testing skill. Do not use browser e2e tooling. Update status.json when done.`,
159
+ 'integration-test-generator': (s) =>
160
+ `Invoke integration-test-generator for slug "${s}". Generate/update *_integration_test.go from plans. ` +
161
+ `Follow tests-integration.mdc and the integration-testing skill. Do not use browser e2e tooling. Update status.json when done.`,
162
+ 'integration-test-healer': (s) =>
163
+ `Invoke integration-test-healer for slug "${s}". Fix failing/flaky integration tests while preserving plan assertions. ` +
164
+ `Follow tests-integration.mdc, integration-testing, and debug-investigation. Do not use browser e2e tooling. Update status.json when done.`,
165
+ 'tech-writer': (s) =>
166
+ `Invoke tech-writer for slug "${s}". Write documentation.md from task artifacts. Update status.json when done.`,
167
+ };
168
+
169
+ const REVIEW_AGENTS = new Set([
170
+ 'code-reviewer',
171
+ 'security-reviewer',
172
+ 'api-contract-reviewer',
173
+ ]);
174
+
175
+
176
+ function handoffForAgent(agent, scope) {
177
+ const fn = AGENT_HANDOFF[agent];
178
+ return fn ? fn(slug, scope) : `Invoke ${agent} subagent for slug "${slug}". Update status.json when done.`;
179
+ }
180
+
181
+ function handoffForParallelStep(step) {
182
+ const agents = getStepAgents(step);
183
+ return (
184
+ `Invoke IN PARALLEL (one message, multiple Task calls): ${agents.join(' AND ')} for slug "${slug}". ` +
185
+ `Each agent writes its artifact and appends itself to status.json parallelCompleted when done.`
186
+ );
187
+ }
188
+
189
+ function hasGateAfter(agent, humanGates) {
190
+ return Array.isArray(humanGates) && humanGates.includes(`after:${agent}`);
191
+ }
192
+
193
+ function hasGateAfterStep(step, humanGates) {
194
+ return getStepAgents(step).some((a) => hasGateAfter(a, humanGates));
195
+ }
196
+
197
+ function legacyFlow() {
198
+ if (status.phase === 'analysis') {
199
+ process.stdout.write('{}');
200
+ process.exit(0);
201
+ }
202
+ if (status.phase === 'development' && (status.state === 'completed' || status.state === 'in_progress')) {
203
+ writeStatus({ phase: 'executing', state: 'in_progress', currentAgent: 'build-verifier' });
204
+ out(handoffForAgent('build-verifier'));
205
+ process.exit(0);
206
+ }
207
+ if (status.currentAgent === 'build-verifier' && status.state === 'completed') {
208
+ writeStatus({ phase: 'executing', state: 'in_progress', currentAgent: 'code-reviewer' });
209
+ out(handoffForAgent('code-reviewer'));
210
+ process.exit(0);
211
+ }
212
+ if (status.phase === 'review' && status.state === 'completed') {
213
+ writeStatus({ phase: 'executing', state: 'in_progress', currentAgent: 'qa-tester' });
214
+ out(handoffForAgent('qa-tester'));
215
+ process.exit(0);
216
+ }
217
+ if (status.state === 'changes_requested' && REVIEW_AGENTS.has(status.currentAgent)) {
218
+ writeStatus({
219
+ currentAgent: 'feature-developer',
220
+ state: 'in_progress',
221
+ phase: 'executing',
222
+ retryAfterFix: status.currentAgent,
223
+ });
224
+ out(
225
+ handoffForAgent('feature-developer') +
226
+ ` After fixes, re-run ${status.currentAgent}.`,
227
+ );
228
+ process.exit(0);
229
+ }
230
+ if (status.state === 'validation_failed' && status.currentAgent === 'build-verifier') {
231
+ writeStatus({
232
+ currentAgent: 'feature-developer',
233
+ state: 'in_progress',
234
+ phase: 'executing',
235
+ retryAfterFix: 'build-verifier',
236
+ });
237
+ out(
238
+ handoffForAgent('feature-developer') +
239
+ ` Read validation-report.md. After fixes, re-run build-verifier.`,
240
+ );
241
+ process.exit(0);
242
+ }
243
+ if (status.state === 'completed' && status.retryAfterFix) {
244
+ const retry = status.retryAfterFix;
245
+ writeStatus({ currentAgent: retry, state: 'in_progress', retryAfterFix: null });
246
+ out(handoffForAgent(retry));
247
+ process.exit(0);
248
+ }
249
+ if (status.phase === 'testing' && status.state === 'completed') {
250
+ writeStatus({ phase: 'done', state: 'completed' });
251
+ out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
252
+ process.exit(0);
253
+ }
254
+ process.stdout.write('{}');
255
+ process.exit(0);
256
+ }
257
+
258
+ if (!fs.existsSync(pipelinePath)) {
259
+ legacyFlow();
260
+ }
261
+
262
+ let pipeline;
263
+ try {
264
+ pipeline = JSON.parse(fs.readFileSync(pipelinePath, 'utf8'));
265
+ } catch {
266
+ legacyFlow();
267
+ }
268
+
269
+ const steps = pipeline.steps || [];
270
+ if (steps.length === 0 || pipeline.autoChain === false) {
271
+ process.stdout.write('{}');
272
+ process.exit(0);
273
+ }
274
+
275
+ if (status.awaitingHumanGate || status.state === 'awaiting_approval') {
276
+ process.stdout.write('{}');
277
+ process.exit(0);
278
+ }
279
+
280
+ if (status.state === 'changes_requested' && REVIEW_AGENTS.has(status.currentAgent)) {
281
+ const reviewer = status.currentAgent;
282
+ writeStatus({
283
+ currentAgent: 'feature-developer',
284
+ state: 'in_progress',
285
+ phase: 'executing',
286
+ retryAfterFix: reviewer,
287
+ });
288
+ out(
289
+ handoffForAgent('feature-developer') +
290
+ ` After fixes, re-run ${reviewer}.`,
291
+ );
292
+ process.exit(0);
293
+ }
294
+
295
+ if (status.state === 'validation_failed' && status.currentAgent === 'build-verifier') {
296
+ writeStatus({
297
+ currentAgent: 'feature-developer',
298
+ state: 'in_progress',
299
+ phase: 'executing',
300
+ retryAfterFix: 'build-verifier',
301
+ });
302
+ out(
303
+ handoffForAgent('feature-developer') +
304
+ ` Read validation-report.md. After fixes, re-run build-verifier.`,
305
+ );
306
+ process.exit(0);
307
+ }
308
+
309
+ if (status.state === 'completed' && status.retryAfterFix) {
310
+ const retry = status.retryAfterFix;
311
+ writeStatus({ currentAgent: retry, state: 'in_progress', retryAfterFix: null });
312
+ out(handoffForAgent(retry));
313
+ process.exit(0);
314
+ }
315
+
316
+ const idx = typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0;
317
+ const currentStep = steps[idx];
318
+ if (!currentStep) {
319
+ writeStatus({ phase: 'done', state: 'completed', currentAgent: null });
320
+ out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
321
+ process.exit(0);
322
+ }
323
+
324
+ const completedAgent = status.currentAgent || getStepAgents(currentStep)[0];
325
+ const stepAgents = getStepAgents(currentStep);
326
+
327
+ if (currentStep.parallel && stepAgents.length > 1) {
328
+ const done = [...(status.parallelCompleted || [])];
329
+ if (completedAgent && !done.includes(completedAgent)) {
330
+ done.push(completedAgent);
331
+ }
332
+ writeStatus({ parallelCompleted: done });
333
+ const remaining = stepAgents.filter((a) => !done.includes(a));
334
+ if (remaining.length > 0) {
335
+ process.stdout.write('{}');
336
+ process.exit(0);
337
+ }
338
+ writeStatus({ parallelCompleted: [] });
339
+ }
340
+
341
+ if (hasGateAfterStep(currentStep, pipeline.humanGates)) {
342
+ writeStatus({
343
+ awaitingHumanGate: true,
344
+ state: 'awaiting_approval',
345
+ currentAgent: completedAgent,
346
+ });
347
+ process.stdout.write('{}');
348
+ process.exit(0);
349
+ }
350
+
351
+ const next = findNextExecutableStep(steps, idx + 1, taskDir);
352
+ if (!next) {
353
+ writeStatus({
354
+ pipelineIndex: steps.length,
355
+ phase: 'done',
356
+ state: 'completed',
357
+ currentAgent: null,
358
+ awaitingHumanGate: false,
359
+ });
360
+ out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
361
+ process.exit(0);
362
+ }
363
+
364
+ const { step: nextStep, index: nextIdx } = next;
365
+ const nextAgents = getStepAgents(nextStep);
366
+
367
+ writeStatus({
368
+ pipelineIndex: nextIdx,
369
+ currentAgent: nextAgents[0],
370
+ phase: 'executing',
371
+ state: 'in_progress',
372
+ awaitingHumanGate: false,
373
+ parallelCompleted: [],
374
+ });
375
+
376
+ if (nextStep.parallel && nextAgents.length > 1) {
377
+ out(handoffForParallelStep(nextStep));
378
+ } else {
379
+ out(handoffForAgent(nextAgents[0], nextStep.scope));
380
+ }
381
+ NODE
@@ -0,0 +1,18 @@
1
+ # Hooks cookbook (examples)
2
+
3
+ Optional scripts under `hooks/examples/`. **Not** referenced from default `hooks.json` (only `guard-shell-command.sh` + `chain-team-phases.sh`).
4
+
5
+ | Script | Purpose |
6
+ |--------|---------|
7
+ | `secret-guard.example.sh` | Fail if staged diff looks like secrets |
8
+ | `format-edited.example.sh` | Stack formatter / linter on edited files |
9
+ | `test-on-save.example.sh` | Scoped tests for the stack |
10
+
11
+ ## Wiring (Cursor)
12
+
13
+ 1. Copy an example into `hooks/` (drop `.example` suffix), e.g. `cp hooks/examples/secret-guard.example.sh hooks/secret-guard.sh`.
14
+ 2. `chmod +x hooks/secret-guard.sh`.
15
+ 3. Add a hook entry in `.cursor/hooks.json` (e.g. `beforeShellExecution` or `afterFileEdit` — see Cursor hooks docs).
16
+ 4. Keep cookbook scripts **out** of the default preset `hooks.json` when contributing back upstream.
17
+
18
+ Stack: **go** — recipes must stay stack-safe (no cross-stack lint/test commands).
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+ # Optional: gofmt / golangci-lint on edited packages.
3
+ # NOT in default hooks.json.
4
+ set -euo pipefail
5
+ gofmt -w $(git diff --name-only --diff-filter=ACMR HEAD 2>/dev/null | grep '\.go$' || true) 2>/dev/null || true
6
+ if command -v golangci-lint >/dev/null 2>&1; then
7
+ golangci-lint run ./... 2>/dev/null || true
8
+ fi
9
+ exit 0
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env bash
2
+ # Optional cookbook: block committing likely secrets in staged diffs.
3
+ # NOT wired in default hooks.json — copy to hooks/ and register manually.
4
+ set -euo pipefail
5
+ PATTERN='(AKIA[0-9A-Z]{16}|-----BEGIN (RSA |OPENSSH )?PRIVATE KEY-----|api[_-]?key\s*[:=]\s*['\''\"][^'\''\"]{12,})'
6
+ if git diff --cached -U0 2>/dev/null | grep -Eiq "$PATTERN"; then
7
+ echo "secret-guard: possible secret in staged diff — review before commit" >&2
8
+ exit 1
9
+ fi
10
+ exit 0
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env bash
2
+ # Optional: package-scoped go test for changed packages.
3
+ # NOT in default hooks.json.
4
+ set -euo pipefail
5
+ pkgs=$(git diff --name-only --diff-filter=ACMR HEAD 2>/dev/null | grep '\.go$' | xargs -n1 dirname 2>/dev/null | sort -u | sed 's|^|./|' || true)
6
+ if [[ -n "${pkgs:-}" ]]; then
7
+ go test $pkgs 2>/dev/null || true
8
+ else
9
+ go test ./... 2>/dev/null || true
10
+ fi
11
+ exit 0
@@ -0,0 +1,79 @@
1
+ #!/usr/bin/env bash
2
+ # Lightweight shell guard for Claude Code projects using this preset.
3
+ # Go: do NOT blanket-block go test / go vet / golangci-lint / staticcheck.
4
+ # Package-manager mismatch checks apply only when a JS lockfile/package.json exists.
5
+
6
+ set -euo pipefail
7
+
8
+ input=$(cat)
9
+
10
+ INPUT="$input" node <<'NODE'
11
+ const fs = require('fs');
12
+
13
+ const raw = process.env.INPUT || '';
14
+ let event;
15
+ try {
16
+ event = JSON.parse(raw);
17
+ } catch {
18
+ process.stdout.write('{ "permission": "allow" }');
19
+ process.exit(0);
20
+ }
21
+
22
+ const command = String(event.command || event.input?.command || '');
23
+ if (!command.trim()) {
24
+ process.stdout.write('{ "permission": "allow" }');
25
+ process.exit(0);
26
+ }
27
+
28
+ function out(permission, userMessage, agentMessage) {
29
+ process.stdout.write(JSON.stringify({
30
+ permission,
31
+ user_message: userMessage,
32
+ agent_message: agentMessage || userMessage,
33
+ }));
34
+ }
35
+
36
+ const dangerousGit = /\bgit\s+(reset\s+--hard|clean\s+-[^\n]*f|push\s+--force|push\s+-f|checkout\s+--\s+)/;
37
+ if (dangerousGit.test(command)) {
38
+ out(
39
+ 'ask',
40
+ 'This command looks destructive for git state. Review it before continuing.',
41
+ 'A project hook flagged a destructive git command. Ask the user before running it.',
42
+ );
43
+ process.exit(0);
44
+ }
45
+
46
+ const managerByFile = [
47
+ ['yarn.lock', 'yarn'],
48
+ ['pnpm-lock.yaml', 'pnpm'],
49
+ ['package-lock.json', 'npm'],
50
+ ].find(([file]) => fs.existsSync(file));
51
+
52
+ let expected = managerByFile?.[1];
53
+ if (!expected && fs.existsSync('package.json')) {
54
+ try {
55
+ const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
56
+ const pm = typeof pkg.packageManager === 'string' ? pkg.packageManager : '';
57
+ expected = pm.split('@')[0] || undefined;
58
+ } catch {
59
+ // Ignore invalid package.json in the hook; the agent can diagnose it later.
60
+ }
61
+ }
62
+
63
+ if (!expected) {
64
+ process.stdout.write('{ "permission": "allow" }');
65
+ process.exit(0);
66
+ }
67
+
68
+ const used = command.match(/(^|[;&|]\s*)(npm|yarn|pnpm)\s+/)?.[2];
69
+ if (used && used !== expected) {
70
+ out(
71
+ 'ask',
72
+ `This repository appears to use ${expected}, but the command uses ${used}. Confirm before continuing.`,
73
+ `Use ${expected} for package scripts and installs unless the user explicitly approves ${used}.`,
74
+ );
75
+ process.exit(0);
76
+ }
77
+
78
+ process.stdout.write('{ "permission": "allow" }');
79
+ NODE
@@ -0,0 +1,12 @@
1
+ {
2
+ "mcpServers": {
3
+ "context7": {
4
+ "command": "npx",
5
+ "args": ["-y", "@upstash/context7-mcp"]
6
+ },
7
+ "figma": {
8
+ "type": "http",
9
+ "url": "https://mcp.figma.com/mcp"
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,60 @@
1
+ # `.claude/rules` (preset go)
2
+
3
+ Claude topic `.md` files are **derived** from Cursor SoT `presets/cursor/go/rules/*.mdc`.
4
+
5
+ ## SoT sync
6
+
7
+ | Principle | Detail |
8
+ |-----------|--------|
9
+ | **SoT** | `presets/cursor/go/rules/*.mdc` |
10
+ | **Derive** | Claude topic `.md` + `paths:` (drop `alwaysApply`) |
11
+ | **Checklist** | change Cursor → update Claude twin **same PR** (**FAIL** if missing — next, ios-swift, and go; see `preset-twin-sync` / build-verifier) |
12
+
13
+ ## Loading budget
14
+
15
+ - **Session-start (no `paths:`):** exactly **3** — `go-app-core`, `boundaries`, `code-quality`
16
+ - All others — with `paths:`
17
+ - **Twin depth:** domain rules target ≥15 body lines; thin aliases: `agent-team-intake`, `technical-retro`; checklist **stubs** documented in Cursor `presets/cursor/go/rules/README.md` Catalog (Depth column)
18
+
19
+ ## Cursor → Claude mapping
20
+
21
+ | Cursor `.mdc` (SoT) | Claude topic |
22
+ |---------------------|--------------|
23
+ | `adapters-driven.mdc` | `api-and-data/adapters-driven.md` |
24
+ | `adapters-driving.mdc` | `api-and-data/adapters-driving.md` |
25
+ | `agent-team-intake.mdc` | `tooling-and-review/agent-team-intake.md` |
26
+ | `agent-team-orchestrator.mdc` | `tooling-and-review/agent-team-orchestrator.md` |
27
+ | `api-grpc.mdc` | `api-and-data/api-grpc.md` |
28
+ | `api-http.mdc` | `api-and-data/api-http.md` |
29
+ | `application-usecases.mdc` | `architecture/application-usecases.md` |
30
+ | `architecture-boundaries.mdc` | `architecture/boundaries.md` |
31
+ | `code-quality-and-refactoring.mdc` | `tooling-and-review/code-quality.md` |
32
+ | `design-guidance.mdc` | `tooling-and-review/design-guidance.md` |
33
+ | `code-review-mr.mdc` | `tooling-and-review/code-review.md` |
34
+ | `composition-root.mdc` | `architecture/composition-root.md` |
35
+ | `domain-layer.mdc` | `architecture/domain-layer.md` |
36
+ | `feature-delivery-workflow.mdc` | `architecture/feature-delivery.md` |
37
+ | `go-app-core.mdc` | `stack/go-app-core.md` |
38
+ | `go-conventions.mdc` | `stack/go-conventions.md` |
39
+ | `go-tooling.mdc` | `tooling-and-review/go-tooling.md` |
40
+ | `messaging-adapters.mdc` | `api-and-data/messaging-adapters.md` |
41
+ | `module-public-api.mdc` | `architecture/module-public-api.md` |
42
+ | `persistence-adapters.mdc` | `api-and-data/persistence-adapters.md` |
43
+ | `ports-interfaces.mdc` | `architecture/ports-interfaces.md` |
44
+ | `post-change-test.mdc` | `tooling-and-review/post-change-test.md` |
45
+ | `preset-layering.mdc` | `tooling-and-review/preset-layering.md` |
46
+ | `preset-no-cross-stack-leakage.mdc` | `tooling-and-review/preset-no-cross-stack-leakage.md` |
47
+ | `preset-pr-checklist.mdc` | `tooling-and-review/preset-pr-checklist.md` |
48
+ | `preset-token-budget.mdc` | `tooling-and-review/preset-token-budget.md` |
49
+ | `preset-twin-sync.mdc` | `tooling-and-review/preset-twin-sync.md` |
50
+ | `reference-features.mdc` | `architecture/reference-features.md` |
51
+ | `security-go.mdc` | `tooling-and-review/security-go.md` |
52
+ | `technical-retro.mdc` | `tooling-and-review/technical-retro.md` |
53
+ | `tests-e2e.mdc` | `testing/e2e.md` |
54
+ | `tests-integration.mdc` | `testing/integration.md` |
55
+ | `tests-unit.mdc` | `testing/unit.md` |
56
+
57
+ ## Topics
58
+
59
+ `architecture/`, `stack/`, `api-and-data/`, `testing/`, `tooling-and-review/`.
60
+ `ui-and-accessibility/` — README stub only (N/A backend).