claude-code-workflow 6.1.4 → 6.2.2

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 (437) hide show
  1. package/.claude/CLAUDE.md +10 -0
  2. package/.claude/agents/action-planning-agent.md +857 -778
  3. package/.claude/agents/cli-execution-agent.md +266 -269
  4. package/.claude/agents/cli-explore-agent.md +2 -2
  5. package/.claude/agents/cli-lite-planning-agent.md +142 -92
  6. package/.claude/agents/cli-planning-agent.md +4 -4
  7. package/.claude/agents/code-developer.md +7 -6
  8. package/.claude/agents/conceptual-planning-agent.md +2 -2
  9. package/.claude/agents/context-search-agent.md +31 -32
  10. package/.claude/agents/doc-generator.md +4 -4
  11. package/.claude/agents/memory-bridge.md +93 -93
  12. package/.claude/agents/test-context-search-agent.md +8 -7
  13. package/.claude/agents/test-fix-agent.md +7 -6
  14. package/.claude/commands/clean.md +516 -0
  15. package/.claude/commands/memory/compact.md +383 -0
  16. package/.claude/commands/memory/docs-full-cli.md +471 -471
  17. package/.claude/commands/memory/docs-related-cli.md +386 -386
  18. package/.claude/commands/memory/docs.md +615 -615
  19. package/.claude/commands/memory/load.md +5 -5
  20. package/.claude/commands/memory/tech-research-rules.md +310 -0
  21. package/.claude/commands/memory/update-full.md +332 -332
  22. package/.claude/commands/memory/workflow-skill-memory.md +4 -4
  23. package/.claude/commands/task/create.md +151 -151
  24. package/.claude/commands/version.md +254 -254
  25. package/.claude/commands/workflow/brainstorm/api-designer.md +587 -585
  26. package/.claude/commands/workflow/brainstorm/artifacts.md +1 -0
  27. package/.claude/commands/workflow/brainstorm/auto-parallel.md +443 -443
  28. package/.claude/commands/workflow/brainstorm/data-architect.md +220 -220
  29. package/.claude/commands/workflow/brainstorm/product-manager.md +200 -200
  30. package/.claude/commands/workflow/brainstorm/product-owner.md +200 -200
  31. package/.claude/commands/workflow/brainstorm/scrum-master.md +200 -200
  32. package/.claude/commands/workflow/brainstorm/subject-matter-expert.md +200 -200
  33. package/.claude/commands/workflow/brainstorm/system-architect.md +389 -387
  34. package/.claude/commands/workflow/brainstorm/ui-designer.md +221 -221
  35. package/.claude/commands/workflow/brainstorm/ux-expert.md +221 -221
  36. package/.claude/commands/workflow/debug.md +321 -0
  37. package/.claude/commands/workflow/execute.md +13 -0
  38. package/.claude/commands/workflow/init.md +165 -164
  39. package/.claude/commands/workflow/lite-execute.md +119 -13
  40. package/.claude/commands/workflow/lite-fix.md +623 -621
  41. package/.claude/commands/workflow/lite-plan.md +610 -592
  42. package/.claude/commands/workflow/plan.md +5 -5
  43. package/.claude/commands/workflow/review-module-cycle.md +2 -0
  44. package/.claude/commands/workflow/review-session-cycle.md +2 -0
  45. package/.claude/commands/workflow/review.md +297 -291
  46. package/.claude/commands/workflow/session/complete.md +153 -500
  47. package/.claude/commands/workflow/session/list.md +95 -95
  48. package/.claude/commands/workflow/session/resume.md +60 -60
  49. package/.claude/commands/workflow/session/start.md +199 -199
  50. package/.claude/commands/workflow/tdd-plan.md +3 -3
  51. package/.claude/commands/workflow/tdd-verify.md +23 -9
  52. package/.claude/commands/workflow/test-cycle-execute.md +2 -0
  53. package/.claude/commands/workflow/test-fix-gen.md +699 -699
  54. package/.claude/commands/workflow/tools/conflict-resolution.md +104 -18
  55. package/.claude/commands/workflow/tools/context-gather.md +436 -434
  56. package/.claude/commands/workflow/tools/task-generate-agent.md +490 -291
  57. package/.claude/commands/workflow/tools/task-generate-tdd.md +18 -10
  58. package/.claude/commands/workflow/tools/test-concept-enhanced.md +2 -1
  59. package/.claude/commands/workflow/tools/test-context-gather.md +1 -0
  60. package/.claude/commands/workflow/tools/test-task-generate.md +1 -0
  61. package/.claude/commands/workflow/ui-design/import-from-code.md +9 -6
  62. package/.claude/skills/command-guide/SKILL.md +5 -5
  63. package/.claude/skills/command-guide/index/all-commands.json +1 -1
  64. package/.claude/skills/command-guide/index/by-category.json +1 -1
  65. package/.claude/skills/command-guide/index/by-use-case.json +1 -1
  66. package/.claude/skills/command-guide/reference/agents/action-planning-agent.md +857 -778
  67. package/.claude/skills/command-guide/reference/agents/cli-execution-agent.md +266 -269
  68. package/.claude/skills/command-guide/reference/agents/cli-explore-agent.md +2 -2
  69. package/.claude/skills/command-guide/reference/agents/cli-lite-planning-agent.md +142 -92
  70. package/.claude/skills/command-guide/reference/agents/cli-planning-agent.md +4 -4
  71. package/.claude/skills/command-guide/reference/agents/code-developer.md +7 -6
  72. package/.claude/skills/command-guide/reference/agents/conceptual-planning-agent.md +2 -2
  73. package/.claude/skills/command-guide/reference/agents/context-search-agent.md +31 -32
  74. package/.claude/skills/command-guide/reference/agents/doc-generator.md +4 -4
  75. package/.claude/skills/command-guide/reference/agents/memory-bridge.md +93 -93
  76. package/.claude/skills/command-guide/reference/agents/test-context-search-agent.md +8 -7
  77. package/.claude/skills/command-guide/reference/agents/test-fix-agent.md +7 -6
  78. package/.claude/skills/command-guide/reference/commands/memory/docs-full-cli.md +471 -471
  79. package/.claude/skills/command-guide/reference/commands/memory/docs-related-cli.md +386 -386
  80. package/.claude/skills/command-guide/reference/commands/memory/docs.md +17 -16
  81. package/.claude/skills/command-guide/reference/commands/memory/load.md +5 -5
  82. package/.claude/skills/command-guide/reference/commands/memory/tech-research.md +194 -357
  83. package/.claude/skills/command-guide/reference/commands/memory/update-full.md +332 -332
  84. package/.claude/skills/command-guide/reference/commands/memory/workflow-skill-memory.md +4 -4
  85. package/.claude/skills/command-guide/reference/commands/task/create.md +151 -151
  86. package/.claude/skills/command-guide/reference/commands/version.md +254 -254
  87. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/api-designer.md +585 -585
  88. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/auto-parallel.md +443 -443
  89. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/data-architect.md +220 -220
  90. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/product-manager.md +200 -200
  91. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/product-owner.md +200 -200
  92. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/scrum-master.md +200 -200
  93. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/subject-matter-expert.md +200 -200
  94. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/system-architect.md +387 -387
  95. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/ui-designer.md +221 -221
  96. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/ux-expert.md +221 -221
  97. package/.claude/skills/command-guide/reference/commands/workflow/execute.md +25 -20
  98. package/.claude/skills/command-guide/reference/commands/workflow/init.md +164 -164
  99. package/.claude/skills/command-guide/reference/commands/workflow/lite-execute.md +748 -686
  100. package/.claude/skills/command-guide/reference/commands/workflow/lite-fix.md +664 -621
  101. package/.claude/skills/command-guide/reference/commands/workflow/lite-plan.md +645 -592
  102. package/.claude/skills/command-guide/reference/commands/workflow/plan.md +5 -5
  103. package/.claude/skills/command-guide/reference/commands/workflow/review.md +25 -18
  104. package/.claude/skills/command-guide/reference/commands/workflow/session/complete.md +547 -500
  105. package/.claude/skills/command-guide/reference/commands/workflow/session/list.md +45 -27
  106. package/.claude/skills/command-guide/reference/commands/workflow/session/resume.md +35 -19
  107. package/.claude/skills/command-guide/reference/commands/workflow/session/start.md +90 -33
  108. package/.claude/skills/command-guide/reference/commands/workflow/tdd-plan.md +3 -3
  109. package/.claude/skills/command-guide/reference/commands/workflow/tdd-verify.md +23 -9
  110. package/.claude/skills/command-guide/reference/commands/workflow/test-fix-gen.md +699 -699
  111. package/.claude/skills/command-guide/reference/commands/workflow/tools/conflict-resolution.md +103 -17
  112. package/.claude/skills/command-guide/reference/commands/workflow/tools/context-gather.md +434 -434
  113. package/.claude/skills/command-guide/reference/commands/workflow/tools/task-generate-agent.md +487 -291
  114. package/.claude/skills/command-guide/reference/commands/workflow/tools/task-generate-tdd.md +17 -10
  115. package/.claude/skills/command-guide/reference/commands/workflow/tools/test-concept-enhanced.md +1 -1
  116. package/.claude/skills/command-guide/reference/commands/workflow/ui-design/import-from-code.md +6 -6
  117. package/.claude/workflows/chinese-response.md +38 -0
  118. package/.claude/workflows/cli-templates/prompts/rules/rule-api.txt +122 -0
  119. package/.claude/workflows/cli-templates/prompts/rules/rule-components.txt +122 -0
  120. package/.claude/workflows/cli-templates/prompts/rules/rule-config.txt +89 -0
  121. package/.claude/workflows/cli-templates/prompts/rules/rule-core.txt +60 -0
  122. package/.claude/workflows/cli-templates/prompts/rules/rule-patterns.txt +70 -0
  123. package/.claude/workflows/cli-templates/prompts/rules/rule-testing.txt +81 -0
  124. package/.claude/workflows/cli-templates/prompts/rules/tech-rules-agent-prompt.txt +89 -0
  125. package/.claude/workflows/cli-templates/prompts/workflow/gemini-solution-design.txt +131 -131
  126. package/.claude/workflows/cli-templates/prompts/workflow/skill-conflict-patterns.txt +5 -9
  127. package/.claude/workflows/cli-templates/prompts/workflow/skill-lessons-learned.txt +5 -9
  128. package/.claude/workflows/cli-templates/protocols/analysis-protocol.md +112 -0
  129. package/.claude/workflows/cli-templates/protocols/write-protocol.md +201 -0
  130. package/.claude/workflows/cli-templates/schemas/conflict-resolution-schema.json +137 -0
  131. package/.claude/workflows/cli-templates/schemas/debug-log-json-schema.json +127 -0
  132. package/.claude/workflows/cli-templates/schemas/fix-plan-json-schema.json +25 -0
  133. package/.claude/workflows/cli-templates/schemas/plan-json-schema.json +25 -0
  134. package/.claude/workflows/cli-tools-usage.md +526 -0
  135. package/{CLAUDE.md → .claude/workflows/coding-philosophy.md} +24 -45
  136. package/.claude/workflows/context-tools.md +84 -0
  137. package/.claude/workflows/file-modification.md +64 -0
  138. package/.claude/workflows/tool-strategy.md +216 -79
  139. package/.claude/workflows/windows-platform.md +16 -0
  140. package/.claude/workflows/workflow-architecture.md +942 -942
  141. package/.codex/AGENTS.md +63 -330
  142. package/.codex/prompts/debug.md +318 -0
  143. package/.codex/prompts/execute.md +273 -0
  144. package/.codex/prompts/lite-execute.md +164 -0
  145. package/.codex/prompts/lite-plan.md +469 -0
  146. package/.codex/prompts.zip +0 -0
  147. package/.gemini/GEMINI.md +25 -164
  148. package/.qwen/QWEN.md +0 -139
  149. package/README.md +29 -9
  150. package/ccw/README.md +30 -6
  151. package/ccw/bin/ccw-mcp.js +7 -0
  152. package/ccw/bin/ccw.js +9 -9
  153. package/ccw/package.json +65 -47
  154. package/ccw/src/.workflow/.cli-history/history.db +0 -0
  155. package/ccw/src/.workflow/.cli-history/history.db-shm +0 -0
  156. package/ccw/src/.workflow/.cli-history/history.db-wal +0 -0
  157. package/ccw/src/cli.ts +244 -0
  158. package/ccw/src/commands/cli.ts +740 -0
  159. package/ccw/src/commands/core-memory.ts +770 -0
  160. package/ccw/src/commands/hook.ts +315 -0
  161. package/ccw/src/commands/install.ts +519 -0
  162. package/ccw/src/commands/{list.js → list.ts} +1 -1
  163. package/ccw/src/commands/memory.ts +1090 -0
  164. package/ccw/src/commands/{serve.js → serve.ts} +14 -5
  165. package/ccw/src/commands/session-path-resolver.ts +372 -0
  166. package/ccw/src/commands/session.ts +1141 -0
  167. package/ccw/src/commands/{stop.js → stop.ts} +16 -6
  168. package/ccw/src/commands/tool.ts +201 -0
  169. package/ccw/src/commands/{uninstall.js → uninstall.ts} +89 -40
  170. package/ccw/src/commands/{upgrade.js → upgrade.ts} +68 -23
  171. package/ccw/src/commands/{view.js → view.ts} +22 -8
  172. package/ccw/src/config/storage-paths.ts +670 -0
  173. package/ccw/src/core/cache-manager.ts +294 -0
  174. package/ccw/src/core/claude-freshness.ts +319 -0
  175. package/ccw/src/core/core-memory-store.ts +1528 -0
  176. package/ccw/src/core/{dashboard-generator-patch.js → dashboard-generator-patch.ts} +18 -0
  177. package/ccw/src/core/{dashboard-generator.js → dashboard-generator.ts} +69 -12
  178. package/ccw/src/core/data-aggregator.ts +584 -0
  179. package/ccw/src/core/history-importer.ts +625 -0
  180. package/ccw/src/core/{lite-scanner.js → lite-scanner-complete.ts} +162 -66
  181. package/ccw/src/core/lite-scanner.ts +469 -0
  182. package/ccw/src/core/{manifest.js → manifest.ts} +104 -34
  183. package/ccw/src/core/memory-embedder-bridge.ts +262 -0
  184. package/ccw/src/core/memory-store.ts +978 -0
  185. package/ccw/src/core/routes/ccw-routes.ts +96 -0
  186. package/ccw/src/core/routes/claude-routes.ts +1183 -0
  187. package/ccw/src/core/routes/cli-routes.ts +561 -0
  188. package/ccw/src/core/routes/codexlens-routes.ts +806 -0
  189. package/ccw/src/core/routes/core-memory-routes.ts +605 -0
  190. package/ccw/src/core/routes/files-routes.ts +428 -0
  191. package/ccw/src/core/routes/graph-routes.md +164 -0
  192. package/ccw/src/core/routes/graph-routes.ts +626 -0
  193. package/ccw/src/core/routes/help-routes.ts +308 -0
  194. package/ccw/src/core/routes/hooks-routes.ts +405 -0
  195. package/ccw/src/core/routes/mcp-routes.ts +1271 -0
  196. package/ccw/src/core/routes/mcp-routes.ts.backup +550 -0
  197. package/ccw/src/core/routes/mcp-templates-db.ts +268 -0
  198. package/ccw/src/core/routes/memory-routes.ts +1206 -0
  199. package/ccw/src/core/routes/rules-routes.ts +526 -0
  200. package/ccw/src/core/routes/session-routes.ts +467 -0
  201. package/ccw/src/core/routes/skills-routes.ts +599 -0
  202. package/ccw/src/core/routes/status-routes.ts +57 -0
  203. package/ccw/src/core/routes/system-routes.ts +427 -0
  204. package/ccw/src/core/server.ts +431 -0
  205. package/ccw/src/core/session-clustering-service.ts +1258 -0
  206. package/ccw/src/core/session-scanner.ts +283 -0
  207. package/ccw/src/core/websocket.ts +190 -0
  208. package/ccw/src/{index.js → index.ts} +1 -0
  209. package/ccw/src/mcp-server/index.ts +186 -0
  210. package/ccw/src/templates/assets/css/github-dark.min.css +10 -0
  211. package/ccw/src/templates/assets/css/github.min.css +10 -0
  212. package/ccw/src/templates/assets/js/cytoscape.min.js +32 -0
  213. package/ccw/src/templates/assets/js/d3.min.js +2 -0
  214. package/ccw/src/templates/assets/js/highlight.min.js +1244 -0
  215. package/ccw/src/templates/assets/js/lucide.min.js +12 -0
  216. package/ccw/src/templates/assets/js/marked.min.js +69 -0
  217. package/ccw/src/templates/assets/js/tailwind.js +83 -0
  218. package/ccw/src/templates/dashboard-css/01-base.css +11 -0
  219. package/ccw/src/templates/dashboard-css/02-session.css +22 -0
  220. package/ccw/src/templates/dashboard-css/04-lite-tasks.css +10 -0
  221. package/ccw/src/templates/dashboard-css/06-cards.css +10 -4
  222. package/ccw/src/templates/dashboard-css/07-managers.css +1178 -7
  223. package/ccw/src/templates/dashboard-css/09-explorer.css +23 -12
  224. package/ccw/src/templates/dashboard-css/10-cli-status.css +337 -0
  225. package/ccw/src/templates/dashboard-css/11-cli-history.css +271 -0
  226. package/ccw/src/templates/dashboard-css/12-cli-legacy.css +796 -0
  227. package/ccw/src/templates/dashboard-css/13-cli-ccw.css +199 -0
  228. package/ccw/src/templates/dashboard-css/14-cli-modals.css +258 -0
  229. package/ccw/src/templates/dashboard-css/15-cli-endpoints.css +305 -0
  230. package/ccw/src/templates/dashboard-css/16-cli-session.css +241 -0
  231. package/ccw/src/templates/dashboard-css/17-cli-conversation.css +283 -0
  232. package/ccw/src/templates/dashboard-css/18-cli-settings.css +160 -0
  233. package/ccw/src/templates/dashboard-css/19-cli-native-session.css +496 -0
  234. package/ccw/src/templates/dashboard-css/20-cli-taskqueue.css +188 -0
  235. package/ccw/src/templates/dashboard-css/21-cli-toolmgmt.css +310 -0
  236. package/ccw/src/templates/dashboard-css/22-cli-semantic.css +240 -0
  237. package/ccw/src/templates/dashboard-css/23-memory.css +2390 -0
  238. package/ccw/src/templates/dashboard-css/24-prompt-history.css +1089 -0
  239. package/ccw/src/templates/dashboard-css/25-skills-rules.css +326 -0
  240. package/ccw/src/templates/dashboard-css/26-claude-manager.css +908 -0
  241. package/ccw/src/templates/dashboard-css/27-graph-explorer.css +1678 -0
  242. package/ccw/src/templates/dashboard-css/28-mcp-manager.css +748 -0
  243. package/ccw/src/templates/dashboard-css/29-help.css +264 -0
  244. package/ccw/src/templates/dashboard-css/30-core-memory.css +1700 -0
  245. package/ccw/src/templates/dashboard-js/api.js +162 -142
  246. package/ccw/src/templates/dashboard-js/components/carousel.js +4 -4
  247. package/ccw/src/templates/dashboard-js/components/cli-history.js +876 -0
  248. package/ccw/src/templates/dashboard-js/components/cli-status.js +978 -0
  249. package/ccw/src/templates/dashboard-js/components/global-notifications.js +508 -219
  250. package/ccw/src/templates/dashboard-js/components/hook-manager.js +1277 -282
  251. package/ccw/src/templates/dashboard-js/components/index-manager.js +302 -0
  252. package/ccw/src/templates/dashboard-js/components/mcp-manager.js +718 -27
  253. package/ccw/src/templates/dashboard-js/components/modals.js +66 -0
  254. package/ccw/src/templates/dashboard-js/components/navigation.js +80 -12
  255. package/ccw/src/templates/dashboard-js/components/notifications.js +758 -194
  256. package/ccw/src/templates/dashboard-js/components/storage-manager.js +478 -0
  257. package/ccw/src/templates/dashboard-js/components/tabs-other.js +157 -6
  258. package/ccw/src/templates/dashboard-js/components/task-queue-sidebar.js +716 -0
  259. package/ccw/src/templates/dashboard-js/help-i18n.js +272 -0
  260. package/ccw/src/templates/dashboard-js/i18n.js +2807 -0
  261. package/ccw/src/templates/dashboard-js/main.js +15 -0
  262. package/ccw/src/templates/dashboard-js/state.js +243 -42
  263. package/ccw/src/templates/dashboard-js/utils.js +47 -1
  264. package/ccw/src/templates/dashboard-js/views/claude-manager.js +912 -0
  265. package/ccw/src/templates/dashboard-js/views/cli-manager.js +2272 -0
  266. package/ccw/src/templates/dashboard-js/views/codexlens-manager.js +964 -0
  267. package/ccw/src/templates/dashboard-js/views/core-memory-clusters.js +503 -0
  268. package/ccw/src/templates/dashboard-js/views/core-memory.js +782 -0
  269. package/ccw/src/templates/dashboard-js/views/explorer.js +888 -852
  270. package/ccw/src/templates/dashboard-js/views/graph-explorer.js +1157 -0
  271. package/ccw/src/templates/dashboard-js/views/help.js +856 -0
  272. package/ccw/src/templates/dashboard-js/views/history.js +337 -0
  273. package/ccw/src/templates/dashboard-js/views/home.js +61 -15
  274. package/ccw/src/templates/dashboard-js/views/hook-manager.js +311 -43
  275. package/ccw/src/templates/dashboard-js/views/lite-tasks.js +204 -28
  276. package/ccw/src/templates/dashboard-js/views/mcp-manager.js +2187 -411
  277. package/ccw/src/templates/dashboard-js/views/mcp-manager.js.backup +1729 -0
  278. package/ccw/src/templates/dashboard-js/views/mcp-manager.js.new +928 -0
  279. package/ccw/src/templates/dashboard-js/views/memory.js +1221 -0
  280. package/ccw/src/templates/dashboard-js/views/prompt-history.js +713 -0
  281. package/ccw/src/templates/dashboard-js/views/rules-manager.js +828 -0
  282. package/ccw/src/templates/dashboard-js/views/session-detail.js +54 -53
  283. package/ccw/src/templates/dashboard-js/views/skills-manager.js +819 -0
  284. package/ccw/src/templates/dashboard.html +185 -85
  285. package/ccw/src/templates/hooks-config-example.json +60 -0
  286. package/ccw/src/tools/classify-folders.ts +245 -0
  287. package/ccw/src/tools/cli-config-manager.ts +268 -0
  288. package/ccw/src/tools/cli-executor.ts +2014 -0
  289. package/ccw/src/tools/cli-history-store.ts +1195 -0
  290. package/ccw/src/tools/codex-lens.ts +1141 -0
  291. package/ccw/src/tools/{convert-tokens-to-css.js → convert-tokens-to-css.ts} +73 -23
  292. package/ccw/src/tools/core-memory.ts +444 -0
  293. package/ccw/src/tools/detect-changed-modules.ts +325 -0
  294. package/ccw/src/tools/{discover-design-files.js → discover-design-files.ts} +74 -24
  295. package/ccw/src/tools/edit-file.ts +568 -0
  296. package/ccw/src/tools/{generate-module-docs.js → generate-module-docs.ts} +207 -185
  297. package/ccw/src/tools/{get-modules-by-depth.js → get-modules-by-depth.ts} +120 -79
  298. package/ccw/src/tools/index.ts +370 -0
  299. package/ccw/src/tools/native-session-discovery.ts +795 -0
  300. package/ccw/src/tools/notifier.ts +129 -0
  301. package/ccw/src/tools/read-file.ts +410 -0
  302. package/ccw/src/tools/resume-strategy.ts +345 -0
  303. package/ccw/src/tools/session-content-parser.ts +619 -0
  304. package/ccw/src/tools/session-manager.ts +1026 -0
  305. package/ccw/src/tools/smart-context.ts +228 -0
  306. package/ccw/src/tools/smart-search.ts +2065 -0
  307. package/ccw/src/tools/smart-search.ts.backup +1233 -0
  308. package/ccw/src/tools/storage-manager.ts +455 -0
  309. package/ccw/src/tools/write-file.ts +222 -0
  310. package/ccw/src/types/config.ts +11 -0
  311. package/ccw/src/types/index.ts +3 -0
  312. package/ccw/src/types/session.ts +25 -0
  313. package/ccw/src/types/tool.ts +41 -0
  314. package/ccw/src/utils/{browser-launcher.js → browser-launcher.ts} +10 -8
  315. package/ccw/src/utils/file-utils.ts +48 -0
  316. package/ccw/src/utils/{path-resolver.js → path-resolver.ts} +114 -78
  317. package/ccw/src/utils/path-validator.ts +153 -0
  318. package/ccw/src/utils/{ui.js → ui.ts} +32 -25
  319. package/codex-lens/pyproject.toml +48 -0
  320. package/codex-lens/src/codexlens/.workflow/.cli-history/history.db +0 -0
  321. package/codex-lens/src/codexlens/__init__.py +28 -0
  322. package/codex-lens/src/codexlens/__main__.py +14 -0
  323. package/codex-lens/src/codexlens/__pycache__/__init__.cpython-313.pyc +0 -0
  324. package/codex-lens/src/codexlens/__pycache__/__main__.cpython-313.pyc +0 -0
  325. package/codex-lens/src/codexlens/__pycache__/config.cpython-313.pyc +0 -0
  326. package/codex-lens/src/codexlens/__pycache__/entities.cpython-313.pyc +0 -0
  327. package/codex-lens/src/codexlens/__pycache__/errors.cpython-313.pyc +0 -0
  328. package/codex-lens/src/codexlens/cli/__init__.py +27 -0
  329. package/codex-lens/src/codexlens/cli/__pycache__/__init__.cpython-313.pyc +0 -0
  330. package/codex-lens/src/codexlens/cli/__pycache__/commands.cpython-313.pyc +0 -0
  331. package/codex-lens/src/codexlens/cli/__pycache__/embedding_manager.cpython-313.pyc +0 -0
  332. package/codex-lens/src/codexlens/cli/__pycache__/model_manager.cpython-313.pyc +0 -0
  333. package/codex-lens/src/codexlens/cli/__pycache__/output.cpython-313.pyc +0 -0
  334. package/codex-lens/src/codexlens/cli/commands.py +1931 -0
  335. package/codex-lens/src/codexlens/cli/embedding_manager.py +620 -0
  336. package/codex-lens/src/codexlens/cli/model_manager.py +289 -0
  337. package/codex-lens/src/codexlens/cli/output.py +124 -0
  338. package/codex-lens/src/codexlens/config.py +201 -0
  339. package/codex-lens/src/codexlens/entities.py +121 -0
  340. package/codex-lens/src/codexlens/errors.py +55 -0
  341. package/codex-lens/src/codexlens/indexing/README.md +77 -0
  342. package/codex-lens/src/codexlens/indexing/__init__.py +4 -0
  343. package/codex-lens/src/codexlens/indexing/__pycache__/__init__.cpython-313.pyc +0 -0
  344. package/codex-lens/src/codexlens/indexing/__pycache__/symbol_extractor.cpython-313.pyc +0 -0
  345. package/codex-lens/src/codexlens/indexing/symbol_extractor.py +243 -0
  346. package/codex-lens/src/codexlens/parsers/__init__.py +8 -0
  347. package/codex-lens/src/codexlens/parsers/__pycache__/__init__.cpython-313.pyc +0 -0
  348. package/codex-lens/src/codexlens/parsers/__pycache__/encoding.cpython-313.pyc +0 -0
  349. package/codex-lens/src/codexlens/parsers/__pycache__/factory.cpython-313.pyc +0 -0
  350. package/codex-lens/src/codexlens/parsers/__pycache__/tokenizer.cpython-313.pyc +0 -0
  351. package/codex-lens/src/codexlens/parsers/__pycache__/treesitter_parser.cpython-313.pyc +0 -0
  352. package/codex-lens/src/codexlens/parsers/encoding.py +202 -0
  353. package/codex-lens/src/codexlens/parsers/factory.py +256 -0
  354. package/codex-lens/src/codexlens/parsers/tokenizer.py +98 -0
  355. package/codex-lens/src/codexlens/parsers/treesitter_parser.py +335 -0
  356. package/codex-lens/src/codexlens/search/__init__.py +15 -0
  357. package/codex-lens/src/codexlens/search/__pycache__/__init__.cpython-313.pyc +0 -0
  358. package/codex-lens/src/codexlens/search/__pycache__/chain_search.cpython-313.pyc +0 -0
  359. package/codex-lens/src/codexlens/search/__pycache__/enrichment.cpython-313.pyc +0 -0
  360. package/codex-lens/src/codexlens/search/__pycache__/hybrid_search.cpython-313.pyc +0 -0
  361. package/codex-lens/src/codexlens/search/__pycache__/query_parser.cpython-313.pyc +0 -0
  362. package/codex-lens/src/codexlens/search/__pycache__/ranking.cpython-313.pyc +0 -0
  363. package/codex-lens/src/codexlens/search/chain_search.py +647 -0
  364. package/codex-lens/src/codexlens/search/enrichment.py +150 -0
  365. package/codex-lens/src/codexlens/search/hybrid_search.py +313 -0
  366. package/codex-lens/src/codexlens/search/query_parser.py +242 -0
  367. package/codex-lens/src/codexlens/search/ranking.py +274 -0
  368. package/codex-lens/src/codexlens/semantic/__init__.py +39 -0
  369. package/codex-lens/src/codexlens/semantic/__pycache__/__init__.cpython-313.pyc +0 -0
  370. package/codex-lens/src/codexlens/semantic/__pycache__/ann_index.cpython-313.pyc +0 -0
  371. package/codex-lens/src/codexlens/semantic/__pycache__/chunker.cpython-313.pyc +0 -0
  372. package/codex-lens/src/codexlens/semantic/__pycache__/code_extractor.cpython-313.pyc +0 -0
  373. package/codex-lens/src/codexlens/semantic/__pycache__/embedder.cpython-313.pyc +0 -0
  374. package/codex-lens/src/codexlens/semantic/__pycache__/graph_analyzer.cpython-313.pyc +0 -0
  375. package/codex-lens/src/codexlens/semantic/__pycache__/llm_enhancer.cpython-313.pyc +0 -0
  376. package/codex-lens/src/codexlens/semantic/__pycache__/vector_store.cpython-313.pyc +0 -0
  377. package/codex-lens/src/codexlens/semantic/ann_index.py +414 -0
  378. package/codex-lens/src/codexlens/semantic/chunker.py +448 -0
  379. package/codex-lens/src/codexlens/semantic/code_extractor.py +274 -0
  380. package/codex-lens/src/codexlens/semantic/embedder.py +185 -0
  381. package/codex-lens/src/codexlens/semantic/vector_store.py +955 -0
  382. package/codex-lens/src/codexlens/storage/__init__.py +29 -0
  383. package/codex-lens/src/codexlens/storage/__pycache__/__init__.cpython-313.pyc +0 -0
  384. package/codex-lens/src/codexlens/storage/__pycache__/dir_index.cpython-313.pyc +0 -0
  385. package/codex-lens/src/codexlens/storage/__pycache__/file_cache.cpython-313.pyc +0 -0
  386. package/codex-lens/src/codexlens/storage/__pycache__/index_tree.cpython-313.pyc +0 -0
  387. package/codex-lens/src/codexlens/storage/__pycache__/migration_manager.cpython-313.pyc +0 -0
  388. package/codex-lens/src/codexlens/storage/__pycache__/path_mapper.cpython-313.pyc +0 -0
  389. package/codex-lens/src/codexlens/storage/__pycache__/registry.cpython-313.pyc +0 -0
  390. package/codex-lens/src/codexlens/storage/__pycache__/sqlite_store.cpython-313.pyc +0 -0
  391. package/codex-lens/src/codexlens/storage/__pycache__/sqlite_utils.cpython-313.pyc +0 -0
  392. package/codex-lens/src/codexlens/storage/dir_index.py +1850 -0
  393. package/codex-lens/src/codexlens/storage/file_cache.py +32 -0
  394. package/codex-lens/src/codexlens/storage/index_tree.py +776 -0
  395. package/codex-lens/src/codexlens/storage/migration_manager.py +154 -0
  396. package/codex-lens/src/codexlens/storage/migrations/__init__.py +1 -0
  397. package/codex-lens/src/codexlens/storage/migrations/__pycache__/__init__.cpython-313.pyc +0 -0
  398. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_001_normalize_keywords.cpython-313.pyc +0 -0
  399. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_002_add_token_metadata.cpython-313.pyc +0 -0
  400. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_003_code_relationships.cpython-313.pyc +0 -0
  401. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_004_dual_fts.cpython-313.pyc +0 -0
  402. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_005_cleanup_unused_fields.cpython-313.pyc +0 -0
  403. package/codex-lens/src/codexlens/storage/migrations/migration_001_normalize_keywords.py +123 -0
  404. package/codex-lens/src/codexlens/storage/migrations/migration_002_add_token_metadata.py +48 -0
  405. package/codex-lens/src/codexlens/storage/migrations/migration_004_dual_fts.py +232 -0
  406. package/codex-lens/src/codexlens/storage/migrations/migration_005_cleanup_unused_fields.py +196 -0
  407. package/codex-lens/src/codexlens/storage/path_mapper.py +274 -0
  408. package/codex-lens/src/codexlens/storage/registry.py +670 -0
  409. package/codex-lens/src/codexlens/storage/sqlite_store.py +576 -0
  410. package/codex-lens/src/codexlens/storage/sqlite_utils.py +64 -0
  411. package/package.json +4 -1
  412. package/.claude/commands/memory/tech-research.md +0 -477
  413. package/.claude/scripts/classify-folders.sh +0 -39
  414. package/.claude/scripts/convert_tokens_to_css.sh +0 -229
  415. package/.claude/scripts/detect_changed_modules.sh +0 -161
  416. package/.claude/scripts/discover-design-files.sh +0 -87
  417. package/.claude/scripts/extract-animations.js +0 -243
  418. package/.claude/scripts/extract-computed-styles.js +0 -118
  419. package/.claude/scripts/extract-layout-structure.js +0 -411
  420. package/.claude/scripts/generate_module_docs.sh +0 -717
  421. package/.claude/scripts/get_modules_by_depth.sh +0 -170
  422. package/.claude/scripts/ui-generate-preview.sh +0 -395
  423. package/.claude/scripts/ui-instantiate-prototypes.sh +0 -815
  424. package/.claude/scripts/update_module_claude.sh +0 -337
  425. package/.claude/workflows/context-search-strategy.md +0 -77
  426. package/.claude/workflows/intelligent-tools-strategy.md +0 -662
  427. package/ccw/src/cli.js +0 -119
  428. package/ccw/src/commands/install.js +0 -324
  429. package/ccw/src/commands/tool.js +0 -138
  430. package/ccw/src/core/data-aggregator.js +0 -409
  431. package/ccw/src/core/server.js +0 -2063
  432. package/ccw/src/core/session-scanner.js +0 -235
  433. package/ccw/src/tools/classify-folders.js +0 -204
  434. package/ccw/src/tools/detect-changed-modules.js +0 -288
  435. package/ccw/src/tools/edit-file.js +0 -266
  436. package/ccw/src/tools/index.js +0 -176
  437. package/ccw/src/utils/file-utils.js +0 -48
