ai-engineering-init 1.1.0

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 (313) hide show
  1. package/.claude/agents/code-reviewer.md +139 -0
  2. package/.claude/agents/project-manager.md +159 -0
  3. package/.claude/audio/completed.wav +0 -0
  4. package/.claude/commands/add-todo.md +255 -0
  5. package/.claude/commands/check.md +210 -0
  6. package/.claude/commands/crud.md +454 -0
  7. package/.claude/commands/dev.md +503 -0
  8. package/.claude/commands/init-docs.md +681 -0
  9. package/.claude/commands/next.md +251 -0
  10. package/.claude/commands/progress.md +242 -0
  11. package/.claude/commands/start.md +199 -0
  12. package/.claude/commands/sync.md +307 -0
  13. package/.claude/commands/update-status.md +428 -0
  14. package/.claude/docs/Mixin/344/275/277/347/224/250/346/214/207/345/215/227.md +299 -0
  15. package/.claude/docs/README.md +167 -0
  16. package/.claude/docs//345/211/215/347/253/257/345/274/200/345/217/221/346/214/207/345/215/227.md +599 -0
  17. package/.claude/docs//345/220/216/347/253/257/345/274/200/345/217/221/346/214/207/345/215/227.md +726 -0
  18. package/.claude/docs//345/267/245/344/275/234/346/265/201/345/274/200/345/217/221/346/214/207/345/215/227.md +714 -0
  19. package/.claude/docs//345/267/245/345/205/267/347/261/273/344/275/277/347/224/250/346/214/207/345/215/227.md +463 -0
  20. package/.claude/docs//346/225/260/346/215/256/345/272/223/350/256/276/350/256/241/350/247/204/350/214/203.md +390 -0
  21. package/.claude/docs//346/226/260/345/212/237/350/203/275/345/274/200/345/217/221/346/265/201/347/250/213/350/247/204/350/214/203.md +688 -0
  22. package/.claude/docs//346/226/260/351/241/271/347/233/256/345/274/200/345/217/221/346/265/201/347/250/213.md +365 -0
  23. package/.claude/docs//346/241/206/346/236/266/350/257/264/346/230/216.md +393 -0
  24. package/.claude/docs//350/267/257/347/224/261/351/205/215/347/275/256/346/214/207/345/215/227.md +246 -0
  25. package/.claude/framework-config.json +73 -0
  26. package/.claude/hooks/pre-tool-use.js +117 -0
  27. package/.claude/hooks/skill-forced-eval.js +167 -0
  28. package/.claude/hooks/stop.js +58 -0
  29. package/.claude/settings.json +41 -0
  30. package/.claude/skills/add-skill/SKILL.md +352 -0
  31. package/.claude/skills/api-development/SKILL.md +560 -0
  32. package/.claude/skills/architecture-design/SKILL.md +756 -0
  33. package/.claude/skills/backend-annotations/SKILL.md +674 -0
  34. package/.claude/skills/banana-image/CHANGELOG.md +37 -0
  35. package/.claude/skills/banana-image/README.md +146 -0
  36. package/.claude/skills/banana-image/SKILL.md +164 -0
  37. package/.claude/skills/banana-image/assets/logo.png +0 -0
  38. package/.claude/skills/banana-image/references/advanced-usage.md +189 -0
  39. package/.claude/skills/banana-image/scripts/apply_template.py +125 -0
  40. package/.claude/skills/banana-image/scripts/banana_image_exec.ts +412 -0
  41. package/.claude/skills/banana-image/scripts/batch_prep.py +82 -0
  42. package/.claude/skills/banana-image/scripts/package-lock.json +1437 -0
  43. package/.claude/skills/banana-image/scripts/package.json +18 -0
  44. package/.claude/skills/banana-image/scripts/requirements.txt +10 -0
  45. package/.claude/skills/banana-image/templates/poster.json +22 -0
  46. package/.claude/skills/banana-image/templates/product.json +17 -0
  47. package/.claude/skills/banana-image/templates/social.json +22 -0
  48. package/.claude/skills/banana-image/templates/thumbnail.json +17 -0
  49. package/.claude/skills/brainstorm/SKILL.md +648 -0
  50. package/.claude/skills/bug-detective/SKILL.md +1206 -0
  51. package/.claude/skills/code-patterns/SKILL.md +590 -0
  52. package/.claude/skills/collaborating-with-codex/SKILL.md +174 -0
  53. package/.claude/skills/collaborating-with-codex/scripts/codex_bridge.py +275 -0
  54. package/.claude/skills/collaborating-with-gemini/SKILL.md +194 -0
  55. package/.claude/skills/collaborating-with-gemini/scripts/gemini_bridge.py +275 -0
  56. package/.claude/skills/crud-development/SKILL.md +649 -0
  57. package/.claude/skills/data-permission/SKILL.md +599 -0
  58. package/.claude/skills/database-ops/SKILL.md +407 -0
  59. package/.claude/skills/error-handler/SKILL.md +371 -0
  60. package/.claude/skills/file-oss-management/SKILL.md +863 -0
  61. package/.claude/skills/git-workflow/SKILL.md +375 -0
  62. package/.claude/skills/json-serialization/SKILL.md +357 -0
  63. package/.claude/skills/leniu-api-development/SKILL.md +803 -0
  64. package/.claude/skills/leniu-architecture-design/SKILL.md +598 -0
  65. package/.claude/skills/leniu-backend-annotations/SKILL.md +664 -0
  66. package/.claude/skills/leniu-code-patterns/SKILL.md +365 -0
  67. package/.claude/skills/leniu-crud-development/SKILL.md +1110 -0
  68. package/.claude/skills/leniu-data-permission/SKILL.md +256 -0
  69. package/.claude/skills/leniu-database-ops/SKILL.md +426 -0
  70. package/.claude/skills/leniu-error-handler/SKILL.md +462 -0
  71. package/.claude/skills/leniu-java-amount-handling/SKILL.md +461 -0
  72. package/.claude/skills/leniu-java-code-style/SKILL.md +510 -0
  73. package/.claude/skills/leniu-java-concurrent/SKILL.md +400 -0
  74. package/.claude/skills/leniu-java-entity/SKILL.md +751 -0
  75. package/.claude/skills/leniu-java-export/SKILL.md +560 -0
  76. package/.claude/skills/leniu-java-logging/SKILL.md +832 -0
  77. package/.claude/skills/leniu-java-mq/SKILL.md +338 -0
  78. package/.claude/skills/leniu-java-mybatis/SKILL.md +640 -0
  79. package/.claude/skills/leniu-java-report-query-param/SKILL.md +291 -0
  80. package/.claude/skills/leniu-java-task/SKILL.md +367 -0
  81. package/.claude/skills/leniu-java-total-line/SKILL.md +195 -0
  82. package/.claude/skills/leniu-marketing-price-rule-customizer/SKILL.md +301 -0
  83. package/.claude/skills/leniu-marketing-recharge-rule-customizer/SKILL.md +285 -0
  84. package/.claude/skills/leniu-mealtime/SKILL.md +215 -0
  85. package/.claude/skills/leniu-redis-cache/SKILL.md +316 -0
  86. package/.claude/skills/leniu-security-guard/SKILL.md +520 -0
  87. package/.claude/skills/leniu-utils-toolkit/SKILL.md +380 -0
  88. package/.claude/skills/openspec-apply-change/SKILL.md +156 -0
  89. package/.claude/skills/openspec-archive-change/SKILL.md +114 -0
  90. package/.claude/skills/openspec-bulk-archive-change/SKILL.md +246 -0
  91. package/.claude/skills/openspec-continue-change/SKILL.md +118 -0
  92. package/.claude/skills/openspec-explore/SKILL.md +290 -0
  93. package/.claude/skills/openspec-ff-change/SKILL.md +101 -0
  94. package/.claude/skills/openspec-new-change/SKILL.md +74 -0
  95. package/.claude/skills/openspec-onboard/SKILL.md +529 -0
  96. package/.claude/skills/openspec-sync-specs/SKILL.md +138 -0
  97. package/.claude/skills/openspec-verify-change/SKILL.md +168 -0
  98. package/.claude/skills/performance-doctor/SKILL.md +627 -0
  99. package/.claude/skills/project-navigator/SKILL.md +305 -0
  100. package/.claude/skills/redis-cache/SKILL.md +839 -0
  101. package/.claude/skills/scheduled-jobs/SKILL.md +633 -0
  102. package/.claude/skills/security-guard/SKILL.md +748 -0
  103. package/.claude/skills/sms-mail/SKILL.md +766 -0
  104. package/.claude/skills/social-login/SKILL.md +668 -0
  105. package/.claude/skills/store-pc/SKILL.md +366 -0
  106. package/.claude/skills/task-tracker/SKILL.md +307 -0
  107. package/.claude/skills/tech-decision/SKILL.md +393 -0
  108. package/.claude/skills/tenant-management/SKILL.md +603 -0
  109. package/.claude/skills/test-development/SKILL.md +755 -0
  110. package/.claude/skills/ui-pc/SKILL.md +438 -0
  111. package/.claude/skills/utils-toolkit/SKILL.md +615 -0
  112. package/.claude/skills/websocket-sse/SKILL.md +716 -0
  113. package/.claude/skills/workflow-engine/SKILL.md +676 -0
  114. package/.claude/templates//345/276/205/345/212/236/346/270/205/345/215/225/346/250/241/346/235/277.md +56 -0
  115. package/.claude/templates//351/234/200/346/261/202/346/226/207/346/241/243/346/250/241/346/235/277.md +85 -0
  116. package/.claude/templates//351/241/271/347/233/256/347/212/266/346/200/201/346/250/241/346/235/277.md +43 -0
  117. package/.codex/skills/add-skill/SKILL.md +352 -0
  118. package/.codex/skills/add-todo/SKILL.md +269 -0
  119. package/.codex/skills/api-development/SKILL.md +693 -0
  120. package/.codex/skills/architecture-design/SKILL.md +628 -0
  121. package/.codex/skills/backend-annotations/SKILL.md +664 -0
  122. package/.codex/skills/banana-image/CHANGELOG.md +37 -0
  123. package/.codex/skills/banana-image/README.md +146 -0
  124. package/.codex/skills/banana-image/SKILL.md +164 -0
  125. package/.codex/skills/banana-image/assets/logo.png +0 -0
  126. package/.codex/skills/banana-image/references/advanced-usage.md +189 -0
  127. package/.codex/skills/banana-image/scripts/apply_template.py +125 -0
  128. package/.codex/skills/banana-image/scripts/banana_image_exec.ts +412 -0
  129. package/.codex/skills/banana-image/scripts/batch_prep.py +82 -0
  130. package/.codex/skills/banana-image/scripts/package-lock.json +1437 -0
  131. package/.codex/skills/banana-image/scripts/package.json +18 -0
  132. package/.codex/skills/banana-image/scripts/requirements.txt +10 -0
  133. package/.codex/skills/banana-image/templates/poster.json +22 -0
  134. package/.codex/skills/banana-image/templates/product.json +17 -0
  135. package/.codex/skills/banana-image/templates/social.json +22 -0
  136. package/.codex/skills/banana-image/templates/thumbnail.json +17 -0
  137. package/.codex/skills/brainstorm/SKILL.md +648 -0
  138. package/.codex/skills/bug-detective/SKILL.md +1206 -0
  139. package/.codex/skills/check/SKILL.md +367 -0
  140. package/.codex/skills/code-patterns/SKILL.md +442 -0
  141. package/.codex/skills/collaborating-with-codex/SKILL.md +174 -0
  142. package/.codex/skills/collaborating-with-codex/scripts/codex_bridge.py +275 -0
  143. package/.codex/skills/collaborating-with-gemini/SKILL.md +194 -0
  144. package/.codex/skills/collaborating-with-gemini/scripts/gemini_bridge.py +275 -0
  145. package/.codex/skills/crud/SKILL.md +265 -0
  146. package/.codex/skills/crud-development/SKILL.md +637 -0
  147. package/.codex/skills/data-permission/SKILL.md +591 -0
  148. package/.codex/skills/database-ops/SKILL.md +553 -0
  149. package/.codex/skills/dev/SKILL.md +187 -0
  150. package/.codex/skills/error-handler/SKILL.md +361 -0
  151. package/.codex/skills/file-oss-management/SKILL.md +863 -0
  152. package/.codex/skills/git-workflow/SKILL.md +375 -0
  153. package/.codex/skills/init-docs/SKILL.md +194 -0
  154. package/.codex/skills/json-serialization/SKILL.md +357 -0
  155. package/.codex/skills/leniu-api-development/SKILL.md +803 -0
  156. package/.codex/skills/leniu-architecture-design/SKILL.md +594 -0
  157. package/.codex/skills/leniu-backend-annotations/SKILL.md +662 -0
  158. package/.codex/skills/leniu-code-patterns/SKILL.md +365 -0
  159. package/.codex/skills/leniu-crud-development/SKILL.md +1110 -0
  160. package/.codex/skills/leniu-data-permission/SKILL.md +256 -0
  161. package/.codex/skills/leniu-database-ops/SKILL.md +426 -0
  162. package/.codex/skills/leniu-error-handler/SKILL.md +462 -0
  163. package/.codex/skills/leniu-java-amount-handling/SKILL.md +461 -0
  164. package/.codex/skills/leniu-java-code-style/SKILL.md +510 -0
  165. package/.codex/skills/leniu-java-concurrent/SKILL.md +400 -0
  166. package/.codex/skills/leniu-java-entity/SKILL.md +751 -0
  167. package/.codex/skills/leniu-java-export/SKILL.md +560 -0
  168. package/.codex/skills/leniu-java-logging/SKILL.md +832 -0
  169. package/.codex/skills/leniu-java-mq/SKILL.md +338 -0
  170. package/.codex/skills/leniu-java-mybatis/SKILL.md +640 -0
  171. package/.codex/skills/leniu-java-report-query-param/SKILL.md +291 -0
  172. package/.codex/skills/leniu-java-task/SKILL.md +367 -0
  173. package/.codex/skills/leniu-java-total-line/SKILL.md +195 -0
  174. package/.codex/skills/leniu-marketing-price-rule-customizer/SKILL.md +301 -0
  175. package/.codex/skills/leniu-marketing-recharge-rule-customizer/SKILL.md +285 -0
  176. package/.codex/skills/leniu-mealtime/SKILL.md +215 -0
  177. package/.codex/skills/leniu-redis-cache/SKILL.md +316 -0
  178. package/.codex/skills/leniu-security-guard/SKILL.md +520 -0
  179. package/.codex/skills/leniu-utils-toolkit/SKILL.md +378 -0
  180. package/.codex/skills/next/SKILL.md +137 -0
  181. package/.codex/skills/openspec-apply-change/SKILL.md +156 -0
  182. package/.codex/skills/openspec-archive-change/SKILL.md +114 -0
  183. package/.codex/skills/openspec-bulk-archive-change/SKILL.md +246 -0
  184. package/.codex/skills/openspec-continue-change/SKILL.md +118 -0
  185. package/.codex/skills/openspec-explore/SKILL.md +290 -0
  186. package/.codex/skills/openspec-ff-change/SKILL.md +101 -0
  187. package/.codex/skills/openspec-new-change/SKILL.md +74 -0
  188. package/.codex/skills/openspec-onboard/SKILL.md +529 -0
  189. package/.codex/skills/openspec-sync-specs/SKILL.md +138 -0
  190. package/.codex/skills/openspec-verify-change/SKILL.md +168 -0
  191. package/.codex/skills/performance-doctor/SKILL.md +627 -0
  192. package/.codex/skills/progress/SKILL.md +193 -0
  193. package/.codex/skills/project-navigator/SKILL.md +286 -0
  194. package/.codex/skills/redis-cache/SKILL.md +829 -0
  195. package/.codex/skills/scheduled-jobs/SKILL.md +633 -0
  196. package/.codex/skills/security-guard/SKILL.md +739 -0
  197. package/.codex/skills/sms-mail/SKILL.md +766 -0
  198. package/.codex/skills/social-login/SKILL.md +668 -0
  199. package/.codex/skills/start/SKILL.md +154 -0
  200. package/.codex/skills/store-pc/SKILL.md +491 -0
  201. package/.codex/skills/sync/SKILL.md +149 -0
  202. package/.codex/skills/task-tracker/SKILL.md +307 -0
  203. package/.codex/skills/tech-decision/SKILL.md +393 -0
  204. package/.codex/skills/tenant-management/SKILL.md +603 -0
  205. package/.codex/skills/test-development/SKILL.md +755 -0
  206. package/.codex/skills/ui-pc/SKILL.md +475 -0
  207. package/.codex/skills/update-status/SKILL.md +159 -0
  208. package/.codex/skills/utils-toolkit/SKILL.md +593 -0
  209. package/.codex/skills/websocket-sse/SKILL.md +716 -0
  210. package/.codex/skills/workflow-engine/SKILL.md +676 -0
  211. package/.cursor/agents/code-reviewer.md +139 -0
  212. package/.cursor/agents/project-manager.md +159 -0
  213. package/.cursor/commands/opsx-apply.md +152 -0
  214. package/.cursor/commands/opsx-archive.md +157 -0
  215. package/.cursor/commands/opsx-bulk-archive.md +242 -0
  216. package/.cursor/commands/opsx-continue.md +114 -0
  217. package/.cursor/commands/opsx-explore.md +174 -0
  218. package/.cursor/commands/opsx-ff.md +94 -0
  219. package/.cursor/commands/opsx-new.md +69 -0
  220. package/.cursor/commands/opsx-onboard.md +525 -0
  221. package/.cursor/commands/opsx-sync.md +134 -0
  222. package/.cursor/commands/opsx-verify.md +164 -0
  223. package/.cursor/mcp.json +22 -0
  224. package/.cursor/skills/add-skill/SKILL.md +352 -0
  225. package/.cursor/skills/api-development/SKILL.md +560 -0
  226. package/.cursor/skills/architecture-design/SKILL.md +756 -0
  227. package/.cursor/skills/backend-annotations/SKILL.md +674 -0
  228. package/.cursor/skills/banana-image/CHANGELOG.md +37 -0
  229. package/.cursor/skills/banana-image/README.md +146 -0
  230. package/.cursor/skills/banana-image/SKILL.md +164 -0
  231. package/.cursor/skills/banana-image/assets/logo.png +0 -0
  232. package/.cursor/skills/banana-image/references/advanced-usage.md +189 -0
  233. package/.cursor/skills/banana-image/scripts/apply_template.py +125 -0
  234. package/.cursor/skills/banana-image/scripts/banana_image_exec.ts +412 -0
  235. package/.cursor/skills/banana-image/scripts/batch_prep.py +82 -0
  236. package/.cursor/skills/banana-image/scripts/package-lock.json +1437 -0
  237. package/.cursor/skills/banana-image/scripts/package.json +18 -0
  238. package/.cursor/skills/banana-image/scripts/requirements.txt +10 -0
  239. package/.cursor/skills/banana-image/templates/poster.json +22 -0
  240. package/.cursor/skills/banana-image/templates/product.json +17 -0
  241. package/.cursor/skills/banana-image/templates/social.json +22 -0
  242. package/.cursor/skills/banana-image/templates/thumbnail.json +17 -0
  243. package/.cursor/skills/brainstorm/SKILL.md +648 -0
  244. package/.cursor/skills/bug-detective/SKILL.md +1206 -0
  245. package/.cursor/skills/code-patterns/SKILL.md +590 -0
  246. package/.cursor/skills/collaborating-with-codex/SKILL.md +174 -0
  247. package/.cursor/skills/collaborating-with-codex/scripts/codex_bridge.py +275 -0
  248. package/.cursor/skills/collaborating-with-gemini/SKILL.md +194 -0
  249. package/.cursor/skills/collaborating-with-gemini/scripts/gemini_bridge.py +275 -0
  250. package/.cursor/skills/crud-development/SKILL.md +649 -0
  251. package/.cursor/skills/data-permission/SKILL.md +599 -0
  252. package/.cursor/skills/database-ops/SKILL.md +407 -0
  253. package/.cursor/skills/error-handler/SKILL.md +371 -0
  254. package/.cursor/skills/file-oss-management/SKILL.md +863 -0
  255. package/.cursor/skills/git-workflow/SKILL.md +375 -0
  256. package/.cursor/skills/json-serialization/SKILL.md +357 -0
  257. package/.cursor/skills/leniu-api-development/SKILL.md +803 -0
  258. package/.cursor/skills/leniu-architecture-design/SKILL.md +598 -0
  259. package/.cursor/skills/leniu-backend-annotations/SKILL.md +664 -0
  260. package/.cursor/skills/leniu-code-patterns/SKILL.md +365 -0
  261. package/.cursor/skills/leniu-crud-development/SKILL.md +1110 -0
  262. package/.cursor/skills/leniu-data-permission/SKILL.md +256 -0
  263. package/.cursor/skills/leniu-database-ops/SKILL.md +426 -0
  264. package/.cursor/skills/leniu-error-handler/SKILL.md +462 -0
  265. package/.cursor/skills/leniu-java-amount-handling/SKILL.md +461 -0
  266. package/.cursor/skills/leniu-java-code-style/SKILL.md +510 -0
  267. package/.cursor/skills/leniu-java-concurrent/SKILL.md +400 -0
  268. package/.cursor/skills/leniu-java-entity/SKILL.md +751 -0
  269. package/.cursor/skills/leniu-java-export/SKILL.md +560 -0
  270. package/.cursor/skills/leniu-java-logging/SKILL.md +832 -0
  271. package/.cursor/skills/leniu-java-mq/SKILL.md +338 -0
  272. package/.cursor/skills/leniu-java-mybatis/SKILL.md +640 -0
  273. package/.cursor/skills/leniu-java-report-query-param/SKILL.md +291 -0
  274. package/.cursor/skills/leniu-java-task/SKILL.md +367 -0
  275. package/.cursor/skills/leniu-java-total-line/SKILL.md +195 -0
  276. package/.cursor/skills/leniu-marketing-price-rule-customizer/SKILL.md +301 -0
  277. package/.cursor/skills/leniu-marketing-recharge-rule-customizer/SKILL.md +285 -0
  278. package/.cursor/skills/leniu-mealtime/SKILL.md +215 -0
  279. package/.cursor/skills/leniu-redis-cache/SKILL.md +316 -0
  280. package/.cursor/skills/leniu-security-guard/SKILL.md +520 -0
  281. package/.cursor/skills/leniu-utils-toolkit/SKILL.md +380 -0
  282. package/.cursor/skills/openspec-apply-change/SKILL.md +156 -0
  283. package/.cursor/skills/openspec-archive-change/SKILL.md +114 -0
  284. package/.cursor/skills/openspec-bulk-archive-change/SKILL.md +246 -0
  285. package/.cursor/skills/openspec-continue-change/SKILL.md +118 -0
  286. package/.cursor/skills/openspec-explore/SKILL.md +290 -0
  287. package/.cursor/skills/openspec-ff-change/SKILL.md +101 -0
  288. package/.cursor/skills/openspec-new-change/SKILL.md +74 -0
  289. package/.cursor/skills/openspec-onboard/SKILL.md +529 -0
  290. package/.cursor/skills/openspec-sync-specs/SKILL.md +138 -0
  291. package/.cursor/skills/openspec-verify-change/SKILL.md +168 -0
  292. package/.cursor/skills/performance-doctor/SKILL.md +627 -0
  293. package/.cursor/skills/project-navigator/SKILL.md +305 -0
  294. package/.cursor/skills/redis-cache/SKILL.md +839 -0
  295. package/.cursor/skills/scheduled-jobs/SKILL.md +633 -0
  296. package/.cursor/skills/security-guard/SKILL.md +748 -0
  297. package/.cursor/skills/sms-mail/SKILL.md +766 -0
  298. package/.cursor/skills/social-login/SKILL.md +668 -0
  299. package/.cursor/skills/store-pc/SKILL.md +366 -0
  300. package/.cursor/skills/task-tracker/SKILL.md +307 -0
  301. package/.cursor/skills/tech-decision/SKILL.md +393 -0
  302. package/.cursor/skills/tenant-management/SKILL.md +603 -0
  303. package/.cursor/skills/test-development/SKILL.md +755 -0
  304. package/.cursor/skills/ui-pc/SKILL.md +438 -0
  305. package/.cursor/skills/utils-toolkit/SKILL.md +615 -0
  306. package/.cursor/skills/websocket-sse/SKILL.md +716 -0
  307. package/.cursor/skills/workflow-engine/SKILL.md +676 -0
  308. package/AGENTS.md +669 -0
  309. package/CLAUDE.md +205 -0
  310. package/README.md +205 -0
  311. package/bin/index.js +179 -0
  312. package/init.sh +178 -0
  313. package/package.json +27 -0
