@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,110 @@
1
+ ---
2
+ description: Design smells (Fowler) and curated GoF patterns for agents. Load when assessing structure, smells, or pattern fit.
3
+ paths:
4
+ - "**/*.swift"
5
+ ---
6
+
7
+ <!-- shared-core: quality/design-guidance.md -->
8
+
9
+ # Design guidance (smells & patterns)
10
+
11
+ Словарь **code smells** (Fowler) и **design patterns** (GoF) для агентов при implement / review / debug.
12
+
13
+ Применять только в scope задачи или MR. Лёгкий refactor — да; «большой» rewrite без явного запроса — нет.
14
+
15
+ Называть паттерн **только если** репозиторий уже так делает или это минимальный match. Иначе — extract/split/move без ярлыка GoF.
16
+
17
+ Не заменяет always-on Principles в `code-quality-and-refactoring` (KISS, DRY + Rule of Three, YAGNI, SOLID, CUPID, composition, Demeter).
18
+
19
+ ## When to load
20
+
21
+ - **Feature delivery / implement** — оценка структуры модулей, границ и дублирования.
22
+ - **Code review** — smells и pattern fit **в диффе MR**, не по всему репо.
23
+ - **Debug** — root-cause похож на wrong abstraction, Feature Envy, Message Chains, Shotgun Surgery.
24
+ - **Light refactor only** — улучшения в рамках boy-scout / MR scope; не расширять задачу ради каталога.
25
+
26
+ Агенты и skills подгружают stem по one-liner wiring — не копировать этот каталог в промпт агента.
27
+
28
+ ## How to use (agent rules of thumb)
29
+
30
+ 1. Сначала сверить с Principles (always-on): проще ли решение, нет ли ранней абстракции, соблюдён ли public API.
31
+ 2. Затем отметить smells **в изменённых файлах** задачи/MR; предложить fix только если он укладывается в light refactor.
32
+ 3. Паттерн GoF — опциональный ярлык после того, как структура уже ясна; не начинать дизайн с выбора паттерна.
33
+ 4. Если smell и паттерн конфликтуют с границами слоёв стека — побеждают stack boundaries и existing repo patterns.
34
+ 5. Не требовать переименования «под GoF», если поведение уже корректно и читаемо.
35
+
36
+ ## Code smells (Fowler, curated ≤12)
37
+
38
+ Таблица: smell → detect hint → fix hint (одна линия каждый). Без механических меню рефакторинга.
39
+
40
+ | # | Smell | Detect | Fix hint |
41
+ |---|-------|--------|----------|
42
+ | 1 | Duplicate Code | одинаковая логика в ≥2 местах | dedupe после Rule of Three |
43
+ | 2 | Long Method / Long Module | единица делает слишком много | extract в рамках scope; без big rewrite |
44
+ | 3 | Feature Envy | метод чаще трогает чужие данные, чем свои | сдвинуть логику к данным / public API |
45
+ | 4 | Data Clumps | одни и те же группы аргументов кочуют вместе | сгруппировать в type / value object |
46
+ | 5 | Primitive Obsession | сырые string/int вместо доменных понятий | typed ids / value objects при нужде домена |
47
+ | 6 | Speculative Generality | неиспользуемые хуки, флаги, абстракции «на будущее» | удалить (YAGNI) |
48
+ | 7 | Message Chains | цепочки `a.b.c.d` | Demeter; facade / public API модуля |
49
+ | 8 | Middle Man | класс почти только прокидывает вызовы | убрать pass-through **или** оставить как boundary |
50
+ | 9 | Divergent Change | один модуль меняется по разным причинам | split по поводам изменения |
51
+ | 10 | Shotgun Surgery | одно смысловое изменение разъезжается по многим файлам | consolidate ответственность |
52
+ | 11 | Inappropriate Intimacy | доступ к чужим internals / private деталям | только public API / ports / facades |
53
+ | 12 | Refused Bequest / Parallel Inheritance | подтип игнорирует базу; зеркальные иерархии классов | composition; не плодить параллельные деревья |
54
+
55
+ **Skip Fowler (не в core):** Lazy Class, Incomplete Library Class, Comments-as-smell dogma, полный каталог 70+, пошаговые recipe-меню.
56
+
57
+ Приоритет при конфликте smells: Inappropriate Intimacy и Message Chains (границы модулей) > Duplicate Code (после Rule of Three) > Long Method внутри уже правильного модуля.
58
+
59
+ ## Design patterns (GoF, curated ≤8)
60
+
61
+ Suggest only when repo already uses the shape or the match is minimal. Prefer extract-function over naming Strategy ради ярлыка.
62
+
63
+ Паттерны ниже — **разрешённый минимум** для агентов; остальной GoF по умолчанию в Skip.
64
+
65
+ | Pattern | When to suggest | Anti-trigger |
66
+ |---------|-----------------|--------------|
67
+ | Strategy | взаимозаменяемые алгоритмы уже (или явно скоро) выбираются политикой | один алгоритм без ветвления политики |
68
+ | Adapter | обернуть внешний / чужой API под локальный port | лишняя обёртка вокруг своего же API |
69
+ | Facade | упростить multi-step subsystem за public API | facade превращается в god-object |
70
+ | Factory Method | полиморфное создание уже принято в стиле репо | factory на каждый тривиальный `new` |
71
+ | Decorator | аддитивное поведение без взрыва subclass-иерархий | decorator «для слоёв» без реальной нужды |
72
+ | Observer | events / subscriptions уже есть в архитектуре | самодельный pub/sub без прецедента в репо |
73
+ | Template Method | общий algorithm skeleton + вариативные hooks | наследование ради пары отличающихся строк |
74
+ | Composite | дерево однородных узлов (UI/domain), как уже в репо | Composite на плоский список без иерархии |
75
+
76
+ Если сомневаешься между двумя паттернами — выбери более простой extract/compose без имени; ярлык можно добавить на review, если репо уже так говорит.
77
+
78
+ ## Skip / avoid by default
79
+
80
+ | Catalog | Skip |
81
+ |---------|------|
82
+ | GoF | Singleton, Abstract Factory, Flyweight, Memento, Interpreter, Visitor, Bridge, Prototype |
83
+ | GoF (conditional) | Command, Chain of Responsibility, State — упоминать **только если** репо уже использует |
84
+ | Fowler | всё сверх 12 smells выше |
85
+ | DDD | Aggregates, bounded-context maps, event sourcing, CQRS — **не в core** |
86
+ | DDD (pointer) | ubiquitous language anti-pattern — расширять в `feature-delivery-workflow`, не здесь |
87
+ | GRASP | список Larman как отдельные правила — skip (перекрывается SOLID/CUPID) |
88
+ | Clean Code dogma | жёсткие caps на строки функции / «ровно один assert» — skip |
89
+
90
+ Не вводить второй stem (`refactoring-smells` / `design-patterns-for-agents`) — один каталог: `design-guidance`.
91
+
92
+ ## Out of scope for this stem
93
+
94
+ - Полный GoF (23) и полный Fowler catalog.
95
+ - Stack-specific рецепты (пути модулей, lint-команды) — только в **Stack notes** адаптера.
96
+ - Security, a11y, perf — отдельные review-правила; здесь только структурные smells/patterns.
97
+ - Четвёртое always-on правило — запрещено; этот stem только requestable / agent-load.
98
+
99
+ ## Cross-refs
100
+
101
+ - Always-on Principles: `code-quality-and-refactoring`.
102
+ - DIP / ports vs adapters: stack `architecture-boundaries` (детали стека — в Stack notes адаптеров).
103
+ - Ubiquitous language: `feature-delivery-workflow` (lineage).
104
+ - MR checklist (smells in scope; pattern name only if repo uses it): `code-review-mr`.
105
+ - Token / twin policy for authors: `preset-token-budget`, `preset-twin-sync` (meta, not consumer always-on).
106
+
107
+ ## Stack notes
108
+
109
+ - Prefer protocol + composition over class inheritance hierarchies.
110
+ - Suggest Adapter/Facade at Feature public API / DI boundaries — not inside Views.
@@ -0,0 +1,36 @@
1
+ ---
2
+ description: Preset authoring: Core → Stack → Platform layering. Use when editing packages/ai-rules/presets/**.
3
+ paths:
4
+ - packages/ai-rules/presets/**/*
5
+ - .claude/**/*
6
+ - .cursor/rules/**/*
7
+ - .cursor/team/tasks/**/*
8
+ ---
9
+
10
+ <!-- shared-core: meta/preset-layering.md -->
11
+
12
+ # Preset layering
13
+
14
+ Правила для **авторов пресетов** (`packages/ai-rules/presets/**`). Не always-on в consumer apps.
15
+
16
+ ## Слои
17
+
18
+ | Слой | Где | Что класть |
19
+ |------|-----|------------|
20
+ | **Core** | `presets/_shared/core/**` | Stack-agnostic prose + checklists; без frontmatter; без путей `app/**`, `Features/**`, Playwright, xcodebuild |
21
+ | **Stack** | `presets/{cursor\|claude}/<stack>/` | Domain/tooling, always-on trio стека, stack examples в **Stack notes** |
22
+ | **Platform** | Cursor `.mdc` / Claude `.md` | Frontmatter (`alwaysApply`/`globs` vs `paths:`), platform-only (`BUGBOT.md`, `CLAUDE.md`) |
23
+
24
+ ## Куда класть новое правило
25
+
26
+ 1. Общие принципы для всех стеков → **core** + адаптеры с `<!-- shared-core: … -->`.
27
+ 2. Только один из installable стеков (`next` / `ios-swift` / `go`) → **stack-specific** (не в `_shared`).
28
+ 3. Только Cursor или только Claude packaging → platform artifact / frontmatter, не дублировать семантику.
29
+
30
+ ## SoT
31
+
32
+ - Packages path — SoT; root `.cursor/` — dogfood sync.
33
+ - Per stack: **Cursor** `presets/cursor/<stack>/` → Claude twin same PR.
34
+ - `_shared` **не** `--preset` и не копируется CLI `init`.
35
+
36
+ См. также: `preset-twin-sync`, `preset-token-budget`, `preset-pr-checklist`, `preset-no-cross-stack-leakage`.
@@ -0,0 +1,54 @@
1
+ ---
2
+ description: Preset authoring: forbid cross-stack agent/path leakage in hooks and agents.
3
+ paths:
4
+ - packages/ai-rules/presets/**/*
5
+ - .claude/**/*
6
+ - .cursor/rules/**/*
7
+ - .cursor/team/tasks/**/*
8
+ ---
9
+
10
+ <!-- shared-core: meta/preset-no-cross-stack-leakage.md -->
11
+
12
+ # Preset no cross-stack leakage
13
+
14
+ Запрет протекания stack-specific имён, путей и handoff stems между пресетами.
15
+
16
+ ## Principles
17
+
18
+ - `next` must not require iOS-only agents/tooling (`xcuitest-*`, `xcodebuild` as required handoff, Keychain-only rules).
19
+ - `ios-swift` must not ship Playwright handoffs or Next lint recipes as required commands.
20
+ - `go` must not ship Playwright, XCUITest, Next lint recipes, or `xcodebuild`/`SwiftLint` as required handoffs.
21
+ - Shared core must not embed stack paths (`app/src/**`, `Features/**`, `playwright`, `xcodebuild`).
22
+
23
+ ## Forbidden in ios-swift hooks/agents (FAIL)
24
+
25
+ In ios-swift `chain-team-phases.sh` / agent handoffs (Cursor + Claude):
26
+
27
+ - `playwright-test-`, `playwright-agents`, `playwright-e2e`, `user-playwright`
28
+ - `app/__tests__/e2e` as a required path
29
+ - Positive yarn recipes `lint:js` / `lint:css` as commands to run (negation prose alone is weak — prefer zero occurrences)
30
+
31
+ Required instead: `xcuitest-test-*` stems; build-verifier mentions `xcodebuild` or `post-change-build` / `xcode-tooling`.
32
+
33
+ ## Forbidden in next hooks/agents (FAIL when present as required)
34
+
35
+ - `xcuitest-test-` as handoff stems
36
+ - Requiring `xcodebuild` / SwiftLint as the default post-change gate for Next app work
37
+
38
+ ## Forbidden in go hooks/agents (FAIL)
39
+
40
+ - `playwright-test-`, `playwright-e2e`, `user-playwright`, `app/__tests__/e2e`
41
+ - Positive yarn recipes `lint:js` / `lint:css`
42
+ - `xcuitest-test-`, `xcodebuild`, `SwiftLint` as required handoffs
43
+ - Agent file `accessibility-reviewer` (no UI surface)
44
+
45
+ Required instead: `integration-test-*`; build-verifier / `post-change-test` / `go-tooling` (`go test`, `go vet`).
46
+
47
+ ## Soft / document
48
+
49
+ - Mentioning the other stack in **docs** comparing presets is OK.
50
+ - `build-verifier` may reference other stacks when validating **preset packaging** (`scope: preset-structure-validation`).
51
+
52
+ ## Chain fork
53
+
54
+ `hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `ios-swift`, and `go` (per platform).
@@ -0,0 +1,39 @@
1
+ ---
2
+ description: Preset authoring: PR checklist for twin sync, budget, leakage, README. Use on preset PRs.
3
+ paths:
4
+ - packages/ai-rules/presets/**/*
5
+ - .claude/**/*
6
+ - .cursor/rules/**/*
7
+ - .cursor/team/tasks/**/*
8
+ ---
9
+
10
+ <!-- shared-core: meta/preset-pr-checklist.md -->
11
+
12
+ # Preset PR checklist
13
+
14
+ Чеклист для PR, затрагивающих `packages/ai-rules/presets/**` (и dogfood `.cursor/` sync).
15
+
16
+ ## Before merge
17
+
18
+ - [ ] **SoT:** правки в `packages/…` (не только root `.cursor/`)
19
+ - [ ] **Core:** если менялся `_shared/core/**` — обновлены все `<!-- shared-core: … -->` consumers (или documented intentional fork)
20
+ - [ ] **Twin:** Cursor change → Claude twin **same PR** (**FAIL** if missing on next, ios-swift, and go — см. `preset-twin-sync`)
21
+ - [ ] **Mapping:** `claude/<stack>/rules/README.md` mapping table актуален
22
+ - [ ] **Token budget:** alwaysApply / session-start ≤ 3; meta rules not always-on
23
+ - [ ] **Leakage:** нет чужих stack agent stems / handoff strings (`preset-no-cross-stack-leakage`)
24
+ - [ ] **Twin depth:** domain ≥15 lines; thin aliases documented
25
+ - [ ] **README:** stack `rules/README.md` core→stack mapping / catalog updated if stems added
26
+ - [ ] **CHANGELOG / package README:** note when public preset paths or install surface change
27
+ - [ ] **Dogfood:** run `packages/ai-rules/scripts/sync-dogfood-cursor.sh` (or document intentional skip) when maintaining this monorepo
28
+ - [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
29
+
30
+ ## Pointers
31
+
32
+ - Layering: `preset-layering`
33
+ - Sync: `preset-twin-sync`
34
+ - Budget: `preset-token-budget`
35
+ - Leakage: `preset-no-cross-stack-leakage`
36
+ - Validation: stack `agents/build-verifier.md` → preset-structure section
37
+ - Dogfood script: `packages/ai-rules/scripts/sync-dogfood-cursor.sh`
38
+ - Drift script: `packages/ai-rules/scripts/check-shared-core-drift.sh`
39
+ - Orchestrator: when editing presets, load this checklist + twin-sync
@@ -0,0 +1,41 @@
1
+ ---
2
+ description: Preset authoring: ≤3 always-on / session-start; meta rules never alwaysApply.
3
+ paths:
4
+ - packages/ai-rules/presets/**/*
5
+ - .claude/**/*
6
+ - .cursor/rules/**/*
7
+ - .cursor/team/tasks/**/*
8
+ ---
9
+
10
+ <!-- shared-core: meta/preset-token-budget.md -->
11
+
12
+ # Preset token budget
13
+
14
+ Инварианты загрузки правил в **установленном** пресете (consumer app).
15
+
16
+ ## Hard caps
17
+
18
+ | Platform | Always-on | Cap |
19
+ |----------|-----------|-----|
20
+ | Cursor | `alwaysApply: true` | **≤ 3** |
21
+ | Claude | rules **without** `paths:` | **ровно 3** |
22
+
23
+ **Claude Option A (README exclusion):** when counting Claude rules without `paths:` / session-start, **exclude `**/README.md`** (topic indexes are not session-start rules). The intended session-start trio remains **exactly 3**; body budget sums **only those 3** rules.
24
+
25
+ Session-start body budget (где задокументировано): ≤120 строк суммарно (stretch ≤100).
26
+
27
+ ## Meta / author rules
28
+
29
+ Rules for preset authors (`preset-layering`, `preset-twin-sync`, …):
30
+
31
+ - **Never** `alwaysApply: true` on consumer installs.
32
+ - Cursor: `globs` limited to `packages/ai-rules/presets/**` (and dogfood `.cursor/**` where useful).
33
+ - Claude: `paths:` limited to `packages/ai-rules/presets/**` (and `.claude/**` dogfood if present).
34
+
35
+ ## Heavy workflows
36
+
37
+ Orchestrator, feature-delivery, code-review, post-change gates, domain globs — **requestable / paths**, not always-on.
38
+
39
+ ## Verifier
40
+
41
+ build-verifier **FAIL** if alwaysApply / session-start count exceeds 3 (Claude count **excludes `**/README.md`**), or if a `preset-*` meta rule is marked always-on.
@@ -0,0 +1,42 @@
1
+ ---
2
+ description: Preset authoring: Cursor SoT → Claude twin same PR. Use when editing preset rules.
3
+ paths:
4
+ - packages/ai-rules/presets/**/*
5
+ - .claude/**/*
6
+ - .cursor/rules/**/*
7
+ - .cursor/team/tasks/**/*
8
+ ---
9
+
10
+ <!-- shared-core: meta/preset-twin-sync.md -->
11
+
12
+ # Preset twin sync
13
+
14
+ Cursor `.mdc` — **SoT per stack**. Claude topic `.md` — derived twin.
15
+
16
+ ## Matrix
17
+
18
+ | Stack | Cursor SoT | Claude derive | Mapping table |
19
+ |-------|------------|---------------|---------------|
20
+ | `next` | `presets/cursor/next/rules/*.mdc` | `presets/claude/next/rules/<topic>/` | **Required** in `claude/next/rules/README.md` |
21
+ | `ios-swift` | `presets/cursor/ios-swift/rules/*.mdc` | `presets/claude/ios-swift/rules/<topic>/` | Keep in `claude/ios-swift/rules/README.md` |
22
+ | `go` | `presets/cursor/go/rules/*.mdc` | `presets/claude/go/rules/<topic>/` | Keep in `claude/go/rules/README.md` |
23
+
24
+ ## Same-PR checklist
25
+
26
+ 1. Edit Cursor rule first (body + frontmatter).
27
+ 2. Update Claude twin: body + `paths:` (from Cursor `globs:` / requestable triggers); drop `alwaysApply`.
28
+ 3. Update mapping table row if stem/path changed.
29
+ 4. If body embeds core (`<!-- shared-core: … -->`), sync core consumers across stacks when core changed.
30
+
31
+ ## Twin depth
32
+
33
+ - **Domain** rules: ≥15 body lines (FAIL if thin without documented alias reason).
34
+ - **Thin aliases** (`agent-team-intake`, `technical-retro`): may be shorter (soft) if they only point to a command/skill.
35
+
36
+ ## Severity (build-verifier)
37
+
38
+ - **next:** missing Claude twin for a changed Cursor rule → **FAIL** (mapping table required).
39
+ - **ios-swift:** missing Claude twin for a changed Cursor rule → **FAIL**.
40
+ - **go:** missing Claude twin for a changed Cursor rule → **FAIL** (same as next / ios-swift; mapping table required).
41
+
42
+ Dogfood: sync packages → root `.cursor/` after Cursor SoT changes (not the reverse). Use `packages/ai-rules/scripts/sync-dogfood-cursor.sh`.
@@ -5,10 +5,12 @@ paths:
5
5
  - .claude/team/**/*
