intent-flow 0.1.0__py3-none-any.whl

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 (264) hide show
  1. intent_flow/__init__.py +1 -0
  2. intent_flow/_assets/agents/backend-java-ddd-design.yaml +23 -0
  3. intent_flow/_assets/agents/backend-java-ddd-implementer.yaml +24 -0
  4. intent_flow/_assets/agents/backend-java-ddd-verify.yaml +26 -0
  5. intent_flow/_assets/agents/ddd-schema-designer.yaml +21 -0
  6. intent_flow/_assets/agents/prd-writer.yaml +22 -0
  7. intent_flow/_assets/agents/project-decomposer.yaml +24 -0
  8. intent_flow/_assets/agents/requirement-intake.yaml +19 -0
  9. intent_flow/_assets/flow/stages.yaml +26 -0
  10. intent_flow/_assets/flow/status.yaml +17 -0
  11. intent_flow/_assets/flow/transitions.yaml +23 -0
  12. intent_flow/_assets/intent-flow.yaml.example +33 -0
  13. intent_flow/_assets/manifest.yaml +13 -0
  14. intent_flow/_assets/roles/developer.yaml +28 -0
  15. intent_flow/_assets/roles/fullstack.yaml +35 -0
  16. intent_flow/_assets/roles/product-manager.yaml +13 -0
  17. intent_flow/_assets/skills/backend-java-ddd/design/SKILL.md +442 -0
  18. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/SPEC.md +80 -0
  19. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/acceptance/acceptance.md +37 -0
  20. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/application/country-create.md +113 -0
  21. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/application/country-detail.md +97 -0
  22. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/application/country-disable.md +97 -0
  23. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/application/country-enable.md +90 -0
  24. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/application/country-page.md +113 -0
  25. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/application/country-update.md +102 -0
  26. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/change/260227-01-/321/205/320/253/342/225/234/321/205/320/276/342/225/242/321/207/320/276/320/261/321/207/320/240/320/226/321/206/320/270/320/261/321/205/320/255/320/247.md +63 -0
  27. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/change/260315-02-/321/205/320/253/342/225/234/321/205/320/276/342/225/242/321/211/342/225/227/320/250/321/210/320/276/320/264/321/205/342/225/225/320/221/321/207/320/267/320/235/321/205/320/262/320/256/321/205/342/225/235/342/225/221.md +53 -0
  28. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/constraints/ddd-implementation.md +7 -0
  29. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/core/create.md +110 -0
  30. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/core/disable.md +85 -0
  31. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/core/enable.md +85 -0
  32. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/core/object-profile.md +106 -0
  33. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/core/update.md +103 -0
  34. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/rules/application-rules.md +12 -0
  35. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/rules/cross-object-rules.md +11 -0
  36. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/rules/object-rules.md +13 -0
  37. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/scenarios/create-country.md +26 -0
  38. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/scenarios/detail-country.md +22 -0
  39. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/scenarios/disable-country.md +22 -0
  40. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/scenarios/enable-country.md +22 -0
  41. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/scenarios/page-country.md +24 -0
  42. intent_flow/_assets/skills/backend-java-ddd/design/examples/country/scenarios/update-country.md +24 -0
  43. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/SPEC.md +79 -0
  44. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/acceptance/acceptance.md +36 -0
  45. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/application/currency-create.md +80 -0
  46. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/application/currency-detail.md +77 -0
  47. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/application/currency-disable.md +77 -0
  48. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/application/currency-enable.md +70 -0
  49. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/application/currency-page.md +89 -0
  50. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/application/currency-update.md +75 -0
  51. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/change/260303-01-/321/205/342/225/225/320/221/321/207/320/267/320/235/321/207/320/276/320/261/321/207/320/240/320/226.md +64 -0
  52. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/constraints/ddd-implementation.md +7 -0
  53. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/core/create.md +94 -0
  54. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/core/disable.md +85 -0
  55. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/core/enable.md +85 -0
  56. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/core/object-profile.md +95 -0
  57. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/core/update.md +90 -0
  58. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/rules/application-rules.md +11 -0
  59. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/rules/cross-object-rules.md +10 -0
  60. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/rules/object-rules.md +13 -0
  61. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/scenarios/create-currency.md +24 -0
  62. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/scenarios/detail-currency.md +22 -0
  63. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/scenarios/disable-currency.md +22 -0
  64. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/scenarios/enable-currency.md +22 -0
  65. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/scenarios/page-currency.md +24 -0
  66. intent_flow/_assets/skills/backend-java-ddd/design/examples/currency/scenarios/update-currency.md +23 -0
  67. intent_flow/_assets/skills/backend-java-ddd/design/references/INDEX.md +35 -0
  68. intent_flow/_assets/skills/backend-java-ddd/design/references/concepts/application-vs-core-behavior.md +54 -0
  69. intent_flow/_assets/skills/backend-java-ddd/design/references/concepts/business-object.md +43 -0
  70. intent_flow/_assets/skills/backend-java-ddd/design/references/concepts/object-spec-package.md +45 -0
  71. intent_flow/_assets/skills/backend-java-ddd/design/references/process/generation-process.md +75 -0
  72. intent_flow/_assets/skills/backend-java-ddd/design/references/rules/business-object-generation-rules.md +82 -0
  73. intent_flow/_assets/skills/backend-java-ddd/design/references/rules/change-impact-rules.md +45 -0
  74. intent_flow/_assets/skills/backend-java-ddd/design/references/rules/consistency-check-rules.md +47 -0
  75. intent_flow/_assets/skills/backend-java-ddd/design/references/rules/extraction-rules.md +126 -0
  76. intent_flow/_assets/skills/backend-java-ddd/design/references/rules/file-generation-rules.md +275 -0
  77. intent_flow/_assets/skills/backend-java-ddd/design/references/rules/output-artifact-checklist.md +328 -0
  78. intent_flow/_assets/skills/backend-java-ddd/design/templates/INDEX.md +22 -0
  79. intent_flow/_assets/skills/backend-java-ddd/design/templates/object/SPEC.md +34 -0
  80. intent_flow/_assets/skills/backend-java-ddd/design/templates/object/acceptance.md +13 -0
  81. intent_flow/_assets/skills/backend-java-ddd/design/templates/object/application-behavior.md +67 -0
  82. intent_flow/_assets/skills/backend-java-ddd/design/templates/object/change.md +43 -0
  83. intent_flow/_assets/skills/backend-java-ddd/design/templates/object/constraints.md +19 -0
  84. intent_flow/_assets/skills/backend-java-ddd/design/templates/object/core-behavior.md +67 -0
  85. intent_flow/_assets/skills/backend-java-ddd/design/templates/object/object-profile.md +35 -0
  86. intent_flow/_assets/skills/backend-java-ddd/design/templates/object/rules.md +17 -0
  87. intent_flow/_assets/skills/backend-java-ddd/design/templates/object/scenario.md +25 -0
  88. intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/anti-patterns/SKILL.md +488 -0
  89. intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/bootstrap/SKILL.md +171 -0
  90. intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/code-generation-workflow/SKILL.md +755 -0
  91. intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/code-style/code-formatting/SKILL.md +297 -0
  92. intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/code-style/comment-javadoc/SKILL.md +494 -0
  93. intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/code-style/imports/SKILL.md +237 -0
  94. intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/coding-standards/SKILL.md +304 -0
  95. intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/exception-logging/SKILL.md +318 -0
  96. intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/loading-strategy/SKILL.md +193 -0
  97. intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/naming-convention/SKILL.md +223 -0
  98. intent_flow/_assets/skills/backend-java-ddd/implementer/00-core/project-architecture/SKILL.md +132 -0
  99. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/adapter/controller/SKILL.md +488 -0
  100. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/adapter/controller/examples/complete-controller.md +382 -0
  101. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/adapter/controller/examples/pagination.md +103 -0
  102. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/appservice/SKILL.md +216 -0
  103. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/appservice/examples/async.md +446 -0
  104. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/appservice/examples/batch.md +555 -0
  105. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/appservice/examples/conditional.md +549 -0
  106. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/appservice/examples/cross-domain-cmdexe.md +417 -0
  107. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/appservice/examples/cross-domain.md +491 -0
  108. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/appservice/examples/distributed-tx.md +406 -0
  109. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/appservice/examples/mixed.md +470 -0
  110. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/appservice/examples/simple-cmdexe.md +512 -0
  111. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/appservice/examples/simple-qryexe.md +434 -0
  112. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/cmdexe/SKILL.md +288 -0
  113. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/cmdexe/examples/action.md +648 -0
  114. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/cmdexe/examples/create.md +775 -0
  115. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/cmdexe/examples/update.md +721 -0
  116. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/convertor/SKILL.md +231 -0
  117. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/convertor/examples/convertor.md +612 -0
  118. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/dto/SKILL.md +75 -0
  119. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/dto/examples/cmd.md +205 -0
  120. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/dto/examples/co.md +168 -0
  121. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/dto/examples/qry.md +208 -0
  122. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/qryexe/SKILL.md +354 -0
  123. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/qryexe/examples/detail.md +156 -0
  124. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/application/qryexe/examples/pagination.md +145 -0
  125. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/domain/entity/SKILL.md +280 -0
  126. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/domain/entity/examples/aggregate-creation.md +1009 -0
  127. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/domain/entity/examples/aggregate-design.md +728 -0
  128. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/domain/entity/examples/method-design.md +640 -0
  129. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/domain/entity/examples/update-patterns.md +503 -0
  130. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/domain/gateway/SKILL.md +181 -0
  131. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/domain/gateway/examples/gateway-capabilities.md +536 -0
  132. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/domain/gateway/examples/gateway-interface.md +270 -0
  133. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/infrastructure/external/SKILL.md +142 -0
  134. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/infrastructure/gatewayimpl/SKILL.md +197 -0
  135. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/infrastructure/gatewayimpl/examples/cascade-mechanism.md +353 -0
  136. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/infrastructure/gatewayimpl/examples/gateway.md +316 -0
  137. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/infrastructure/repository/SKILL.md +294 -0
  138. intent_flow/_assets/skills/backend-java-ddd/implementer/01-layers/infrastructure/repository/examples/pagination.md +439 -0
  139. intent_flow/_assets/skills/backend-java-ddd/implementer/02-plugins/enum-dict-plugin/SKILL.md +239 -0
  140. intent_flow/_assets/skills/backend-java-ddd/implementer/02-plugins/pagination-backend/SKILL.md +411 -0
  141. intent_flow/_assets/skills/backend-java-ddd/implementer/02-plugins/repository-methods/SKILL.md +229 -0
  142. intent_flow/_assets/skills/backend-java-ddd/implementer/02-plugins/seata-xa/SKILL.md +268 -0
  143. intent_flow/_assets/skills/backend-java-ddd/implementer/02-plugins/spring-cache/SKILL.md +252 -0
  144. intent_flow/_assets/skills/backend-java-ddd/implementer/10-learning/README.md +45 -0
  145. intent_flow/_assets/skills/backend-java-ddd/implementer/10-learning/architecture/ddd-architecture.md +101 -0
  146. intent_flow/_assets/skills/backend-java-ddd/implementer/10-learning/architecture/project-structure.md +143 -0
  147. intent_flow/_assets/skills/backend-java-ddd/implementer/10-learning/ddd-concepts/aggregate-update.md +432 -0
  148. intent_flow/_assets/skills/backend-java-ddd/implementer/10-learning/ddd-concepts/method-design.md +344 -0
  149. intent_flow/_assets/skills/backend-java-ddd/implementer/10-learning/ddd-concepts/parameter-object.md +416 -0
  150. intent_flow/_assets/skills/backend-java-ddd/implementer/10-learning/ddd-concepts/rich-model.md +270 -0
  151. intent_flow/_assets/skills/backend-java-ddd/implementer/10-learning/ddd-concepts/value-object.md +375 -0
  152. intent_flow/_assets/skills/backend-java-ddd/scaffold/README.md +17 -0
  153. intent_flow/_assets/skills/backend-java-ddd/scaffold/add-service-module/SKILL.md +77 -0
  154. intent_flow/_assets/skills/backend-java-ddd/scaffold/examples/service-basis.md +27 -0
  155. intent_flow/_assets/skills/backend-java-ddd/scaffold/init-multi-module-project/SKILL.md +137 -0
  156. intent_flow/_assets/skills/backend-java-ddd/scaffold/init-single-module-project/SKILL.md +115 -0
  157. intent_flow/_assets/skills/backend-java-ddd/scaffold/references/INDEX.md +19 -0
  158. intent_flow/_assets/skills/backend-java-ddd/scaffold/references/config-conventions.md +29 -0
  159. intent_flow/_assets/skills/backend-java-ddd/scaffold/references/input-checklist.md +19 -0
  160. intent_flow/_assets/skills/backend-java-ddd/scaffold/references/project-structure.md +29 -0
  161. intent_flow/_assets/skills/backend-java-ddd/scaffold/references/what-is-scaffold.md +18 -0
  162. intent_flow/_assets/skills/backend-java-ddd/scaffold/templates/INDEX.md +8 -0
  163. intent_flow/_assets/skills/backend-java-ddd/scaffold/templates/files.md +33 -0
  164. intent_flow/_assets/skills/backend-java-ddd/scaffold/templates/module-layout.md +23 -0
  165. intent_flow/_assets/skills/code-repository/commit-changes/SKILL.md +41 -0
  166. intent_flow/_assets/skills/code-repository/commit-changes/mappings/git.yaml +12 -0
  167. intent_flow/_assets/skills/code-repository/commit-changes/references/commit.md +19 -0
  168. intent_flow/_assets/skills/code-repository/create-branch/SKILL.md +41 -0
  169. intent_flow/_assets/skills/code-repository/create-branch/mappings/git.yaml +12 -0
  170. intent_flow/_assets/skills/code-repository/create-branch/references/create.md +19 -0
  171. intent_flow/_assets/skills/code-repository/diff-changes/SKILL.md +41 -0
  172. intent_flow/_assets/skills/code-repository/diff-changes/mappings/git.yaml +12 -0
  173. intent_flow/_assets/skills/code-repository/diff-changes/references/diff.md +19 -0
  174. intent_flow/_assets/skills/code-repository/read-file/SKILL.md +41 -0
  175. intent_flow/_assets/skills/code-repository/read-file/mappings/git.yaml +12 -0
  176. intent_flow/_assets/skills/code-repository/read-file/references/read.md +19 -0
  177. intent_flow/_assets/skills/decomposition/analyze-impact/SKILL.md +41 -0
  178. intent_flow/_assets/skills/decomposition/analyze-impact/references/analyze.md +19 -0
  179. intent_flow/_assets/skills/decomposition/create-project-changes/SKILL.md +41 -0
  180. intent_flow/_assets/skills/decomposition/create-project-changes/references/create.md +19 -0
  181. intent_flow/_assets/skills/decomposition/normalize-requirement/SKILL.md +41 -0
  182. intent_flow/_assets/skills/decomposition/normalize-requirement/references/normalize.md +19 -0
  183. intent_flow/_assets/skills/decomposition/normalize-requirement/templates/normalized-requirement.template.md +34 -0
  184. intent_flow/_assets/skills/domains.yaml +207 -0
  185. intent_flow/_assets/skills/local-workspace/list-artifacts/SKILL.md +41 -0
  186. intent_flow/_assets/skills/local-workspace/list-artifacts/references/list.md +19 -0
  187. intent_flow/_assets/skills/local-workspace/read-artifact/SKILL.md +41 -0
  188. intent_flow/_assets/skills/local-workspace/read-artifact/references/read.md +19 -0
  189. intent_flow/_assets/skills/local-workspace/read-meta/SKILL.md +41 -0
  190. intent_flow/_assets/skills/local-workspace/read-meta/references/read.md +19 -0
  191. intent_flow/_assets/skills/local-workspace/write-artifact/SKILL.md +41 -0
  192. intent_flow/_assets/skills/local-workspace/write-artifact/references/write.md +19 -0
  193. intent_flow/_assets/skills/local-workspace/write-meta/SKILL.md +41 -0
  194. intent_flow/_assets/skills/local-workspace/write-meta/references/write.md +19 -0
  195. intent_flow/_assets/skills/project-management/create-work-item/SKILL.md +43 -0
  196. intent_flow/_assets/skills/project-management/create-work-item/mappings/jira.yaml +29 -0
  197. intent_flow/_assets/skills/project-management/create-work-item/mappings/tapd.yaml +29 -0
  198. intent_flow/_assets/skills/project-management/create-work-item/mappings/yunxiao.yaml +36 -0
  199. intent_flow/_assets/skills/project-management/create-work-item/references/create.md +22 -0
  200. intent_flow/_assets/skills/project-management/query-work-item/SKILL.md +41 -0
  201. intent_flow/_assets/skills/project-management/query-work-item/mappings/jira.yaml +15 -0
  202. intent_flow/_assets/skills/project-management/query-work-item/mappings/tapd.yaml +15 -0
  203. intent_flow/_assets/skills/project-management/query-work-item/mappings/yunxiao.yaml +15 -0
  204. intent_flow/_assets/skills/project-management/query-work-item/references/query.md +19 -0
  205. intent_flow/_assets/skills/project-management/sync-stage/SKILL.md +41 -0
  206. intent_flow/_assets/skills/project-management/sync-stage/mappings/jira.yaml +15 -0
  207. intent_flow/_assets/skills/project-management/sync-stage/mappings/tapd.yaml +15 -0
  208. intent_flow/_assets/skills/project-management/sync-stage/mappings/yunxiao.yaml +15 -0
  209. intent_flow/_assets/skills/project-management/sync-stage/references/sync.md +19 -0
  210. intent_flow/_assets/skills/project-management/update-status/SKILL.md +41 -0
  211. intent_flow/_assets/skills/project-management/update-status/mappings/jira.yaml +31 -0
  212. intent_flow/_assets/skills/project-management/update-status/mappings/tapd.yaml +31 -0
  213. intent_flow/_assets/skills/project-management/update-status/mappings/yunxiao.yaml +32 -0
  214. intent_flow/_assets/skills/project-management/update-status/references/update.md +19 -0
  215. intent_flow/_assets/skills/project-management/update-work-item/SKILL.md +41 -0
  216. intent_flow/_assets/skills/project-management/update-work-item/mappings/jira.yaml +15 -0
  217. intent_flow/_assets/skills/project-management/update-work-item/mappings/tapd.yaml +15 -0
  218. intent_flow/_assets/skills/project-management/update-work-item/mappings/yunxiao.yaml +15 -0
  219. intent_flow/_assets/skills/project-management/update-work-item/references/update.md +19 -0
  220. intent_flow/_assets/skills/remote-document/create-doc/SKILL.md +41 -0
  221. intent_flow/_assets/skills/remote-document/create-doc/mappings/feishu.yaml +12 -0
  222. intent_flow/_assets/skills/remote-document/create-doc/mappings/yuque.yaml +12 -0
  223. intent_flow/_assets/skills/remote-document/create-doc/references/create.md +19 -0
  224. intent_flow/_assets/skills/remote-document/publish-doc/SKILL.md +41 -0
  225. intent_flow/_assets/skills/remote-document/publish-doc/mappings/feishu.yaml +12 -0
  226. intent_flow/_assets/skills/remote-document/publish-doc/mappings/yuque.yaml +12 -0
  227. intent_flow/_assets/skills/remote-document/publish-doc/references/publish.md +19 -0
  228. intent_flow/_assets/skills/remote-document/read-doc/SKILL.md +41 -0
  229. intent_flow/_assets/skills/remote-document/read-doc/mappings/feishu.yaml +12 -0
  230. intent_flow/_assets/skills/remote-document/read-doc/mappings/yuque.yaml +12 -0
  231. intent_flow/_assets/skills/remote-document/read-doc/references/read.md +19 -0
  232. intent_flow/_assets/skills/remote-document/search-doc/SKILL.md +41 -0
  233. intent_flow/_assets/skills/remote-document/search-doc/mappings/feishu.yaml +12 -0
  234. intent_flow/_assets/skills/remote-document/search-doc/mappings/yuque.yaml +12 -0
  235. intent_flow/_assets/skills/remote-document/search-doc/references/search.md +19 -0
  236. intent_flow/_assets/skills/remote-document/update-doc/SKILL.md +41 -0
  237. intent_flow/_assets/skills/remote-document/update-doc/mappings/feishu.yaml +12 -0
  238. intent_flow/_assets/skills/remote-document/update-doc/mappings/yuque.yaml +12 -0
  239. intent_flow/_assets/skills/remote-document/update-doc/references/update.md +19 -0
  240. intent_flow/_assets/skills/requirement/analyze-requirement/SKILL.md +41 -0
  241. intent_flow/_assets/skills/requirement/analyze-requirement/references/analyze.md +19 -0
  242. intent_flow/_assets/skills/requirement/generate-prd/SKILL.md +41 -0
  243. intent_flow/_assets/skills/requirement/generate-prd/references/generate.md +19 -0
  244. intent_flow/_assets/skills/requirement/generate-prd/templates/prd.template.md +24 -0
  245. intent_flow/_assets/skills/requirement/generate-prototype/SKILL.md +41 -0
  246. intent_flow/_assets/skills/requirement/generate-prototype/references/generate.md +19 -0
  247. intent_flow/_assets/skills/requirement/generate-prototype/templates/prototype.template.md +26 -0
  248. intent_flow/_assets/skills/requirement/generate-scope/SKILL.md +41 -0
  249. intent_flow/_assets/skills/requirement/generate-scope/references/generate.md +19 -0
  250. intent_flow/_assets/skills/requirement/generate-scope/templates/scope.template.md +13 -0
  251. intent_flow/_assets/skills/requirement/intake-requirement/SKILL.md +41 -0
  252. intent_flow/_assets/skills/requirement/intake-requirement/references/intake.md +19 -0
  253. intent_flow/_assets/skills/resolution.yaml +17 -0
  254. intent_flow/adapters/__init__.py +1 -0
  255. intent_flow/adapters/opencode/__init__.py +1 -0
  256. intent_flow/adapters/opencode/adapter.yaml +31 -0
  257. intent_flow/adapters/opencode/build_runtime.py +1207 -0
  258. intent_flow/adapters/opencode/intent-flow.plugin.js +161 -0
  259. intent_flow/cli.py +1067 -0
  260. intent_flow-0.1.0.dist-info/METADATA +10 -0
  261. intent_flow-0.1.0.dist-info/RECORD +264 -0
  262. intent_flow-0.1.0.dist-info/WHEEL +5 -0
  263. intent_flow-0.1.0.dist-info/entry_points.txt +2 -0
  264. intent_flow-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,268 @@
