@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,40 @@
1
+ ---
2
+ description: HTTP API adapter conventions for PHP hexagonal services
3
+ globs:
4
+ - "**/Adapters/Inbound/Http/**/*"
5
+ - "**/adapters/inbound/http/**/*"
6
+ - "**/adapters/http/**/*"
7
+ - "**/*Controller*.php"
8
+ - "**/*Handler*.php"
9
+ - "**/*Action*.php"
10
+ alwaysApply: false
11
+ ---
12
+
13
+
14
+ # HTTP API adapters
15
+
16
+ - Controllers/handlers/actions are **thin**: parse input, call one inbound port / use case, map status + body.
17
+ - Use a consistent error envelope; map **domain exceptions** centrally (exception listener / middleware) — do not leak transport types into use cases.
18
+ - Version routes if the repo already versions (`/v1/...`).
19
+ - Framework-agnostic edge by default (Slim / Symfony HttpFoundation / Laravel HTTP / plain PHP) — same mapping rules.
20
+ - DTO validation at the adapter edge; do not put HTTP constraints on domain entities.
21
+ - Map DTO ↔ domain/application at the edge (dedicated mapper or small private methods).
22
+
23
+ ## Resilience
24
+
25
+ - Side-effect endpoints (charge, create, enqueue): accept/propagate an **idempotency key** when the domain already uses one; document if intentionally omitted.
26
+ - Outbound HTTP to third parties: prefer **per-provider clients** (separate timeouts) — bulkhead isolation.
27
+ - Provider/ACL adapters return typed results or errors — never raw untyped arrays into the domain.
28
+ - Soft file-size hint: split when a controller grows past ~400 LOC.
29
+
30
+ ## Testing
31
+
32
+ - Prefer controller/handler unit tests with a mocked use case.
33
+ - Integration: HTTP kernel + DB fixtures behind driven ports when needed (`integration-test-*`).
34
+
35
+ ## Forbidden
36
+
37
+ - Business rules or SQL/DQL in controllers.
38
+ - Ignoring request timeouts / cancel when the framework exposes them.
39
+ - Raising transport-only errors from use cases (keep HTTP mapping at the adapter edge).
40
+ - Returning ORM entities directly as JSON response bodies.
@@ -0,0 +1,33 @@
1
+ ---
2
+ description: Application use cases and orchestration in PHP hexagonal services
3
+ globs:
4
+ - "**/Application/**/*"
5
+ - "**/application/**/*"
6
+ alwaysApply: false
7
+ ---
8
+
9
+
10
+ # Application / use cases
11
+
12
+ - One use case ≈ one application service method (command/query).
13
+ - Depend on **outbound ports** (interfaces), not concrete repos, ORM, or HTTP clients.
14
+ - Orchestrate domain; transaction boundaries via ports (`UnitOfWork` / framework transaction on the application service when the repo uses that) — still **no SQL/DQL** here.
15
+ - Keep signatures in domain / application types — never framework request objects, `EntityManager`, or controller DTOs.
16
+ - Framework service attributes on use cases are optional wiring sugar; domain remains framework-free. Plain PHP: plain classes constructed in composition root.
17
+
18
+ ## Forbidden
19
+
20
+ - Importing `Adapters\*`, PDO/Doctrine drivers, framework HTTP, ORM entity classes as use-case deps.
21
+ - Embedding Redis/Kafka clients or controller types in use-case fields.
22
+ - Business rules that belong on domain entities/VOs (keep use cases thin orchestrators).
23
+
24
+ ## Structure
25
+
26
+ - Prefer `…/Application/<Feature>Service.php` (or `…/<usecase>/`) with ports colocated (`…/Application/Ports/` or `*Port.php` beside the service).
27
+ - Inbound port = interface the driving adapter calls (optional when a concrete use-case class is the only API).
28
+ - Package layout may be layer-first (`Application/`) or feature-first (`<Feature>/Application/`) — same dependency direction.
29
+
30
+ ## Tests
31
+
32
+ - Unit-test with fakes/mocks of outbound ports; assert domain outcomes and port interactions — **no** real DB.
33
+ - Prefer simple fakes for narrow ports; PHPUnit mocks only if the repo already uses them.
@@ -0,0 +1,36 @@
1
+ ---
2
+ description: Hexagonal layer boundaries for PHP backends (domain, application, ports, adapters)
3
+ alwaysApply: true
4
+ ---
5
+
6
+
7
+ # Границы слоёв (hexagonal)
8
+
9
+ - **Domain** (`**/Domain/**`, `**/domain/**`):
10
+ - Может: entities, value objects, domain services, domain errors; PHP stdlib / same BC domain.
11
+ - Не должен: framework HTTP kernels, Eloquent/Doctrine as domain types, broker SDKs, transport DTOs.
12
+ - **Application** (`**/Application/**`, `**/application/**`):
13
+ - Может: use cases; **define ports** (inbound/outbound interfaces) with domain types in signatures.
14
+ - Не должен: concrete adapters, SQL/DQL, controller/framework types as domain input.
15
+ - **Ports**: interfaces only — no adapter implementations in port packages.
16
+ - **Driving adapters** (`Adapters/Inbound/**`, `adapters/inbound/**`): map DTO ↔ application/domain at the edge; no business rules/SQL in controllers.
17
+ - **Driven adapters** (`Adapters/Outbound/**`, `adapters/outbound/**`): implement outbound ports; map rows/messages → domain; do not leak persistence models upward.
18
+ - **Composition** (`Composition/`, `composition/`, bootstrap): wires the graph; no business logic.
19
+
20
+ # Зависимости
21
+
22
+ - Направление: **adapters → application → domain**.
23
+ - Driven adapters implement outbound ports defined by application.
24
+ - Domain never imports adapters or frameworks.
25
+ - Cross-feature access — only via public ports / module API, not deep imports of another feature's internals.
26
+
27
+ # Edit bundles (load on matching paths)
28
+
29
+ - `**/Domain/**` → `domain-layer`; `**/Application/**` → `application-usecases` + `ports-interfaces`
30
+ - Inbound HTTP/gRPC → `adapters-driving` + `api-http` / `api-grpc`; outbound persistence/messaging → `adapters-driven` + matching `*-adapters`
31
+ - `**/Composition/**`, bootstrap → `composition-root`; after `*.php` edits → `post-change-test` (+ `php-tooling`)
32
+
33
+ # Требование к агенту
34
+
35
+ - Класть файлы в правильный слой; не «коротить» слои ради скорости.
36
+ - DI / wiring только в composition / bootstrap.
@@ -0,0 +1,54 @@
1
+ ---
2
+ description: Code quality and light refactoring for PHP hexagonal services
3
+ alwaysApply: true
4
+ ---
5
+
6
+ <!-- shared-core: quality/code-quality-and-refactoring.md -->
7
+
8
+ # Поддержка существующего стиля
9
+
10
+ - Следовать существующим паттернам (имена, структура, типизация / DI / error handling); минимизировать стилистический шум (лишний format/rename).
11
+ - Перед новым решением: искать аналог и **повторять подход**; проверять дизайн‑систему / UI‑пакеты; ходить только через **public API** (deep‑импорты — повод для рефакторинга).
12
+
13
+ # Принципы
14
+
15
+ - **KISS:** самое простое изменение в паттернах репозитория.
16
+ - **DRY + Rule of Three:** общее — только после 3-го повторения (ошибочная абстракция дороже дублирования).
17
+ - **YAGNI:** без API, флагов, слоёв «на будущее» без текущего требования.
18
+ - **SOLID:** S — один повод менять; O — композиция/новые реализации; L — контракт подтипа; I — узкие порты; D — абстракции (порты), детали в адаптерах стека.
19
+ - **CUPID:** Composable; Unix philosophy (одна ответственность); Predictable; Idiomatic (репо); Domain-based.
20
+ - **Composition over inheritance;** Law of Demeter — без цепочек `a.b.c.d`; через public API / facade.
21
+
22
+ # Рефакторинг при изменениях
23
+
24
+ - Лёгкий refactor OK, если меньше дублирования, выше читаемость, без ломки публичных контрактов.
25
+ - Примеры: общая утилита/хук/mapper/use case; сузить unsafe-типы; разбить крупный модуль; токены вместо «магии»; deep‑импорт → public API.
26
+ - Не делать «большой» рефакторинг на точечной задаче (структура/публичные имена без запроса). Крупное — минимальными шагами; код остаётся собираемым.
27
+
28
+ # Требование к агенту
29
+
30
+ - **Boy scout:** оставлять модуль немного лучше; не жертвовать архитектурой и слоями ради краткости.
31
+
32
+ ## Agent discipline (anti-sycophancy)
33
+
34
+ Essentials below. Full procedural set (~17 rules) → load **`anti-sycophancy-discipline`**.
35
+
36
+ - Unverifiable third-party API → mark `// VERIFY: lib.symbol @ version` (or stack equivalent); never invent signatures.
37
+ - Before «is this correct?» — ≥3 failure modes (empty, boundary, concurrency/state) or name what you could not check.
38
+ - Refactor without tests → propose characterization test; if declined, label `UNTESTED`.
39
+ - Comments = WHY only when non-obvious; ban self-referential «added for issue Y».
40
+ - Urgency/authority: name the trade-off once, then comply — no apology loops.
41
+ - Match verification to risk; report by what was **verified**, not attempted.
42
+
43
+ Style enforcement (formatter / linter / post-change gate) lives in the **stack toolchain** — see each adapter’s **Stack notes**.
44
+
45
+ > Stack-specific lint gates, примеры и toolchain — в секции **Stack notes** адаптера пресета.
46
+
47
+ ## Stack notes
48
+
49
+ - **No UI layer in this preset** — ignore shared-core bullets about дизайн‑система / UI‑пакеты / CSS‑токены; apply public-API and boy-scout rules to PHP packages/ports instead.
50
+ - Public API between packages: exported types in module API or explicit ports — avoid deep imports of another feature's internals.
51
+ - Prefer checked/unchecked exceptions with clear translation at adapter edges; do not leak persistence exceptions upward.
52
+ - Interfaces belong at **ports** (consumer side), not on every class; prefer composition over inheritance.
53
+ - Post-change gate: **`post-change-test.mdc`** + **`php-tooling.mdc`** (not yarn lint / xcodebuild / Playwright).
54
+ - Style/static analysis: use **repository/CI** formatter and checks — do not invent a parallel PHP-CS-Fixer/PHPStan bible in rules.
@@ -0,0 +1,54 @@
1
+ ---
2
+ description: Code review checklist for PHP hexagonal merge requests
3
+ alwaysApply: false
4
+ ---
5
+
6
+ <!-- shared-core: review/code-review-mr.md -->
7
+
8
+ # Code review merge requests
9
+
10
+ On-demand rule for review flows. **Procedure and output format:** skill `code-review`.
11
+
12
+ ## When to load
13
+
14
+ - User asks for review/MR/diff
15
+ - Pipeline step `code-reviewer`
16
+ - Platform automated review (e.g. BUGBOT) when present
17
+
18
+ ## Checklist references (abstract)
19
+
20
+ - Architecture layers and stack core rules
21
+ - Public imports / module boundaries
22
+ - UI conventions of the stack
23
+ - Unit and e2e/UI test conventions
24
+ - Post-change lint/build gate before final report
25
+ - Design smells **in MR diff scope** — load `design-guidance`; не разворачивать полный каталог Fowler вне диффа
26
+ - Pattern name (GoF) — только если репозиторий уже использует эту форму или match минимален
27
+ - Principles (KISS / DRY+Ro3 / YAGNI / SOLID / CUPID) — через always-on `code-quality-and-refactoring`, не дублировать эссе в review
28
+
29
+ Concrete rule stems — in **Stack notes**.
30
+
31
+ ## Constraints
32
+
33
+ - Focus on MR diff, not the whole repo.
34
+ - Use local `git diff` — do not invent hosting metadata.
35
+ - Boy scout rule: suggest fixes feasible within the MR scope.
36
+ - No «большие рефакторинги» without an explicit request (`code-quality-and-refactoring`).
37
+
38
+ ## Output contract
39
+
40
+ Procedure details live in skill `code-review`. Required shape:
41
+
42
+ - Each finding cites **`path:line`**, the problem, impact, and a concrete fix direction.
43
+ - Rank by severity: **`blocker` | `important` | `nit`** (list blocker → nit).
44
+ - Vague («looks risky») is not a finding — cite evidence or ask for surrounding file context.
45
+ - End with a verdict on its own line: **`Safe to merge | needs changes | reject`**.
46
+
47
+ ## Stack notes
48
+
49
+ - Hexagonal boundaries: `architecture-boundaries`, `domain-layer`, ports vs adapters; framework/ORM only at edges.
50
+ - HTTP DTO validation/mapping and persistence entity isolation: `api-http`, `persistence-adapters`.
51
+ - Composition root (`Composition/`, `Composition/*`) has no business logic.
52
+ - Tests: `tests-unit` (PHPUnit), `tests-integration` (integration DB fixtures); post-change: `post-change-test` / `php-tooling`.
53
+ - Security: secrets/PII/`security-php`; framework Security config stays out of domain.
54
+ - Never require Playwright, XCUITest, `lint:js`, or `xcodebuild` for PHP MRs.
@@ -0,0 +1,37 @@
1
+ ---
2
+ description: Composition root and DI wiring for PHP hexagonal services
3
+ globs:
4
+ - "**/Composition/**/*"
5
+ - "**/composition/**/*"
6
+ - "**/bootstrap/**/*"
7
+ - "**/public/index.php"
8
+ alwaysApply: false
9
+ ---
10
+
11
+
12
+ # Composition root
13
+
14
+ - Construct adapters, use cases, and servers in `Composition/` (or repo bootstrap / DI container definitions).
15
+ - Wire ports → implementations explicitly (PHP-DI, Symfony DI, Laravel container, or manual factories — match the repo).
16
+ - Load config once; **fail fast** on missing required settings before opening listeners or connections.
17
+ - Lifecycle: graceful shutdown matching the repo (close DB pools / clients in reverse wire order).
18
+
19
+ ## Allowed here
20
+
21
+ - Import all layers for **wiring only**.
22
+ - Process-wide loggers, metrics, health providers constructed once and injected.
23
+
24
+ ## Forbidden
25
+
26
+ - Business rules, SQL/DQL, HTTP routing tables with domain logic.
27
+ - Global mutable singletons for repos without clear init (prefer constructor injection / explicit bindings).
28
+ - Putting domain types under framework stereotypes unless the repo already does — prefer adapters + application as framework components.
29
+
30
+ ## Framework variants (pointer)
31
+
32
+ - Slim / plain PHP: explicit bootstrap in `public/index.php` or `Composition/`.
33
+ - Symfony / Laravel: keep container config / providers thin — no business rules in service providers.
34
+
35
+ ## Tests
36
+
37
+ - Optional smoke that the container/bootstrap builds; heavy logic stays in unit/integration tests.
@@ -0,0 +1,112 @@
1
+ ---
2
+ description: Design smells (Fowler) and curated GoF patterns for agents. Load when assessing structure, smells, or pattern fit.
3
+ globs:
4
+ - "**/*.php"
5
+ alwaysApply: false
6
+ ---
7
+
8
+ <!-- shared-core: quality/design-guidance.md -->
9
+
10
+ # Design guidance (smells & patterns)
11
+
12
+ Словарь **code smells** (Fowler) и **design patterns** (GoF) для агентов при implement / review / debug.
13
+
14
+ Применять только в scope задачи или MR. Лёгкий refactor — да; «большой» rewrite без явного запроса — нет.
15
+
16
+ Называть паттерн **только если** репозиторий уже так делает или это минимальный match. Иначе — extract/split/move без ярлыка GoF.
17
+
18
+ Не заменяет always-on Principles в `code-quality-and-refactoring` (KISS, DRY + Rule of Three, YAGNI, SOLID, CUPID, composition, Demeter).
19
+
20
+ ## When to load
21
+
22
+ - **Feature delivery / implement** — оценка структуры модулей, границ и дублирования.
23
+ - **Code review** — smells и pattern fit **в диффе MR**, не по всему репо.
24
+ - **Debug** — root-cause похож на wrong abstraction, Feature Envy, Message Chains, Shotgun Surgery.
25
+ - **Light refactor only** — улучшения в рамках boy-scout / MR scope; не расширять задачу ради каталога.
26
+
27
+ Агенты и skills подгружают stem по one-liner wiring — не копировать этот каталог в промпт агента.
28
+
29
+ ## How to use (agent rules of thumb)
30
+
31
+ 1. Сначала сверить с Principles (always-on): проще ли решение, нет ли ранней абстракции, соблюдён ли public API.
32
+ 2. Затем отметить smells **в изменённых файлах** задачи/MR; предложить fix только если он укладывается в light refactor.
33
+ 3. Паттерн GoF — опциональный ярлык после того, как структура уже ясна; не начинать дизайн с выбора паттерна.
34
+ 4. Если smell и паттерн конфликтуют с границами слоёв стека — побеждают stack boundaries и existing repo patterns.
35
+ 5. Не требовать переименования «под GoF», если поведение уже корректно и читаемо.
36
+
37
+ ## Code smells (Fowler, curated ≤12)
38
+
39
+ Таблица: smell → detect hint → fix hint (одна линия каждый). Без механических меню рефакторинга.
40
+
41
+ | # | Smell | Detect | Fix hint |
42
+ |---|-------|--------|----------|
43
+ | 1 | Duplicate Code | одинаковая логика в ≥2 местах | dedupe после Rule of Three |
44
+ | 2 | Long Method / Long Module | единица делает слишком много | extract в рамках scope; без big rewrite |
45
+ | 3 | Feature Envy | метод чаще трогает чужие данные, чем свои | сдвинуть логику к данным / public API |
46
+ | 4 | Data Clumps | одни и те же группы аргументов кочуют вместе | сгруппировать в type / value object |
47
+ | 5 | Primitive Obsession | сырые string/int вместо доменных понятий | typed ids / value objects при нужде домена |
48
+ | 6 | Speculative Generality | неиспользуемые хуки, флаги, абстракции «на будущее» | удалить (YAGNI) |
49
+ | 7 | Message Chains | цепочки `a.b.c.d` | Demeter; facade / public API модуля |
50
+ | 8 | Middle Man | класс почти только прокидывает вызовы | убрать pass-through **или** оставить как boundary |
51
+ | 9 | Divergent Change | один модуль меняется по разным причинам | split по поводам изменения |
52
+ | 10 | Shotgun Surgery | одно смысловое изменение разъезжается по многим файлам | consolidate ответственность |
53
+ | 11 | Inappropriate Intimacy | доступ к чужим internals / private деталям | только public API / ports / facades |
54
+ | 12 | Refused Bequest / Parallel Inheritance | подтип игнорирует базу; зеркальные иерархии классов | composition; не плодить параллельные деревья |
55
+
56
+ **Skip Fowler (не в core):** Lazy Class, Incomplete Library Class, Comments-as-smell dogma, полный каталог 70+, пошаговые recipe-меню.
57
+
58
+ Приоритет при конфликте smells: Inappropriate Intimacy и Message Chains (границы модулей) > Duplicate Code (после Rule of Three) > Long Method внутри уже правильного модуля.
59
+
60
+ ## Design patterns (GoF, curated ≤8)
61
+
62
+ Suggest only when repo already uses the shape or the match is minimal. Prefer extract-function over naming Strategy ради ярлыка.
63
+
64
+ Паттерны ниже — **разрешённый минимум** для агентов; остальной GoF по умолчанию в Skip.
65
+
66
+ | Pattern | When to suggest | Anti-trigger |
67
+ |---------|-----------------|--------------|
68
+ | Strategy | взаимозаменяемые алгоритмы уже (или явно скоро) выбираются политикой | один алгоритм без ветвления политики |
69
+ | Adapter | обернуть внешний / чужой API под локальный port | лишняя обёртка вокруг своего же API |
70
+ | Facade | упростить multi-step subsystem за public API | facade превращается в god-object |
71
+ | Factory Method | полиморфное создание уже принято в стиле репо | factory на каждый тривиальный `new` |
72
+ | Decorator | аддитивное поведение без взрыва subclass-иерархий | decorator «для слоёв» без реальной нужды |
73
+ | Observer | events / subscriptions уже есть в архитектуре | самодельный pub/sub без прецедента в репо |
74
+ | Template Method | общий algorithm skeleton + вариативные hooks | наследование ради пары отличающихся строк |
75
+ | Composite | дерево однородных узлов (UI/domain), как уже в репо | Composite на плоский список без иерархии |
76
+
77
+ Если сомневаешься между двумя паттернами — выбери более простой extract/compose без имени; ярлык можно добавить на review, если репо уже так говорит.
78
+
79
+ ## Skip / avoid by default
80
+
81
+ | Catalog | Skip |
82
+ |---------|------|
83
+ | GoF | Singleton, Abstract Factory, Flyweight, Memento, Interpreter, Visitor, Bridge, Prototype |
84
+ | GoF (conditional) | Command, Chain of Responsibility, State — упоминать **только если** репо уже использует |
85
+ | Fowler | всё сверх 12 smells выше |
86
+ | DDD | Aggregates, bounded-context maps, event sourcing, CQRS — **не в core** |
87
+ | DDD (pointer) | ubiquitous language anti-pattern — расширять в `feature-delivery-workflow`, не здесь |
88
+ | GRASP | список Larman как отдельные правила — skip (перекрывается SOLID/CUPID) |
89
+ | Clean Code dogma | жёсткие caps на строки функции / «ровно один assert» — skip |
90
+
91
+ Не вводить второй stem (`refactoring-smells` / `design-patterns-for-agents`) — один каталог: `design-guidance`.
92
+
93
+ ## Out of scope for this stem
94
+
95
+ - Полный GoF (23) и полный Fowler catalog.
96
+ - Stack-specific рецепты (пути модулей, lint-команды) — только в **Stack notes** адаптера.
97
+ - Security, a11y, perf — отдельные review-правила; здесь только структурные smells/patterns.
98
+ - Четвёртое always-on правило — запрещено; этот stem только requestable / agent-load.
99
+
100
+ ## Cross-refs
101
+
102
+ - Always-on Principles: `code-quality-and-refactoring`.
103
+ - DIP / ports vs adapters: stack `architecture-boundaries` (детали стека — в Stack notes адаптеров).
104
+ - Ubiquitous language: `feature-delivery-workflow` (lineage).
105
+ - MR checklist (smells in scope; pattern name only if repo uses it): `code-review-mr`.
106
+ - Token / twin policy for authors: `preset-token-budget`, `preset-twin-sync` (meta, not consumer always-on).
107
+
108
+ ## Stack notes
109
+
110
+ - Strategy via small interfaces at **ports**; adapters (framework/ORM/HTTP) implement, domain stays free of frameworks.
111
+ - Suggest Facade at package public API; avoid Singleton in favor of composition root / `@Configuration` wiring.
112
+ - Prefer records / immutable VOs for Strategy inputs when the repo already uses them — do not invent patterns mid-module.
@@ -0,0 +1,39 @@
1
+ ---
2
+ description: Domain layer invariants for PHP hexagonal services
3
+ globs:
4
+ - "**/Domain/**/*"
5
+ - "**/domain/**/*"
6
+ alwaysApply: false
7
+ ---
8
+
9
+
10
+ # Domain layer
11
+
12
+ - Pure business types and rules; **no I/O**, no framework, no ORM, no HTTP.
13
+ - Prefer small value objects with validation factories (`of` / `from` / private constructors) that throw typed **domain** exceptions.
14
+ - Domain errors are typed (`RuntimeException` subtypes or a small hierarchy); map to HTTP/gRPC statuses **only** in adapters.
15
+ - Domain services orchestrate entities/VOs without calling outbound ports (ports live in **application**).
16
+ - Keep invariants close to the type that owns them; avoid anemic bags of fields with all logic in use cases.
17
+ - Prefer `readonly` / immutable types when the repo already uses them; do not invent a new VO style mid-module.
18
+
19
+ ## Forbidden imports
20
+
21
+ - Framework HTTP kernels, PSR-15 request/response types as domain deps, Laravel/Symfony request classes.
22
+ - Eloquent/Doctrine entities as domain types, `EntityManager`, query builders as domain deps.
23
+ - Redis/Kafka/HTTP clients, OpenAPI/JSON serialization attributes that mirror wire contracts.
24
+ - Framework request-scope / security-context plumbing as a substitute for domain deadlines (prefer explicit types).
25
+
26
+ ## Allowed
27
+
28
+ - PHP stdlib: `DateTimeImmutable`, arrays/collections used by the repo, custom exceptions, pure utilities.
29
+ - Cross-aggregate references by **ID**, not by loading other aggregates via ports.
30
+ - Deadline/time primitives only when the domain API genuinely needs them (prefer application to pass values).
31
+
32
+ ## Plain-PHP / alternate frameworks
33
+
34
+ Same rules: domain stays framework-free whether the edge is Slim, Symfony HttpFoundation, Laravel HTTP, or plain PHP.
35
+
36
+ ## Tests
37
+
38
+ - PHPUnit (or Pest) unit tests; **no** DB, HTTP controller harness, or framework kernel.
39
+ - Cover invalid factory inputs and invariant violations explicitly.
@@ -0,0 +1,47 @@
1
+ ---
2
+ description: End-to-end delivery checklist for PHP hexagonal features
3
+ alwaysApply: false
4
+ ---
5
+
6
+ <!-- shared-core: architecture/feature-delivery-workflow.md -->
7
+
8
+ # Feature delivery (PHP hexagonal)
9
+
10
+ Order of work:
11
+
12
+ 1. **Domain** — entities/VOs/errors (`domain-layer`).
13
+ 2. **Application + ports** — use case + outbound interfaces (`application-usecases`, `ports-interfaces`).
14
+ 3. **Driven adapters** — persistence/cache/messaging implementing ports (`adapters-driven`, `persistence-adapters`).
15
+ 4. **Driving adapters** — HTTP/gRPC/CLI mapping DTOs (`adapters-driving`, `api-http`; stubs for gRPC/messaging).
16
+ 5. **Composition root** — wire in `Composition/` / `Composition/*` (`composition-root`).
17
+ 6. **Tests** — unit (domain/app) → integration (adapters) → optional e2e smoke.
18
+ 7. **Gate** — `post-change-test` (+ `php-tooling`).
19
+
20
+ ```mermaid
21
+ flowchart LR
22
+ D[Domain] --> A[Application+Ports]
23
+ A --> Drv[Driven adapters]
24
+ Drv --> A
25
+ HTTP[Driving HTTP] --> A
26
+ CR[Composition root] --> HTTP
27
+ CR --> A
28
+ CR --> Drv
29
+ ```
30
+
31
+ ## Matrix
32
+
33
+ | Path | Rules |
34
+ |------|-------|
35
+ | `**/domain/**` | `domain-layer`, `architecture-boundaries` |
36
+ | `**/application/**` | `application-usecases`, `ports-interfaces` |
37
+ | `**/adapters/inbound/**`, `**/adapters/http/**` | `adapters-driving`, `api-http` / `api-grpc` |
38
+ | `**/adapters/outbound/**`, `**/adapters/persistence/**` | `adapters-driven`, `persistence-adapters` / `messaging-adapters` |
39
+ | `**/Composition/**`, `**/Composition/*` | `composition-root` |
40
+ | After `*.php` edits | `post-change-test` (+ `php-tooling`) |
41
+
42
+ ## Anti-patterns
43
+
44
+ - Framework types in domain; SQL/DQL in use cases; DI inside controllers; skipping port interfaces “for speed”; returning ORM entities as HTTP bodies.
45
+ - **Ubiquitous language:** Domain names/boundaries reflect the feature domain — do not mix transport/framework terms into domain without need.
46
+ - Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
47
+ - PHP framework edge is the default edge; plain PHP / Slim / Symfony HttpFoundation keep the same layer order with different wiring.
@@ -0,0 +1,38 @@
1
+ ---
2
+ description: Messaging driven/driving adapters for PHP hexagonal services
3
+ globs:
4
+ - "**/Adapters/Outbound/Messaging/**/*"
5
+ - "**/Adapters/Inbound/Messaging/**/*"
6
+ - "**/adapters/**/messaging/**/*"
7
+ alwaysApply: false
8
+ ---
9
+
10
+ # Messaging adapters
11
+
12
+ - **Publisher** (driven): implements an outbound port; serializes application/domain events to wire format inside the adapter.
13
+ - **Consumer** (driving): deserializes → maps to application/domain types → calls inbound port / use case; **ack/nack** (and commit) stays in the adapter.
14
+ - Idempotency keys, retry, and DLQ/parking-lot policy are adapter (or infra) concerns — document at-least-once vs exactly-once assumptions at the port.
15
+ - Use the broker client already present in the repo — do not invent a second stack.
16
+
17
+ ## Event shapes
18
+
19
+ - Prefer explicit event types in application or a small `Events` namespace used by ports.
20
+ - Map wire DTOs ↔ application events **only** in the adapter; never pass broker payloads (`AMQPMessage`, Kafka records, SQS envelopes) into domain.
21
+
22
+ ## Stack notes (PHP)
23
+
24
+ - Prefer the transport already wired: **Symfony Messenger**, enqueue/AMQP clients, php-rdkafka / Kafka clients, or AWS SDK for SQS — follow the repo.
25
+ - Framework bus types (`Envelope`, `MessageBusInterface`, raw AMQP channel) stay in adapters / composition — not in domain or application ports.
26
+ - Outbox / inbox and retry schedules are infra; ports expose intent (`publish`, `handle`) without broker APIs.
27
+
28
+ ## Forbidden
29
+
30
+ - Broker client types (`AMQPStreamConnection`, `RdKafka\Producer`, SQS client classes, Messenger `Envelope`) in domain or application signatures.
31
+ - Business rules inside listeners beyond mapping + calling one use case.
32
+ - Silent catch-and-ack that drops poison messages without DLQ/metrics policy.
33
+
34
+ ## Tests
35
+
36
+ - Unit-test mapping and idempotency branches with fakes.
37
+ - Integration against embedded broker / Testcontainers **when the repo already has that setup**.
38
+ - After edits: `post-change-test` (+ `php-tooling`); agents `integration-test-*` when adding consumer contracts.
@@ -0,0 +1,32 @@
1
+ ---
2
+ description: Public module API and package boundaries for PHP services
3
+ globs:
4
+ - "**/composer.json"
5
+ - "**/src/**/*.php"
6
+ alwaysApply: false
7
+ ---
8
+
9
+ # Module public API
10
+
11
+ - Published types under a package's public namespaces are a compatibility surface — change carefully; prefer additive APIs.
12
+ - Service-private code stays in implementation namespaces — do not treat every namespace as public API.
13
+ - Prefer narrow exports; expose only what other modules/features need.
14
+ - Do not deep-import another module's internal namespaces; depend on its published API / facade only.
15
+ - Document breaking PHP API changes in CHANGELOG when the repo publishes libraries.
16
+
17
+ ## Single-package default / multi-package variant
18
+
19
+ - **Default:** one Composer package with layer-first namespaces under `src/` (see `dogfood/php-hexagonal`).
20
+ - **Multi-package (Composer path repos / monorepo):** each package exposes a narrow public API; application ports may live in an `*-api` / `*-contracts` package; adapters depend inward. Do not invent multi-package scaffolding unless the repo already uses it.
21
+ - Path repositories / `"repositories": [{"type":"path",...}]` — treat each package's `composer.json` `autoload.psr-4` as that package's boundary SoT.
22
+
23
+ ## composer.json
24
+
25
+ - Package name, PHP version, and PSR-4 map are SoT for toolchain/autoload.
26
+ - Prefer minimal direct deps; pin via `composer.lock` the repo already uses.
27
+ - Dev-only tools (PHPUnit, PHPStan) stay in `require-dev` — not runtime public API.
28
+
29
+ ## Cross-feature
30
+
31
+ - Inside one package, features communicate via application ports or small public facades — not by importing sibling feature adapter namespaces (`Adapters/Inbound/...` of another feature).
32
+ - Domain and application types may be shared within the package; adapter DTOs stay local to that adapter.
@@ -0,0 +1,35 @@
1
+ ---
2
+ description: Persistence driven adapters (PDO/ORM/repos) for PHP hexagonal services
3
+ globs:
4
+ - "**/Adapters/Outbound/Persistence/**/*"
5
+ - "**/adapters/outbound/persistence/**/*"
6
+ - "**/adapters/persistence/**/*"
7
+ - "**/*Repository*.php"
8
+ alwaysApply: false
9
+ ---
10
+
11
+
12
+ # Persistence adapters
13
+
14
+ - Implement outbound repository ports from application.
15
+ - Use parameterized queries / query builders / ORM methods — **never** string-concatenated SQL with untrusted input.
16
+ - Map rows / ORM entities → **domain** inside the adapter; entities stay private to the adapter package when possible.
17
+ - 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.
18
+ - Migrations live with infra (`database/migrations`, Doctrine migrations dirs) — **not** in domain.
19
+
20
+ ## Mapping
21
+
22
+ - Eloquent/Doctrine entities / PDO row mappers are adapter-local; do not pass them through port signatures or up into application/domain.
23
+ - Nullability and DB defaults convert to domain values explicitly (no silent nulls into invariants).
24
+ - ORM repositories may be used **inside** the adapter as helpers; the application still depends on the port interface, not on the ORM base class.
25
+
26
+ ## Forbidden
27
+
28
+ - Importing persistence from domain, or leaking `EntityManager` / Eloquent models / PDO through port APIs.
29
+ - Building SQL/DQL strings in use cases.
30
+ - Returning ORM entities from HTTP controllers “because lazy loading”.
31
+
32
+ ## Tests
33
+
34
+ - Integration tests with test DB / fixtures preferred for repos; unit-test mappers with fixtures.
35
+ - Prefer testing through the port implementation (`integration-test-*`).
@@ -0,0 +1,37 @@
1
+ ---
2
+ description: PHP/Composer hexagonal stack, module layout, and agent entry points
3
+ alwaysApply: true
4
+ ---
5
+
6
+
7
+ # Стек и окружение
8
+
9
+ Версии PHP и зависимостей — **из `composer.json` / `composer.lock` целевого репозитория**. Рамка preset:
10
+
11
+ - **Язык / платформа:** PHP **8.x** + **Composer** + **PSR-4** namespaces.
12
+ - **Архитектура:** hexagonal (ports & adapters); domain не знает HTTP/ORM/брокеры.
13
+ - **Framework:** framework-agnostic HTTP edge; Slim / Symfony HttpFoundation / Laravel HTTP — **variants in Stack notes only** (не Laravel-first).
14
+ - **Тесты:** PHPUnit default; Pest — если уже в репо/CI.
15
+ - **Static / format:** PHPStan/Psalm / PHP-CS-Fixer/Pint — только если уже сконфигурированы.
16
+ - **HTTP:** thin controllers at the edge; map DTO ↔ application/domain.
17
+
18
+ # Структура (default: layer-first)
19
+
20
+ ```text
21
+ src/
22
+ Domain/
23
+ Application/ # use cases + port interfaces
24
+ Adapters/Inbound/Http/
25
+ Adapters/Outbound/Persistence|Messaging|External/
26
+ Composition/ # bootstrap / DI wiring (no business logic)
27
+ tests/
28
+ Unit/
29
+ Integration/
30
+ composer.json
31
+ ```
32
+
33
+ **Feature-first variant:** `src/<Feature>/{Domain,Application,Adapters}` — same dependency direction.
34
+
35
+ Namespace base — из Composer PSR-4 map (`App\Domain\…` и т.п.); не изобретать classmap.
36
+
37
+ Границы — **`architecture-boundaries.mdc`**. Tooling — requestable **`php-tooling.mdc`**. После правок PHP — **`post-change-test.mdc`**.