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
package/CLAUDE.md ADDED
@@ -0,0 +1,205 @@
1
+ # CLAUDE.md - leniu-tengyun-core 云食堂项目
2
+
3
+ ## 语言设置
4
+ **必须使用中文**与用户对话。
5
+
6
+ ## 术语约定
7
+
8
+ | 术语 | 含义 | 路径 |
9
+ |------|------|------|
10
+ | **后端** | Java 服务 | `leniu-tengyun-core/` |
11
+ | **前端** | PC 管理端 | `/Users/xujiajun/Developer/frontProj/web`(Vue 2) |
12
+ | **食堂模块** | 食堂业务 | `sys-canteen/` |
13
+ | **后场模块** | 后场厨房 | `sys-kitchen/` |
14
+ | **供应链模块** | 供应链 | `sys-drp/` |
15
+ | **公共模块** | 基础公共 | `core-base/`、`sys-common/` |
16
+
17
+ ## 前端技术栈
18
+
19
+ | 技术 | 版本 | 说明 |
20
+ |------|------|------|
21
+ | Vue | 2.7.16 | Options API |
22
+ | Element UI | 2.15.9 | `el-` 前缀组件 |
23
+ | Vuex | 3.4.0 | namespaced:true |
24
+ | Vue Router | 3.2.0 | Hash 路由 |
25
+ | vue-i18n | 7.3.2 | `$t('key')` |
26
+
27
+ **前端关键机制**:Token=`Admin-Token`(localStorage)、租户=`MERCHANT-ID`(请求头)、成功码=`10000`、金额=分(`money()` 转元)、权限=`v-hasPerm`、加密=SM4
28
+
29
+ **前端 src 结构**:`api/`(65个接口) | `leniuview/`(35个业务模块) | `leniu-components/`(业务组件) | `components/`(~87) | `store/`(30个模块)
30
+
31
+ > **前端技能**:`ui-pc`(组件/API/权限)、`store-pc`(Vuex)
32
+
33
+ ## MCP 工具触发
34
+
35
+ | 触发词 | 工具 |
36
+ |-------|------|
37
+ | 深度分析、仔细思考、全面评估 | `sequential-thinking` |
38
+ | 最佳实践、官方文档、标准写法 | `context7` |
39
+ | 打开浏览器、截图、检查元素 | `chrome-devtools` |
40
+
41
+ ## Skills 强制评估
42
+
43
+ > UserPromptSubmit Hook 会注入评估提示,**必须严格遵循**。
44
+
45
+ 1. **评估**:列出匹配的技能
46
+ 2. **激活**:逐个调用 `Skill(技能名)`(串行,不能并行)
47
+ 3. **实现**:所有技能激活完成后开始
48
+
49
+ **Skills 位置**:`.claude/skills/[skill-name]/SKILL.md`
50
+
51
+ ---
52
+
53
+ ## 核心规范速查
54
+
55
+ | 项目 | 规范 |
56
+ |------|------|
57
+ | **包名** | `net.xnzn.core.*` |
58
+ | **JDK** | 21 |
59
+ | **框架** | pigx-framework 3.4.7 + Spring Boot 3.x |
60
+ | **架构** | Controller → Business → Service → Mapper |
61
+ | **请求封装** | `LeRequest<T>` |
62
+ | **分页** | `PageDTO` + `PageVO` + PageHelper |
63
+ | **异常** | `LeException` |
64
+ | **国际化** | `I18n.getMessage()` |
65
+ | **对象转换** | `BeanUtil.copyProperties()`(Hutool) |
66
+ | **权限** | `@RequiresAuthentication` |
67
+ | **ID** | `Id.next()`(雪花ID) |
68
+ | **验证** | `jakarta.validation.*`(JDK 21) |
69
+
70
+ ## 双库架构
71
+
72
+ 物理分离双库,**无 tenant_id 字段**:
73
+
74
+ | 库 | 说明 | 切换方式 |
75
+ |----|------|---------|
76
+ | 系统库 | 全局数据(商户配置、字典) | `Executors.doInSystem()` |
77
+ | 商户库 | 租户业务数据(订单、菜品) | 默认(请求头 `MERCHANT-ID`) |
78
+
79
+ ```java
80
+ Executors.doInTenant(tenantId, () -> { /* 商户库 */ });
81
+ Executors.doInSystem(() -> { /* 系统库 */ });
82
+ Executors.doInAllTenant(tenantId -> { /* 遍历所有租户 */ });
83
+ ```
84
+
85
+ ## 四层架构说明
86
+
87
+ | 层 | 职责 | 命名示例 |
88
+ |----|------|---------|
89
+ | Controller | 接收请求、参数校验、路由 | `OrderInfoWebController` |
90
+ | **Business** | 业务编排、跨 Service 协调 | `OrderWebBusiness` |
91
+ | Service | 单表 CRUD、事务 | `OrderInfoService` |
92
+ | Mapper | ORM 映射(含 XML 同目录) | `OrderInfoMapper` |
93
+
94
+ > Business 层是本项目核心特色,复杂逻辑在此处编排。
95
+
96
+ ## 标准包结构
97
+
98
+ ```
99
+ net.xnzn.core.[module]/
100
+ ├── controller/ # 按端分:web/mobile/android
101
+ ├── business/impl/ # 业务编排
102
+ ├── service/impl/ # 服务层
103
+ ├── mapper/ # Mapper + XML(同目录!)
104
+ ├── model/ # Entity
105
+ ├── vo/ # 响应对象
106
+ ├── dto/ # 请求参数
107
+ ├── constants/ # 枚举和常量
108
+ ├── mq/ # 消息队列
109
+ └── task/ # 定时任务
110
+ ```
111
+
112
+ > **XML 与 Mapper 同目录**(非 `resources/mapper/`),需在 pom.xml 配置资源过滤。
113
+
114
+ ## 多端 Controller 路由
115
+
116
+ | 端 | 路由前缀 |
117
+ |----|---------|
118
+ | Web 管理端 | `/api/v2/web/{module}` |
119
+ | 移动端 | `/api/v2/mobile/{module}` |
120
+ | 设备端 | `/api/v2/android/{module}` |
121
+ | 开放接口 | `/api/v2/open/{module}` |
122
+
123
+ ## Entity 审计字段
124
+
125
+ | leniu 字段 | 含义 | 填充时机 |
126
+ |-----------|------|---------|
127
+ | `crby` | 创建人 | INSERT |
128
+ | `crtime` | 创建时间 | INSERT |
129
+ | `upby` | 更新人 | INSERT_UPDATE |
130
+ | `uptime` | 更新时间 | INSERT_UPDATE |
131
+ | `delFlag` | **1=删除,2=正常** | 手动 |
132
+
133
+ ## 工具类速查
134
+
135
+ | 工具 | 用途 |
136
+ |------|------|
137
+ | `BeanUtil.copyProperties()` | 对象转换 |
138
+ | `CollUtil.isEmpty()` | 集合判空 |
139
+ | `ObjectUtil.isNull()` | 对象判空 |
140
+ | `StrUtil.isBlank()` | 字符串判空 |
141
+ | `Id.next()` | 雪花ID |
142
+ | `LeException` | 业务异常 |
143
+ | `I18n.getMessage()` | 国际化 |
144
+ | `TenantContextHolder.getTenantId()` | 租户上下文 |
145
+ | `PageMethod.startPage()` | 分页拦截 |
146
+
147
+ ## 绝对禁止
148
+
149
+ ```java
150
+ // ❌ 错误包名
151
+ package org.dromara.xxx; // 必须 net.xnzn.core.xxx
152
+
153
+ // ❌ 旧验证包(JDK 21 必须用 jakarta)
154
+ import javax.validation.constraints.*;
155
+
156
+ // ❌ RuoYi 工具类
157
+ MapstructUtils.convert(); // 用 BeanUtil.copyProperties()
158
+ throw new ServiceException("msg"); // 用 throw new LeException("msg")
159
+
160
+ // ❌ 错误审计字段名
161
+ private String createBy; // 必须 crby
162
+ private LocalDateTime createTime; // 必须 crtime
163
+
164
+ // ❌ Entity 加 tenant_id(双库物理隔离,不需要)
165
+
166
+ // ❌ del_flag: 0=正常(leniu 是 2=正常)
167
+
168
+ // ❌ Map 传递业务数据(必须用 VO/DTO)
169
+ ```
170
+
171
+ ## 数据库规范
172
+
173
+ ```sql
174
+ CREATE TABLE xxx (
175
+ id BIGINT NOT NULL COMMENT '主键(雪花ID)',
176
+ -- 业务字段...
177
+ crby VARCHAR(64) COMMENT '创建人',
178
+ crtime DATETIME COMMENT '创建时间',
179
+ upby VARCHAR(64) COMMENT '更新人',
180
+ uptime DATETIME COMMENT '更新时间',
181
+ del_flag INT DEFAULT 2 COMMENT '删除标识(1-删除,2-正常)',
182
+ PRIMARY KEY (id)
183
+ );
184
+ -- ⚠️ 无需 tenant_id(双库物理隔离)
185
+ ```
186
+
187
+ ## 参考代码位置
188
+
189
+ | 类型 | 路径 |
190
+ |------|------|
191
+ | 订单 Controller | `sys-canteen/.../order/web/controller/OrderInfoWebController.java` |
192
+ | 订单 Business | `sys-canteen/.../order/web/business/impl/OrderWebBusiness.java` |
193
+ | 订单 Service | `sys-canteen/.../order/common/service/impl/OrderInfoService.java` |
194
+ | 订单 Entity | `sys-canteen/.../order/common/model/OrderInfo.java` |
195
+ | 订单枚举 | `sys-canteen/.../order/common/constants/OrderStateEnum.java` |
196
+ | 排班 Controller | `sys-kitchen/.../attendance/scheduling/controller/BackAttendanceWorkShiftController.java` |
197
+ | Bootstrap 配置 | `core-base/src/main/resources/bootstrap.yml` |
198
+
199
+ ## 快速命令
200
+
201
+ | 命令 | 用途 |
202
+ |------|------|
203
+ | `/dev` | 开发新功能 |
204
+ | `/crud` | 快速生成 CRUD |
205
+ | `/check` | 代码规范检查 |
package/README.md ADDED
@@ -0,0 +1,205 @@
1
+ # AI Engineering Init
2
+
3
+ > 一键初始化 AI 工程化配置,支持 Claude Code、Cursor、OpenAI Codex 等主流 AI 开发工具。
4
+
5
+ ## 快速开始
6
+
7
+ ### 方式一:npx(推荐,无需克隆)
8
+
9
+ ```bash
10
+ # 交互式选择
11
+ npx ai-engineering-init
12
+
13
+ # 直接指定工具
14
+ npx ai-engineering-init --tool claude # 初始化 Claude Code
15
+ npx ai-engineering-init --tool cursor # 初始化 Cursor
16
+ npx ai-engineering-init --tool codex # 初始化 OpenAI Codex
17
+ npx ai-engineering-init --tool all # 初始化全部
18
+ ```
19
+
20
+ ### 方式二:Shell 脚本(远程执行)
21
+
22
+ ```bash
23
+ # 交互式
24
+ bash <(curl -fsSL https://raw.githubusercontent.com/xu-cell/ai-engineering-init/main/init.sh)
25
+
26
+ # 直接指定工具
27
+ bash <(curl -fsSL https://raw.githubusercontent.com/xu-cell/ai-engineering-init/main/init.sh) --tool claude
28
+ bash <(curl -fsSL https://raw.githubusercontent.com/xu-cell/ai-engineering-init/main/init.sh) --tool cursor
29
+ ```
30
+
31
+ ### 方式三:克隆后初始化
32
+
33
+ ```bash
34
+ git clone https://github.com/xu-cell/ai-engineering-init
35
+ cd ai-engineering-init
36
+ ./init.sh --tool claude
37
+ ./init.sh --tool cursor
38
+ ```
39
+
40
+ ## 支持的工具
41
+
42
+ | 工具 | 参数 | 初始化内容 |
43
+ |------|------|-----------|
44
+ | Claude Code | `--tool claude` | `.claude/` 目录 + `CLAUDE.md` |
45
+ | Cursor | `--tool cursor` | `.cursor/` 目录(Skills + Agents + MCP) |
46
+ | OpenAI Codex | `--tool codex` | `.codex/` 目录 + `AGENTS.md` |
47
+ | 全部 | `--tool all` | 以上全部 |
48
+
49
+ ## 选项
50
+
51
+ ```
52
+ --tool, -t <工具> 指定工具: claude | cursor | codex | all
53
+ --dir, -d <目录> 目标目录(默认:当前目录)
54
+ --force,-f 强制覆盖已有文件
55
+ --help, -h 显示帮助
56
+ ```
57
+
58
+ ## 包含内容
59
+
60
+ ### Claude Code(`.claude/`)
61
+
62
+ | 目录/文件 | 说明 |
63
+ |-----------|------|
64
+ | `skills/`(68个) | 业务技能:CRUD、API、数据库、安全、性能、leniu 云食堂专项等 |
65
+ | `commands/`(10个) | 快捷命令:`/dev`、`/crud`、`/check`、`/start`、`/progress` 等 |
66
+ | `agents/`(2个) | 子代理:`code-reviewer`(代码审查)、`project-manager`(项目管理) |
67
+ | `hooks/` | 自动化钩子:技能强制评估(UserPromptSubmit)、代码规范检查(PreToolUse) |
68
+ | `CLAUDE.md` | 项目规范说明(包名、架构、工具类、禁止事项等) |
69
+
70
+ ### Cursor(`.cursor/`)
71
+
72
+ | 目录/文件 | 说明 |
73
+ |-----------|------|
74
+ | `skills/`(68个) | 与 `.claude/skills/` 完全同步,支持 `@技能名` 手动调用或 Agent 自动委托 |
75
+ | `agents/`(2个) | Subagents:`code-reviewer`(`readonly: true`)、`project-manager` |
76
+ | `mcp.json` | MCP 服务器配置:`sequential-thinking`、`context7`、`github` |
77
+
78
+ ### OpenAI Codex(`.codex/`)
79
+
80
+ | 目录/文件 | 说明 |
81
+ |-----------|------|
82
+ | `skills/` | Codex 技能配置 |
83
+ | `AGENTS.md` | AI Agent 项目规范说明 |
84
+
85
+ ## Skills 列表(68个)
86
+
87
+ <details>
88
+ <summary>展开查看完整列表</summary>
89
+
90
+ **通用后端技能(33个)**
91
+
92
+ | 技能 | 触发场景 |
93
+ |------|---------|
94
+ | `crud-development` | CRUD 开发、业务模块、Entity/Service/Controller |
95
+ | `api-development` | RESTful API 设计、接口规范 |
96
+ | `database-ops` | 建表、SQL、字典、菜单配置 |
97
+ | `backend-annotations` | `@RateLimiter`、`@RepeatSubmit`、`@DataPermission` |
98
+ | `utils-toolkit` | StringUtils、MapstructUtils、StreamUtils 等工具类 |
99
+ | `architecture-design` | 系统架构、模块划分、代码重构 |
100
+ | `code-patterns` | 编码规范、命名规范、禁止事项 |
101
+ | `error-handler` | 异常处理、ServiceException、全局错误码 |
102
+ | `security-guard` | Sa-Token 认证授权、数据脱敏、加密 |
103
+ | `data-permission` | 行级数据权限、部门隔离 |
104
+ | `performance-doctor` | 慢查询优化、缓存策略、N+1 问题 |
105
+ | `redis-cache` | Redis 缓存、分布式锁、`@Cacheable` |
106
+ | `json-serialization` | JSON 序列化、BigDecimal 精度、日期格式 |
107
+ | `scheduled-jobs` | 定时任务、SnailJob、`@Scheduled` |
108
+ | `websocket-sse` | WebSocket、SSE 实时推送、消息通知 |
109
+ | `workflow-engine` | 工作流、审批流、WarmFlow |
110
+ | `file-oss-management` | 文件上传、OSS、MinIO |
111
+ | `sms-mail` | 短信、邮件、SMS4j |
112
+ | `social-login` | 第三方登录、OAuth2、JustAuth |
113
+ | `tenant-management` | 多租户隔离、TenantEntity |
114
+ | `test-development` | 单元测试、JUnit5、Mockito |
115
+ | `git-workflow` | Git 提交规范、分支策略 |
116
+ | `bug-detective` | Bug 排查、异常定位 |
117
+ | `brainstorm` | 方案设计、头脑风暴 |
118
+ | `tech-decision` | 技术选型、方案对比 |
119
+ | `task-tracker` | 任务进度跟踪 |
120
+ | `project-navigator` | 项目结构导航、文件定位 |
121
+ | `collaborating-with-codex` | 与 Codex 协同开发 |
122
+ | `collaborating-with-gemini` | 与 Gemini 协同开发 |
123
+ | `banana-image` | AI 图片生成、海报、缩略图 |
124
+ | `add-skill` | 创建新技能 |
125
+ | `ui-pc` | 前端 PC 端组件库 |
126
+ | `store-pc` | 前端 Vuex 状态管理 |
127
+
128
+ **leniu 云食堂专项技能(25个)**
129
+
130
+ | 技能 | 说明 |
131
+ |------|------|
132
+ | `leniu-crud-development` | 云食堂四层架构 CRUD(Controller→Business→Service→Mapper) |
133
+ | `leniu-api-development` | 云食堂 API 规范(LeResult、LeRequest、LeException) |
134
+ | `leniu-architecture-design` | 双库架构(商户库/系统库)、pigx-framework |
135
+ | `leniu-database-ops` | 云食堂建表规范(审计字段、逻辑删除、雪花ID) |
136
+ | `leniu-error-handler` | LeException、I18n 国际化异常处理 |
137
+ | `leniu-backend-annotations` | `@RequiresAuthentication`、分组校验 |
138
+ | `leniu-utils-toolkit` | BeanUtil、CollUtil、StrUtil、RedisUtil |
139
+ | `leniu-code-patterns` | net.xnzn 包名规范、禁止事项 |
140
+ | `leniu-data-permission` | 云食堂数据权限控制 |
141
+ | `leniu-java-entity` | Entity/VO/DTO/Param 数据类规范 |
142
+ | `leniu-java-mybatis` | MyBatis Plus、LambdaQueryWrapper、XML 映射 |
143
+ | `leniu-java-amount-handling` | 金额分/元转换(Long 类型存储) |
144
+ | `leniu-java-code-style` | 命名规范、注解风格 |
145
+ | `leniu-java-concurrent` | CompletableFuture、线程池、分布式锁 |
146
+ | `leniu-java-export` | Excel 异步导出 |
147
+ | `leniu-java-logging` | `@Slf4j`、日志级别规范 |
148
+ | `leniu-java-mq` | MqUtil、`@MqConsumer`、延迟消息 |
149
+ | `leniu-java-report-query-param` | 报表查询入参 Param 类规范 |
150
+ | `leniu-java-task` | XXL-Job 定时任务 |
151
+ | `leniu-java-total-line` | 报表分页合计行 |
152
+ | `leniu-mealtime` | 餐次(早/午/下午茶/晚/夜宵)处理 |
153
+ | `leniu-redis-cache` | 云食堂 Redis 缓存规范 |
154
+ | `leniu-security-guard` | SQL 注入防护、XSS 防护、限流 |
155
+ | `leniu-marketing-price-rule-customizer` | 营销计费规则定制 |
156
+ | `leniu-marketing-recharge-rule-customizer` | 营销充值规则定制 |
157
+
158
+ **OpenSpec 工作流技能(10个)**
159
+
160
+ `openspec-new-change`、`openspec-ff-change`、`openspec-apply-change`、`openspec-continue-change`、`openspec-archive-change`、`openspec-bulk-archive-change`、`openspec-explore`、`openspec-onboard`、`openspec-sync-specs`、`openspec-verify-change`
161
+
162
+ </details>
163
+
164
+ ## 初始化后使用
165
+
166
+ ### Claude Code
167
+
168
+ 1. 修改 `CLAUDE.md` 中的项目信息(包名、模块名、架构说明等)
169
+ 2. 输入 `/start` 快速了解项目
170
+ 3. 输入 `/dev` 开始开发新功能
171
+ 4. 输入 `/crud` 快速生成 CRUD 代码
172
+ 5. 输入 `/check` 检查代码规范
173
+
174
+ ### Cursor
175
+
176
+ 1. 在 Chat 中输入 `/` 查看所有可用 Skills
177
+ 2. 输入 `@技能名` 手动调用指定技能(如 `@leniu-crud-development`)
178
+ 3. Subagents 会根据任务自动委托:`/code-reviewer`、`/project-manager`
179
+ 4. 在 Settings → MCP 中确认 MCP 服务器已连接
180
+
181
+ ### OpenAI Codex
182
+
183
+ 1. 修改 `AGENTS.md` 中的项目说明
184
+ 2. 使用 `.codex/skills/` 下的技能辅助开发
185
+
186
+ ## 更新日志
187
+
188
+ ### v1.1.0(2026-02-24)
189
+
190
+ - 新增 **Cursor** 工具支持(`.cursor/` 目录)
191
+ - 同步 68 个 Skills 到 `.cursor/skills/`
192
+ - 新增 Subagents 配置(`code-reviewer`、`project-manager`)
193
+ - 新增 MCP 服务器配置(`sequential-thinking`、`context7`、`github`)
194
+ - 新增 **25 个 leniu 云食堂专项技能**
195
+ - 覆盖金额处理、并发、MQ、定时任务、报表、餐次、营销规则等场景
196
+
197
+ ### v1.0.0
198
+
199
+ - 初始版本,支持 Claude Code 和 OpenAI Codex
200
+ - 内置通用后端技能、OpenSpec 工作流技能
201
+ - 自动化 Hooks(技能强制评估、代码规范检查)
202
+
203
+ ## License
204
+
205
+ MIT
package/bin/index.js ADDED
@@ -0,0 +1,179 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * AI Engineering 初始化 CLI
4
+ * 用法:
5
+ * npx ai-engineering-init # 交互式
6
+ * npx ai-engineering-init --tool claude
7
+ * npx ai-engineering-init --tool codex
8
+ * npx ai-engineering-init --tool all
9
+ */
10
+ 'use strict';
11
+
12
+ const fs = require('fs');
13
+ const path = require('path');
14
+ const readline = require('readline');
15
+
16
+ // ── ANSI 颜色 ──────────────────────────────────────────────────────────────
17
+ const c = {
18
+ reset: '\x1b[0m', bold: '\x1b[1m',
19
+ red: '\x1b[31m', green: '\x1b[32m', yellow: '\x1b[33m',
20
+ blue: '\x1b[34m', cyan: '\x1b[36m',
21
+ };
22
+ const fmt = (color, text) => `${c[color]}${text}${c.reset}`;
23
+
24
+ // ── Banner ─────────────────────────────────────────────────────────────────
25
+ console.log('');
26
+ console.log(fmt('blue', fmt('bold', '┌─────────────────────────────────────────┐')));
27
+ console.log(fmt('blue', fmt('bold', '│ AI Engineering 初始化工具 v1.1 │')));
28
+ console.log(fmt('blue', fmt('bold', '└─────────────────────────────────────────┘')));
29
+ console.log('');
30
+
31
+ // ── 参数解析 ───────────────────────────────────────────────────────────────
32
+ const args = process.argv.slice(2);
33
+ let tool = '';
34
+ let targetDir = process.cwd();
35
+ let force = false;
36
+
37
+ for (let i = 0; i < args.length; i++) {
38
+ switch (args[i]) {
39
+ case '--tool': case '-t': tool = args[++i]; break;
40
+ case '--dir': case '-d': targetDir = path.resolve(args[++i]); break;
41
+ case '--force':case '-f': force = true; break;
42
+ case '--help': case '-h':
43
+ console.log(`用法: ${fmt('bold', 'npx ai-engineering-init')} [选项]\n`);
44
+ console.log('选项:');
45
+ console.log(' --tool, -t <工具> 指定工具: claude | cursor | codex | all');
46
+ console.log(' --dir, -d <目录> 目标目录(默认:当前目录)');
47
+ console.log(' --force,-f 强制覆盖已有文件');
48
+ console.log(' --help, -h 显示此帮助\n');
49
+ console.log('示例:');
50
+ console.log(' npx ai-engineering-init --tool claude');
51
+ console.log(' npx ai-engineering-init --tool all --dir /path/to/project\n');
52
+ process.exit(0);
53
+ }
54
+ }
55
+
56
+ // ── 工具定义 ───────────────────────────────────────────────────────────────
57
+ const TOOLS = {
58
+ claude: {
59
+ label: 'Claude Code',
60
+ files: [
61
+ { src: '.claude', dest: '.claude', label: '.claude/ 目录', isDir: true },
62
+ { src: 'CLAUDE.md', dest: 'CLAUDE.md', label: 'CLAUDE.md' },
63
+ ],
64
+ },
65
+ cursor: {
66
+ label: 'Cursor',
67
+ files: [
68
+ { src: '.cursor', dest: '.cursor', label: '.cursor/ 目录', isDir: true },
69
+ ],
70
+ },
71
+ codex: {
72
+ label: 'OpenAI Codex',
73
+ files: [
74
+ { src: '.codex', dest: '.codex', label: '.codex/ 目录', isDir: true },
75
+ { src: 'AGENTS.md', dest: 'AGENTS.md', label: 'AGENTS.md' },
76
+ ],
77
+ },
78
+ };
79
+
80
+ // ── 工具函数 ───────────────────────────────────────────────────────────────
81
+ const SOURCE_DIR = path.join(__dirname, '..');
82
+
83
+ function copyDir(src, dest) {
84
+ if (!fs.existsSync(dest)) fs.mkdirSync(dest, { recursive: true });
85
+ for (const entry of fs.readdirSync(src)) {
86
+ const s = path.join(src, entry);
87
+ const d = path.join(dest, entry);
88
+ fs.statSync(s).isDirectory() ? copyDir(s, d) : fs.copyFileSync(s, d);
89
+ }
90
+ }
91
+
92
+ function copyItem({ src, dest, label, isDir }) {
93
+ const srcPath = path.join(SOURCE_DIR, src);
94
+ const destPath = path.join(targetDir, dest);
95
+
96
+ if (!fs.existsSync(srcPath)) {
97
+ console.log(` ${fmt('yellow', '⚠')} ${label} 在源目录中不存在,跳过`);
98
+ return;
99
+ }
100
+ if (fs.existsSync(destPath) && !force) {
101
+ console.log(` ${fmt('yellow', '⚠')} ${label} 已存在,跳过(--force 可强制覆盖)`);
102
+ return;
103
+ }
104
+ isDir ? copyDir(srcPath, destPath) : fs.copyFileSync(srcPath, destPath);
105
+ console.log(` ${fmt('green', '✓')} ${label}`);
106
+ }
107
+
108
+ function initTool(toolKey) {
109
+ const t = TOOLS[toolKey];
110
+ console.log(fmt('cyan', `[${t.label}]`));
111
+ for (const f of t.files) copyItem(f);
112
+ }
113
+
114
+ function showDoneHint(toolKey) {
115
+ console.log('');
116
+ console.log(fmt('green', fmt('bold', '✅ 初始化完成!')));
117
+ console.log('');
118
+ if (toolKey === 'claude' || toolKey === 'all') {
119
+ console.log(fmt('cyan', 'Claude Code 使用:'));
120
+ console.log(` 1. 按需修改 ${fmt('bold', 'CLAUDE.md')} 中的项目信息`);
121
+ console.log(` 2. 在 Claude Code 中输入 ${fmt('bold', '/start')} 快速了解项目`);
122
+ console.log(` 3. 输入 ${fmt('bold', '/dev')} 开始开发新功能`);
123
+ console.log('');
124
+ }
125
+ if (toolKey === 'cursor' || toolKey === 'all') {
126
+ console.log(fmt('cyan', 'Cursor 使用:'));
127
+ console.log(` 1. 在 Cursor Chat 中输入 ${fmt('bold', '/')} 查看所有可用 Skills`);
128
+ console.log(` 2. 输入 ${fmt('bold', '@技能名')} 手动调用指定技能`);
129
+ console.log(` 3. 在 Settings → MCP 中确认 MCP 服务器已连接`);
130
+ console.log('');
131
+ }
132
+ if (toolKey === 'codex' || toolKey === 'all') {
133
+ console.log(fmt('cyan', 'Codex 使用:'));
134
+ console.log(` 1. 按需修改 ${fmt('bold', 'AGENTS.md')} 中的项目说明`);
135
+ console.log(` 2. 在 Codex 中使用 .codex/skills/ 下的技能`);
136
+ console.log('');
137
+ }
138
+ }
139
+
140
+ // ── 主逻辑 ────────────────────────────────────────────────────────────────
141
+ function run(selectedTool) {
142
+ if (!['claude', 'cursor', 'codex', 'all'].includes(selectedTool)) {
143
+ console.error(fmt('red', `无效工具: ${selectedTool}。有效选项: claude | cursor | codex | all`));
144
+ process.exit(1);
145
+ }
146
+ console.log(` 目标目录: ${fmt('bold', targetDir)}`);
147
+ console.log(` 初始化工具: ${fmt('bold', selectedTool)}`);
148
+ console.log('');
149
+ console.log(fmt('bold', '正在复制文件...'));
150
+ console.log('');
151
+
152
+ if (selectedTool === 'all') {
153
+ initTool('claude'); console.log(''); initTool('cursor'); console.log(''); initTool('codex');
154
+ } else {
155
+ initTool(selectedTool);
156
+ }
157
+ showDoneHint(selectedTool);
158
+ }
159
+
160
+ if (tool) {
161
+ run(tool);
162
+ } else {
163
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
164
+ console.log(fmt('cyan', '请选择要初始化的 AI 工具:'));
165
+ console.log('');
166
+ console.log(` ${fmt('bold', '1')}) ${fmt('green', 'Claude Code')} — 初始化 .claude/ + CLAUDE.md`);
167
+ console.log(` ${fmt('bold', '2')}) ${fmt('cyan', 'Cursor')} — 初始化 .cursor/(Skills + Agents + MCP)`);
168
+ console.log(` ${fmt('bold', '3')}) ${fmt('yellow', 'OpenAI Codex')} — 初始化 .codex/ + AGENTS.md`);
169
+ console.log(` ${fmt('bold', '4')}) ${fmt('blue', '全部工具')} — 同时初始化 Claude + Cursor + Codex`);
170
+ console.log('');
171
+ rl.question(fmt('bold', '请输入选项 [1-4]: '), (answer) => {
172
+ rl.close();
173
+ const map = { '1': 'claude', '2': 'cursor', '3': 'codex', '4': 'all' };
174
+ const selected = map[answer.trim()];
175
+ if (!selected) { console.error(fmt('red', '无效选项,退出。')); process.exit(1); }
176
+ console.log('');
177
+ run(selected);
178
+ });
179
+ }