6
6
  ---
7
7
 
8
+ <!-- shared-core: review/technical-retro.md -->
9
+
8
10
  # Техническое ретро — rule alias
9
11
 
10
- Полный сценарий — в slash-команде:
12
+ Полный сценарий (включая блок **«Работа агентов»** для slug из team tasks) — в slash-команде:
11
13
 
12
- **`.claude/commands/technical-retro.md`** → `/technical-retro`
14
+ **`commands/technical-retro.md`** → `/technical-retro`
13
15
 
14
- Используй rule только если command недоступен. Не дублируй содержимое — следуй command-файлу и skill `technical-retro`.
16
+ Используй rule только если command недоступен. Не дублируй содержимое command в ответе — следуй command-файлу и skill `technical-retro`.
@@ -20,6 +20,14 @@ paths:
20
20
  - View читает state и вызывает **явные методы** ViewModel (`submit()`, `load()`), а не мутирует внутреннее состояние напрямую.
21
21
  - Для навигации — coordinator/router или enum route в ViewModel, не размазанные `NavigationLink` с бизнес-условиями в View.
22
22
 
23
+ # Lifecycle, ownership, hit testing
24
+
25
+ - Prefer **`.task(id:)`** (auto-cancel) over `.onAppear { Task { … } }` for async loads tied to the view lifetime.
26
+ - `@StateObject` / owned observable — **only where the view owns** the instance; prefer DI / parent-injected ViewModels over `@EnvironmentObject` sprawl.
27
+ - Shared mutable services — `actor` (or existing isolation); default `[weak self]` in escaping closures that capture ViewModel/`self`.
28
+ - Transparent stacks that should receive taps: `.contentShape(Rectangle())`.
29
+ - High-frequency visual updates — prefer `TimelineView` (or repo pattern) over ad-hoc `Timer` in Views.
30
+
23
31
  # Структура файлов