@@ -0,0 +1,442 @@
1
+ ---
2
+ name: code-patterns
3
+ description: |
4
+ 后端代码禁令和编码规范速查。本项目是纯后端项目,前端代码在分离的项目中开发。
5
+
6
+ 触发场景:
7
+ - 查看项目禁止事项(后端代码)
8
+ - 命名规范速查
9
+ - Git 提交规范
10
+ - 避免过度工程
11
+ - 代码风格检查
12
+
13
+ 触发词:规范、禁止、命名、Git提交、代码风格、不能用、不允许、包名、架构
14
+
15
+ 注意:后端 CRUD 开发规范请激活 crud-development,API 开发规范请激活 api-development,数据库设计规范请激活 database-ops。
16
+ ---
17
+
18
+ # 代码规范速查
19
+
20
+ ## 🚫 后端禁令速查表
21
+
22
+ > **快速查表**:一眼定位所有后端代码禁止写法
23
+
24
+ | 禁止项 | ❌ 禁止写法 | ✅ 正确写法 | 原因 |
25
+ |--------|-----------|-----------|------|
26
+ | 包名规范 | `com.ruoyi.*` 或 `plus.ruoyi.*` | `org.dromara.*` | 包名统一标准 |
27
+ | 完整引用 | `org.dromara.xxx.Xxx` (内联全限定名) | `import` + 短类名 | 代码整洁 |
28
+ | 数据返回 | `Map<String, Object>` 返回业务数据 | 创建 VO 类 | 类型安全 |
29
+ | Service设计 | `extends ServiceImpl<>` | `implements IXxxService` | 三层架构 |
30
+ | 查询构建 | 在 Controller 层构建 | **Service 层** `buildQueryWrapper()` | 职责分离 |
31
+ | 接口路径 | `/pageXxxs`, `/getXxx/{id}` | `/list`, `/{id}`, `/` | RESTful 规范 |
32
+ | 对象转换 | `BeanUtil.copyProperties()` | `MapstructUtils.convert()` | 项目统一规范 |
33
+ | 主键策略 | `AUTO_INCREMENT` | 雪花ID(不指定type) | 主键策略规范 |
34
+ | 返回String陷阱 | `R.ok(stringValue)` 返回字符串到data | `R.ok(null, stringValue)` | 方法重载陷阱 |
35
+ | Entity基类 | 无基类继承 | `extends TenantEntity`(业务表)或 `extends BaseEntity`(系统表) | 多租户支持 |
36
+ | Redis缓存 | `@Cacheable` 返回 `List.of()`/`Set.of()` | `new ArrayList<>(List.of())` | Redis 反序列化失败 |
37
+ | Mapper注解 | 单目标用 `@AutoMappers`(复数) | 单目标用 `@AutoMapper`(单数) | 多目标时可用复数 |
38
+ | Bash命令 | `> nul` | `> /dev/null 2>&1` | Windows 会创建 nul 文件 |
39
+ | 注释语言 | 英文注释 `// get user name` | 中文注释 `// 获取用户名` | 项目统一中文 |
40
+ | SQL COMMENT | `COMMENT 'user name'` | `COMMENT '用户名'` | 项目统一中文 |
41
+
42
+ ---
43
+
44
+ ## 🚫 后端禁令(14 条)
45
+
46
+ ### 1. 包名必须是 `org.dromara.*`
47
+
48
+ ```java
49
+ // ✅ 正确
50
+ package org.dromara.system.service;
51
+ package org.dromara.demo.controller;
52
+
53
+ // ❌ 错误
54
+ package com.ruoyi.system.service;
55
+ package plus.ruoyi.business.service;
56
+ ```
57
+
58
+ ### 2. 禁止使用完整类型引用
59
+
60
+ ```java
61
+ // ✅ 正确:先 import 再使用
62
+ import org.dromara.common.core.domain.R;
63
+ public R<XxxVo> getXxx(Long id) { ... }
64
+
65
+ // ❌ 错误:直接使用完整包名
66
+ public org.dromara.common.core.domain.R<XxxVo> getXxx(Long id) { ... }
67
+ ```
68
+
69
+ ### 3. 禁止使用 Map 封装业务数据
70
+
71
+ ```java
72
+ // ✅ 正确:创建 VO 类
73
+ public XxxVo getXxx(Long id) {
74
+ return MapstructUtils.convert(entity, XxxVo.class);
75
+ }
76
+
77
+ // ❌ 错误:使用 Map
78
+ public Map<String, Object> getXxx(Long id) {
79
+ Map<String, Object> result = new HashMap<>();
80
+ result.put("id", entity.getId());
81
+ return result;
82
+ }
83
+ ```
84
+
85
+ ### 4. Service 禁止继承 ServiceImpl 基类
86
+
87
+ ```java
88
+ // ✅ 正确:不继承任何基类,直接注入 Mapper
89
+ @Service
90
+ public class XxxServiceImpl implements IXxxService {
91
+ private final XxxMapper baseMapper; // 直接注入 Mapper
92
+ }
93
+
94
+ // ❌ 错误:继承 ServiceImpl
95
+ public class XxxServiceImpl extends ServiceImpl<XxxMapper, Xxx> {
96
+ }
97
+ ```
98
+
99
+ ### 5. 查询条件必须在 Service 层构建
100
+
101
+ > **本项目是三层架构(无 DAO 层)**,`buildQueryWrapper()` 在 **Service 实现类**中。
102
+
103
+ ```java
104
+ // ✅ 正确:在 Service 层构建查询条件
105
+ @Service
106
+ public class XxxServiceImpl implements IXxxService {
107
+
108
+ private final XxxMapper baseMapper;
109
+
110
+ private LambdaQueryWrapper<Xxx> buildQueryWrapper(XxxBo bo) {
111
+ LambdaQueryWrapper<Xxx> lqw = Wrappers.lambdaQuery();
112
+ lqw.eq(bo.getStatus() != null, Xxx::getStatus, bo.getStatus());
113
+ lqw.like(StringUtils.isNotBlank(bo.getName()), Xxx::getName, bo.getName());
114
+ return lqw;
115
+ }
116
+
117
+ @Override
118
+ public TableDataInfo<XxxVo> queryPageList(XxxBo bo, PageQuery pageQuery) {
119
+ LambdaQueryWrapper<Xxx> lqw = buildQueryWrapper(bo);
120
+ Page<XxxVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
121
+ return TableDataInfo.build(result);
122
+ }
123
+ }
124
+
125
+ // ❌ 错误:在 Controller 层构建查询条件
126
+ @RestController
127
+ public class XxxController {
128
+ @GetMapping("/list")
129
+ public R<List<XxxVo>> list(XxxBo bo) {
130
+ LambdaQueryWrapper<Xxx> wrapper = new LambdaQueryWrapper<>(); // 禁止!
131
+ wrapper.eq(Xxx::getStatus, bo.getStatus());
132
+ }
133
+ }
134
+ ```
135
+
136
+ ### 6. 接口路径必须使用标准 RESTful 格式
137
+
138
+ ```java
139
+ // ✅ 正确:标准 RESTful 路径
140
+ @GetMapping("/list") // 分页/列表查询
141
+ @GetMapping("/{id}") // 获取详情
142
+ @PostMapping // 新增(空路径)
143
+ @PutMapping // 修改(空路径)
144
+ @DeleteMapping("/{ids}") // 删除
145
+ @PostMapping("/export") // 导出
146
+
147
+ // ❌ 错误:包含动词或实体名
148
+ @GetMapping("/pageAds")
149
+ @GetMapping("/getAd/{id}")
150
+ @PostMapping("/addAd")
151
+ @PutMapping("/updateAd")
152
+ ```
153
+
154
+ ### 7. 禁止使用 BeanUtil 进行对象转换
155
+
156
+ ```java
157
+ // ✅ 正确:使用 MapstructUtils
158
+ XxxVo vo = MapstructUtils.convert(entity, XxxVo.class);
159
+ List<XxxVo> voList = MapstructUtils.convert(entityList, XxxVo.class);
160
+
161
+ // ❌ 错误:使用 BeanUtil
162
+ BeanUtil.copyProperties(entity, vo); // 禁止!
163
+ BeanUtils.copyProperties(entity, vo); // 禁止!
164
+ ```
165
+
166
+ ### 8. 禁止使用 AUTO_INCREMENT
167
+
168
+ ```sql
169
+ -- ✅ 正确:不指定自增,使用雪花ID(MyBatis-Plus 全局配置)
170
+ id BIGINT(20) NOT NULL COMMENT '主键ID'
171
+
172
+ -- ❌ 错误:使用自增
173
+ id BIGINT(20) AUTO_INCREMENT -- 禁止!
174
+ ```
175
+
176
+ ### 9. R.ok() 返回 String 类型的陷阱
177
+
178
+ ```java
179
+ // 场景:Controller 返回 R<String>,想把字符串放到 data 中
180
+
181
+ // ❌ 错误:会匹配 R.ok(String msg),字符串进入 msg 而非 data
182
+ return R.ok(token); // 结果:{code:200, msg:"xxx", data:null}
183
+
184
+ // ✅ 正确:明确指定 msg 和 data
185
+ return R.ok(null, token); // data 有值,msg 为 null
186
+ return R.ok("获取成功", token); // msg 和 data 都有值
187
+ ```
188
+
189
+ ### 10. Entity 必须继承合适的基类
190
+
191
+ ```java
192
+ // ✅ 正确:业务表(需要多租户隔离)继承 TenantEntity
193
+ @Data
194
+ @EqualsAndHashCode(callSuper = true)
195
+ @TableName("xxx_table")
196
+ public class Xxx extends TenantEntity { // ✅ 业务表推荐
197
+ @TableId(value = "id")
198
+ private Long id;
199
+ }
200
+
201
+ // ✅ 正确:系统级/工具级表(不需要多租户)继承 BaseEntity
202
+ // 例如:SysClient(OAuth2客户端)、GenTable(代码生成)
203
+ @Data
204
+ @EqualsAndHashCode(callSuper = true)
205
+ @TableName("sys_client")
206
+ public class SysClient extends BaseEntity { // ✅ 系统表可用
207
+ @TableId(value = "id")
208
+ private Long id;
209
+ }
210
+
211
+ // ❌ 错误:不继承任何基类
212
+ public class Xxx { // 禁止!缺少审计字段
213
+ }
214
+ ```
215
+
216
+ ### 11. @Cacheable 禁止返回不可变集合
217
+
218
+ ```java
219
+ // ❌ 错误:List.of()/Set.of()/Map.of() 返回不可变集合
220
+ // 会导致 Redis 反序列化失败(Jackson DefaultTyping 无法正确处理)
221
+ @Cacheable(value = "xxx")
222
+ public List<String> listXxx() {
223
+ return List.of("1", "2"); // 禁止!第二次请求会报错
224
+ return Set.of("a", "b"); // 禁止!
225
+ return Map.of("k", "v"); // 禁止!
226
+ }
227
+
228
+ // ✅ 正确:使用可变集合包装
229
+ @Cacheable(value = "xxx")
230
+ public List<String> listXxx() {
231
+ return new ArrayList<>(List.of("1", "2")); // ✅
232
+ }
233
+
234
+ @Cacheable(value = "xxx")
235
+ public Set<String> setXxx() {
236
+ return new HashSet<>(Set.of("a", "b")); // ✅
237
+ }
238
+
239
+ @Cacheable(value = "xxx")
240
+ public Map<String, String> mapXxx() {
241
+ return new HashMap<>(Map.of("k", "v")); // ✅
242
+ }
243
+ ```
244
+
245
+ **原因**:本项目 Redis 使用 `Jackson DefaultTyping.NON_FINAL`,会为非 final 类添加类型信息。`List.of()` 返回的 `ImmutableCollections$List12` 是非 final 类,序列化后反序列化时会将内层元素误判为类型数组,导致 `ClassNotFoundException`。
246
+
247
+ ### 12. BO 映射注解规范
248
+
249
+ ```java
250
+ // ✅ 正确:单目标映射使用 @AutoMapper(单数)
251
+ @Data
252
+ @AutoMapper(target = Xxx.class, reverseConvertGenerate = false)
253
+ public class XxxBo {
254
+ // ...
255
+ }
256
+
257
+ // ✅ 正确:多目标映射使用 @AutoMappers(复数)
258
+ // 例如 SysOperLogBo 需要映射到 SysOperLog 和 OperLogEvent 两个目标
259
+ @AutoMappers({
260
+ @AutoMapper(target = SysOperLog.class, reverseConvertGenerate = false),
261
+ @AutoMapper(target = OperLogEvent.class)
262
+ })
263
+ public class SysOperLogBo {
264
+ // ...
265
+ }
266
+
267
+ // ❌ 错误:单目标时使用 @AutoMappers 包装(冗余)
268
+ @AutoMappers({
269
+ @AutoMapper(target = Xxx.class)
270
+ })
271
+ public class XxxBo {
272
+ // ...
273
+ }
274
+ ```
275
+
276
+ ### 13. 代码注释必须使用中文
277
+
278
+ > **⚠️ 高频问题**:Codex/Gemini 协作时经常输出英文注释,必须检查并修正。
279
+
280
+ ```java
281
+ // ✅ 正确:中文注释
282
+ /**
283
+ * 根据 ID 查询用户信息
284
+ *
285
+ * @param id 用户 ID
286
+ * @return 用户视图对象
287
+ */
288
+ public SysUserVo queryById(Long id) {
289
+ // 查询用户基本信息
290
+ return baseMapper.selectVoById(id);
291
+ }
292
+
293
+ // ❌ 错误:英文注释
294
+ /**
295
+ * Query user info by ID
296
+ *
297
+ * @param id user ID
298
+ * @return user view object
299
+ */
300
+ public SysUserVo queryById(Long id) {
301
+ // query user basic info
302
+ return baseMapper.selectVoById(id);
303
+ }
304
+ ```
305
+
306
+ **适用范围**:
307
+ - Javadoc 注释(`/** */`)
308
+ - 行内注释(`//`)
309
+ - 块注释(`/* */`)
310
+ - `@param`、`@return`、`@throws` 的描述文本
311
+ - SQL 注释(`--`)
312
+
313
+ **不适用**(保持英文):
314
+ - 变量名、方法名、类名(遵循 Java 命名规范)
315
+ - 注解属性值(如 `@TableName("sys_user")`)
316
+ - 日志中的英文关键词(如 `log.error("Failed to...")`,但建议也用中文)
317
+
318
+ ### 14. SQL COMMENT 必须使用中文
319
+
320
+ ```sql
321
+ -- ✅ 正确:中文 COMMENT
322
+ `user_name` VARCHAR(50) NOT NULL COMMENT '用户名',
323
+ `status` CHAR(1) DEFAULT '0' COMMENT '状态(0正常 1停用)',
324
+ ) ENGINE=InnoDB COMMENT='用户信息表';
325
+
326
+ -- ❌ 错误:英文 COMMENT(⚠️ Codex 高频错误)
327
+ `user_name` VARCHAR(50) NOT NULL COMMENT 'user name',
328
+ `status` CHAR(1) DEFAULT '0' COMMENT 'status(0=normal 1=disabled)',
329
+ ) ENGINE=InnoDB COMMENT='user info table';
330
+ ```
331
+
332
+ ---
333
+
334
+ ## 📝 命名规范速查
335
+
336
+ ### 后端命名
337
+
338
+ | 类型 | 规范 | 示例 |
339
+ |------|------|------|
340
+ | 包名 | 小写,点分隔 | `org.dromara.system` |
341
+ | 类名 | 大驼峰 | `SysUserServiceImpl` |
342
+ | 方法名 | 小驼峰 | `queryPageList`, `selectById` |
343
+ | 变量名 | 小驼峰 | `userName`, `createTime` |
344
+ | 常量 | 全大写下划线 | `MAX_PAGE_SIZE` |
345
+ | 表名 | 小写下划线 | `sys_user`, `test_demo` |
346
+ | 字段名 | 小写下划线 | `user_name`, `create_time` |
347
+
348
+ ### 类命名后缀
349
+
350
+ | 类型 | 后缀 | 示例 |
351
+ |------|------|------|
352
+ | 实体类 | 无/Sys前缀 | `SysUser`, `TestDemo` |
353
+ | 业务对象 | Bo | `SysUserBo`, `TestDemoBo` |
354
+ | 视图对象 | Vo | `SysUserVo`, `TestDemoVo` |
355
+ | 服务接口 | IXxxService | `ISysUserService` |
356
+ | 服务实现 | XxxServiceImpl | `SysUserServiceImpl` |
357
+ | 控制器 | XxxController | `SysUserController` |
358
+ | Mapper | XxxMapper | `SysUserMapper` |
359
+
360
+ > **注意**:本项目是三层架构,没有 DAO 层。Service 直接注入 Mapper。
361
+
362
+ ### 方法命名
363
+
364
+ | 操作 | Service 方法 | Controller URL |
365
+ |------|-------------|----------------|
366
+ | 分页查询 | `queryPageList(bo, pageQuery)` | `GET /list` |
367
+ | 查询单个 | `queryById(id)` | `GET /{id}` |
368
+ | 新增 | `insertByBo(bo)` | `POST /` |
369
+ | 修改 | `updateByBo(bo)` | `PUT /` |
370
+ | 删除 | `deleteWithValidByIds(ids)` | `DELETE /{ids}` |
371
+ | 导出 | `queryList(bo)` + ExcelUtil | `POST /export` |
372
+
373
+ ---
374
+
375
+ ## ✅ 避免过度工程
376
+
377
+ ### 不要做的事
378
+
379
+ 1. **不要创建不必要的抽象**
380
+ - 只有一处使用的代码不需要抽取
381
+ - 三处以上相同代码才考虑抽取
382
+
383
+ 2. **不要添加不需要的功能**
384
+ - 只实现当前需求
385
+ - 不要"以防万一"添加功能
386
+
387
+ 3. **不要过早优化**
388
+ - 优先使用简单直接的方案
389
+ - 复杂方案需要有明确理由
390
+
391
+ 4. **不要添加无用注释**
392
+ - 不要给显而易见的代码加注释
393
+ - 只在逻辑复杂处添加注释
394
+
395
+ 5. **不要保留废弃代码**
396
+ - 删除不用的代码,不要注释保留
397
+ - Git 有历史记录
398
+
399
+ ---
400
+
401
+ ## 📦 Git 提交规范
402
+
403
+ ### 格式
404
+
405
+ ```
406
+ <type>(<scope>): <description>
407
+ ```
408
+
409
+ ### 类型
410
+
411
+ | type | 说明 |
412
+ |------|------|
413
+ | `feat` | 新功能 |
414
+ | `fix` | 修复 Bug |
415
+ | `docs` | 文档更新 |
416
+ | `style` | 代码格式(不影响逻辑) |
417
+ | `refactor` | 重构(不是新功能或修复) |
418
+ | `perf` | 性能优化 |
419
+ | `test` | 测试 |
420
+ | `chore` | 构建/工具 |
421
+
422
+ ### 示例
423
+
424
+ ```bash
425
+ feat(system): 新增用户反馈功能
426
+ fix(demo): 修复订单状态显示错误
427
+ docs(readme): 更新安装说明
428
+ refactor(common): 重构分页查询工具类
429
+ perf(system): 优化用户列表查询性能
430
+ ```
431
+
432
+ ---
433
+
434
+ ## 🔗 相关 Skill
435
+
436
+ | 需要了解 | 激活 Skill |
437
+ |---------|-----------|
438
+ | 后端 CRUD 开发规范 | `crud-development` |
439
+ | API 开发规范 | `api-development` |
440
+ | 数据库设计规范 | `database-ops` |
441
+ | 系统架构设计 | `architecture-design` |
442
+ | 技术方案决策 | `tech-decision` |
@@ -0,0 +1,174 @@
1
+ ---
2
+ name: collaborating-with-codex
3
+ description: |
4
+ 与 OpenAI Codex CLI 协同开发。将编码任务委托给 Codex 进行原型开发、调试分析和代码审查。
5
+
6
+ 触发场景:
7
+ - 需要算法实现或复杂逻辑分析
8
+ - 需要代码审查和 Bug 分析
9
+ - 需要生成 Unified Diff 补丁
10
+ - 用户明确要求使用 Codex 协作
11
+ - 复杂后端逻辑的原型设计
12
+
13
+ 触发词:Codex、协作、多模型、原型、Diff、算法分析、代码审查、codex协同
14
+
15
+ 前置要求:
16
+ - 已安装 Codex CLI (npm install -g @openai/codex)
17
+ - 已配置 OpenAI API Key
18
+ ---
19
+
20
+ # 与 Codex CLI 协同开发
21
+
22
+ > 通过 Python 桥接脚本调用 Codex CLI,获取算法实现和代码审查建议。
23
+
24
+ ## 快速开始
25
+
26
+ ```bash
27
+ # 相对路径(推荐,在项目根目录执行)
28
+ python .claude/skills/collaborating-with-codex/scripts/codex_bridge.py --cd . --PROMPT "Your task"
29
+ ```
30
+
31
+ **输出**: JSON 格式,包含 `success`、`SESSION_ID`、`agent_messages` 和可选的 `error`。
32
+
33
+ ## 参数说明
34
+
35
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
36
+ |------|------|------|--------|------|
37
+ | `--PROMPT` | str | ✅ | - | 发送给 Codex 的任务指令(使用英语) |
38
+ | `--cd` | Path | ✅ | - | 工作目录根路径 |
39
+ | `--sandbox` | Literal | ❌ | `read-only` | 沙箱策略:`read-only`/`workspace-write`/`danger-full-access` |
40
+ | `--SESSION_ID` | UUID | ❌ | `None` | 会话 ID(继续之前的对话) |
41
+ | `--skip-git-repo-check` | bool | ❌ | `True` | 允许在非 Git 仓库运行 |
42
+ | `--return-all-messages` | bool | ❌ | `False` | 返回完整推理信息 |
43
+ | `--image` | List[Path] | ❌ | `None` | 附加图片文件到提示词 |
44
+ | `--model` | str | ❌ | `None` | 指定模型(仅用户明确要求时使用) |
45
+ | `--yolo` | bool | ❌ | `False` | 跳过所有审批与沙箱限制(危险) |
46
+
47
+ ## 使用模式
48
+
49
+ ### 1. 基础调用(只读模式)
50
+
51
+ ```bash
52
+ python .claude/skills/collaborating-with-codex/scripts/codex_bridge.py \
53
+ --cd . \
54
+ --PROMPT "Analyze the authentication flow in the login module"
55
+ ```
56
+
57
+ ### 2. 多轮会话
58
+
59
+ **始终保存 SESSION_ID** 用于后续对话:
60
+
61
+ ```bash
62
+ # 第一轮:分析代码
63
+ python .claude/skills/collaborating-with-codex/scripts/codex_bridge.py \
64
+ --cd "/project" \
65
+ --PROMPT "Analyze the AdServiceImpl class"
66
+
67
+ # 后续轮次:使用 SESSION_ID 继续
68
+ python .claude/skills/collaborating-with-codex/scripts/codex_bridge.py \
69
+ --cd "/project" \
70
+ --SESSION_ID "uuid-from-previous-response" \
71
+ --PROMPT "Now write unit tests for the add method"
72
+ ```
73
+
74
+ ### 3. 获取 Unified Diff 补丁
75
+
76
+ ```bash
77
+ python .claude/skills/collaborating-with-codex/scripts/codex_bridge.py \
78
+ --cd "/project" \
79
+ --PROMPT "Generate a unified diff to add logging to AdServiceImpl. OUTPUT: Unified Diff Patch ONLY."
80
+ ```
81
+
82
+ ### 4. 调试模式(返回完整信息)
83
+
84
+ ```bash
85
+ python .claude/skills/collaborating-with-codex/scripts/codex_bridge.py \
86
+ --cd "/project" \
87
+ --PROMPT "Debug this error: NullPointerException in line 42" \
88
+ --return-all-messages
89
+ ```
90
+
91
+ ## 返回值结构
92
+
93
+ **成功时:**
94
+ ```json
95
+ {
96
+ "success": true,
97
+ "SESSION_ID": "550e8400-e29b-41d4-a716-446655440000",
98
+ "agent_messages": "模型回复内容..."
99
+ }
100
+ ```
101
+
102
+ **失败时:**
103
+ ```json
104
+ {
105
+ "success": false,
106
+ "error": "错误信息描述"
107
+ }
108
+ ```
109
+
110
+ ## 协作工作流
111
+
112
+ ### 推荐场景
113
+
114
+ | 场景 | 说明 |
115
+ |------|------|
116
+ | **后端逻辑分析** | Codex 擅长复杂算法和后端逻辑 |
117
+ | **代码审查** | 获取代码质量和潜在问题的反馈 |
118
+ | **Debug 分析** | 利用其强大的调试能力定位问题 |
119
+ | **原型设计** | 快速获取实现思路(返回 Diff 而非直接修改) |
120
+
121
+ ### 重要约束
122
+
123
+ 1. **只读模式**: 始终使用 `--sandbox read-only`,禁止 Codex 直接修改文件
124
+ 2. **英语交互**: 与 Codex 交互时使用英语,获得更好效果
125
+ 3. **中文输出强制**: Codex 倾向于输出英文,必须在每次 PROMPT 末尾追加以下约束:
126
+ ```
127
+ IMPORTANT LANGUAGE RULES:
128
+ - All SQL COMMENT values MUST be in Chinese (e.g., COMMENT '用户名' NOT COMMENT 'username')
129
+ - All Java/code comments (Javadoc, inline //, block /* */) MUST be in Chinese
130
+ - All field descriptions, table descriptions MUST be in Chinese
131
+ - Variable names and class names remain in English (camelCase/PascalCase)
132
+ ```
133
+ 4. **Diff 输出**: 在 PROMPT 中明确要求 `OUTPUT: Unified Diff Patch ONLY`
134
+ 5. **重构代码**: 将 Codex 的输出视为"脏原型",由 Claude 重构为生产代码(**特别检查注释和 COMMENT 是否为中文,不是则修正**)
135
+ 6. **后台运行**: 对于长时间任务,使用 `Run in the background`
136
+
137
+ ## 与本项目的集成
138
+
139
+ ### 典型用例:后端模块分析
140
+
141
+ ```bash
142
+ # 分析 Service 层实现
143
+ python .claude/skills/collaborating-with-codex/scripts/codex_bridge.py \
144
+ --cd . \
145
+ --PROMPT "Analyze the three-layer architecture (Controller -> Service -> Mapper) in ruoyi-modules/ruoyi-system. Focus on how buildQueryWrapper is implemented in Service layer."
146
+ ```
147
+
148
+ ### 典型用例:代码审查
149
+
150
+ ```bash
151
+ # 审查新增的业务模块
152
+ python .claude/skills/collaborating-with-codex/scripts/codex_bridge.py \
153
+ --cd "/project" \
154
+ --PROMPT "Review the XxxServiceImpl.java for potential bugs, security issues, and adherence to the project's three-layer architecture pattern (Controller -> Service -> Mapper, NO DAO layer). OUTPUT: Review comments with specific line numbers."
155
+ ```
156
+
157
+ ## 安装前置
158
+
159
+ ```bash
160
+ # 安装 Codex CLI
161
+ npm install -g @openai/codex
162
+
163
+ # 配置 API Key(可选,如果未设置环境变量)
164
+ codex auth login
165
+ ```
166
+
167
+ ## 故障排除
168
+
169
+ | 问题 | 解决方案 |
170
+ |------|---------|
171
+ | `codex: command not found` | 确保已安装并添加到 PATH |
172
+ | `SESSION_ID` 获取失败 | 检查网络连接和 API Key |
173
+ | 输出被截断 | 使用 `--return-all-messages` 获取完整信息 |
174
+ | Windows 路径问题 | 使用正斜杠 `/` 或双反斜杠 `\\` |