1
+ # Seata XA 分布式事务模式(seata-xa)
2
+
3
+ ## 适用场景
4
+
5
+ - 聚合根分布在**不同服务**
6
+ - 要求**强一致性**
7
+ - 可以接受同步调用的延迟
8
+ - 典型场景:支付扣款、库存扣减等必须强一致的操作
9
+
10
+ ## 特点
11
+
12
+ | 维度 | 说明 |
13
+ |------|------|
14
+ | 一致性 | 强一致性 |
15
+ | 性能 | 中等(有锁等待) |
16
+ | 复杂度 | 中等 |
17
+ | 回滚方式 | Seata 协调自动回滚 |
18
+
19
+ ## 实现方式
20
+
21
+ ### 依赖配置
22
+
23
+ ```xml
24
+ <!-- pom.xml -->
25
+ <dependency>
26
+ <groupId>com.trob4cloud</groupId>
27
+ <artifactId>common-seata</artifactId>
28
+ </dependency>
29
+ ```
30
+
31
+ ### 代码结构
32
+
33
+ ```java
34
+ package com.trob4cloud.service.{xxx}.application.{module}.service.impl;
35
+
36
+ import io.seata.spring.annotation.GlobalTransactional;
37
+ import org.springframework.stereotype.Service;
38
+ import lombok.RequiredArgsConstructor;
39
+
40
+ @Service
41
+ @RequiredArgsConstructor
42
+ public class {FlowName}AppServiceImpl implements {FlowName}AppService {
43
+
44
+ // 本地 Gateway
45
+ private final {聚合根1}Gateway {聚合根1小写}Gateway;
46
+
47
+ // 远程服务 Gateway(通过 Feign 调用)
48
+ private final {聚合根2}Gateway {聚合根2小写}Gateway;
49
+ private final {聚合根3}Gateway {聚合根3小写}Gateway;
50
+
51
+ @Override
52
+ @GlobalTransactional(rollbackFor = Exception.class, name = "{flow-name}-tx")
53
+ public void execute({FlowCmd} cmd) {
54
+ // ========== 步骤 1: 本地聚合根操作 ==========
55
+ {聚合根1} aggregate1 = {聚合根1小写}Gateway.findById(cmd.getId());
56
+ if (aggregate1 == null) {
57
+ throw new BizException("{聚合根1}不存在");
58
+ }
59
+ aggregate1.{method1}(cmd.getParam1());
60
+ {聚合根1小写}Gateway.save(aggregate1);
61
+
62
+ // ========== 步骤 2: 远程服务调用(服务 B) ==========
63
+ // 通过 Feign 调用,Seata 会自动传播事务上下文
64
+ {聚合根2}Response response2 = {聚合根2小写}Gateway.{method2}(
65
+ new {Method2}Cmd(aggregate1.getId(), cmd.getParam2())
66
+ );
67
+ if (!response2.isSuccess()) {
68
+ throw new BizException(response2.getMessage());
69
+ }
70
+
71
+ // ========== 步骤 3: 远程服务调用(服务 C) ==========
72
+ {聚合根3}Response response3 = {聚合根3小写}Gateway.{method3}(
73
+ new {Method3}Cmd(aggregate1.getId(), cmd.getParam3())
74
+ );
75
+ if (!response3.isSuccess()) {
76
+ throw new BizException(response3.getMessage());
77
+ }
78
+
79
+ // 任何异常 Seata 会协调所有分支事务回滚
80
+ }
81
+ }
82
+ ```
83
+
84
+ ### Gateway 定义(远程服务)
85
+
86
+ ```java
87
+ package com.trob4cloud.service.{xxx}.domain.{module};
88
+
89
+ /**
90
+ * 远程服务 Gateway 接口
91
+ * 实现类通过 Feign 调用远程服务
92
+ */
93
+ public interface {聚合根2}Gateway {
94
+
95
+ /**
96
+ * 远程调用方法
97
+ * Seata 会自动传播全局事务 XID
98
+ */
99
+ {聚合根2}Response {method2}({Method2}Cmd cmd);
100
+ }
101
+ ```
102
+
103
+ ### Gateway 实现(Feign 调用)
104
+
105
+ ```java
106
+ package com.trob4cloud.service.{xxx}.infrastructure.gatewayimpl;
107
+
108
+ import org.springframework.stereotype.Component;
109
+ import lombok.RequiredArgsConstructor;
110
+
111
+ @Component
112
+ @RequiredArgsConstructor
113
+ public class {聚合根2}GatewayImpl implements {聚合根2}Gateway {
114
+
115
+ private final {Service2}FeignClient {service2}FeignClient;
116
+
117
+ @Override
118
+ public {聚合根2}Response {method2}({Method2}Cmd cmd) {
119
+ // Feign 调用会自动传播 Seata 事务上下文
120
+ R<{聚合根2}Response> result = {service2}FeignClient.{method2}(cmd);
121
+ if (result.isSuccess()) {
122
+ return result.getData();
123
+ }
124
+ throw new BizException(result.getMessage());
125
+ }
126
+ }
127
+ ```
128
+
129
+ ### 被调用服务(参与者)
130
+
131
+ ```java
132
+ package com.trob4cloud.service.{yyy}.application.{module}.service.impl;
133
+
134
+ import org.springframework.transaction.annotation.Transactional;
135
+ import org.springframework.stereotype.Service;
136
+ import lombok.RequiredArgsConstructor;
137
+
138
+ @Service
139
+ @RequiredArgsConstructor
140
+ public class {聚合根2}AppServiceImpl implements {聚合根2}AppService {
141
+
142
+ private final {聚合根2}Gateway gateway;
143
+
144
+ /**
145
+ * 被 Seata 全局事务调用时,自动加入全局事务
146
+ * 使用本地事务注解即可,Seata 会协调
147
+ */
148
+ @Override
149
+ @Transactional(rollbackFor = Exception.class)
150
+ public {聚合根2}Response {method2}({Method2}Cmd cmd) {
151
+ {聚合根2} aggregate = gateway.findById(cmd.getId());
152
+ aggregate.{method2}(cmd.getParam());
153
+ gateway.save(aggregate);
154
+
155
+ return new {聚合根2}Response(aggregate.getId());
156
+ }
157
+ }
158
+ ```
159
+
160
+ ## 调用链路
161
+
162
+ ```
163
+ 服务 A(发起者) 服务 B(参与者) 服务 C(参与者)
164
+ │ │ │
165
+ │ @GlobalTransactional │ │
166
+ │ ────────────────────→ │ │
167
+ │ 开启全局事务 │ │
168
+ │ │ │
169
+ │ 本地操作 │ │
170
+ │ aggregate1.method1() │ │
171
+ │ │ │
172
+ │ Feign 调用(传播 XID) │ │
173
+ │ ─────────────────────────────────→│ │
174
+ │ │ 本地操作 │
175
+ │ │ @Transactional │
176
+ │ │ │
177
+ │ Feign 调用(传播 XID) │
178
+ │ ──────────────────────────────────────────────────────────→│
179
+ │ │ 本地操作
180
+ │ │ @Transactional
181
+ │ │ │
182
+ │ 全局提交/回滚 │ │
183
+ │ ←─────────────────────────────────│←──────────────────────│
184
+ │ Seata 协调所有分支 │ │
185
+ ```
186
+
187
+ ## 异常处理
188
+
189
+ ```java
190
+ @GlobalTransactional(rollbackFor = Exception.class, name = "{flow-name}-tx")
191
+ public void execute(Cmd cmd) {
192
+ try {
193
+ // 步骤 1: 本地操作
194
+ localGateway.save(aggregate1);
195
+
196
+ // 步骤 2: 远程调用
197
+ Response response = remoteGateway.doSomething(cmd);
198
+ if (!response.isSuccess()) {
199
+ // 业务失败,抛出异常触发全局回滚
200
+ throw new BizException(response.getMessage());
201
+ }
202
+
203
+ } catch (FeignException e) {
204
+ // 远程调用异常,Seata 自动回滚
205
+ log.error("远程服务调用失败", e);
206
+ throw new BizException("服务暂时不可用,请稍后重试");
207
+ } catch (Exception e) {
208
+ // 其他异常,Seata 自动回滚
209
+ log.error("流程执行失败", e);
210
+ throw new BizException("操作失败");
211
+ }
212
+ }
213
+ ```
214
+
215
+ ## 注意事项
216
+
217
+ 1. **所有参与服务都要集成 Seata**:确保 Seata 配置正确
218
+ 2. **Feign 传播 XID**:确保 Feign 拦截器传播 Seata 事务上下文
219
+ 3. **避免长事务**:XA 模式有锁等待,事务不宜过长
220
+ 4. **超时配置**:合理设置全局事务超时时间
221
+ 5. **幂等性**:被调用方法建议支持幂等,应对重试场景
222
+
223
+ ## 配置示例
224
+
225
+ ```yaml
226
+ # application.yml
227
+ seata:
228
+ enabled: true
229
+ tx-service-group: trobs-erp-tx-group
230
+ service:
231
+ vgroup-mapping:
232
+ trobs-erp-tx-group: default
233
+ registry:
234
+ type: nacos
235
+ nacos:
236
+ server-addr: ${NACOS_SERVER_ADDR}
237
+ namespace: ${NACOS_NAMESPACE}
238
+ ```
239
+
240
+ ## 示例场景
241
+
242
+ ### 订单支付(订单服务 + 账户服务 + 库存服务)
243
+
244
+ ```java
245
+ @GlobalTransactional(rollbackFor = Exception.class, name = "order-payment-tx")
246
+ public void payOrder(PayOrderCmd cmd) {
247
+ // 1. 更新订单状态(本地)
248
+ SalesOrder order = orderGateway.findById(cmd.getOrderId());
249
+ order.pay();
250
+ orderGateway.save(order);
251
+
252
+ // 2. 扣减账户余额(远程:账户服务)
253
+ accountGateway.deduct(new DeductCmd(
254
+ order.getCustomerId(),
255
+ order.getTotalAmount()
256
+ ));
257
+
258
+ // 3. 扣减库存(远程:库存服务)
259
+ for (OrderItem item : order.getItems()) {
260
+ inventoryGateway.deduct(new DeductInventoryCmd(
261
+ item.getMaterialId(),
262
+ item.getQuantity()
263
+ ));
264
+ }
265
+
266
+ // 任何失败,Seata 协调全局回滚
267
+ }
268
+ ```
@@ -0,0 +1,252 @@
1
+ ---
2
+ name: spring-cache
3
+ description: Spring Cache 缓存注解使用规范。@Cacheable、@CacheEvict 的写法、cacheNames 命名规范、key 编写规范。缓存由人工根据业务场景判断添加,不自动生成。
4
+ ---
5
+
6
+ # Spring Cache 缓存规范
7
+
8
+ ## 概述
9
+
10
+ 项目使用 Spring Cache 注解(`@Cacheable` / `@CacheEvict`)在 **AppService 层**实现缓存。
11
+
12
+ **重要原则**:
13
+ - 缓存是**业务决策**,由人工判断哪些方法需要缓存,AI 生成代码时不自动添加缓存注解
14
+ - 缓存接口**正常命名**,不加 `Cache` 后缀(如 `getDropdownOptions`、`getShopInfo`)
15
+ - 缓存加在 **AppService 层**,不加在 QryExe / CmdExe 层
16
+
17
+ ---
18
+
19
+ ## 注解用法
20
+
21
+ ### @Cacheable(查询加缓存)
22
+
23
+ ```java
24
+ // 全量下拉(无参方法,不需要指定 key)
25
+ @Override
26
+ @Cacheable(cacheNames = "dropdown:country")
27
+ public List<DropdownOptionCO> getDropdownOptions() {
28
+ return countryDropdownQryExe.execute();
29
+ }
30
+
31
+ // 带 ID 的业务查询
32
+ @Override
33
+ @Cacheable(cacheNames = "shop:info", key = "#shopId")
34
+ public ShopInfoCO getShopInfo(Long shopId) {
35
+ return shopInfoQryExe.execute(shopId);
36
+ }
37
+ ```
38
+
39
+ ### @CacheEvict(写操作清缓存)
40
+
41
+ ```java
42
+ // 单个缓存组
43
+ @Override
44
+ @CacheEvict(cacheNames = "dropdown:country", allEntries = true)
45
+ @Transactional(rollbackFor = Exception.class)
46
+ public void create(CreateCountryCmd cmd) {
47
+ createCountryCmdExe.execute(cmd);
48
+ }
49
+
50
+ @Override
51
+ @CacheEvict(cacheNames = "dropdown:country", allEntries = true)
52
+ @Transactional(rollbackFor = Exception.class)
53
+ public void update(UpdateCountryCmd cmd) {
54
+ updateCountryCmdExe.execute(cmd);
55
+ }
56
+
57
+ @Override
58
+ @CacheEvict(cacheNames = "dropdown:country", allEntries = true)
59
+ @Transactional(rollbackFor = Exception.class)
60
+ public void enable(EnableCountryCmd cmd) {
61
+ enableCountryCmdExe.execute(cmd);
62
+ }
63
+
64
+ @Override
65
+ @CacheEvict(cacheNames = "dropdown:country", allEntries = true)
66
+ @Transactional(rollbackFor = Exception.class)
67
+ public void disable(DisableCountryCmd cmd) {
68
+ disableCountryCmdExe.execute(cmd);
69
+ }
70
+ ```
71
+
72
+ ### @CacheEvict 同时清多个缓存组
73
+
74
+ 当一个写操作影响多个缓存时,用数组形式同时清除:
75
+
76
+ ```java
77
+ // Platform 的写操作同时清 platform 和 platformSite 两个缓存组
78
+ @Override
79
+ @CacheEvict(cacheNames = {"dropdown:platform", "dropdown:platformSite"}, allEntries = true)
80
+ @Transactional(rollbackFor = Exception.class)
81
+ public void create(CreatePlatformCmd cmd) {
82
+ createPlatformCmdExe.execute(cmd);
83
+ }
84
+ ```
85
+
86
+ ---
87
+
88
+ ## cacheNames 命名规范
89
+
90
+ 格式:`{场景}:{模块名}`
91
+
92
+ | 场景 | 格式 | 示例 |
93
+ |------|------|------|
94
+ | 下拉选项 | `dropdown:{模块名}` | `dropdown:country`、`dropdown:platform`、`dropdown:platformSite` |
95
+ | 业务数据查询 | `{模块名}:{数据类型}` | `shop:info`、`warehouse:info` |
96
+
97
+ **规则**:
98
+ - 全小写,单词间用 `:` 分隔
99
+ - 模块名与代码中的模块保持一致(如 `country`、`platform`、`shop`)
100
+ - ❌ 不在 `CacheManager` 配置类中硬编码业务 `cacheNames`,`CacheManager` 只配置默认序列化和 TTL
101
+
102
+ ## CacheNames 常量类
103
+
104
+ `cacheNames` 字符串必须定义为常量,禁止在注解中直接硬编码字符串。
105
+
106
+ **常量类位置**:`application/base/constant/CacheNames.java`(每个服务各自维护)
107
+
108
+ ```java
109
+ package com.trob4cloud.service.basis.application.base.constant;
110
+
111
+ /**
112
+ * 缓存名称常量(Spring Cache cacheNames)
113
+ * <p>
114
+ * 命名规范:{场景}:{模块名}
115
+ */
116
+ public interface CacheNames {
117
+
118
+ // ==================== 下拉选项缓存 ====================
119
+
120
+ String DROPDOWN_COUNTRY = "dropdown:country";
121
+
122
+ String DROPDOWN_DISTRICT = "dropdown:district";
123
+
124
+ String DROPDOWN_PLATFORM = "dropdown:platform";
125
+
126
+ String DROPDOWN_PLATFORM_SITE = "dropdown:platformSite";
127
+ }
128
+ ```
129
+
130
+ **使用方式**:
131
+
132
+ ```java
133
+ // ✅ 正确:引用常量
134
+ @Cacheable(cacheNames = CacheNames.DROPDOWN_COUNTRY)
135
+ @CacheEvict(cacheNames = CacheNames.DROPDOWN_COUNTRY, allEntries = true)
136
+ @CacheEvict(cacheNames = {CacheNames.DROPDOWN_PLATFORM, CacheNames.DROPDOWN_PLATFORM_SITE}, allEntries = true)
137
+
138
+ // ❌ 错误:直接硬编码字符串
139
+ @Cacheable(cacheNames = "dropdown:country")
140
+ @CacheEvict(cacheNames = {"dropdown:platform", "dropdown:platformSite"}, allEntries = true)
141
+ ```
142
+
143
+ ---
144
+
145
+ ## key 编写规范
146
+
147
+ | 场景 | key 写法 | 示例 |
148
+ |------|---------|------|
149
+ | 无参方法(全量缓存) | 不指定 key(省略即可) | `@Cacheable(cacheNames = "dropdown:country")` |
150
+ | 单个基本类型参数 | `#参数名` | `key = "#shopId"` |
151
+ | 对象中取字段 | `#对象名.字段名` | `key = "#qry.countryId"` |
152
+ | List 参数 | `#参数名.toString()` | `key = "#platformTypeIds.toString()"` |
153
+
154
+ ---
155
+
156
+ ## 与 @Transactional 配合规范
157
+
158
+ - 默认行为:方法执行后清缓存(`afterInvocation = true`)
159
+ - 若事务回滚,缓存已被清除,下次查询回源数据库——这是**安全的**,最坏结果是多一次数据库查询
160
+ - 注解顺序遵循**长度升序**规范(短在上,长在下),详见 [code-formatting/SKILL.md](../../00-core/code-style/code-formatting/SKILL.md)
161
+
162
+ ```java
163
+ // ✅ 正确:@Transactional 比 @CacheEvict 短,在上方
164
+ @Override
165
+ @Transactional(rollbackFor = Exception.class)
166
+ @CacheEvict(cacheNames = CacheNames.DROPDOWN_COUNTRY, allEntries = true)
167
+ public void create(CreateCountryCmd cmd) { ... }
168
+ ```
169
+
170
+ ---
171
+
172
+ ## 规范要点
173
+
174
+ ### ✅ 正确做法
175
+
176
+ ```java
177
+ // ✅ 缓存加在 AppService 层,无参方法不指定 key
178
+ @Cacheable(cacheNames = "dropdown:country")
179
+ public List<DropdownOptionCO> getDropdownOptions() { ... }
180
+
181
+ // ✅ 所有写操作都加 @CacheEvict(create / update / enable / disable)
182
+ @CacheEvict(cacheNames = "dropdown:country", allEntries = true)
183
+ @Transactional(rollbackFor = Exception.class)
184
+ public void update(UpdateCountryCmd cmd) { ... }
185
+
186
+ // ✅ cacheNames 遵循命名规范
187
+ cacheNames = "dropdown:country"
188
+ cacheNames = "shop:info"
189
+
190
+ // ✅ 无参全量缓存不指定 key,省略即可
191
+ @Cacheable(cacheNames = "dropdown:country")
192
+ ```
193
+
194
+ ### ❌ 错误做法
195
+
196
+ ```java
197
+ // ❌ 在分页方法上加缓存(条件复杂,缓存无意义)
198
+ @Cacheable(cacheNames = "country:page", key = "#pageRequest.toString()")
199
+ public PageResult<CountryCO> page(PageRequest pageRequest) { ... }
200
+
201
+ // ❌ 在详情接口(管理后台 CRUD)上加缓存
202
+ @Cacheable(cacheNames = "country:detail", key = "#qry.countryId")
203
+ public CountryDetailCO getById(GetCountryByIdQry qry) { ... }
204
+
205
+ // ❌ key 用对象整体(序列化结果不稳定)
206
+ key = "#cmd.toString()"
207
+
208
+ // ❌ 缓存加在 QryExe 层
209
+ @Cacheable(...) // QryExe 是内部实现,不加缓存
210
+ public List<DropdownOptionCO> execute() { ... }
211
+
212
+ // ❌ 在 CacheManager 中硬编码业务 cacheNames
213
+ RedisCacheManager.builder(factory)
214
+ .withCacheConfiguration("dropdown:country", ...) // ❌ 业务 Key 不应出现在基础设施配置中
215
+ .build();
216
+
217
+ // ❌ 方法命名加 Cache 后缀
218
+ public List<DropdownOptionCO> getDropdownOptionsCache() { ... } // ❌
219
+ ```
220
+
221
+ ---
222
+
223
+ ## 常见问题
224
+
225
+ ### 写操作有多个方法,漏加了 @CacheEvict
226
+
227
+ **后果**:数据已更新但缓存未清,前端看到旧数据。
228
+
229
+ **解决**:检查 AppServiceImpl 中所有写操作方法(`create` / `update` / `enable` / `disable` / `delete`),确保每个都加了 `@CacheEvict`。
230
+
231
+ ### 一个写操作影响多个缓存,只清了一个
232
+
233
+ **示例**:修改 Platform 同时影响 `dropdown:platform` 和 `dropdown:platformSite`,只清了 `dropdown:platform`。
234
+
235
+ **解决**:使用数组形式同时清除:
236
+ ```java
237
+ @CacheEvict(cacheNames = {"dropdown:platform", "dropdown:platformSite"}, allEntries = true)
238
+ ```
239
+
240
+ ---
241
+
242
+ ## 检查清单
243
+
244
+ - [ ] 缓存注解加在 AppService 层(不在 QryExe / CmdExe 层)
245
+ - [ ] `cacheNames` 遵循 `{场景}:{模块名}` 命名规范,全小写
246
+ - [ ] `cacheNames` 使用 `CacheNames` 常量类引用,不直接硬编码字符串
247
+ - [ ] 无参全量缓存不指定 `key`(省略即可)
248
+ - [ ] 所有写操作(`create` / `update` / `enable` / `disable`)都加了 `@CacheEvict`
249
+ - [ ] 一个写操作影响多个缓存组时,使用数组形式同时清除
250
+ - [ ] 注解按长度升序排列:`@Override` → `@Transactional` → `@CacheEvict`
251
+ - [ ] 没有在分页方法上加 `@Cacheable`
252
+ - [ ] 没有在 `CacheManager` 配置中硬编码业务 `cacheNames`
@@ -0,0 +1,45 @@
1
+ # 学习文档
2
+
3
+ > 本目录存放学习和理解用的文档,与 SKILL 系统分离。
4
+ >
5
+ > **注意**:本目录的文档**不参与代码生成**,只用于人员学习和理解。
6
+
7
+ ## 目录结构
8
+
9
+ ```
10
+ 01-learning/
11
+ ├── ddd-concepts/ # DDD 概念学习
12
+ │ ├── rich-model.md # 充血模型设计理念
13
+ │ ├── method-design.md # 领域方法设计
14
+ │ ├── aggregate-update.md # 聚合根更新模式
15
+ │ ├── value-object.md # 值对象设计
16
+ │ └── parameter-object.md # 参数对象设计
17
+ │
18
+ ├── architecture/ # 架构学习
19
+ │ ├── ddd-architecture.md # DDD 四层架构
20
+ │ └── project-structure.md# 项目目录结构
21
+ │
22
+ └── best-practices/ # 最佳实践
23
+ └── ...
24
+ ```
25
+
26
+ ## 与 SKILL 系统的关系
27
+
28
+ | 目录 | 用途 | 参与代码生成 |
29
+ |------|------|------------|
30
+ | `./` | 驱动 AI 生成代码 | ✅ 是 |
31
+ | `01-learning/` | 人员学习理解 | ❌ 否 |
32
+
33
+ ## 学习路径推荐
34
+
35
+ ### 新人入门
36
+
37
+ 1. `architecture/ddd-architecture.md` - 理解 DDD 四层架构
38
+ 2. `architecture/project-structure.md` - 理解项目目录结构
39
+ 3. `ddd-concepts/rich-model.md` - 理解充血模型
40
+
41
+ ### 深入学习
42
+
43
+ 1. `ddd-concepts/method-design.md` - 领域方法设计
44
+ 2. `ddd-concepts/aggregate-update.md` - 聚合根更新模式
45
+ 3. `ddd-concepts/value-object.md` - 值对象设计
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: ddd-architecture
3
+ description: 项目 DDD 四层架构总览、核心设计理念。当询问"项目架构"、"DDD是什么"、"分层架构"时使用。
4
+ ---
5
+
6
+ # DDD 四层架构规范
7
+
8
+ ## 核心设计理念
9
+
10
+ ### 三大核心原则
11
+
12
+ 1. **领域高内聚**:业务逻辑强制回归实体(充血模型),查库校验由 Domain Gateway 负责
13
+ 2. **存储层透传**:不搞 DO/PO 转换,Domain Entity 直接映射数据库表,利用 MyBatis Plus 的能力
14
+ 3. **整存整取**:Gateway 实现层封装聚合根的拆解与组装,Application 层只需一行代码保存
15
+
16
+ ### 与传统 CRUD 的对比
17
+
18
+ | 设计点 | 传统 CRUD | 实用主义 DDD | 优势 |
19
+ |--------|-----------|--------------|------|
20
+ | **实体类** | 贫血,全是 `@Data` | 充血,只有 `@Getter`,带业务方法 | 业务逻辑不外泄,代码更安全 |
21
+ | **POJO** | StoreDTO, StoreVO, StorePO | 合并为 `Store`(既是实体又是 MP 表对象) | 开发效率极高,减少无意义转换 |
22
+ | **多表保存** | Service 里写多个 mapper.insert | `gateway.save(store)` 一行代码 | Service 层极度整洁 |
23
+ | **查库校验** | 混在 Service 里 | 由 `Gateway` 提供查询校验方法 | 职责清晰 |
24
+
25
+ ## 四层架构总览
26
+
27
+ ```
28
+ ┌─────────────────────────────────────────────────────────────┐
29
+ │ Adapter Layer(适配层) │
30
+ │ - Controller:接收请求,参数校验,调用 AppService │
31
+ │ - 职责:HTTP 适配,DTO 转换 │
32
+ └─────────────────────────────────────────────────────────────┘
33
+ ↓
34
+ ┌─────────────────────────────────────────────────────────────┐
35
+ │ Application Layer(应用层) │
36
+ │ - AppService:流程编排,事务边界(⭐严禁引用 Repository) │
37
+ │ - CmdExe:命令执行器,编排聚合根,调用 Gateway │
38
+ │ - QryExe:查询执行器,调用 Repository 或 Gateway 进行查询 │
39
+ │ - 职责:编排执行器,控制事务 │
40
+ └─────────────────────────────────────────────────────────────┘
41
+ ↓
42
+ ┌─────────────────────────────────────────────────────────────┐
43
+ │ Domain Layer(领域层)★核心★ │
44
+ │ - Model:充血模型,包含业务行为,直接映射数据库表 │
45
+ │ - ValueObject:值对象(不可变、有业务行为) │
46
+ │ - Param:参数对象(可变、仅用于方法参数传递) │
47
+ │ - Gateway 接口:定义聚合根的存取接口和查询校验方法 │
48
+ └─────────────────────────────────────────────────────────────┘
49
+ ↓
50
+ ┌─────────────────────────────────────────────────────────────┐
51
+ │ Infrastructure Layer(基础设施层) │
52
+ │ - Repository:数据访问层,继承 BaseEntityRepository │
53
+ │ - GatewayImpl:实现 Gateway,负责聚合根拆解与组装 │
54
+ │ - 职责:数据持久化,整存整取,查询校验,复杂查询 │
55
+ └─────────────────────────────────────────────────────────────┘
56
+ ```
57
+
58
+ ## 调用链路
59
+
60
+ ```
61
+ Controller
62
+ ↓ 调用
63
+ AppService(编排层 + 事务控制)⭐严禁引用 Repository
64
+ ↓ 编排
65
+ CmdExe / QryExe(执行器)
66
+ ↓ 调用
67
+ Gateway / Repository(数据层)
68
+ ```
69
+
70
+ ## 核心约束(强制)
71
+
72
+ | 约束 | 说明 |
73
+ |------|------|
74
+ | **AppService 严禁引用 Repository** | 只能引用 CmdExe、QryExe 或其他域的 AppService |
75
+ | **事务在 AppService 层** | `@Transactional` 必须标注在 AppService 的方法上 |
76
+ | **CmdExe 编排聚合根** | 负责写操作,编排聚合根逻辑,调用 Gateway |
77
+ | **QryExe 直接查询** | 负责读操作,直接查询 Repository 或 Gateway |
78
+ | **Exe 不加事务** | CmdExe 和 QryExe 不加 `@Transactional` 注解 |
79
+
80
+ ## Domain 层组成
81
+
82
+ | 组件 | 定义 | 特点 | 位置 |
83
+ |------|------|------|------|
84
+ | **Model** | 聚合根、实体 | 充血模型、只用 @Getter | `domain/{业务}/model/` |
85
+ | **ValueObject** | 值对象 | **不可变、有业务行为** | `domain/{业务}/valueobject/` |
86
+ | **Param** | 参数对象 | **可变、无业务行为** | `domain/{业务}/param/` |
87
+ | **Gateway** | 网关接口 | 数据存取抽象 | `domain/{业务}/{业务}Gateway.java` |
88
+
89
+ **重要区分**:
90
+ - **ValueObject(值对象)**:封装领域逻辑,如 `Money`、`Address`、`TimeRange`
91
+ - **Param(参数对象)**:仅为简化方法签名,如 `StoreBasicInfo`、`UpdateParam`
92
+
93
+ 详见:`ddd-value-object` 和 `ddd-parameter-object` SKILL。
94
+
95
+ ## 相关 Skill
96
+
97
+ - `project-structure`:目录结构模板
98
+ - `domain-isolation`:域隔离规范
99
+ - `application-appservice`:AppService 编写规范
100
+ - `ddd-value-object`:值对象设计规范
101
+ - `ddd-parameter-object`:参数对象设计规范