24
32
 
25
33
  Для экрана фичи:
@@ -9,5 +9,6 @@
9
9
  | `debug-investigation` | Runtime evidence before fix |
10
10
  | `ci-investigation` | iOS CI red |
11
11
  | `technical-retro` | Retro facilitation |
12
+ | `write-adr` | Architecture Decision Record (context / decision / consequences) |
12
13
 
13
14
  Копируется в `.claude/skills/` при init.
@@ -18,10 +18,22 @@ Use the local repository as the source of truth: `git status`, `git diff`, task
18
18
  5. Review Swift concurrency and conventions (`stack/swift-conventions.md`): `@MainActor`, typed errors, force unwrap.
19
19
  6. Review SwiftUI thinness, Design System usage, accessibility identifiers (`ui-and-accessibility/swiftui.md`).
20
20
  7. Check tests: unit for mapper/domain/VM (`testing/unit.md`); XCUITest for user flows (`testing/ui.md`).
21
- 8. Report validation gaps: `xcodebuild`, SwiftLint, or relevant tests not run (`tooling-and-review/xcode-tooling.md`, `tooling-and-review/post-change-build.md`).
21
+ 8. **Reuse lens:** flag new helpers that duplicate existing Feature/shared utilities; prefer public module APIs over copy-paste.
22
+ 9. **Efficiency lens:** unnecessary work on main thread, redundant network/persistence, hot-path bloat, missing cancellation/cleanup.
23
+ 10. Report validation gaps: `xcodebuild`, SwiftLint, or relevant tests not run (`tooling-and-review/xcode-tooling.md`, `tooling-and-review/post-change-build.md`).
22
24
 
