@bonesofspring/ai-rules 0.2.11 → 0.2.13

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 (593) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +5 -1
  3. package/bin/cli.js +4 -0
  4. package/package.json +1 -1
  5. package/presets/_shared/README.md +1 -1
  6. package/presets/_shared/core/agent-team/agent-artifact-contracts.md +114 -0
  7. package/presets/_shared/core/agent-team/agent-task-metrics.md +30 -0
  8. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +71 -4
  9. package/presets/_shared/core/meta/preset-layering.md +1 -1
  10. package/presets/_shared/core/meta/preset-no-cross-stack-leakage.md +5 -5
  11. package/presets/_shared/core/meta/preset-pr-checklist.md +1 -1
  12. package/presets/_shared/core/meta/preset-twin-sync.md +4 -0
  13. package/presets/_shared/core/review/technical-retro.md +2 -0
  14. package/presets/claude/go/agents/build-verifier.md +11 -4
  15. package/presets/claude/go/agents/code-reviewer.md +8 -1
  16. package/presets/claude/go/agents/feature-developer.md +8 -1
  17. package/presets/claude/go/agents/task-analyst.md +8 -1
  18. package/presets/claude/go/agents/task-router.md +35 -3
  19. package/presets/claude/go/commands/task-continue.md +17 -16
  20. package/presets/claude/go/commands/task.md +11 -5
  21. package/presets/claude/go/commands/technical-retro.md +4 -0
  22. package/presets/claude/go/hooks/chain-team-phases.sh +411 -69
  23. package/presets/claude/go/rules/README.md +6 -0
  24. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +33 -4
  25. package/presets/claude/go/rules/tooling-and-review/preset-layering.md +1 -1
  26. package/presets/claude/go/rules/tooling-and-review/preset-no-cross-stack-leakage.md +5 -5
  27. package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  28. package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +4 -0
  29. package/presets/claude/go/rules/tooling-and-review/technical-retro.md +2 -0
  30. package/presets/claude/go/team/README.md +19 -0
  31. package/presets/claude/ios-swift/agents/build-verifier.md +11 -4
  32. package/presets/claude/ios-swift/agents/code-reviewer.md +9 -14
  33. package/presets/claude/ios-swift/agents/feature-developer.md +8 -1
  34. package/presets/claude/ios-swift/agents/task-analyst.md +8 -1
  35. package/presets/claude/ios-swift/agents/task-router.md +33 -1
  36. package/presets/claude/ios-swift/commands/task-continue.md +17 -16
  37. package/presets/claude/ios-swift/commands/task.md +11 -5
  38. package/presets/claude/ios-swift/commands/technical-retro.md +4 -0
  39. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +393 -70
  40. package/presets/claude/ios-swift/rules/README.md +6 -0
  41. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +36 -1
  42. package/presets/claude/ios-swift/rules/tooling-and-review/preset-layering.md +1 -1
  43. package/presets/claude/ios-swift/rules/tooling-and-review/preset-no-cross-stack-leakage.md +5 -5
  44. package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  45. package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +4 -0
  46. package/presets/claude/ios-swift/rules/tooling-and-review/technical-retro.md +2 -0
  47. package/presets/claude/ios-swift/team/README.md +19 -0
  48. package/presets/claude/java/agents/build-verifier.md +11 -4
  49. package/presets/claude/java/agents/code-reviewer.md +8 -1
  50. package/presets/claude/java/agents/feature-developer.md +8 -1
  51. package/presets/claude/java/agents/task-analyst.md +8 -1
  52. package/presets/claude/java/agents/task-router.md +33 -1
  53. package/presets/claude/java/commands/task-continue.md +17 -16
  54. package/presets/claude/java/commands/task.md +11 -5
  55. package/presets/claude/java/commands/technical-retro.md +4 -0
  56. package/presets/claude/java/hooks/chain-team-phases.sh +411 -69
  57. package/presets/claude/java/rules/README.md +6 -0
  58. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +33 -4
  59. package/presets/claude/java/rules/tooling-and-review/preset-layering.md +1 -1
  60. package/presets/claude/java/rules/tooling-and-review/preset-no-cross-stack-leakage.md +5 -5
  61. package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  62. package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +4 -0
  63. package/presets/claude/java/rules/tooling-and-review/technical-retro.md +2 -0
  64. package/presets/claude/java/team/README.md +19 -0
  65. package/presets/claude/mcp-ts/agents/build-verifier.md +11 -4
  66. package/presets/claude/mcp-ts/agents/feature-developer.md +7 -1
  67. package/presets/claude/mcp-ts/agents/task-analyst.md +8 -1
  68. package/presets/claude/mcp-ts/agents/task-router.md +35 -3
  69. package/presets/claude/mcp-ts/commands/task-continue.md +21 -20
  70. package/presets/claude/mcp-ts/commands/task.md +11 -5
  71. package/presets/claude/mcp-ts/commands/technical-retro.md +4 -0
  72. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +397 -55
  73. package/presets/claude/mcp-ts/rules/README.md +6 -0
  74. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +33 -4
  75. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-layering.md +1 -1
  76. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-no-cross-stack-leakage.md +5 -5
  77. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  78. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-twin-sync.md +4 -0
  79. package/presets/claude/mcp-ts/rules/tooling-and-review/technical-retro.md +2 -4
  80. package/presets/claude/mcp-ts/team/README.md +19 -0
  81. package/presets/claude/next/agents/accessibility-reviewer.md +6 -12
  82. package/presets/claude/next/agents/api-contract-reviewer.md +6 -12
  83. package/presets/claude/next/agents/build-verifier.md +10 -14
  84. package/presets/claude/next/agents/ci-investigator.md +7 -13
  85. package/presets/claude/next/agents/code-reviewer.md +9 -14
  86. package/presets/claude/next/agents/debugger.md +6 -12
  87. package/presets/claude/next/agents/feature-developer.md +8 -1
  88. package/presets/claude/next/agents/migration-specialist.md +6 -12
  89. package/presets/claude/next/agents/performance-auditor.md +5 -11
  90. package/presets/claude/next/agents/qa-tester.md +6 -12
  91. package/presets/claude/next/agents/security-reviewer.md +6 -12
  92. package/presets/claude/next/agents/solution-architect.md +6 -12
  93. package/presets/claude/next/agents/task-analyst.md +10 -16
  94. package/presets/claude/next/agents/task-router.md +33 -1
  95. package/presets/claude/next/agents/tech-writer.md +6 -13
  96. package/presets/claude/next/agents/unit-test-generator.md +6 -10
  97. package/presets/claude/next/agents/unit-test-healer.md +6 -10
  98. package/presets/claude/next/agents/unit-test-planner.md +5 -11
  99. package/presets/claude/next/commands/task-continue.md +17 -16
  100. package/presets/claude/next/commands/task.md +11 -5
  101. package/presets/claude/next/commands/technical-retro.md +4 -0
  102. package/presets/claude/next/hooks/chain-team-phases.sh +413 -70
  103. package/presets/claude/next/rules/README.md +6 -0
  104. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +32 -3
  105. package/presets/claude/next/rules/tooling-and-review/preset-layering.md +1 -1
  106. package/presets/claude/next/rules/tooling-and-review/preset-no-cross-stack-leakage.md +5 -5
  107. package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  108. package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +4 -0
  109. package/presets/claude/next/rules/tooling-and-review/technical-retro.md +2 -0
  110. package/presets/claude/next/team/README.md +32 -1
  111. package/presets/claude/next/team/fixtures/artifact-manifest.example.json +61 -0
  112. package/presets/claude/next/team/fixtures/bugfix-standard.json +10 -0
  113. package/presets/claude/next/team/fixtures/feature-full.json +10 -0
  114. package/presets/claude/next/team/fixtures/feature-light.json +10 -0
  115. package/presets/claude/php-hexagonal/CLAUDE.md +31 -0
  116. package/presets/claude/php-hexagonal/MCP.md +15 -0
  117. package/presets/claude/php-hexagonal/README.md +26 -0
  118. package/presets/claude/php-hexagonal/REPO_AGENTS.md +46 -0
  119. package/presets/claude/php-hexagonal/agents/README.md +32 -0
  120. package/presets/claude/php-hexagonal/agents/api-contract-reviewer.md +23 -0
  121. package/presets/claude/php-hexagonal/agents/build-verifier.md +52 -0
  122. package/presets/claude/php-hexagonal/agents/ci-investigator.md +21 -0
  123. package/presets/claude/php-hexagonal/agents/code-reviewer.md +47 -0
  124. package/presets/claude/php-hexagonal/agents/codebase-analyzer.md +28 -0
  125. package/presets/claude/php-hexagonal/agents/debugger.md +29 -0
  126. package/presets/claude/php-hexagonal/agents/feature-developer.md +54 -0
  127. package/presets/claude/php-hexagonal/agents/integration-test-generator.md +22 -0
  128. package/presets/claude/php-hexagonal/agents/integration-test-healer.md +22 -0
  129. package/presets/claude/php-hexagonal/agents/integration-test-planner.md +22 -0
  130. package/presets/claude/php-hexagonal/agents/migration-specialist.md +31 -0
  131. package/presets/claude/php-hexagonal/agents/performance-auditor.md +22 -0
  132. package/presets/claude/php-hexagonal/agents/qa-tester.md +24 -0
  133. package/presets/claude/php-hexagonal/agents/security-reviewer.md +20 -0
  134. package/presets/claude/php-hexagonal/agents/solution-architect.md +28 -0
  135. package/presets/claude/php-hexagonal/agents/task-analyst.md +32 -0
  136. package/presets/claude/php-hexagonal/agents/task-router.md +101 -0
  137. package/presets/claude/php-hexagonal/agents/tech-writer.md +15 -0
  138. package/presets/claude/php-hexagonal/agents/unit-test-generator.md +21 -0
  139. package/presets/claude/php-hexagonal/agents/unit-test-healer.md +13 -0
  140. package/presets/claude/php-hexagonal/agents/unit-test-planner.md +26 -0
  141. package/presets/claude/php-hexagonal/commands/README.md +13 -0
  142. package/presets/claude/php-hexagonal/commands/feature-continue.md +51 -0
  143. package/presets/claude/php-hexagonal/commands/feature-start.md +30 -0
  144. package/presets/claude/php-hexagonal/commands/task-continue.md +50 -0
  145. package/presets/claude/php-hexagonal/commands/task.md +55 -0
  146. package/presets/claude/php-hexagonal/commands/technical-retro.md +62 -0
  147. package/presets/claude/php-hexagonal/hooks/README.md +16 -0
  148. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +724 -0
  149. package/presets/claude/php-hexagonal/hooks/examples/README.md +18 -0
  150. package/presets/claude/php-hexagonal/hooks/examples/format-edited.example.sh +11 -0
  151. package/presets/claude/php-hexagonal/hooks/examples/secret-guard.example.sh +10 -0
  152. package/presets/claude/php-hexagonal/hooks/examples/test-on-save.example.sh +19 -0
  153. package/presets/claude/php-hexagonal/hooks/guard-shell-command.sh +80 -0
  154. package/presets/claude/php-hexagonal/mcp.json +11 -0
  155. package/presets/claude/php-hexagonal/rules/README.md +67 -0
  156. package/presets/claude/php-hexagonal/rules/api-and-data/README.md +14 -0
  157. package/presets/claude/php-hexagonal/rules/api-and-data/adapters-driven.md +38 -0
  158. package/presets/claude/php-hexagonal/rules/api-and-data/adapters-driving.md +38 -0
  159. package/presets/claude/php-hexagonal/rules/api-and-data/api-grpc.md +29 -0
  160. package/presets/claude/php-hexagonal/rules/api-and-data/api-http.md +36 -0
  161. package/presets/claude/php-hexagonal/rules/api-and-data/messaging-adapters.md +37 -0
  162. package/presets/claude/php-hexagonal/rules/api-and-data/persistence-adapters.md +33 -0
  163. package/presets/claude/php-hexagonal/rules/architecture/README.md +16 -0
  164. package/presets/claude/php-hexagonal/rules/architecture/application-usecases.md +31 -0
  165. package/presets/claude/php-hexagonal/rules/architecture/boundaries.md +34 -0
  166. package/presets/claude/php-hexagonal/rules/architecture/composition-root.md +33 -0
  167. package/presets/claude/php-hexagonal/rules/architecture/domain-layer.md +37 -0
  168. package/presets/claude/php-hexagonal/rules/architecture/feature-delivery.md +53 -0
  169. package/presets/claude/php-hexagonal/rules/architecture/module-public-api.md +31 -0
  170. package/presets/claude/php-hexagonal/rules/architecture/ports-interfaces.md +34 -0
  171. package/presets/claude/php-hexagonal/rules/architecture/reference-features.md +39 -0
  172. package/presets/claude/php-hexagonal/rules/stack/README.md +10 -0
  173. package/presets/claude/php-hexagonal/rules/stack/php-app-core.md +35 -0
  174. package/presets/claude/php-hexagonal/rules/stack/php-conventions.md +51 -0
  175. package/presets/claude/php-hexagonal/rules/testing/README.md +11 -0
  176. package/presets/claude/php-hexagonal/rules/testing/e2e.md +35 -0
  177. package/presets/claude/php-hexagonal/rules/testing/integration.md +31 -0
  178. package/presets/claude/php-hexagonal/rules/testing/unit.md +32 -0
  179. package/presets/claude/php-hexagonal/rules/tooling-and-review/README.md +21 -0
  180. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-intake.md +26 -0
  181. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +208 -0
  182. package/presets/claude/php-hexagonal/rules/tooling-and-review/anti-sycophancy-discipline.md +29 -0
  183. package/presets/claude/php-hexagonal/rules/tooling-and-review/code-quality.md +53 -0
  184. package/presets/claude/php-hexagonal/rules/tooling-and-review/code-review.md +60 -0
  185. package/presets/claude/php-hexagonal/rules/tooling-and-review/design-guidance.md +111 -0
  186. package/presets/claude/php-hexagonal/rules/tooling-and-review/php-tooling.md +39 -0
  187. package/presets/claude/php-hexagonal/rules/tooling-and-review/post-change-test.md +31 -0
  188. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-layering.md +36 -0
  189. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-no-cross-stack-leakage.md +69 -0
  190. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +39 -0
  191. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-token-budget.md +41 -0
  192. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-twin-sync.md +50 -0
  193. package/presets/claude/php-hexagonal/rules/tooling-and-review/security-php.md +29 -0
  194. package/presets/claude/php-hexagonal/rules/tooling-and-review/technical-retro.md +22 -0
  195. package/presets/claude/php-hexagonal/rules/ui-and-accessibility/README.md +5 -0
  196. package/presets/claude/php-hexagonal/skills/README.md +5 -0
  197. package/presets/claude/php-hexagonal/skills/ci-investigation/SKILL.md +11 -0
  198. package/presets/claude/php-hexagonal/skills/code-review/SKILL.md +25 -0
  199. package/presets/claude/php-hexagonal/skills/debug-investigation/SKILL.md +15 -0
  200. package/presets/claude/php-hexagonal/skills/feature-delivery/SKILL.md +30 -0
  201. package/presets/claude/php-hexagonal/skills/integration-testing/SKILL.md +15 -0
  202. package/presets/claude/php-hexagonal/skills/technical-retro/SKILL.md +54 -0
  203. package/presets/claude/php-hexagonal/skills/unit-testing/SKILL.md +14 -0
  204. package/presets/claude/php-hexagonal/skills/write-adr/SKILL.md +41 -0
  205. package/presets/claude/php-hexagonal/team/README.md +48 -0
  206. package/presets/claude/php-hexagonal/team/conventions.md +21 -0
  207. package/presets/claude/php-hexagonal/team/fixtures/bugfix-standard.json +37 -0
  208. package/presets/claude/php-hexagonal/team/fixtures/feature-full.json +25 -0
  209. package/presets/claude/php-hexagonal/team/fixtures/feature-light.json +17 -0
  210. package/presets/claude/php-laravel/CLAUDE.md +20 -0
  211. package/presets/claude/php-laravel/MCP.md +5 -0
  212. package/presets/claude/php-laravel/README.md +30 -0
  213. package/presets/claude/php-laravel/REPO_AGENTS.md +47 -0
  214. package/presets/claude/php-laravel/agents/README.md +32 -0
  215. package/presets/claude/php-laravel/agents/api-contract-reviewer.md +23 -0
  216. package/presets/claude/php-laravel/agents/build-verifier.md +52 -0
  217. package/presets/claude/php-laravel/agents/ci-investigator.md +21 -0
  218. package/presets/claude/php-laravel/agents/code-reviewer.md +47 -0
  219. package/presets/claude/php-laravel/agents/codebase-analyzer.md +28 -0
  220. package/presets/claude/php-laravel/agents/debugger.md +29 -0
  221. package/presets/claude/php-laravel/agents/feature-developer.md +54 -0
  222. package/presets/claude/php-laravel/agents/integration-test-generator.md +22 -0
  223. package/presets/claude/php-laravel/agents/integration-test-healer.md +22 -0
  224. package/presets/claude/php-laravel/agents/integration-test-planner.md +22 -0
  225. package/presets/claude/php-laravel/agents/migration-specialist.md +31 -0
  226. package/presets/claude/php-laravel/agents/performance-auditor.md +22 -0
  227. package/presets/claude/php-laravel/agents/qa-tester.md +30 -0
  228. package/presets/claude/php-laravel/agents/security-reviewer.md +32 -0
  229. package/presets/claude/php-laravel/agents/solution-architect.md +29 -0
  230. package/presets/claude/php-laravel/agents/task-analyst.md +32 -0
  231. package/presets/claude/php-laravel/agents/task-router.md +120 -0
  232. package/presets/claude/php-laravel/agents/tech-writer.md +15 -0
  233. package/presets/claude/php-laravel/agents/unit-test-generator.md +21 -0
  234. package/presets/claude/php-laravel/agents/unit-test-healer.md +13 -0
  235. package/presets/claude/php-laravel/agents/unit-test-planner.md +26 -0
  236. package/presets/claude/php-laravel/commands/README.md +13 -0
  237. package/presets/claude/php-laravel/commands/feature-continue.md +51 -0
  238. package/presets/claude/php-laravel/commands/feature-start.md +30 -0
  239. package/presets/claude/php-laravel/commands/task-continue.md +50 -0
  240. package/presets/claude/php-laravel/commands/task.md +55 -0
  241. package/presets/claude/php-laravel/commands/technical-retro.md +62 -0
  242. package/presets/claude/php-laravel/hooks/README.md +16 -0
  243. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +724 -0
  244. package/presets/claude/php-laravel/hooks/examples/README.md +18 -0
  245. package/presets/claude/php-laravel/hooks/examples/format-edited.example.sh +11 -0
  246. package/presets/claude/php-laravel/hooks/examples/secret-guard.example.sh +10 -0
  247. package/presets/claude/php-laravel/hooks/examples/test-on-save.example.sh +19 -0
  248. package/presets/claude/php-laravel/hooks/guard-shell-command.sh +80 -0
  249. package/presets/claude/php-laravel/mcp.json +11 -0
  250. package/presets/claude/php-laravel/rules/README.md +67 -0
  251. package/presets/claude/php-laravel/rules/api-and-data/README.md +3 -0
  252. package/presets/claude/php-laravel/rules/api-and-data/eloquent-persistence.md +31 -0
  253. package/presets/claude/php-laravel/rules/api-and-data/events-listeners.md +31 -0
  254. package/presets/claude/php-laravel/rules/api-and-data/form-requests.md +29 -0
  255. package/presets/claude/php-laravel/rules/api-and-data/http-layer.md +32 -0
  256. package/presets/claude/php-laravel/rules/api-and-data/jobs-queues.md +41 -0
  257. package/presets/claude/php-laravel/rules/api-and-data/policies-authorization.md +29 -0
  258. package/presets/claude/php-laravel/rules/api-and-data/routes-api.md +29 -0
  259. package/presets/claude/php-laravel/rules/architecture/README.md +3 -0
  260. package/presets/claude/php-laravel/rules/architecture/actions-services.md +30 -0
  261. package/presets/claude/php-laravel/rules/architecture/boundaries.md +34 -0
  262. package/presets/claude/php-laravel/rules/architecture/domain-layer.md +24 -0
  263. package/presets/claude/php-laravel/rules/architecture/feature-delivery.md +51 -0
  264. package/presets/claude/php-laravel/rules/architecture/module-public-api.md +29 -0
  265. package/presets/claude/php-laravel/rules/architecture/reference-features.md +40 -0
  266. package/presets/claude/php-laravel/rules/architecture/service-providers.md +28 -0
  267. package/presets/claude/php-laravel/rules/stack/README.md +3 -0
  268. package/presets/claude/php-laravel/rules/stack/laravel-app-core.md +32 -0
  269. package/presets/claude/php-laravel/rules/stack/laravel-conventions.md +38 -0
  270. package/presets/claude/php-laravel/rules/testing/README.md +3 -0
  271. package/presets/claude/php-laravel/rules/testing/e2e.md +34 -0
  272. package/presets/claude/php-laravel/rules/testing/integration.md +30 -0
  273. package/presets/claude/php-laravel/rules/testing/unit.md +30 -0
  274. package/presets/claude/php-laravel/rules/tooling-and-review/README.md +3 -0
  275. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-intake.md +21 -0
  276. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +205 -0
  277. package/presets/claude/php-laravel/rules/tooling-and-review/anti-sycophancy-discipline.md +29 -0
  278. package/presets/claude/php-laravel/rules/tooling-and-review/code-quality.md +52 -0
  279. package/presets/claude/php-laravel/rules/tooling-and-review/code-review.md +58 -0
  280. package/presets/claude/php-laravel/rules/tooling-and-review/design-guidance.md +111 -0
  281. package/presets/claude/php-laravel/rules/tooling-and-review/php-tooling.md +37 -0
  282. package/presets/claude/php-laravel/rules/tooling-and-review/post-change-test.md +29 -0
  283. package/presets/claude/php-laravel/rules/tooling-and-review/preset-layering.md +33 -0
  284. package/presets/claude/php-laravel/rules/tooling-and-review/preset-no-cross-stack-leakage.md +66 -0
  285. package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +36 -0
  286. package/presets/claude/php-laravel/rules/tooling-and-review/preset-token-budget.md +38 -0
  287. package/presets/claude/php-laravel/rules/tooling-and-review/preset-twin-sync.md +47 -0
  288. package/presets/claude/php-laravel/rules/tooling-and-review/security-php.md +58 -0
  289. package/presets/claude/php-laravel/rules/tooling-and-review/technical-retro.md +17 -0
  290. package/presets/claude/php-laravel/rules/ui-and-accessibility/README.md +3 -0
  291. package/presets/claude/php-laravel/skills/README.md +5 -0
  292. package/presets/claude/php-laravel/skills/ci-investigation/SKILL.md +11 -0
  293. package/presets/claude/php-laravel/skills/code-review/SKILL.md +25 -0
  294. package/presets/claude/php-laravel/skills/debug-investigation/SKILL.md +15 -0
  295. package/presets/claude/php-laravel/skills/feature-delivery/SKILL.md +30 -0
  296. package/presets/claude/php-laravel/skills/integration-testing/SKILL.md +15 -0
  297. package/presets/claude/php-laravel/skills/technical-retro/SKILL.md +54 -0
  298. package/presets/claude/php-laravel/skills/unit-testing/SKILL.md +14 -0
  299. package/presets/claude/php-laravel/skills/write-adr/SKILL.md +41 -0
  300. package/presets/claude/php-laravel/team/README.md +28 -0
  301. package/presets/claude/php-laravel/team/conventions.md +21 -0
  302. package/presets/claude/php-laravel/team/fixtures/bugfix-standard.json +12 -0
  303. package/presets/claude/php-laravel/team/fixtures/feature-full.json +15 -0
  304. package/presets/claude/php-laravel/team/fixtures/feature-light.json +8 -0
  305. package/presets/cursor/go/agents/build-verifier.md +10 -3
  306. package/presets/cursor/go/agents/code-reviewer.md +8 -1
  307. package/presets/cursor/go/agents/feature-developer.md +8 -1
  308. package/presets/cursor/go/agents/task-analyst.md +8 -1
  309. package/presets/cursor/go/agents/task-router.md +33 -1
  310. package/presets/cursor/go/commands/task-continue.md +17 -16
  311. package/presets/cursor/go/commands/task.md +11 -5
  312. package/presets/cursor/go/commands/technical-retro.md +4 -0
  313. package/presets/cursor/go/hooks/chain-team-phases.sh +411 -69
  314. package/presets/cursor/go/rules/README.md +6 -0
  315. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +33 -4
  316. package/presets/cursor/go/rules/preset-layering.mdc +1 -1
  317. package/presets/cursor/go/rules/preset-no-cross-stack-leakage.mdc +5 -5
  318. package/presets/cursor/go/rules/preset-pr-checklist.mdc +1 -1
  319. package/presets/cursor/go/rules/preset-twin-sync.mdc +4 -0
  320. package/presets/cursor/go/rules/technical-retro.mdc +2 -0
  321. package/presets/cursor/go/team/README.md +19 -0
  322. package/presets/cursor/ios-swift/agents/build-verifier.md +11 -4
  323. package/presets/cursor/ios-swift/agents/code-reviewer.md +9 -14
  324. package/presets/cursor/ios-swift/agents/feature-developer.md +8 -1
  325. package/presets/cursor/ios-swift/agents/task-analyst.md +8 -1
  326. package/presets/cursor/ios-swift/agents/task-router.md +33 -1
  327. package/presets/cursor/ios-swift/commands/task-continue.md +17 -16
  328. package/presets/cursor/ios-swift/commands/task.md +11 -5
  329. package/presets/cursor/ios-swift/commands/technical-retro.md +4 -0
  330. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +411 -70
  331. package/presets/cursor/ios-swift/rules/README.md +6 -0
  332. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +26 -1
  333. package/presets/cursor/ios-swift/rules/preset-layering.mdc +1 -1
  334. package/presets/cursor/ios-swift/rules/preset-no-cross-stack-leakage.mdc +5 -5
  335. package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +1 -1
  336. package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +4 -0
  337. package/presets/cursor/ios-swift/rules/technical-retro.mdc +2 -0
  338. package/presets/cursor/ios-swift/team/README.md +19 -0
  339. package/presets/cursor/java/agents/build-verifier.md +11 -4
  340. package/presets/cursor/java/agents/code-reviewer.md +8 -1
  341. package/presets/cursor/java/agents/feature-developer.md +8 -1
  342. package/presets/cursor/java/agents/task-analyst.md +8 -1
  343. package/presets/cursor/java/agents/task-router.md +33 -1
  344. package/presets/cursor/java/commands/task-continue.md +17 -16
  345. package/presets/cursor/java/commands/task.md +11 -5
  346. package/presets/cursor/java/commands/technical-retro.md +4 -0
  347. package/presets/cursor/java/hooks/chain-team-phases.sh +411 -69
  348. package/presets/cursor/java/rules/README.md +6 -0
  349. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +33 -4
  350. package/presets/cursor/java/rules/preset-layering.mdc +1 -1
  351. package/presets/cursor/java/rules/preset-no-cross-stack-leakage.mdc +5 -5
  352. package/presets/cursor/java/rules/preset-pr-checklist.mdc +1 -1
  353. package/presets/cursor/java/rules/preset-twin-sync.mdc +4 -0
  354. package/presets/cursor/java/rules/technical-retro.mdc +2 -0
  355. package/presets/cursor/java/team/README.md +19 -0
  356. package/presets/cursor/mcp-ts/agents/build-verifier.md +10 -3
  357. package/presets/cursor/mcp-ts/agents/feature-developer.md +7 -1
  358. package/presets/cursor/mcp-ts/agents/task-analyst.md +8 -1
  359. package/presets/cursor/mcp-ts/agents/task-router.md +33 -1
  360. package/presets/cursor/mcp-ts/commands/task-continue.md +19 -18
  361. package/presets/cursor/mcp-ts/commands/task.md +11 -5
  362. package/presets/cursor/mcp-ts/commands/technical-retro.md +4 -0
  363. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +397 -55
  364. package/presets/cursor/mcp-ts/rules/README.md +6 -0
  365. package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +33 -4
  366. package/presets/cursor/mcp-ts/rules/preset-layering.mdc +1 -1
  367. package/presets/cursor/mcp-ts/rules/preset-no-cross-stack-leakage.mdc +5 -5
  368. package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +1 -1
  369. package/presets/cursor/mcp-ts/rules/preset-twin-sync.mdc +4 -0
  370. package/presets/cursor/mcp-ts/rules/technical-retro.mdc +2 -4
  371. package/presets/cursor/mcp-ts/team/README.md +19 -0
  372. package/presets/cursor/next/agents/accessibility-reviewer.md +7 -14
  373. package/presets/cursor/next/agents/api-contract-reviewer.md +7 -14
  374. package/presets/cursor/next/agents/build-verifier.md +10 -15
  375. package/presets/cursor/next/agents/ci-investigator.md +7 -14
  376. package/presets/cursor/next/agents/code-reviewer.md +9 -14
  377. package/presets/cursor/next/agents/debugger.md +6 -12
  378. package/presets/cursor/next/agents/feature-developer.md +8 -1
  379. package/presets/cursor/next/agents/migration-specialist.md +7 -14
  380. package/presets/cursor/next/agents/performance-auditor.md +6 -13
  381. package/presets/cursor/next/agents/qa-tester.md +6 -13
  382. package/presets/cursor/next/agents/security-reviewer.md +7 -14
  383. package/presets/cursor/next/agents/solution-architect.md +6 -12
  384. package/presets/cursor/next/agents/task-analyst.md +10 -16
  385. package/presets/cursor/next/agents/task-router.md +33 -1
  386. package/presets/cursor/next/agents/tech-writer.md +6 -13
  387. package/presets/cursor/next/agents/unit-test-generator.md +6 -11
  388. package/presets/cursor/next/agents/unit-test-healer.md +6 -11
  389. package/presets/cursor/next/agents/unit-test-planner.md +6 -13
  390. package/presets/cursor/next/commands/task-continue.md +17 -16
  391. package/presets/cursor/next/commands/task.md +11 -5
  392. package/presets/cursor/next/commands/technical-retro.md +4 -0
  393. package/presets/cursor/next/hooks/chain-team-phases.sh +417 -70
  394. package/presets/cursor/next/rules/README.md +6 -0
  395. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +33 -4
  396. package/presets/cursor/next/rules/preset-layering.mdc +1 -1
  397. package/presets/cursor/next/rules/preset-no-cross-stack-leakage.mdc +5 -5
  398. package/presets/cursor/next/rules/preset-pr-checklist.mdc +1 -1
  399. package/presets/cursor/next/rules/preset-twin-sync.mdc +4 -0
  400. package/presets/cursor/next/rules/technical-retro.mdc +2 -0
  401. package/presets/cursor/next/team/README.md +33 -2
  402. package/presets/cursor/next/team/fixtures/artifact-manifest.example.json +61 -0
  403. package/presets/cursor/next/team/fixtures/bugfix-standard.json +10 -0
  404. package/presets/cursor/next/team/fixtures/feature-full.json +10 -0
  405. package/presets/cursor/next/team/fixtures/feature-light.json +10 -0
  406. package/presets/cursor/next/team/fixtures/metrics-scenarios/tasks/human-gate/metrics.json +69 -0
  407. package/presets/cursor/next/team/fixtures/metrics-scenarios/tasks/missing-ledger/status.json +5 -0
  408. package/presets/cursor/next/team/fixtures/metrics-scenarios/tasks/parallel-receipts/metrics.json +79 -0
  409. package/presets/cursor/next/team/fixtures/metrics-scenarios/tasks/serial-retry/metrics.json +124 -0
  410. package/presets/cursor/next/team/fixtures/metrics-scenarios/tasks/validation-failed/metrics.json +124 -0
  411. package/presets/cursor/next/team/fixtures/metrics.example.json +54 -0
  412. package/presets/cursor/php-hexagonal/AGENTS.md +39 -0
  413. package/presets/cursor/php-hexagonal/BUGBOT.md +11 -0
  414. package/presets/cursor/php-hexagonal/MCP.md +15 -0
  415. package/presets/cursor/php-hexagonal/README.md +26 -0
  416. package/presets/cursor/php-hexagonal/REPO_AGENTS.md +46 -0
  417. package/presets/cursor/php-hexagonal/agents/README.md +36 -0
  418. package/presets/cursor/php-hexagonal/agents/api-contract-reviewer.md +23 -0
  419. package/presets/cursor/php-hexagonal/agents/build-verifier.md +52 -0
  420. package/presets/cursor/php-hexagonal/agents/ci-investigator.md +21 -0
  421. package/presets/cursor/php-hexagonal/agents/code-reviewer.md +47 -0
  422. package/presets/cursor/php-hexagonal/agents/codebase-analyzer.md +28 -0
  423. package/presets/cursor/php-hexagonal/agents/debugger.md +29 -0
  424. package/presets/cursor/php-hexagonal/agents/feature-developer.md +54 -0
  425. package/presets/cursor/php-hexagonal/agents/integration-test-generator.md +22 -0
  426. package/presets/cursor/php-hexagonal/agents/integration-test-healer.md +22 -0
  427. package/presets/cursor/php-hexagonal/agents/integration-test-planner.md +22 -0
  428. package/presets/cursor/php-hexagonal/agents/migration-specialist.md +31 -0
  429. package/presets/cursor/php-hexagonal/agents/performance-auditor.md +22 -0
  430. package/presets/cursor/php-hexagonal/agents/qa-tester.md +24 -0
  431. package/presets/cursor/php-hexagonal/agents/security-reviewer.md +20 -0
  432. package/presets/cursor/php-hexagonal/agents/solution-architect.md +28 -0
  433. package/presets/cursor/php-hexagonal/agents/task-analyst.md +32 -0
  434. package/presets/cursor/php-hexagonal/agents/task-router.md +101 -0
  435. package/presets/cursor/php-hexagonal/agents/tech-writer.md +15 -0
  436. package/presets/cursor/php-hexagonal/agents/unit-test-generator.md +21 -0
  437. package/presets/cursor/php-hexagonal/agents/unit-test-healer.md +13 -0
  438. package/presets/cursor/php-hexagonal/agents/unit-test-planner.md +26 -0
  439. package/presets/cursor/php-hexagonal/commands/README.md +54 -0
  440. package/presets/cursor/php-hexagonal/commands/feature-continue.md +19 -0
  441. package/presets/cursor/php-hexagonal/commands/feature-start.md +33 -0
  442. package/presets/cursor/php-hexagonal/commands/task-continue.md +50 -0
  443. package/presets/cursor/php-hexagonal/commands/task.md +55 -0
  444. package/presets/cursor/php-hexagonal/commands/technical-retro.md +85 -0
  445. package/presets/cursor/php-hexagonal/hooks/README.md +12 -0
  446. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +724 -0
  447. package/presets/cursor/php-hexagonal/hooks/examples/README.md +18 -0
  448. package/presets/cursor/php-hexagonal/hooks/examples/format-edited.example.sh +11 -0
  449. package/presets/cursor/php-hexagonal/hooks/examples/secret-guard.example.sh +10 -0
  450. package/presets/cursor/php-hexagonal/hooks/examples/test-on-save.example.sh +19 -0
  451. package/presets/cursor/php-hexagonal/hooks/guard-shell-command.sh +80 -0
  452. package/presets/cursor/php-hexagonal/hooks.json +17 -0
  453. package/presets/cursor/php-hexagonal/mcp.json +11 -0
  454. package/presets/cursor/php-hexagonal/rules/README.md +106 -0
  455. package/presets/cursor/php-hexagonal/rules/adapters-driven.mdc +41 -0
  456. package/presets/cursor/php-hexagonal/rules/adapters-driving.mdc +42 -0
  457. package/presets/cursor/php-hexagonal/rules/agent-team-intake.mdc +20 -0
  458. package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +202 -0
  459. package/presets/cursor/php-hexagonal/rules/anti-sycophancy-discipline.mdc +30 -0
  460. package/presets/cursor/php-hexagonal/rules/api-grpc.mdc +31 -0
  461. package/presets/cursor/php-hexagonal/rules/api-http.mdc +40 -0
  462. package/presets/cursor/php-hexagonal/rules/application-usecases.mdc +33 -0
  463. package/presets/cursor/php-hexagonal/rules/architecture-boundaries.mdc +36 -0
  464. package/presets/cursor/php-hexagonal/rules/code-quality-and-refactoring.mdc +54 -0
  465. package/presets/cursor/php-hexagonal/rules/code-review-mr.mdc +54 -0
  466. package/presets/cursor/php-hexagonal/rules/composition-root.mdc +37 -0
  467. package/presets/cursor/php-hexagonal/rules/design-guidance.mdc +112 -0
  468. package/presets/cursor/php-hexagonal/rules/domain-layer.mdc +39 -0
  469. package/presets/cursor/php-hexagonal/rules/feature-delivery-workflow.mdc +47 -0
  470. package/presets/cursor/php-hexagonal/rules/messaging-adapters.mdc +38 -0
  471. package/presets/cursor/php-hexagonal/rules/module-public-api.mdc +32 -0
  472. package/presets/cursor/php-hexagonal/rules/persistence-adapters.mdc +35 -0
  473. package/presets/cursor/php-hexagonal/rules/php-app-core.mdc +37 -0
  474. package/presets/cursor/php-hexagonal/rules/php-conventions.mdc +53 -0
  475. package/presets/cursor/php-hexagonal/rules/php-tooling.mdc +38 -0
  476. package/presets/cursor/php-hexagonal/rules/ports-interfaces.mdc +37 -0
  477. package/presets/cursor/php-hexagonal/rules/post-change-test.mdc +30 -0
  478. package/presets/cursor/php-hexagonal/rules/preset-layering.mdc +36 -0
  479. package/presets/cursor/php-hexagonal/rules/preset-no-cross-stack-leakage.mdc +69 -0
  480. package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +39 -0
  481. package/presets/cursor/php-hexagonal/rules/preset-token-budget.mdc +41 -0
  482. package/presets/cursor/php-hexagonal/rules/preset-twin-sync.mdc +50 -0
  483. package/presets/cursor/php-hexagonal/rules/reference-features.mdc +40 -0
  484. package/presets/cursor/php-hexagonal/rules/security-php.mdc +33 -0
  485. package/presets/cursor/php-hexagonal/rules/technical-retro.mdc +16 -0
  486. package/presets/cursor/php-hexagonal/rules/tests-e2e.mdc +36 -0
  487. package/presets/cursor/php-hexagonal/rules/tests-integration.mdc +33 -0
  488. package/presets/cursor/php-hexagonal/rules/tests-unit.mdc +35 -0
  489. package/presets/cursor/php-hexagonal/skills/README.md +5 -0
  490. package/presets/cursor/php-hexagonal/skills/ci-investigation/SKILL.md +11 -0
  491. package/presets/cursor/php-hexagonal/skills/code-review/SKILL.md +25 -0
  492. package/presets/cursor/php-hexagonal/skills/debug-investigation/SKILL.md +15 -0
  493. package/presets/cursor/php-hexagonal/skills/feature-delivery/SKILL.md +30 -0
  494. package/presets/cursor/php-hexagonal/skills/integration-testing/SKILL.md +15 -0
  495. package/presets/cursor/php-hexagonal/skills/technical-retro/SKILL.md +54 -0
  496. package/presets/cursor/php-hexagonal/skills/unit-testing/SKILL.md +14 -0
  497. package/presets/cursor/php-hexagonal/skills/write-adr/SKILL.md +41 -0
  498. package/presets/cursor/php-hexagonal/team/README.md +52 -0
  499. package/presets/cursor/php-hexagonal/team/conventions.md +21 -0
  500. package/presets/cursor/php-hexagonal/team/fixtures/bugfix-standard.json +37 -0
  501. package/presets/cursor/php-hexagonal/team/fixtures/feature-full.json +25 -0
  502. package/presets/cursor/php-hexagonal/team/fixtures/feature-light.json +17 -0
  503. package/presets/cursor/php-laravel/AGENTS.md +39 -0
  504. package/presets/cursor/php-laravel/BUGBOT.md +9 -0
  505. package/presets/cursor/php-laravel/MCP.md +5 -0
  506. package/presets/cursor/php-laravel/README.md +33 -0
  507. package/presets/cursor/php-laravel/REPO_AGENTS.md +47 -0
  508. package/presets/cursor/php-laravel/agents/README.md +36 -0
  509. package/presets/cursor/php-laravel/agents/api-contract-reviewer.md +23 -0
  510. package/presets/cursor/php-laravel/agents/build-verifier.md +52 -0
  511. package/presets/cursor/php-laravel/agents/ci-investigator.md +21 -0
  512. package/presets/cursor/php-laravel/agents/code-reviewer.md +47 -0
  513. package/presets/cursor/php-laravel/agents/codebase-analyzer.md +28 -0
  514. package/presets/cursor/php-laravel/agents/debugger.md +29 -0
  515. package/presets/cursor/php-laravel/agents/feature-developer.md +54 -0
  516. package/presets/cursor/php-laravel/agents/integration-test-generator.md +22 -0
  517. package/presets/cursor/php-laravel/agents/integration-test-healer.md +22 -0
  518. package/presets/cursor/php-laravel/agents/integration-test-planner.md +22 -0
  519. package/presets/cursor/php-laravel/agents/migration-specialist.md +31 -0
  520. package/presets/cursor/php-laravel/agents/performance-auditor.md +22 -0
  521. package/presets/cursor/php-laravel/agents/qa-tester.md +30 -0
  522. package/presets/cursor/php-laravel/agents/security-reviewer.md +32 -0
  523. package/presets/cursor/php-laravel/agents/solution-architect.md +29 -0
  524. package/presets/cursor/php-laravel/agents/task-analyst.md +32 -0
  525. package/presets/cursor/php-laravel/agents/task-router.md +120 -0
  526. package/presets/cursor/php-laravel/agents/tech-writer.md +15 -0
  527. package/presets/cursor/php-laravel/agents/unit-test-generator.md +21 -0
  528. package/presets/cursor/php-laravel/agents/unit-test-healer.md +13 -0
  529. package/presets/cursor/php-laravel/agents/unit-test-planner.md +26 -0
  530. package/presets/cursor/php-laravel/commands/README.md +54 -0
  531. package/presets/cursor/php-laravel/commands/feature-continue.md +19 -0
  532. package/presets/cursor/php-laravel/commands/feature-start.md +33 -0
  533. package/presets/cursor/php-laravel/commands/task-continue.md +50 -0
  534. package/presets/cursor/php-laravel/commands/task.md +55 -0
  535. package/presets/cursor/php-laravel/commands/technical-retro.md +85 -0
  536. package/presets/cursor/php-laravel/hooks/README.md +12 -0
  537. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +724 -0
  538. package/presets/cursor/php-laravel/hooks/examples/README.md +18 -0
  539. package/presets/cursor/php-laravel/hooks/examples/format-edited.example.sh +11 -0
  540. package/presets/cursor/php-laravel/hooks/examples/secret-guard.example.sh +10 -0
  541. package/presets/cursor/php-laravel/hooks/examples/test-on-save.example.sh +19 -0
  542. package/presets/cursor/php-laravel/hooks/guard-shell-command.sh +80 -0
  543. package/presets/cursor/php-laravel/hooks.json +17 -0
  544. package/presets/cursor/php-laravel/mcp.json +11 -0
  545. package/presets/cursor/php-laravel/rules/README.md +111 -0
  546. package/presets/cursor/php-laravel/rules/actions-services.mdc +33 -0
  547. package/presets/cursor/php-laravel/rules/agent-team-intake.mdc +20 -0
  548. package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +203 -0
  549. package/presets/cursor/php-laravel/rules/anti-sycophancy-discipline.mdc +30 -0
  550. package/presets/cursor/php-laravel/rules/architecture-boundaries.mdc +37 -0
  551. package/presets/cursor/php-laravel/rules/code-quality-and-refactoring.mdc +54 -0
  552. package/presets/cursor/php-laravel/rules/code-review-mr.mdc +56 -0
  553. package/presets/cursor/php-laravel/rules/design-guidance.mdc +112 -0
  554. package/presets/cursor/php-laravel/rules/domain-layer.mdc +27 -0
  555. package/presets/cursor/php-laravel/rules/eloquent-persistence.mdc +34 -0
  556. package/presets/cursor/php-laravel/rules/events-listeners.mdc +34 -0
  557. package/presets/cursor/php-laravel/rules/feature-delivery-workflow.mdc +50 -0
  558. package/presets/cursor/php-laravel/rules/form-requests.mdc +32 -0
  559. package/presets/cursor/php-laravel/rules/http-layer.mdc +35 -0
  560. package/presets/cursor/php-laravel/rules/jobs-queues.mdc +44 -0
  561. package/presets/cursor/php-laravel/rules/laravel-app-core.mdc +35 -0
  562. package/presets/cursor/php-laravel/rules/laravel-conventions.mdc +41 -0
  563. package/presets/cursor/php-laravel/rules/module-public-api.mdc +31 -0
  564. package/presets/cursor/php-laravel/rules/php-tooling.mdc +39 -0
  565. package/presets/cursor/php-laravel/rules/policies-authorization.mdc +32 -0
  566. package/presets/cursor/php-laravel/rules/post-change-test.mdc +31 -0
  567. package/presets/cursor/php-laravel/rules/preset-layering.mdc +36 -0
  568. package/presets/cursor/php-laravel/rules/preset-no-cross-stack-leakage.mdc +69 -0
  569. package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +39 -0
  570. package/presets/cursor/php-laravel/rules/preset-token-budget.mdc +41 -0
  571. package/presets/cursor/php-laravel/rules/preset-twin-sync.mdc +50 -0
  572. package/presets/cursor/php-laravel/rules/reference-features.mdc +42 -0
  573. package/presets/cursor/php-laravel/rules/routes-api.mdc +32 -0
  574. package/presets/cursor/php-laravel/rules/security-php.mdc +61 -0
  575. package/presets/cursor/php-laravel/rules/service-providers.mdc +31 -0
  576. package/presets/cursor/php-laravel/rules/technical-retro.mdc +16 -0
  577. package/presets/cursor/php-laravel/rules/tests-e2e.mdc +36 -0
  578. package/presets/cursor/php-laravel/rules/tests-integration.mdc +33 -0
  579. package/presets/cursor/php-laravel/rules/tests-unit.mdc +33 -0
  580. package/presets/cursor/php-laravel/skills/README.md +5 -0
  581. package/presets/cursor/php-laravel/skills/ci-investigation/SKILL.md +11 -0
  582. package/presets/cursor/php-laravel/skills/code-review/SKILL.md +25 -0
  583. package/presets/cursor/php-laravel/skills/debug-investigation/SKILL.md +15 -0
  584. package/presets/cursor/php-laravel/skills/feature-delivery/SKILL.md +30 -0
  585. package/presets/cursor/php-laravel/skills/integration-testing/SKILL.md +15 -0
  586. package/presets/cursor/php-laravel/skills/technical-retro/SKILL.md +54 -0
  587. package/presets/cursor/php-laravel/skills/unit-testing/SKILL.md +14 -0
  588. package/presets/cursor/php-laravel/skills/write-adr/SKILL.md +41 -0
  589. package/presets/cursor/php-laravel/team/README.md +28 -0
  590. package/presets/cursor/php-laravel/team/conventions.md +21 -0
  591. package/presets/cursor/php-laravel/team/fixtures/bugfix-standard.json +12 -0
  592. package/presets/cursor/php-laravel/team/fixtures/feature-full.json +15 -0
  593. package/presets/cursor/php-laravel/team/fixtures/feature-light.json +8 -0