@@ -1,662 +0,0 @@
1
- # Intelligent Tools Selection Strategy
2
-
3
- ## 📋 Table of Contents
4
- 1. [Quick Start](#-quick-start)
5
- 2. [Tool Specifications](#-tool-specifications)
6
- 3. [Command Templates](#-command-templates)
7
- 4. [Execution Configuration](#-execution-configuration)
8
- 5. [Best Practices](#-best-practices)
9
-
10
- ---
11
-
12
- ## ⚡ Quick Start
13
-
14
- ### Universal Prompt Template
15
-
16
- All CLI tools (Gemini, Qwen, Codex) share this template structure:
17
-
18
- ```
19
- PURPOSE: [objective + why + success criteria]
20
- TASK: • [step 1] • [step 2] • [step 3]
21
- MODE: [analysis|write|auto]
22
- CONTEXT: @**/* | Memory: [session/tech/module context]
23
- EXPECTED: [format + quality + structure]
24
- RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt) | [constraints] | MODE=[permission level]
25
- ```
26
-
27
- ### Tool Selection
28
-
29
- - **Analysis/Documentation** → Gemini (preferred) or Qwen (fallback)
30
- - **Implementation/Testing** → Codex
31
-
32
- ### Quick Command Syntax
33
-
34
- ```bash
35
- # Gemini/Qwen
36
- cd [dir] && gemini -p "[prompt]" [--approval-mode yolo]
37
-
38
- # Codex
39
- codex -C [dir] --full-auto exec "[prompt]" [--skip-git-repo-check -s danger-full-access]
40
- ```
41
-
42
- ### Model Selection
43
-
44
- **Available Models** (user selects via `-m` after prompt):
45
- - Gemini: `gemini-2.5-pro`, `gemini-2.5-flash`
46
- - Qwen: `coder-model`, `vision-model`
47
- - Codex: `gpt-5.1`, `gpt-5.1-codex`, `gpt-5.1-codex-mini`
48
-
49
- **Usage**: `-m <model>` placed AFTER `-p "prompt"` (e.g., `gemini -p "..." -m gemini-2.5-flash`)
50
-
51
- ### Quick Decision Matrix
52
-
53
- | Scenario | Tool | MODE | Template |
54
- |----------|------|------|----------|
55
- | Execution Tracing | Gemini → Qwen | analysis | `analysis/01-trace-code-execution.txt` |
56
- | Bug Diagnosis | Gemini → Qwen | analysis | `analysis/01-diagnose-bug-root-cause.txt` |
57
- | Architecture Planning | Gemini → Qwen | analysis | `planning/01-plan-architecture-design.txt` |
58
- | Code Pattern Analysis | Gemini → Qwen | analysis | `analysis/02-analyze-code-patterns.txt` |
59
- | Architecture Review | Gemini → Qwen | analysis | `analysis/02-review-architecture.txt` |
60
- | Document Analysis | Gemini → Qwen | analysis | `analysis/02-analyze-technical-document.txt` |
61
- | Feature Implementation | Codex | auto | `development/02-implement-feature.txt` |
62
- | Component Development | Codex | auto | `development/02-implement-component-ui.txt` |
63
- | Test Generation | Codex | write | `development/02-generate-tests.txt` |
64
-
65
- ### Core Principles
66
-
67
- - **Use tools early and often** - Tools are faster and more thorough
68
- - **When in doubt, use both** - Parallel usage provides comprehensive coverage
69
- - **Default to tools** - Use for most coding tasks, no matter how small
70
- - **Minimize context noise** - Use `cd` + `--include-directories` to focus on relevant files
71
- - **⚠️ Choose templates by need** - Select templates based on task requirements:
72
- - `00-*` for universal fallback when no specific template matches
73
- - `01-*` for general exploratory/diagnostic work
74
- - `02-*` for common implementation/analysis tasks
75
- - `03-*` for specialized domains
76
- - **⚠️ Always specify templates** - Include appropriate template in RULES field via `$(cat ~/.claude/workflows/cli-templates/prompts/.../...txt)`
77
- - **⚠️ Universal templates as fallback** - Use universal templates when no specific template matches your needs:
78
- - `universal/00-universal-rigorous-style.txt` for precision-critical tasks
79
- - `universal/00-universal-creative-style.txt` for exploratory/innovative tasks
80
- - **⚠️ Write protection** - Require EXPLICIT MODE=write or MODE=auto specification
81
-
82
- ---
83
-
84
- ## 🎯 Tool Specifications
85
-
86
- ### MODE Options
87
-
88
- **analysis** (default for Gemini/Qwen)
89
- - Read-only operations, no file modifications
90
- - Analysis output returned as text response
91
- - Use for: code review, architecture analysis, pattern discovery
92
- - Permission: Default, no special parameters needed
93
-
94
- **write** (Gemini/Qwen/Codex)
95
- - File creation/modification/deletion allowed
96
- - Requires explicit MODE=write specification
97
- - Use for: documentation generation, code creation, file modifications
98
- - Permission:
99
- - Gemini/Qwen: `--approval-mode yolo`
100
- - Codex: `--skip-git-repo-check -s danger-full-access`
101
-
102
- **auto** (Codex only)
103
- - Full autonomous development operations
104
- - Requires explicit MODE=auto specification
105
- - Use for: feature implementation, bug fixes, autonomous development
106
- - Permission: `--skip-git-repo-check -s danger-full-access`
107
-
108
- ### Gemini & Qwen
109
-
110
- **Commands**: `gemini` (primary) | `qwen` (fallback)
111
-
112
- **Strengths**: Large context window, pattern recognition
113
-
114
- **Best For**: Analysis, documentation generation, code exploration, architecture review
115
-
116
- **Default MODE**: `analysis` (read-only)
117
-
118
- **Priority**: Prefer Gemini; use Qwen as fallback when Gemini unavailable
119
-
120
- **Error Handling**:
121
- - **HTTP 429**: May show error but still return results - check if results exist (results present = success, no results = retry/fallback to Qwen)
122
-
123
- ### Codex
124
-
125
- **Command**: `codex --full-auto exec`
126
-
127
- **Strengths**: Autonomous development, mathematical reasoning
128
-
129
- **Best For**: Implementation, testing, automation
130
-
131
- **Default MODE**: No default, must be explicitly specified
132
-
133
- **Session Management**:
134
- - `codex resume` - Resume previous session (picker)
135
- - `codex resume --last` - Resume most recent session
136
- - `codex -i <image_file>` - Attach image to prompt
137
-
138
- **Multi-task Pattern**:
139
- - **First task**: MUST use full Standard Prompt Template with `exec` to establish complete context
140
- - **Subsequent tasks**: Can use brief prompt with `exec "..." resume --last` (inherits context from session)
141
-
142
- **Prompt Requirements**:
143
- - **Without `resume --last`**: ALWAYS use full Standard Prompt Template
144
- - **With `resume --last`**: Brief description sufficient (previous template context inherited)
145
-
146
- **Auto-Resume Rules**:
147
- - **Use `resume --last`**: Related tasks, extending previous work, multi-step workflow
148
- - **Don't use**: First task, new independent work, different module
149
-
150
- ---
151
-
152
- ## 🎯 Command Templates
153
-
154
- ### Universal Template Structure
155
-
156
- Every command MUST follow this structure:
157
-
158
- - [ ] **PURPOSE** - Clear goal and intent
159
- - State the high-level objective of this execution
160
- - Explain why this task is needed
161
- - Define success criteria
162
- - Example: "Analyze authentication module to identify security vulnerabilities"
163
-
164
- - [ ] **TASK** - Specific execution task (use list format: • Task item 1 • Task item 2 • Task item 3)
165
- - Break down PURPOSE into concrete, actionable steps
166
- - Use bullet points (•) for multiple sub-tasks
167
- - Order tasks by execution sequence
168
- - Example: "• Review auth implementation patterns • Identify potential security risks • Document findings with recommendations"
169
-
170
- - [ ] **MODE** - Execution mode and permission level
171
- - `analysis` (default): Read-only operations, no file modifications
172
- - `write`: File creation/modification/deletion allowed (requires explicit specification)
173
- - `auto`: Full autonomous development operations (Codex only, requires explicit specification)
174
- - Example: "MODE: analysis" or "MODE: write"
175
-
176
- - [ ] **CONTEXT** - File references and memory context from previous sessions
177
- - **File Patterns**: Use @ syntax for file references (default: `@**/*` for all files)
178
- - `@**/*` - All files in current directory tree
179
- - `@src/**/*.ts` - TypeScript files in src directory
180
- - `@../shared/**/*` - Files from sibling directory (requires `--include-directories`)
181
- - **Memory Context**: Reference previous session findings and context
182
- - Related tasks: `Building on previous analysis from [session/commit]`
183
- - Tech stack: `Using patterns from [tech-stack-name] documentation`
184
- - Cross-reference: `Related to implementation in [module/file]`
185
- - **Memory Sources**: Include relevant memory sources
186
- - Documentation: `CLAUDE.md`, module-specific docs
187
- - Example: "CONTEXT: @src/auth/**/* @CLAUDE.md | Memory: Building on previous auth refactoring (commit abc123)"
188
-
189
- - [ ] **EXPECTED** - Clear expected results
190
- - Specify deliverable format (report, code, documentation, list)
191
- - Define quality criteria
192
- - State output structure requirements
193
- - Example: "Comprehensive security report with categorized findings, risk levels, and actionable recommendations"
194
-
195
- - [ ] **RULES** - Template reference and constraints (include mode constraints: analysis=READ-ONLY | write=CREATE/MODIFY/DELETE | auto=FULL operations)
196
- - Reference templates: `$(cat ~/.claude/workflows/cli-templates/prompts/[category]/[template].txt)`
197
- - Specify constraints and boundaries
198
- - Include mode-specific constraints:
199
- - `analysis=READ-ONLY` - No file modifications
200
- - `write=CREATE/MODIFY/DELETE` - File operations allowed
201
- - `auto=FULL operations` - Autonomous development
202
- - Example: "$(cat ~/.claude/workflows/cli-templates/prompts/analysis/security.txt) | Focus on authentication flows only | analysis=READ-ONLY"
203
-
204
- ### Standard Prompt Template
205
-
206
- ```
207
- PURPOSE: [clear goal - state objective, why needed, success criteria]
208
- TASK:
209
- • [specific task - actionable step 1]
210
- • [specific task - actionable step 2]
211
- • [specific task - actionable step 3]
212
- MODE: [analysis|write|auto]
213
- CONTEXT: @**/* | Memory: [previous session findings, related implementations, tech stack patterns, workflow context]
214
- EXPECTED: [deliverable format, quality criteria, output structure, testing requirements (if applicable)]
215
- RULES: $(cat ~/.claude/workflows/cli-templates/prompts/[category]/[0X-template-name].txt) | [additional constraints] | [MODE]=[READ-ONLY|CREATE/MODIFY/DELETE|FULL operations]
216
- ```
217
-
218
- **Template Selection Guide**:
219
- - Choose template based on your specific task, not by sequence number
220
- - `01-*` templates: General-purpose, broad applicability
221
- - `02-*` templates: Common specialized scenarios
222
- - `03-*` templates: Domain-specific needs
223
-
224
- ### Tool-Specific Configuration
225
-
226
- Use the **[Standard Prompt Template](#standard-prompt-template)** for all tools. This section only covers tool-specific command syntax.
227
-
228
- #### Gemini & Qwen
229
-
230
- **Command Format**: `cd [directory] && [tool] -p "[Standard Prompt Template]" [options]`
231
-
232
- **Syntax Elements**:
233
- - **Directory**: `cd [directory] &&` (navigate to target directory)
234
- - **Tool**: `gemini` (primary) | `qwen` (fallback)
235
- - **Prompt**: `-p "[Standard Prompt Template]"` (prompt BEFORE options)
236
- - **Model**: `-m [model-name]` (optional, NOT recommended - tools auto-select best model)
237
- - Gemini: `gemini-2.5-pro` (default) | `gemini-2.5-flash`
238
- - Qwen: `coder-model` (default) | `vision-model`
239
- - **Best practice**: Omit `-m` parameter for optimal model selection
240
- - **Position**: If used, place AFTER `-p "prompt"`
241
- - **Write Permission**: `--approval-mode yolo` (ONLY for MODE=write, placed AFTER prompt)
242
-
243
- **Command Examples**:
244
- ```bash
245
- # Analysis Mode (default, read-only)
246
- cd [directory] && gemini -p "[Standard Prompt Template]"
247
-
248
- # Write Mode (requires MODE=write in template + --approval-mode yolo)
249
- cd [directory] && gemini -p "[Standard Prompt Template with MODE: write]" --approval-mode yolo
250
-
251
- # Fallback to Qwen
252
- cd [directory] && qwen -p "[Standard Prompt Template]"
253
-
254
- # Multi-directory support
255
- cd [directory] && gemini -p "[Standard Prompt Template]" --include-directories ../shared,../types
256
- ```
257
-
258
- #### Codex
259
-
260
- **Command Format**: `codex -C [directory] --full-auto exec "[Standard Prompt Template]" [options]`
261
-
262
- **Syntax Elements**:
263
- - **Directory**: `-C [directory]` (target directory parameter)
264
- - **Execution Mode**: `--full-auto exec` (required for autonomous execution)
265
- - **Prompt**: `exec "[Standard Prompt Template]"` (prompt BEFORE options)
266
- - **Model**: `-m [model-name]` (optional, NOT recommended - Codex auto-selects best model)
267
- - Available: `gpt-5.1` | `gpt-5.1-codex` | `gpt-5.1-codex-mini`
268
- - **Best practice**: Omit `-m` parameter for optimal model selection
269
- - **Write Permission**: `--skip-git-repo-check -s danger-full-access`
270
- - **⚠️ CRITICAL**: MUST be placed at **command END** (AFTER prompt and all other parameters)
271
- - **ONLY use for**: MODE=auto or MODE=write
272
- - **NEVER place before prompt** - command will fail
273
- - **Session Resume**: `resume --last` (placed AFTER prompt, BEFORE permission flags)
274
-
275
- **Command Examples**:
276
- ```bash
277
- # Auto Mode (requires MODE=auto in template + permission flags)
278
- codex -C [directory] --full-auto exec "[Standard Prompt Template with MODE: auto]" --skip-git-repo-check -s danger-full-access
279
-
280
- # Write Mode (requires MODE=write in template + permission flags)
281
- codex -C [directory] --full-auto exec "[Standard Prompt Template with MODE: write]" --skip-git-repo-check -s danger-full-access
282
-
283
- # Session continuity
284
- # First task - MUST use full Standard Prompt Template to establish context
285
- codex -C project --full-auto exec "[Standard Prompt Template with MODE: auto]" --skip-git-repo-check -s danger-full-access
286
-
287
- # Subsequent tasks - Can use brief prompt ONLY when using 'resume --last'
288
- # (inherits full context from previous session, no need to repeat template)
289
- codex --full-auto exec "Add JWT refresh token validation" resume --last --skip-git-repo-check -s danger-full-access
290
-
291
- # With image attachment
292
- codex -C [directory] -i design.png --full-auto exec "[Standard Prompt Template]" --skip-git-repo-check -s danger-full-access
293
- ```
294
-
295
- **Complete Example (Codex with full template)**:
296
- ```bash
297
- # First task - establish session with full template
298
- codex -C project --full-auto exec "
299
- PURPOSE: Implement authentication module
300
- TASK: • Create auth service • Add user validation • Setup JWT tokens
301
- MODE: auto
302
- CONTEXT: @**/* | Memory: Following security patterns from project standards
303
- EXPECTED: Complete auth module with tests
304
- RULES: $(cat ~/.claude/workflows/cli-templates/prompts/development/02-implement-feature.txt) | Follow existing patterns | auto=FULL operations
305
- " --skip-git-repo-check -s danger-full-access
306
-
307
- # Subsequent tasks - brief description with resume
308
- codex --full-auto exec "Add JWT refresh token validation" resume --last --skip-git-repo-check -s danger-full-access
309
- ```
310
-
311
- ### Directory Context Configuration
312
-
313
- **Tool Directory Navigation**:
314
- - **Gemini & Qwen**: `cd path/to/project && gemini -p "prompt"`
315
- - **Codex**: `codex -C path/to/project --full-auto exec "task"`
316
- - **Path types**: Supports both relative (`../project`) and absolute (`/full/path`)
317
-
318
- #### Critical Directory Scope Rules
319
-
320
- **Once `cd` to a directory**:
321
- - @ references ONLY apply to current directory and subdirectories
322
- - `@**/*` = All files within current directory tree
323
- - `@*.ts` = TypeScript files in current directory tree
324
- - `@src/**/*` = Files within src subdirectory
325
- - CANNOT reference parent/sibling directories via @ alone
326
-
327
- **To reference files outside current directory (TWO-STEP REQUIREMENT)**:
328
- 1. Add `--include-directories` parameter to make external directories ACCESSIBLE
329
- 2. Explicitly reference external files in CONTEXT field with @ patterns
330
- 3. ⚠️ BOTH steps are MANDATORY
331
-
332
- Example: `cd src/auth && gemini -p "CONTEXT: @**/* @../shared/**/*" --include-directories ../shared`
333
-
334
- **Rule**: If CONTEXT contains `@../dir/**/*`, command MUST include `--include-directories ../dir`
335
-
336
- #### Multi-Directory Support (Gemini & Qwen)
337
-
338
- **Parameter**: `--include-directories <dir1,dir2,...>`
339
- - Includes additional directories beyond current `cd` directory
340
- - Can be specified multiple times or comma-separated
341
- - Maximum 5 directories
342
- - REQUIRED when working in subdirectory but needing parent/sibling context
343
-
344
- **Syntax**:
345
- ```bash
346
- # Comma-separated format
347
- gemini -p "prompt" --include-directories /path/to/project1,/path/to/project2
348
-
349
- # Multiple flags format
350
- gemini -p "prompt" --include-directories /path/to/project1 --include-directories /path/to/project2
351
-
352
- # Recommended: cd + --include-directories
353
- cd src/auth && gemini -p "
354
- PURPOSE: Analyze authentication with shared utilities context
355
- TASK: Review auth implementation and its dependencies
356
- MODE: analysis
357
- CONTEXT: @**/* @../shared/**/* @../types/**/*
358
- EXPECTED: Complete analysis with cross-directory dependencies
359
- RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/02-analyze-code-patterns.txt) | Focus on integration patterns | analysis=READ-ONLY
360
- " --include-directories ../shared,../types
361
- ```
362
-
363
- **Best Practices**:
364
- - Use `cd` to navigate to primary focus directory
365
- - Use `--include-directories` for additional context
366
- - ⚠️ CONTEXT must explicitly list external files AND command must include `--include-directories`
367
- - Pattern matching rule: `@../dir/**/*` in CONTEXT → `--include-directories ../dir` in command (MANDATORY)
368
-
369
- ### CONTEXT Field Configuration
370
-
371
- CONTEXT field consists of: **File Patterns** + **Memory Context**
372
-
373
- #### File Pattern Reference
374
-
375
- **Default**: `@**/*` (all files - use as default for comprehensive context)
376
-
377
- **Common Patterns**:
378
- - Source files: `@src/**/*`
379
- - TypeScript: `@*.ts @*.tsx`
380
- - With docs: `@CLAUDE.md @**/*CLAUDE.md`
381
- - Tests: `@src/**/*.test.*`
382
-
383
- #### Memory Context Integration
384
-
385
- **Purpose**: Leverage previous session findings, related implementations, and established patterns to provide continuity
386
-
387
- **Format**: `CONTEXT: [file patterns] | Memory: [memory context]`
388
-
389
- **Memory Sources**:
390
-
391
- 1. **Related Tasks** - Cross-task context
392
- - Previous refactoring, task extensions, conflict resolution
393
-
394
- 2. **Tech Stack Patterns** - Framework and library conventions
395
- - React hooks patterns, TypeScript utilities, security guidelines
396
-
397
- 3. **Cross-Module References** - Inter-module dependencies
398
- - Integration points, shared utilities, type dependencies
399
-
400
- **Memory Context Examples**:
401
-
402
- ```bash
403
- # Example 1: Building on related task
404
- CONTEXT: @src/auth/**/* @CLAUDE.md | Memory: Building on previous auth refactoring (commit abc123), implementing refresh token mechanism following React hooks patterns
405
-
406
- # Example 2: Cross-module integration
407
- CONTEXT: @src/payment/**/* @src/shared/types/**/* | Memory: Integration with auth module from previous implementation, using shared error handling patterns from @shared/utils/errors.ts
408
- ```
409
-
410
- **Best Practices**:
411
- - **Always include memory context** when building on previous work
412
- - **Reference commits/tasks**: Use commit hashes or task IDs for traceability
413
- - **Document dependencies** with explicit file references
414
- - **Cross-reference implementations** with file paths
415
- - **Use consistent format**: `CONTEXT: [file patterns] | Memory: [memory context]`
416
-
417
- #### Complex Pattern Discovery
418
-
419
- For complex file pattern requirements, use semantic discovery BEFORE CLI execution:
420
-
421
- **Tools**:
422
- - `rg (ripgrep)` - Content-based file discovery with regex
423
- - `mcp__code-index__search_code_advanced` - Semantic file search
424
-
425
- **Workflow**: Discover → Extract precise paths → Build CONTEXT field
426
-
427
- **Example**:
428
- ```bash
429
- # Step 1: Discover files semantically
430
- rg "export.*Component" --files-with-matches --type ts
431
- mcp__code-index__search_code_advanced(pattern="interface.*Props", file_pattern="*.tsx")
432
-
433
- # Step 2: Build precise CONTEXT with file patterns + memory
434
- CONTEXT: @src/components/Auth.tsx @src/types/auth.d.ts @src/hooks/useAuth.ts | Memory: Previous refactoring identified type inconsistencies, following React hooks patterns
435
-
436
- # Step 3: Execute CLI with precise references
437
- cd src && gemini -p "
438
- PURPOSE: Analyze authentication components for type safety improvements
439
- TASK:
440
- • Review auth component patterns and props interfaces
441
- • Identify type inconsistencies in auth components
442
- • Recommend improvements following React best practices
443
- MODE: analysis
444
- CONTEXT: @components/Auth.tsx @types/auth.d.ts @hooks/useAuth.ts | Memory: Previous refactoring identified type inconsistencies, following React hooks patterns, related implementation in @hooks/useAuth.ts (commit abc123)
445
- EXPECTED: Comprehensive analysis report with type safety recommendations, code examples, and references to previous findings
446
- RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/02-analyze-code-patterns.txt) | Focus on type safety and component composition | analysis=READ-ONLY
447
- "
448
- ```
449
-
450
- ### RULES Field Configuration
451
-
452
- **Basic Format**: `RULES: $(cat ~/.claude/workflows/cli-templates/prompts/[category]/[template].txt) | [constraints]`
453
-
454
- **⚠️ Command Substitution Rules**:
455
- - **Template reference only, never read**: Use `$(cat ...)` directly, do NOT read template content first
456
- - **NEVER use escape characters**: `\$`, `\"`, `\'` will break command substitution
457
- - **In prompt context**: Path needs NO quotes (tilde expands correctly)
458
- - **Correct**: `RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/01-trace-code-execution.txt)`
459
- - **WRONG**: `RULES: \$(cat ...)` or `RULES: $(cat \"...\")`
460
- - **Why**: Shell executes `$(...)` in subshell where path is safe
461
-
462
- **Examples**:
463
- - Universal rigorous: `$(cat ~/.claude/workflows/cli-templates/prompts/universal/00-universal-rigorous-style.txt) | Critical production refactoring`
464
- - Universal creative: `$(cat ~/.claude/workflows/cli-templates/prompts/universal/00-universal-creative-style.txt) | Explore alternative architecture approaches`
465
- - General template: `$(cat ~/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt) | Focus on authentication module`
466
- - Specialized template: `$(cat ~/.claude/workflows/cli-templates/prompts/analysis/02-analyze-code-patterns.txt) | React hooks only`
467
- - Multiple: `$(cat template1.txt) $(cat template2.txt) | Enterprise standards`
468
- - No template: `Focus on security patterns, include dependency analysis`
469
-
470
- ### Template System
471
-
472
- **Base**: `~/.claude/workflows/cli-templates/`
473
-
474
- **Naming Convention**:
475
- - `00-*` - **Universal fallback templates** (use when no specific template matches)
476
- - `01-*` - Universal, high-frequency templates
477
- - `02-*` - Common specialized templates
478
- - `03-*` - Domain-specific, less frequent templates
479
-
480
- **Note**: Number prefix indicates category and frequency, not required usage order. Choose based on task needs.
481
-
482
- **Universal Templates (Fallback)**:
483
-
484
- When no specific template matches your task requirements, use one of these universal templates based on the desired execution style:
485
-
486
- 1. **Rigorous Style** (`universal/00-universal-rigorous-style.txt`)
487
- - **Use for**: Precision-critical tasks requiring systematic methodology
488
- - **Characteristics**:
489
- - Strict adherence to standards and specifications
490
- - Comprehensive validation and edge case handling
491
- - Defensive programming and error prevention
492
- - Full documentation and traceability
493
- - **Best for**: Production code, critical systems, refactoring, compliance tasks
494
- - **Thinking mode**: Systematic, methodical, standards-driven
495
-
496
- 2. **Creative Style** (`universal/00-universal-creative-style.txt`)
497
- - **Use for**: Exploratory tasks requiring innovative solutions
498
- - **Characteristics**:
499
- - Multi-perspective problem exploration
500
- - Pattern synthesis from different domains
501
- - Alternative approach generation
502
- - Elegant simplicity pursuit
503
- - **Best for**: New feature design, architecture exploration, optimization, problem-solving
504
- - **Thinking mode**: Exploratory, synthesis-driven, innovation-focused
505
-
506
- **Selection Guide**:
507
- - **Rigorous**: When correctness, reliability, and compliance are paramount
508
- - **Creative**: When innovation, flexibility, and elegant solutions are needed
509
- - **Specific template**: When task matches predefined category (analysis, development, planning, etc.)
510
-
511
- **Available Templates**:
512
- ```
513
- prompts/
514
- ├── universal/ # ← Universal fallback templates
515
- │ ├── 00-universal-rigorous-style.txt # Precision & standards-driven
516
- │ └── 00-universal-creative-style.txt # Innovation & exploration-focused
517
- ├── analysis/
518
- │ ├── 01-trace-code-execution.txt
519
- │ ├── 01-diagnose-bug-root-cause.txt
520
- │ ├── 02-analyze-code-patterns.txt
521
- │ ├── 02-analyze-technical-document.txt
522
- │ ├── 02-review-architecture.txt
523
- │ ├── 02-review-code-quality.txt
524
- │ ├── 03-analyze-performance.txt
525
- │ ├── 03-assess-security-risks.txt
526
- │ └── 03-review-quality-standards.txt
527
- ├── development/
528
- │ ├── 02-implement-feature.txt
529
- │ ├── 02-refactor-codebase.txt
530
- │ ├── 02-generate-tests.txt
531
- │ ├── 02-implement-component-ui.txt
532
- │ └── 03-debug-runtime-issues.txt
533
- └── planning/
534
- ├── 01-plan-architecture-design.txt
535
- ├── 02-breakdown-task-steps.txt
536
- ├── 02-design-component-spec.txt
537
- ├── 03-evaluate-concept-feasibility.txt
538
- └── 03-plan-migration-strategy.txt
539
- ```
540
-
541
- **Task-Template Matrix**:
542
-
543
- | Task Type | Tool | Template |
544
- |-----------|------|----------|
545
- | **Universal Fallbacks** | | |
546
- | Precision-Critical Tasks | Gemini/Qwen/Codex | `universal/00-universal-rigorous-style.txt` |
547
- | Exploratory/Innovative Tasks | Gemini/Qwen/Codex | `universal/00-universal-creative-style.txt` |
548
- | **Analysis Tasks** | | |
549
- | Execution Tracing | Gemini (Qwen fallback) | `analysis/01-trace-code-execution.txt` |
550
- | Bug Diagnosis | Gemini (Qwen fallback) | `analysis/01-diagnose-bug-root-cause.txt` |
551
- | Code Pattern Analysis | Gemini (Qwen fallback) | `analysis/02-analyze-code-patterns.txt` |
552
- | Document Analysis | Gemini (Qwen fallback) | `analysis/02-analyze-technical-document.txt` |
553
- | Architecture Review | Gemini (Qwen fallback) | `analysis/02-review-architecture.txt` |
554
- | Code Review | Gemini (Qwen fallback) | `analysis/02-review-code-quality.txt` |
555
- | Performance Analysis | Gemini (Qwen fallback) | `analysis/03-analyze-performance.txt` |
556
- | Security Assessment | Gemini (Qwen fallback) | `analysis/03-assess-security-risks.txt` |
557
- | Quality Standards | Gemini (Qwen fallback) | `analysis/03-review-quality-standards.txt` |
558
- | **Planning Tasks** | | |
559
- | Architecture Planning | Gemini (Qwen fallback) | `planning/01-plan-architecture-design.txt` |
560
- | Task Breakdown | Gemini (Qwen fallback) | `planning/02-breakdown-task-steps.txt` |
561
- | Component Design | Gemini (Qwen fallback) | `planning/02-design-component-spec.txt` |
562
- | Concept Evaluation | Gemini (Qwen fallback) | `planning/03-evaluate-concept-feasibility.txt` |
563
- | Migration Planning | Gemini (Qwen fallback) | `planning/03-plan-migration-strategy.txt` |
564
- | **Development Tasks** | | |
565
- | Feature Development | Codex | `development/02-implement-feature.txt` |
566
- | Refactoring | Codex | `development/02-refactor-codebase.txt` |
567
- | Test Generation | Codex | `development/02-generate-tests.txt` |
568
- | Component Implementation | Codex | `development/02-implement-component-ui.txt` |
569
- | Debugging | Codex | `development/03-debug-runtime-issues.txt` |
570
-
571
- ---
572
-
573
- ## ⚙️ Execution Configuration
574
-
575
- ### Dynamic Timeout Allocation
576
-
577
- **Minimum timeout: 5 minutes (300000ms)** - Never set below this threshold.
578
-
579
- **Timeout Ranges**:
580
- - **Simple** (analysis, search): 5-10min (300000-600000ms)
581
- - **Medium** (refactoring, documentation): 10-20min (600000-1200000ms)
582
- - **Complex** (implementation, migration): 20-60min (1200000-3600000ms)
583
- - **Heavy** (large codebase, multi-file): 60-120min (3600000-7200000ms)
584
-
585
- **Codex Multiplier**: 3x of allocated time (minimum 15min / 900000ms)
586
-
587
- **Application**: All bash() wrapped commands including Gemini, Qwen and Codex executions
588
-
589
- **Auto-detection**: Analyze PURPOSE and TASK fields to determine timeout
590
-
591
- ### Permission Framework
592
-
593
- **⚠️ Single-Use Explicit Authorization**: Each CLI execution requires explicit user command instruction - one command authorizes ONE execution only. Analysis does NOT authorize write operations. Previous authorization does NOT carry over. Each operation needs NEW explicit user directive.
594
-
595
- **Mode Hierarchy**:
596
- - **analysis** (default): Read-only, safe for auto-execution
597
- - **write**: Requires explicit MODE=write specification
598
- - **auto**: Requires explicit MODE=auto specification
599
- - **Exception**: User provides clear instructions like "modify", "create", "implement"
600
-
601
- **Tool-Specific Permissions**:
602
- - **Gemini/Qwen**: Use `--approval-mode yolo` ONLY when MODE=write (placed AFTER prompt)
603
- - **Codex**: Use `--skip-git-repo-check -s danger-full-access` ONLY when MODE=auto or MODE=write (placed at command END)
604
- - **Default**: All tools default to analysis/read-only mode
605
-
606
- ---
607
-
608
- ## 🔧 Best Practices
609
-
610
- ### Workflow Principles
611
-
612
- - **Start with templates** - Use predefined templates for consistency
613
- - **Be specific** - Clear PURPOSE, TASK, and EXPECTED fields with detailed descriptions
614
- - **Include constraints** - File patterns, scope, requirements in RULES
615
- - **Leverage memory context** - ALWAYS include Memory field when building on previous work
616
- - Cross-reference tasks with file paths and commit hashes
617
- - Document dependencies with explicit file references
618
- - Reference related implementations and patterns
619
- - **Discover patterns first** - Use rg/MCP for complex file discovery before CLI execution
620
- - **Build precise CONTEXT** - Convert discovery to explicit file references with memory
621
- - Format: `CONTEXT: [file patterns] | Memory: [memory context]`
622
- - File patterns: `@**/*` (default) or specific patterns
623
- - Memory: Previous sessions, tech stack patterns, cross-references
624
- - **Document context** - Always reference CLAUDE.md and relevant documentation
625
- - **Default to full context** - Use `@**/*` unless specific files needed
626
- - **⚠️ No escape characters** - NEVER use `\$`, `\"`, `\'` in CLI commands
627
-
628
- ### Context Optimization Strategy
629
-
630
- **Directory Navigation**: Use `cd [directory] &&` pattern to reduce irrelevant context
631
-
632
- **When to change directory**:
633
- - Specific directory mentioned → Use `cd directory &&`
634
- - Focused analysis needed → Target specific directory
635
- - Multi-directory scope → Use `cd` + `--include-directories`
636
-
637
- **When to use `--include-directories`**:
638
- - Working in subdirectory but need parent/sibling context
639
- - Cross-directory dependency analysis required
640
- - Multiple related modules need simultaneous access
641
- - **Key benefit**: Excludes unrelated directories, reduces token usage
642
-
643
- ### Workflow Integration
644
-
645
- When planning any coding task, **ALWAYS** integrate CLI tools:
646
-
647
- 1. **Understanding Phase**: Use Gemini for analysis (Qwen as fallback)
648
- 2. **Architecture Phase**: Use Gemini for design and analysis (Qwen as fallback)
649
- 3. **Implementation Phase**: Use Codex for development
650
- 4. **Quality Phase**: Use Codex for testing and validation
651
-
652
- ### Planning Checklist
653
-
654
- For every development task:
655
- - [ ] **Purpose defined** - Clear goal and intent
656
- - [ ] **Mode selected** - Execution mode and permission level determined
657
- - [ ] **Context gathered** - File references and session memory documented (default `@**/*`)
658
- - [ ] **Directory navigation** - Determine if `cd` or `cd + --include-directories` needed
659
- - [ ] **Gemini analysis** completed for understanding
660
- - [ ] **Template applied** - Use Standard Prompt Template (universal for all tools)
661
- - [ ] **Constraints specified** - File patterns, scope, requirements
662
- - [ ] **Implementation approach** - Tool selection and workflow