23
25
  ## Output
24
26
 
25
- Lead with findings ordered by severity. Each finding should include the file, the problem, impact, and a concrete fix direction. If there are no findings, say so and call out remaining test or validation risk.
27
+ Lead with findings ordered by severity. Required shape (also in `code-review`):
28
+
29
+ - Each finding: **`path:line`** — problem — impact — concrete fix direction.
30
+ - Severity: **`blocker` | `important` | `nit`** (list blocker → nit).
31
+ - Vague («looks risky») is not a finding — cite evidence or ask for surrounding context.
32
+ - End with a verdict line: **`Safe to merge | needs changes | reject`**.
33
+ - If there are no findings, say so and call out remaining test or validation risk.
26
34
 
27
35
  For agent team tasks, write `.claude/team/tasks/<slug>/review.md` and set `status.json` to `completed` or `changes_requested`.
36
+
37
+ ## Design guidance
38
+
39
+ - Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
@@ -28,3 +28,7 @@ For agent team tasks, write `.claude/team/tasks/<slug>/debug-report.md` with:
28
28
  Update `status.json` when complete.
29
29
 
30
30
  Do not use browser/Playwright tooling — this is an Xcode stack.
31
+
32
+ ## Design guidance
33
+
34
+ - Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
@@ -18,6 +18,10 @@ description: Delivers iOS Swift/SwiftUI features end-to-end across Domain, Data,
18
18
  - **Don't** introduce TCA/SwiftData/etc. unless the repo already uses them.