@@ -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,11 @@
1
+ #!/usr/bin/env bash
2
+ # Optional: project formatter on edited PHP sources.
3
+ # NOT in default hooks.json. Discover formatter from repo/CI — do not invent one.
4
+ set -euo pipefail
5
+ changed=$(git diff --name-only --diff-filter=ACMR HEAD 2>/dev/null | grep '\.php$' || true)
6
+ if [[ -n "${changed:-}" ]]; then
7
+ # Prefer repo tool already configured — placeholders only:
8
+ # vendor/bin/php-cs-fixer fix $changed OR vendor/bin/pint $changed
9
+ true
10
+ fi
11
+ 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,19 @@
1
+ #!/usr/bin/env bash
2
+ # Optional: Composer/PHPUnit (or Pest) after PHP edits.
3
+ # NOT in default hooks.json. Prefer Composer scripts when present.
4
+ set -euo pipefail
5
+ changed=$(git diff --name-only --diff-filter=ACMR HEAD 2>/dev/null | grep '\.php$' || true)
6
+ if [[ -z "${changed:-}" ]]; then
7
+ exit 0
8
+ fi
9
+ if [[ ! -f composer.json ]]; then
10
+ exit 0
11
+ fi
12
+ if composer test -q >/dev/null 2>&1; then
13
+ composer test -q 2>/dev/null || true
14
+ elif [[ -x vendor/bin/pest ]]; then
15
+ vendor/bin/pest 2>/dev/null || true
16
+ elif [[ -x vendor/bin/phpunit ]]; then
17
+ vendor/bin/phpunit 2>/dev/null || true
18
+ fi
19
+ exit 0
@@ -0,0 +1,80 @@
1
+ #!/usr/bin/env bash
2
+ # Lightweight shell guard for Claude Code projects using this preset.
3
+ # PHP: do NOT blanket-block composer test / vendor/bin/phpunit / compiler/IDE inspections / configured static analysis / repo static analysis.
4
+ # Package-manager mismatch checks apply only when a JS lockfile/package.json exists.
5
+
6
+ set -euo pipefail
7
+ # PHP_PRESET_GUARD: allow composer/composer test; no Playwright/XCUITest assumptions
8
+
9
+ input=$(cat)
10
+
11
+ INPUT="$input" node <<'NODE'
12
+ const fs = require('fs');
13
+
14
+ const raw = process.env.INPUT || '';
15
+ let event;
16
+ try {
17
+ event = JSON.parse(raw);
18
+ } catch {
19
+ process.stdout.write('{ "permission": "allow" }');
20
+ process.exit(0);
21
+ }
22
+
23
+ const command = String(event.command || event.input?.command || '');
24
+ if (!command.trim()) {
25
+ process.stdout.write('{ "permission": "allow" }');
26
+ process.exit(0);
27
+ }
28
+
29
+ function out(permission, userMessage, agentMessage) {
30
+ process.stdout.write(JSON.stringify({
31
+ permission,
32
+ user_message: userMessage,
33
+ agent_message: agentMessage || userMessage,
34
+ }));
35
+ }
36
+
37
+ const dangerousGit = /\bgit\s+(reset\s+--hard|clean\s+-[^\n]*f|push\s+--force|push\s+-f|checkout\s+--\s+)/;
38
+ if (dangerousGit.test(command)) {
39
+ out(
40
+ 'ask',
41
+ 'This command looks destructive for git state. Review it before continuing.',
42
+ 'A project hook flagged a destructive git command. Ask the user before running it.',
43
+ );
44
+ process.exit(0);
45
+ }
46
+
47
+ const managerByFile = [
48
+ ['yarn.lock', 'yarn'],
49
+ ['pnpm-lock.yaml', 'pnpm'],
50
+ ['package-lock.json', 'npm'],
51
+ ].find(([file]) => fs.existsSync(file));
52
+
53
+ let expected = managerByFile?.[1];
54
+ if (!expected && fs.existsSync('package.json')) {
55
+ try {
56
+ const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
57
+ const pm = typeof pkg.packageManager === 'string' ? pkg.packageManager : '';
58
+ expected = pm.split('@')[0] || undefined;
59
+ } catch {
60
+ // Ignore invalid package.json in the hook; the agent can diagnose it later.
61
+ }
62
+ }
63
+
64
+ if (!expected) {
65
+ process.stdout.write('{ "permission": "allow" }');
66
+ process.exit(0);
67
+ }
68
+
69
+ const used = command.match(/(^|[;&|]\s*)(npm|yarn|pnpm)\s+/)?.[2];
70
+ if (used && used !== expected) {
71
+ out(
72
+ 'ask',
73
+ `This repository appears to use ${expected}, but the command uses ${used}. Confirm before continuing.`,
74
+ `Use ${expected} for package scripts and installs unless the user explicitly approves ${used}.`,
75
+ );
76
+ process.exit(0);
77
+ }
78
+
79
+ process.stdout.write('{ "permission": "allow" }');
80
+ NODE
@@ -0,0 +1,11 @@
1
+ {
2
+ "mcpServers": {
3
+ "context7": {
4
+ "command": "npx",
5
+ "args": [
6
+ "-y",
7
+ "@upstash/context7-mcp"
8
+ ]
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,67 @@
1
+ # `.claude/rules` (preset php-hexagonal)
2
+
3
+ Claude topic `.md` files are **derived** from Cursor SoT `presets/cursor/php-hexagonal/rules/*.mdc`.
4
+
5
+ ## SoT sync
6
+
7
+ | Principle | Detail |
8
+ |-----------|--------|
9
+ | **SoT** | `presets/cursor/php-hexagonal/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, go, java, mcp-ts, and php-hexagonal; see `preset-twin-sync` / build-verifier) |
12
+
13
+ ## Loading budget
14
+
15
+ - **Session-start (no `paths:`):** exactly **3** — `php-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`; **documented stub** (v1): `api-grpc`; `messaging-adapters` is full — see Cursor `presets/cursor/php-hexagonal/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
+ | `anti-sycophancy-discipline.mdc` | `tooling-and-review/anti-sycophancy-discipline.md` |
32
+ | `code-quality-and-refactoring.mdc` | `tooling-and-review/code-quality.md` |
33
+ | `design-guidance.mdc` | `tooling-and-review/design-guidance.md` |
34
+ | `code-review-mr.mdc` | `tooling-and-review/code-review.md` |
35
+ | `composition-root.mdc` | `architecture/composition-root.md` |
36
+ | `domain-layer.mdc` | `architecture/domain-layer.md` |
37
+ | `feature-delivery-workflow.mdc` | `architecture/feature-delivery.md` |
38
+ | `php-app-core.mdc` | `stack/php-app-core.md` |
39
+ | `php-conventions.mdc` | `stack/php-conventions.md` |
40
+ | `php-tooling.mdc` | `tooling-and-review/php-tooling.md` |
41
+ | `messaging-adapters.mdc` | `api-and-data/messaging-adapters.md` |
42
+ | `module-public-api.mdc` | `architecture/module-public-api.md` |
43
+ | `persistence-adapters.mdc` | `api-and-data/persistence-adapters.md` |
44
+ | `ports-interfaces.mdc` | `architecture/ports-interfaces.md` |
45
+ | `post-change-test.mdc` | `tooling-and-review/post-change-test.md` |
46
+ | `preset-layering.mdc` | `tooling-and-review/preset-layering.md` |
47
+ | `preset-no-cross-stack-leakage.mdc` | `tooling-and-review/preset-no-cross-stack-leakage.md` |
48
+ | `preset-pr-checklist.mdc` | `tooling-and-review/preset-pr-checklist.md` |
49
+ | `preset-token-budget.mdc` | `tooling-and-review/preset-token-budget.md` |
50
+ | `preset-twin-sync.mdc` | `tooling-and-review/preset-twin-sync.md` |
51
+ | `reference-features.mdc` | `architecture/reference-features.md` |
52
+ | `security-php.mdc` | `tooling-and-review/security-php.md` |
53
+ | `technical-retro.mdc` | `tooling-and-review/technical-retro.md` |
54
+ | `tests-e2e.mdc` | `testing/e2e.md` |
55
+ | `tests-integration.mdc` | `testing/integration.md` |
56
+ | `tests-unit.mdc` | `testing/unit.md` |
57
+
58
+ ## Topics
59
+
60
+ `architecture/`, `stack/`, `api-and-data/`, `testing/`, `tooling-and-review/`.
61
+ `ui-and-accessibility/` — README stub only (N/A backend).
62
+
63
+ ## Metrics policy mapping
64
+
65
+ | Shared core | Runtime integration | Loading |
66
+ |-------------|---------------------|---------|
67
+ | `agent-team/agent-task-metrics.md` | `agent-team-orchestrator` + `hooks/chain-team-phases.sh` | requestable/on-demand; never session-start |
@@ -0,0 +1,14 @@
1
+ # API and data
2
+
3
+ Driving/driven adapters. Index only.
4
+
5
+ | File | Cursor SoT |
6
+ |------|------------|
7
+ | [`adapters-driving.md`](./adapters-driving.md) | `adapters-driving.mdc` |
8
+ | [`adapters-driven.md`](./adapters-driven.md) | `adapters-driven.mdc` |
9
+ | [`api-http.md`](./api-http.md) | `api-http.mdc` |
10
+ | [`api-grpc.md`](./api-grpc.md) | `api-grpc.mdc` |
11
+ | [`persistence-adapters.md`](./persistence-adapters.md) | `persistence-adapters.mdc` |
12
+ | [`messaging-adapters.md`](./messaging-adapters.md) | `messaging-adapters.mdc` |
13
+
14
+ Full map: [`../README.md`](../README.md).
@@ -0,0 +1,38 @@
1
+ ---
2
+ description: Driven adapters (persistence, cache, messaging) for PHP hexagonal services
3
+ paths:
4
+ - "**/adapters/outbound/**/*"
5
+ - "**/adapters/persistence/**/*"
6
+ - "**/adapters/cache/**/*"
7
+ - "**/adapters/messaging/**/*"
8
+ ---
9
+
10
+ # Driven adapters
11
+
12
+ - Implement application **outbound ports**.
13
+ - Map storage/broker models → domain at the boundary; never return ORM entities or raw PDO rows to application.
14
+ - Handle retries/timeouts/idempotency here when infrastructure-specific.
15
+ - Wrap driver/ORM exceptions with context; translate to domain/application errors when meaningful.
16
+ - Honor timeouts/cancellation from the application call when the client API supports them.
17
+
18
+ ## Layout
19
+
20
+ Default: `Adapters/Outbound/Persistence|Messaging|External|Cache/`. Flat `adapters/persistence/` etc. remains valid when already used.
21
+
22
+ ## Persistence
23
+
24
+ - See `persistence-adapters.mdc`.
25
+ - Keep SQL/DQL/query builders inside the adapter package; application sees only port methods.
26
+
27
+ ## Cache / messaging / external HTTP
28
+
29
+ - Cache keys and serialization are adapter concerns.
30
+ - Publishers implement port `publishX`; consumers that trigger use cases are **driving** adapters.
31
+ - Prefer idempotent publish/consume when brokers may redeliver (see stub `messaging-adapters`).
32
+ - Outbound HTTP clients: per-provider timeouts — do not share one god-client for every vendor.
33
+
34
+ ## Forbidden
35
+
36
+ - Calling other driven adapters bypassing application (hidden coupling).
37
+ - Leaking ORM models, PDO types, Redis, or broker client types through port signatures.
38
+ - Embedding business invariants that belong in domain (e.g. discount rules only in SQL).
@@ -0,0 +1,38 @@
1
+ ---
2
+ description: Driving adapters (HTTP, gRPC, CLI) for PHP hexagonal services
3
+ paths:
4
+ - "**/adapters/inbound/**/*"
5
+ - "**/adapters/http/**/*"
6
+ - "**/adapters/grpc/**/*"
7
+ - "**/*Controller*.php"
8
+ ---
9
+
10
+ # Driving adapters
11
+
12
+ - Translate transport → application calls → transport response.
13
+ - Map request/response DTOs at the edge; do **not** pass framework request/security types into use cases.
14
+ - AuthN/AuthZ and wire-format validation belong here (or middleware); domain validation stays in domain.
15
+ - Errors: map domain/application exceptions to status codes once (central exception listener / middleware preferred).
16
+ - Keep controllers/handlers thin: decode → call use case → encode; no multi-step workflows or SQL in the adapter.
17
+
18
+ ## Layout
19
+
20
+ Default (layer-first): `Adapters/Inbound/Http/` (and `…/Grpc/`, `…/Cli/` as needed). Flat `adapters/http/` is an accepted variant when the repo already uses it.
21
+
22
+ ## HTTP
23
+
24
+ - See `api-http.mdc`. Prefer thin controllers/actions; routing in one place.
25
+ - Bind path/query/body into request DTOs and validate at the edge before calling application.
26
+ - Framework choice (Slim, Symfony, Laravel, plain PHP) is optional — match the repo.
27
+
28
+ ## gRPC / CLI / messaging consumers
29
+
30
+ - Same mapping rules; see stub `api-grpc.mdc` for protobuf notes; messaging consumers that trigger use cases are driving adapters (`messaging-adapters` stub).
31
+ - CLI entrypoints may call composition root or inbound ports — **no** SQL in `bin/` scripts.
32
+ - Propagate cancellation/timeouts from the transport into use-case calls when the stack supports it.
33
+
34
+ ## Forbidden
35
+
36
+ - SQL, DQL, or business invariants inside controllers.
37
+ - Importing persistence packages from HTTP handlers (wire via application ports).
38
+ - Swallowing exceptions without mapping to a transport status / structured log field.
@@ -0,0 +1,29 @@
1
+ ---
2
+ description: Thin gRPC/protobuf extension notes for PHP hexagonal services (HTTP-first v1)
3
+ paths:
4
+ - "**/*.proto"
5
+ - "**/adapters/inbound/grpc/**/*"
6
+ - "**/adapters/grpc/**/*"
7
+ ---
8
+
9
+ # gRPC adapters (documented stub)
10
+
11
+ > **Stub (v1):** HTTP is the preset SoT (`api-http`). This rule is a light placeholder — do not pretend full protobuf/streaming depth. **When to use:** editing `*.proto` or `Adapters/**/Grpc/**` in a repo that already (or newly) adopts gRPC.
12
+
13
+ HTTP remains the **v1 SoT**. gRPC is an optional driving adapter with the same hexagonal rules.
14
+
15
+ ## Requirements when adding gRPC
16
+
17
+ 1. Keep protobuf messages in the adapter (or `api/proto`); map to domain/application at the edge.
18
+ 2. Implement the same inbound ports / use cases as HTTP — do not fork business logic.
19
+ 3. Map gRPC status codes from domain/application errors (parity with HTTP mapper).
20
+ 4. Generate code via repo-standard `protoc` / protobuf PHP plugins — do not hand-edit generated stubs unless the repo requires it.
21
+
22
+ ## Non-goals (v1)
23
+
24
+ - Full protobuf style guide and streaming patterns — expand this rule when the consumer repo adopts gRPC widely.
25
+ - Mandating gRPC over HTTP.
26
+
27
+ ## Ports
28
+
29
+ - Prefer shared application use cases; gRPC service class is a driving adapter only.
@@ -0,0 +1,36 @@
1
+ ---
2
+ description: HTTP API adapter conventions for PHP hexagonal services
3
+ paths:
4
+ - "**/adapters/inbound/http/**/*"
5
+ - "**/adapters/http/**/*"
6
+ - "**/*Controller*.php"
7
+ - "**/*handler*.php"
8
+ ---
9
+
10
+ # HTTP API adapters
11
+
12
+ - Controllers/handlers/actions are **thin**: parse input, call one inbound port / use case, map status + body.
13
+ - Use a consistent error envelope; map **domain exceptions** centrally (exception listener / middleware) — do not leak transport types into use cases.
14
+ - Version routes if the repo already versions (`/v1/...`).
15
+ - Framework-agnostic edge by default (Slim / Symfony HttpFoundation / Laravel HTTP / plain PHP) — same mapping rules.
16
+ - DTO validation at the adapter edge; do not put HTTP constraints on domain entities.
17
+ - Map DTO ↔ domain/application at the edge (dedicated mapper or small private methods).
18
+
19
+ ## Resilience
20
+
21
+ - Side-effect endpoints (charge, create, enqueue): accept/propagate an **idempotency key** when the domain already uses one; document if intentionally omitted.
22
+ - Outbound HTTP to third parties: prefer **per-provider clients** (separate timeouts) — bulkhead isolation.
23
+ - Provider/ACL adapters return typed results or errors — never raw untyped arrays into the domain.
24
+ - Soft file-size hint: split when a controller grows past ~400 LOC.
25
+
26
+ ## Testing
27
+
28
+ - Prefer controller/handler unit tests with a mocked use case.
29
+ - Integration: HTTP kernel + DB fixtures behind driven ports when needed (`integration-test-*`).
30
+
31
+ ## Forbidden
32
+
33
+ - Business rules or SQL/DQL in controllers.
34
+ - Ignoring request timeouts / cancel when the framework exposes them.
35
+ - Raising transport-only errors from use cases (keep HTTP mapping at the adapter edge).
36
+ - Returning ORM entities directly as JSON response bodies.
@@ -0,0 +1,37 @@
1
+ ---
2
+ description: Messaging driven/driving adapters for PHP hexagonal services
3
+ paths:
4
+ - "**/Adapters/Outbound/Messaging/**/*"
5
+ - "**/Adapters/Inbound/Messaging/**/*"
6
+ - "**/adapters/**/messaging/**/*"
7
+ ---
8
+
9
+ # Messaging adapters
10
+
11
+ - **Publisher** (driven): implements an outbound port; serializes application/domain events to wire format inside the adapter.
12
+ - **Consumer** (driving): deserializes → maps to application/domain types → calls inbound port / use case; **ack/nack** (and commit) stays in the adapter.
13
+ - Idempotency keys, retry, and DLQ/parking-lot policy are adapter (or infra) concerns — document at-least-once vs exactly-once assumptions at the port.
14
+ - Use the broker client already present in the repo — do not invent a second stack.
15
+
16
+ ## Event shapes
17
+
18
+ - Prefer explicit event types in application or a small `Events` namespace used by ports.
19
+ - Map wire DTOs ↔ application events **only** in the adapter; never pass broker payloads (`AMQPMessage`, Kafka records, SQS envelopes) into domain.
20
+
21
+ ## Stack notes (PHP)
22
+
23
+ - Prefer the transport already wired: **Symfony Messenger**, enqueue/AMQP clients, php-rdkafka / Kafka clients, or AWS SDK for SQS — follow the repo.
24
+ - Framework bus types (`Envelope`, `MessageBusInterface`, raw AMQP channel) stay in adapters / composition — not in domain or application ports.
25
+ - Outbox / inbox and retry schedules are infra; ports expose intent (`publish`, `handle`) without broker APIs.
26
+
27
+ ## Forbidden
28
+
29
+ - Broker client types (`AMQPStreamConnection`, `RdKafka\Producer`, SQS client classes, Messenger `Envelope`) in domain or application signatures.
30
+ - Business rules inside listeners beyond mapping + calling one use case.
31
+ - Silent catch-and-ack that drops poison messages without DLQ/metrics policy.
32
+
33
+ ## Tests
34
+
35
+ - Unit-test mapping and idempotency branches with fakes.
36
+ - Integration against embedded broker / Testcontainers **when the repo already has that setup**.
37
+ - After edits: `post-change-test` (+ `php-tooling`); agents `integration-test-*` when adding consumer contracts.
@@ -0,0 +1,33 @@
1
+ ---
2
+ description: Persistence driven adapters (PDO/ORM/repos) for PHP hexagonal services
3
+ paths:
4
+ - "**/adapters/outbound/persistence/**/*"
5
+ - "**/adapters/persistence/**/*"
6
+ - "**/*Repository*.php"
7
+ - "**/*repository*.php"
8
+ ---
9
+
10
+ # Persistence adapters
11
+
12
+ - Implement outbound repository ports from application.
13
+ - Use parameterized queries / query builders / ORM methods — **never** string-concatenated SQL with untrusted input.
14
+ - Map rows / ORM entities → **domain** inside the adapter; entities stay private to the adapter package when possible.
15
+ - Transactions: use cases own the boundary (framework transaction on application services, or a `UnitOfWork` port). Adapters must not start ad-hoc transactions that hide business atomicity.
16
+ - Migrations live with infra (`database/migrations`, Doctrine migrations dirs) — **not** in domain.
17
+
18
+ ## Mapping
19
+
20
+ - Eloquent/Doctrine entities / PDO row mappers are adapter-local; do not pass them through port signatures or up into application/domain.
21
+ - Nullability and DB defaults convert to domain values explicitly (no silent nulls into invariants).
22
+ - ORM repositories may be used **inside** the adapter as helpers; the application still depends on the port interface, not on the ORM base class.
23
+
24
+ ## Forbidden
25
+
26
+ - Importing persistence from domain, or leaking `EntityManager` / Eloquent models / PDO through port APIs.
27
+ - Building SQL/DQL strings in use cases.
28
+ - Returning ORM entities from HTTP controllers “because lazy loading”.
29
+
30
+ ## Tests
31
+
32
+ - Integration tests with test DB / fixtures preferred for repos; unit-test mappers with fixtures.
33
+ - Prefer testing through the port implementation (`integration-test-*`).
@@ -0,0 +1,16 @@
1
+ # Architecture
2
+
3
+ Hexagonal boundaries and delivery. Index only.
4
+
5
+ | File | Cursor SoT |
6
+ |------|------------|
7
+ | [`boundaries.md`](./boundaries.md) | `architecture-boundaries.mdc` |
8
+ | [`feature-delivery.md`](./feature-delivery.md) | `feature-delivery-workflow.mdc` |
9
+ | [`reference-features.md`](./reference-features.md) | `reference-features.mdc` |
10
+ | [`domain-layer.md`](./domain-layer.md) | `domain-layer.mdc` |
11
+ | [`application-usecases.md`](./application-usecases.md) | `application-usecases.mdc` |
12
+ | [`ports-interfaces.md`](./ports-interfaces.md) | `ports-interfaces.mdc` |
13
+ | [`composition-root.md`](./composition-root.md) | `composition-root.mdc` |
14
+ | [`module-public-api.md`](./module-public-api.md) | `module-public-api.mdc` |
15
+
16
+ Full map: [`../README.md`](../README.md).
@@ -0,0 +1,31 @@
1
+ ---
2
+ description: Application use cases and orchestration in PHP hexagonal services
3
+ paths:
4
+ - "application/**/*"
5
+ - "**/application/**/*"
6
+ ---
7
+
8
+ # Application / use cases
9
+
10
+ - One use case ≈ one application service method (command/query).
11
+ - Depend on **outbound ports** (interfaces), not concrete repos, ORM, or HTTP clients.
12
+ - Orchestrate domain; transaction boundaries via ports (`UnitOfWork` / framework transaction on the application service when the repo uses that) — still **no SQL/DQL** here.
13
+ - Keep signatures in domain / application types — never framework request objects, `EntityManager`, or controller DTOs.
14
+ - Framework service attributes on use cases are optional wiring sugar; domain remains framework-free. Plain PHP: plain classes constructed in composition root.
15
+
16
+ ## Forbidden
17
+
18
+ - Importing `Adapters\*`, PDO/Doctrine drivers, framework HTTP, ORM entity classes as use-case deps.
19
+ - Embedding Redis/Kafka clients or controller types in use-case fields.
20
+ - Business rules that belong on domain entities/VOs (keep use cases thin orchestrators).
21
+
22
+ ## Structure
23
+
24
+ - Prefer `…/Application/<Feature>Service.php` (or `…/<usecase>/`) with ports colocated (`…/Application/Ports/` or `*Port.php` beside the service).
25
+ - Inbound port = interface the driving adapter calls (optional when a concrete use-case class is the only API).
26
+ - Package layout may be layer-first (`Application/`) or feature-first (`<Feature>/Application/`) — same dependency direction.
27
+
28
+ ## Tests
29
+
30
+ - Unit-test with fakes/mocks of outbound ports; assert domain outcomes and port interactions — **no** real DB.
31
+ - Prefer simple fakes for narrow ports; PHPUnit mocks only if the repo already uses them.
@@ -0,0 +1,34 @@
1
+ ---
2
+ description: Hexagonal layer boundaries for PHP backends (domain, application, ports, adapters)
3
+ ---
4
+
5
+ # Границы слоёв (hexagonal)
6
+
7
+ - **Domain** (`**/Domain/**`, `**/domain/**`):
8
+ - Может: entities, value objects, domain services, domain errors; PHP stdlib / same BC domain.
9
+ - Не должен: framework HTTP kernels, Eloquent/Doctrine as domain types, broker SDKs, transport DTOs.
10
+ - **Application** (`**/Application/**`, `**/application/**`):
11
+ - Может: use cases; **define ports** (inbound/outbound interfaces) with domain types in signatures.
12
+ - Не должен: concrete adapters, SQL/DQL, controller/framework types as domain input.
13
+ - **Ports**: interfaces only — no adapter implementations in port packages.
14
+ - **Driving adapters** (`Adapters/Inbound/**`, `adapters/inbound/**`): map DTO ↔ application/domain at the edge; no business rules/SQL in controllers.
15
+ - **Driven adapters** (`Adapters/Outbound/**`, `adapters/outbound/**`): implement outbound ports; map rows/messages → domain; do not leak persistence models upward.
16
+ - **Composition** (`Composition/`, `composition/`, bootstrap): wires the graph; no business logic.
17
+
18
+ # Зависимости
19
+
20
+ - Направление: **adapters → application → domain**.
21
+ - Driven adapters implement outbound ports defined by application.
22
+ - Domain never imports adapters or frameworks.
23
+ - Cross-feature access — only via public ports / module API, not deep imports of another feature's internals.
24
+
25
+ # Edit bundles (load on matching paths)
26
+
27
+ - `**/Domain/**` → `domain-layer`; `**/Application/**` → `application-usecases` + `ports-interfaces`
28
+ - Inbound HTTP/gRPC → `adapters-driving` + `api-http` / `api-grpc`; outbound persistence/messaging → `adapters-driven` + matching `*-adapters`
29
+ - `**/Composition/**`, bootstrap → `composition-root`; after `*.php` edits → `post-change-test` (+ `php-tooling`)
30
+
31
+ # Требование к агенту
32
+
33
+ - Класть файлы в правильный слой; не «коротить» слои ради скорости.
34
+ - DI / wiring только в composition / bootstrap.
@@ -0,0 +1,33 @@
1
+ ---
2
+ description: Composition root and DI wiring for PHP hexagonal services
3
+ paths:
4
+ - "**/Composition/**"
5
+ - "**/Composition/*"
6
+ ---
7
+
8
+ # Composition root
9
+
10
+ - Construct adapters, use cases, and servers in `Composition/` (or repo bootstrap / DI container definitions).
11
+ - Wire ports → implementations explicitly (PHP-DI, Symfony DI, Laravel container, or manual factories — match the repo).
12
+ - Load config once; **fail fast** on missing required settings before opening listeners or connections.
13
+ - Lifecycle: graceful shutdown matching the repo (close DB pools / clients in reverse wire order).
14
+
15
+ ## Allowed here
16
+
17
+ - Import all layers for **wiring only**.
18
+ - Process-wide loggers, metrics, health providers constructed once and injected.
19
+
20
+ ## Forbidden
21
+
22
+ - Business rules, SQL/DQL, HTTP routing tables with domain logic.
23
+ - Global mutable singletons for repos without clear init (prefer constructor injection / explicit bindings).
24
+ - Putting domain types under framework stereotypes unless the repo already does — prefer adapters + application as framework components.
25
+
26
+ ## Framework variants (pointer)
27
+
28
+ - Slim / plain PHP: explicit bootstrap in `public/index.php` or `Composition/`.
29
+ - Symfony / Laravel: keep container config / providers thin — no business rules in service providers.
30
+
31
+ ## Tests
32
+
33
+ - Optional smoke that the container/bootstrap builds; heavy logic stays in unit/integration tests.
@@ -0,0 +1,37 @@
1
+ ---
2
+ description: Domain layer invariants for PHP hexagonal services
3
+ paths:
4
+ - "domain/**/*"
5
+ - "**/domain/**/*"
6
+ ---
7
+
8
+ # Domain layer
9
+
10
+ - Pure business types and rules; **no I/O**, no framework, no ORM, no HTTP.
11
+ - Prefer small value objects with validation factories (`of` / `from` / private constructors) that throw typed **domain** exceptions.
12
+ - Domain errors are typed (`RuntimeException` subtypes or a small hierarchy); map to HTTP/gRPC statuses **only** in adapters.
13
+ - Domain services orchestrate entities/VOs without calling outbound ports (ports live in **application**).
14
+ - Keep invariants close to the type that owns them; avoid anemic bags of fields with all logic in use cases.
15
+ - Prefer `readonly` / immutable types when the repo already uses them; do not invent a new VO style mid-module.
16
+
17
+ ## Forbidden imports
18
+
19
+ - Framework HTTP kernels, PSR-15 request/response types as domain deps, Laravel/Symfony request classes.
20
+ - Eloquent/Doctrine entities as domain types, `EntityManager`, query builders as domain deps.
21
+ - Redis/Kafka/HTTP clients, OpenAPI/JSON serialization attributes that mirror wire contracts.
22
+ - Framework request-scope / security-context plumbing as a substitute for domain deadlines (prefer explicit types).
23
+
24
+ ## Allowed
25
+
26
+ - PHP stdlib: `DateTimeImmutable`, arrays/collections used by the repo, custom exceptions, pure utilities.
27
+ - Cross-aggregate references by **ID**, not by loading other aggregates via ports.
28
+ - Deadline/time primitives only when the domain API genuinely needs them (prefer application to pass values).
29
+
30
+ ## Plain-PHP / alternate frameworks
31
+
32
+ Same rules: domain stays framework-free whether the edge is Slim, Symfony HttpFoundation, Laravel HTTP, or plain PHP.
33
+
34
+ ## Tests
35
+
36
+ - PHPUnit (or Pest) unit tests; **no** DB, HTTP controller harness, or framework kernel.
37
+ - Cover invalid factory inputs and invariant violations explicitly.