19
19
  - **Don't** use yarn, Playwright, or `app/src` paths — wrong stack.
20
20
 
21
+ ## Scope discipline
22
+
23
+ Implement only the current AC / decomposition task. Clarify ambiguity before coding; do not add unrelated hardening, polish, or drive-by refactors. See `feature-developer` → **Zero improvisation**.
24
+
21
25
  ## Preset packaging note
22
26
 
23
27
  When editing **ai-rules ios-swift preset** sources (agents, hooks, rules) rather than an app Feature: keep Cursor and Claude trees in sync where applicable, and **fork / verify hook handoffs** (`hooks/chain-team-phases.sh`, guard scripts, team path conventions) so Cursor (`.cursor/team`) and Claude (`.claude/team`) do not regress against each other or against the next preset templates.
@@ -25,3 +29,7 @@ When editing **ai-rules ios-swift preset** sources (agents, hooks, rules) rather
25
29
  ## Handoff
26
30
 
27
31
  Summarize by layer, validation results, and known gaps. Agent team: update `.claude/team/tasks/<slug>/status.json`.
32
+
33
+ ## Design guidance
34
+
35
+ - Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
@@ -5,6 +5,50 @@ description: Facilitates technical retrospectives for tasks, sprints, incidents,
5
5
 
6
6
  # Technical Retro
7
7
 
8
- Same structure as next technical-retro skill. For `/task` pipelines include router, analyst, developer, **build-verifier** (xcodebuild), reviewer, QA/XCUITest, hooks, rules.
8
+ ## Inputs
9
9
 
10
- Preset feedback: propose updates to `.claude/rules|agents|skills` do not apply without approval.
10
+ Ask for missing period, focus, task slug, participants, or format constraints. If a slug is provided, read `.claude/team/tasks/<slug>/` artifacts and local git status/diff. Do not invent facts not present in artifacts or the user's message.
11
+
12
+ ## Facilitation Principles
13
+
14
+ - Focus on process and system behavior, not blame.
15
+ - Separate facts, interpretations, and proposed actions.
16
+ - Balance what worked with what slowed delivery.
17
+ - Keep action items concrete, owned, and measurable.
18
+
19
+ ## Default Structure
20
+
21
+ 1. Goal and scope.
22
+ 2. Timeline or factual observations.
23
+ 3. What worked.
24
+ 4. What hurt quality, speed, or confidence.
25
+ 5. Root causes for the top one or two issues.
26
+ 6. Experiments and action items.
27
+
28
+ ## Agent Team Block
29
+
30
+ For `/task` pipelines, include router, analyst, developer, **build-verifier** (xcodebuild), reviewer, QA/XCUITest, hooks, and rules.
31
+
32
+ ## Wrong-turn taxonomy (optional)
33
+
34
+ When artifacts or the user mention agent mistakes, tag incidents:
35
+
36
+ | Kind | Signal |
37
+ |------|--------|
38
+ | `correction` | User pushback («no», «don't», «actually») |
39
+ | `retry` | Same tool/approach 2+ times before success |
40
+ | `waste` | Many searches before the right file |
41
+ | `reversal` | Edit then revert / delete |
42
+ | `dead-end` | Env/tool failure (missing binary, wrong path) |
43
+
44
+ Severity: **high** (explicit correction / large waste) · **med** · **low**. Confidence 0–100 — be honest; low-confidence items are optional.
45
+
46
+ ## Preset feedback loop
47
+
48
+ If the same issue appeared in **2+** tasks (or **3+** for packaging a new rule/skill — Rule of Three), add section **Preset updates**:
49
+
50
+ - Proposed change to `.claude/rules/`, `.claude/agents/`, `.claude/skills/`, or **`.claude/team/conventions.md`** (prefer conventions for project gotchas)
51
+ - One concrete snippet or file path
52
+ - Whether it belongs in session-start vs `paths:` vs skill vs conventions (see `PRESET-CONTRIBUTION` → Building blocks)
53
+
54
+ Do not apply preset or conventions changes without user approval.
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: write-adr
3
+ description: Author an Architecture Decision Record (ADR) with Context, Decision, Consequences, and Links. Use when capturing a durable technical choice for the team.
4
+ ---
5
+
6
+ # Write ADR
7
+
8
+ On-demand skill for durable architecture decisions. Stack-agnostic sections — fill with project-specific paths and links.
9
+
10
+ ## When to use
11
+
12
+ - Choosing between non-trivial alternatives (storage, layering, library, API shape).
13
+ - Recording a decision that future agents/humans should not silently reverse.
14
+ - User asks for an ADR, decision log, or “why did we pick X”.
15
+
16
+ ## Template
17
+
18
+ Create (or append) a short markdown ADR in the repo’s agreed location (e.g. `docs/adr/`, `.cursor/team/`, wiki). Suggested filename: `NNNN-short-title.md`.
19
+
20
+ ```markdown
21
+ # ADR NNNN: <Title>
22
+
23
+ ## Context
24
+ What problem / constraint / force requires a decision?
25
+
26
+ ## Decision
27
+ What we chose (one clear option). Include rejected alternatives briefly if useful.
28
+
29
+ ## Consequences
30
+ Positive and negative outcomes; follow-up work; what becomes harder.
31
+
32
+ ## Links
33
+ Related PRs, issues, rules, prior ADRs, diagrams.
34
+ ```
35
+
36
+ ## Guidelines
37
+
38
+ - Prefer one decision per ADR.
39
+ - Keep Context factual; Decision imperative and short.
40
+ - Link living gotchas to `team/conventions.md` when the decision becomes a recurring local pattern.
41
+ - Do not put ADR bodies only in root `AGENTS.md` (overwrite on init).
@@ -0,0 +1,21 @@
1
+ # Living conventions (team)
2
+
3
+ Consumer-owned store for post-init gotchas, patterns, and decisions. **Not** always-on. Fill after `ai-rules init`. Root `AGENTS.md` only points here.
4
+
5
+ ## Gotchas
6
+
7
+ <!-- e.g. fragile flows, “never do X in this repo” -->
8
+
9
+ -
10
+
11
+ ## Patterns
12
+
13
+ <!-- local patterns beyond reference-features table -->
14
+
15
+ -
16
+
17
+ ## Decisions
18
+
19
+ <!-- short pointers to ADRs / product choices that affect code -->
20
+
21
+ -
@@ -2,6 +2,8 @@
2
2
 
3
3
  Краткая точка входа для Claude Code. Подробные правила — модульные файлы под `rules/` (подпапки по темам).
4
4
 
5
+ **Repo-root agents:** see [`AGENTS.md`](../../AGENTS.md) at the project root (cross-tool setup, commands, security, living conventions pointers).
6
+
5
7
  See @rules/README.md for the full catalog and loading strategy.
6
8
 
7
9
  ## Conventions
@@ -24,6 +26,8 @@ See @rules/README.md for the full catalog and loading strategy.
24
26
  | После правок кода | `rules/tooling-and-review/post-change-lint.md` (**requestable**, обязателен после edits) |
25
27
  | Валидация перед review | agent `build-verifier` |
26
28
  | Code review MR | skill `code-review` + `rules/tooling-and-review/code-review-mr.md` |
29
+ | Security (auth/forms/env) | `rules/tooling-and-review/security-next.md` + agent `security-reviewer` |
30
+ | Как работает X | agent `codebase-analyzer` (explain-as-is; без `/task`) |
27
31
  | Техническое ретро | `commands/technical-retro.md` + skill `technical-retro` |
28
32
 
29
33
  ## Install
@@ -32,4 +36,4 @@ See @rules/README.md for the full catalog and loading strategy.
32
36
  npx @bonesofspring/ai-rules init claude --preset next
33
37
  ```
34
38
 
35
- Копирует `CLAUDE.md`, `rules/**`, `commands/**`, `agents/**`, `hooks/**`, `team/**`, `MCP.md` в `.claude/`, плюс `mcp.json` → **`.mcp.json`** в корне проекта.
39
+ Копирует `CLAUDE.md`, `rules/**`, `commands/**`, `agents/**`, `hooks/**`, `team/**`, `MCP.md` в `.claude/`, плюс `mcp.json` → **`.mcp.json`** и `REPO_AGENTS.md` → корневой **`AGENTS.md`**. Skills: `write-adr`, `react-performance` (on-demand).
@@ -16,11 +16,24 @@
16
16
 
17
17
  Файлы правил — обычный Markdown с опциональным YAML frontmatter (`paths:` для скоупа по путям), не формат `.mdc` Cursor.
18
18
 
19
+ ## Preset taxonomy & contributing
20
+
21
+ - **Layers:** Core → Stack → Platform — [`../../_shared/README.md`](../../_shared/README.md)
22
+ - **Contribution guide:** [`../../docs/PRESET-CONTRIBUTION.md`](../../docs/PRESET-CONTRIBUTION.md)
23
+ - **Cursor SoT:** `presets/cursor/next/` — этот пресет derived twin; правки Cursor first, same PR
24
+ - **Cursor→Claude map + core table:** [`rules/README.md`](./rules/README.md)
25
+ - **Author meta:** `tooling-and-review/preset-*.md` (`paths:` on `packages/ai-rules/presets/**` only)
26
+
19
27
  ## Agent team workflow
20
28
 
21
29
  Cursor-пресет и Claude-пресет используют один и тот же смысловой workflow:
22
30
 
23
31
  - `/task <desc>` → `task-router` → `pipeline.json`;
24
32
  - `/task-continue <slug>` → продолжение после human gate;
25
- - `.claude/agents/*.md` → 20 ролей: planning (router, analyst, architect, migration, api-contract), implementation (debugger, ci-investigator, developer), review (code, a11y, security, perf), testing (QA, unit trio, playwright trio), docs (tech-writer);
33
+ - `.claude/agents/*.md` → **22** ролей: planning (router, analyst, architect, migration, api-contract), analysis (`codebase-analyzer`), implementation (debugger, ci-investigator, developer), review (code, a11y, security, perf), testing (QA, unit trio, playwright trio), docs (tech-writer), build (build-verifier);
26
34
  - `.claude/team/tasks/<slug>/` → handoff-артефакты (`brief.md`, `decomposition.md`, `review.md`, `migration-plan.md`, `ci-report.md`, `status.json`, …).
35
+
36
+ ## Cross-tool root AGENTS
37
+
38
+ `REPO_AGENTS.md` → project-root `AGENTS.md` on init. Living conventions: `team/conventions.md`. Skill `write-adr` on-demand.
39
+ Next also ships `react-performance` skill and Incorrect/Correct samples on golden domain rules.
@@ -0,0 +1,48 @@
1
+ # Next.js — agent instructions
2
+
3
+ Cross-tool repo-root guide. Tool-specific maps stay under `.cursor/AGENTS.md` and `.claude/CLAUDE.md`.
4
+
5
+ ## Cross-tool setup
6
+
7
+ - Treat this file as the **shared** entry for any agent (Cursor, Claude Code, or other).
8
+ - Tool maps (agent-team tables, slash commands) live in `.cursor/AGENTS.md` / `.claude/CLAUDE.md` — use them when that tool is installed.
9
+ - Install:
10
+
11
+ ```bash
12
+ npx @bonesofspring/ai-rules init cursor --preset next
13
+ npx @bonesofspring/ai-rules init claude --preset next
14
+ ```
15
+
16
+ `init` overwrites this file from the preset (`REPO_AGENTS.md` → `AGENTS.md`). Living gotchas belong in `team/conventions.md`, not here.
17
+
18
+ ## Commands (test / lint / build)
19
+
20
+ Working directory for app scripts: **`app/`**. Detect the package manager from lockfile / `packageManager` (`package-manager` rule).
21
+
22
+ | Gate | Typical command |
23
+ |------|-----------------|
24
+ | Lint JS | `yarn lint:js` (or project equivalent) from `app/` |
25
+ | Lint CSS | `yarn lint:css` from `app/` |
26
+ | Unit tests | project unit script under `app/` |
27
+ | Build | project `build` under `app/` |
28
+
29
+ After code edits: invoke **`post-change-lint`** (requestable). Full gate: agent `build-verifier`.
30
+
31
+ ## Security basics
32
+
33
+ - Do not commit secrets (`.env`, tokens, credentials).
34
+ - Review destructive git (`reset --hard`, force-push) before running; respect shell hooks.
35
+ - Do not weaken CI or skip hooks unless the user explicitly asks.
36
+
37
+ ## Tool entry points
38
+
39
+ | Tool | Map |
40
+ |------|-----|
41
+ | Cursor | `.cursor/AGENTS.md` (optional if Cursor not installed) |
42
+ | Claude Code | `.claude/CLAUDE.md` (optional if Claude not installed) |
43
+
44
+ Rules: `.cursor/rules/` or `.claude/rules/`. Skills: `.cursor/skills/` or `.claude/skills/`.
45
+
46
+ ## Living conventions
47
+
48
+ Gotchas, local patterns, and team decisions: **`.cursor/team/conventions.md`** and/or **`.claude/team/conventions.md`** (fill after init; not overwritten on every dogfood sync when already present).