@codemieai/code 0.0.33 → 0.0.35

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 (294) hide show
  1. package/README.md +78 -7
  2. package/bin/codemie-claude-acp.js +21 -0
  3. package/bin/codemie-opencode.js +11 -0
  4. package/bin/codemie.js +13 -0
  5. package/dist/agents/codemie-code/agent.d.ts +38 -4
  6. package/dist/agents/codemie-code/agent.d.ts.map +1 -1
  7. package/dist/agents/codemie-code/agent.js +333 -178
  8. package/dist/agents/codemie-code/agent.js.map +1 -1
  9. package/dist/agents/codemie-code/index.d.ts +2 -1
  10. package/dist/agents/codemie-code/index.d.ts.map +1 -1
  11. package/dist/agents/codemie-code/index.js +36 -7
  12. package/dist/agents/codemie-code/index.js.map +1 -1
  13. package/dist/agents/codemie-code/prompts.d.ts +12 -5
  14. package/dist/agents/codemie-code/prompts.d.ts.map +1 -1
  15. package/dist/agents/codemie-code/prompts.js +53 -6
  16. package/dist/agents/codemie-code/prompts.js.map +1 -1
  17. package/dist/agents/codemie-code/toolMetadata.d.ts.map +1 -1
  18. package/dist/agents/codemie-code/toolMetadata.js +9 -8
  19. package/dist/agents/codemie-code/toolMetadata.js.map +1 -1
  20. package/dist/agents/codemie-code/tools/assistant-invocation.d.ts +47 -0
  21. package/dist/agents/codemie-code/tools/assistant-invocation.d.ts.map +1 -0
  22. package/dist/agents/codemie-code/tools/assistant-invocation.js +129 -0
  23. package/dist/agents/codemie-code/tools/assistant-invocation.js.map +1 -0
  24. package/dist/agents/codemie-code/tools/index.d.ts +70 -4
  25. package/dist/agents/codemie-code/tools/index.d.ts.map +1 -1
  26. package/dist/agents/codemie-code/tools/index.js +57 -44
  27. package/dist/agents/codemie-code/tools/index.js.map +1 -1
  28. package/dist/agents/codemie-code/tools/planning.d.ts +6 -5
  29. package/dist/agents/codemie-code/tools/planning.d.ts.map +1 -1
  30. package/dist/agents/codemie-code/tools/planning.js +12 -10
  31. package/dist/agents/codemie-code/tools/planning.js.map +1 -1
  32. package/dist/agents/codemie-code/types.d.ts +27 -3
  33. package/dist/agents/codemie-code/types.d.ts.map +1 -1
  34. package/dist/agents/codemie-code/types.js +24 -0
  35. package/dist/agents/codemie-code/types.js.map +1 -1
  36. package/dist/agents/codemie-code/ui/autocomplete.d.ts +98 -0
  37. package/dist/agents/codemie-code/ui/autocomplete.d.ts.map +1 -0
  38. package/dist/agents/codemie-code/ui/autocomplete.js +145 -0
  39. package/dist/agents/codemie-code/ui/autocomplete.js.map +1 -0
  40. package/dist/agents/codemie-code/ui/keyHandlers.d.ts +112 -0
  41. package/dist/agents/codemie-code/ui/keyHandlers.d.ts.map +1 -0
  42. package/dist/agents/codemie-code/ui/keyHandlers.js +415 -0
  43. package/dist/agents/codemie-code/ui/keyHandlers.js.map +1 -0
  44. package/dist/agents/codemie-code/ui/mentions.d.ts +86 -0
  45. package/dist/agents/codemie-code/ui/mentions.d.ts.map +1 -0
  46. package/dist/agents/codemie-code/ui/mentions.js +122 -0
  47. package/dist/agents/codemie-code/ui/mentions.js.map +1 -0
  48. package/dist/agents/codemie-code/ui/terminalCodes.d.ts +38 -0
  49. package/dist/agents/codemie-code/ui/terminalCodes.d.ts.map +1 -0
  50. package/dist/agents/codemie-code/ui/terminalCodes.js +42 -0
  51. package/dist/agents/codemie-code/ui/terminalCodes.js.map +1 -0
  52. package/dist/agents/codemie-code/ui/todoPanel.d.ts.map +1 -1
  53. package/dist/agents/codemie-code/ui/todoPanel.js +3 -4
  54. package/dist/agents/codemie-code/ui/todoPanel.js.map +1 -1
  55. package/dist/agents/codemie-code/ui.d.ts +8 -7
  56. package/dist/agents/codemie-code/ui.d.ts.map +1 -1
  57. package/dist/agents/codemie-code/ui.js +87 -145
  58. package/dist/agents/codemie-code/ui.js.map +1 -1
  59. package/dist/agents/core/AgentCLI.d.ts +5 -0
  60. package/dist/agents/core/AgentCLI.d.ts.map +1 -1
  61. package/dist/agents/core/AgentCLI.js +25 -1
  62. package/dist/agents/core/AgentCLI.js.map +1 -1
  63. package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
  64. package/dist/agents/core/BaseAgentAdapter.js +90 -27
  65. package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
  66. package/dist/agents/core/extension/BaseExtensionInstaller.d.ts +7 -1
  67. package/dist/agents/core/extension/BaseExtensionInstaller.d.ts.map +1 -1
  68. package/dist/agents/core/extension/BaseExtensionInstaller.js +58 -15
  69. package/dist/agents/core/extension/BaseExtensionInstaller.js.map +1 -1
  70. package/dist/agents/core/session/BaseSessionAdapter.d.ts +25 -0
  71. package/dist/agents/core/session/BaseSessionAdapter.d.ts.map +1 -1
  72. package/dist/agents/core/session/discovery-types.d.ts +53 -0
  73. package/dist/agents/core/session/discovery-types.d.ts.map +1 -0
  74. package/dist/agents/core/session/discovery-types.js +8 -0
  75. package/dist/agents/core/session/discovery-types.js.map +1 -0
  76. package/dist/agents/core/types.d.ts +62 -0
  77. package/dist/agents/core/types.d.ts.map +1 -1
  78. package/dist/agents/plugins/claude/claude-acp.plugin.d.ts +27 -0
  79. package/dist/agents/plugins/claude/claude-acp.plugin.d.ts.map +1 -0
  80. package/dist/agents/plugins/claude/claude-acp.plugin.js +63 -0
  81. package/dist/agents/plugins/claude/claude-acp.plugin.js.map +1 -0
  82. package/dist/agents/plugins/claude/claude-message-types.d.ts +1 -0
  83. package/dist/agents/plugins/claude/claude-message-types.d.ts.map +1 -1
  84. package/dist/agents/plugins/claude/claude.plugin.d.ts +44 -1
  85. package/dist/agents/plugins/claude/claude.plugin.d.ts.map +1 -1
  86. package/dist/agents/plugins/claude/claude.plugin.js +263 -12
  87. package/dist/agents/plugins/claude/claude.plugin.js.map +1 -1
  88. package/dist/agents/plugins/claude/claude.session.d.ts.map +1 -1
  89. package/dist/agents/plugins/claude/claude.session.js +14 -7
  90. package/dist/agents/plugins/claude/claude.session.js.map +1 -1
  91. package/dist/agents/plugins/claude/plugin/.claude-plugin/plugin.json +1 -1
  92. package/dist/agents/plugins/claude/plugin/README.md +40 -2
  93. package/dist/agents/plugins/claude/plugin/claude-templates/README.md +5 -5
  94. package/dist/agents/plugins/claude/plugin/claude-templates/templates/CLAUDE.md.template +177 -436
  95. package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/code-review-agent-template.md.template +49 -82
  96. package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/refactor-cleaner-agent.md.template +337 -0
  97. package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/solution-architect-agent.md.template +129 -419
  98. package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/unit-tester-agent.md.template +146 -693
  99. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/api/api-patterns.md.template +110 -138
  100. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/architecture.md.template +197 -0
  101. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/data/database-patterns.md.template +171 -91
  102. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/development/development-practices.md.template +219 -131
  103. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/security/security-practices.md.template +223 -98
  104. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/standards/code-quality.md.template +131 -95
  105. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/testing/testing-patterns.md.template +247 -75
  106. package/dist/agents/plugins/claude/plugin/commands/README.md +133 -0
  107. package/dist/agents/plugins/claude/plugin/commands/codemie-init.md +336 -544
  108. package/dist/agents/plugins/claude/plugin/commands/codemie-subagents.md +233 -504
  109. package/dist/agents/plugins/claude/plugin/commands/memory-add.md +311 -30
  110. package/dist/agents/plugins/claude/plugin/commands/memory-refresh.md +218 -39
  111. package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.d.ts.map +1 -1
  112. package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js +43 -8
  113. package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js.map +1 -1
  114. package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.d.ts.map +1 -1
  115. package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js +68 -40
  116. package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js.map +1 -1
  117. package/dist/agents/plugins/gemini/gemini.plugin.d.ts.map +1 -1
  118. package/dist/agents/plugins/gemini/gemini.plugin.js +0 -3
  119. package/dist/agents/plugins/gemini/gemini.plugin.js.map +1 -1
  120. package/dist/agents/plugins/opencode/index.d.ts +8 -0
  121. package/dist/agents/plugins/opencode/index.d.ts.map +1 -0
  122. package/dist/agents/plugins/opencode/index.js +12 -0
  123. package/dist/agents/plugins/opencode/index.js.map +1 -0
  124. package/dist/agents/plugins/opencode/opencode-message-types.d.ts +207 -0
  125. package/dist/agents/plugins/opencode/opencode-message-types.d.ts.map +1 -0
  126. package/dist/agents/plugins/opencode/opencode-message-types.js +59 -0
  127. package/dist/agents/plugins/opencode/opencode-message-types.js.map +1 -0
  128. package/dist/agents/plugins/opencode/opencode-model-configs.d.ts +65 -0
  129. package/dist/agents/plugins/opencode/opencode-model-configs.d.ts.map +1 -0
  130. package/dist/agents/plugins/opencode/opencode-model-configs.js +184 -0
  131. package/dist/agents/plugins/opencode/opencode-model-configs.js.map +1 -0
  132. package/dist/agents/plugins/opencode/opencode.paths.d.ts +62 -0
  133. package/dist/agents/plugins/opencode/opencode.paths.d.ts.map +1 -0
  134. package/dist/agents/plugins/opencode/opencode.paths.js +148 -0
  135. package/dist/agents/plugins/opencode/opencode.paths.js.map +1 -0
  136. package/dist/agents/plugins/opencode/opencode.plugin.d.ts +35 -0
  137. package/dist/agents/plugins/opencode/opencode.plugin.d.ts.map +1 -0
  138. package/dist/agents/plugins/opencode/opencode.plugin.js +338 -0
  139. package/dist/agents/plugins/opencode/opencode.plugin.js.map +1 -0
  140. package/dist/agents/plugins/opencode/opencode.session.d.ts +77 -0
  141. package/dist/agents/plugins/opencode/opencode.session.d.ts.map +1 -0
  142. package/dist/agents/plugins/opencode/opencode.session.js +424 -0
  143. package/dist/agents/plugins/opencode/opencode.session.js.map +1 -0
  144. package/dist/agents/plugins/opencode/opencode.storage-utils.d.ts +25 -0
  145. package/dist/agents/plugins/opencode/opencode.storage-utils.d.ts.map +1 -0
  146. package/dist/agents/plugins/opencode/opencode.storage-utils.js +96 -0
  147. package/dist/agents/plugins/opencode/opencode.storage-utils.js.map +1 -0
  148. package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.d.ts +30 -0
  149. package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.d.ts.map +1 -0
  150. package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.js +116 -0
  151. package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.js.map +1 -0
  152. package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.d.ts +102 -0
  153. package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.d.ts.map +1 -0
  154. package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.js +584 -0
  155. package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.js.map +1 -0
  156. package/dist/agents/registry.d.ts +1 -1
  157. package/dist/agents/registry.d.ts.map +1 -1
  158. package/dist/agents/registry.js +5 -1
  159. package/dist/agents/registry.js.map +1 -1
  160. package/dist/cli/commands/assistants/chat.d.ts +11 -0
  161. package/dist/cli/commands/assistants/chat.d.ts.map +1 -0
  162. package/dist/cli/commands/assistants/chat.js +201 -0
  163. package/dist/cli/commands/assistants/chat.js.map +1 -0
  164. package/dist/cli/commands/assistants/constants.d.ts +81 -0
  165. package/dist/cli/commands/assistants/constants.d.ts.map +1 -0
  166. package/dist/cli/commands/assistants/constants.js +75 -0
  167. package/dist/cli/commands/assistants/constants.js.map +1 -0
  168. package/dist/cli/commands/assistants/generators/claude-agent-generator.d.ts +26 -0
  169. package/dist/cli/commands/assistants/generators/claude-agent-generator.d.ts.map +1 -0
  170. package/dist/cli/commands/assistants/generators/claude-agent-generator.js +115 -0
  171. package/dist/cli/commands/assistants/generators/claude-agent-generator.js.map +1 -0
  172. package/dist/cli/commands/assistants/index.d.ts +11 -0
  173. package/dist/cli/commands/assistants/index.d.ts.map +1 -0
  174. package/dist/cli/commands/assistants/index.js +28 -0
  175. package/dist/cli/commands/assistants/index.js.map +1 -0
  176. package/dist/cli/commands/assistants/list.d.ts +11 -0
  177. package/dist/cli/commands/assistants/list.d.ts.map +1 -0
  178. package/dist/cli/commands/assistants/list.js +323 -0
  179. package/dist/cli/commands/assistants/list.js.map +1 -0
  180. package/dist/cli/commands/doctor/checks/AgentsCheck.d.ts +5 -0
  181. package/dist/cli/commands/doctor/checks/AgentsCheck.d.ts.map +1 -1
  182. package/dist/cli/commands/doctor/checks/AgentsCheck.js +29 -0
  183. package/dist/cli/commands/doctor/checks/AgentsCheck.js.map +1 -1
  184. package/dist/cli/commands/install.d.ts.map +1 -1
  185. package/dist/cli/commands/install.js +104 -13
  186. package/dist/cli/commands/install.js.map +1 -1
  187. package/dist/cli/commands/opencode-metrics.d.ts +13 -0
  188. package/dist/cli/commands/opencode-metrics.d.ts.map +1 -0
  189. package/dist/cli/commands/opencode-metrics.js +200 -0
  190. package/dist/cli/commands/opencode-metrics.js.map +1 -0
  191. package/dist/cli/commands/self-update.d.ts +3 -0
  192. package/dist/cli/commands/self-update.d.ts.map +1 -0
  193. package/dist/cli/commands/self-update.js +55 -0
  194. package/dist/cli/commands/self-update.js.map +1 -0
  195. package/dist/cli/commands/setup.d.ts.map +1 -1
  196. package/dist/cli/commands/setup.js +113 -0
  197. package/dist/cli/commands/setup.js.map +1 -1
  198. package/dist/cli/commands/skill.d.ts +6 -0
  199. package/dist/cli/commands/skill.d.ts.map +1 -0
  200. package/dist/cli/commands/skill.js +196 -0
  201. package/dist/cli/commands/skill.js.map +1 -0
  202. package/dist/cli/commands/update.d.ts.map +1 -1
  203. package/dist/cli/commands/update.js +34 -6
  204. package/dist/cli/commands/update.js.map +1 -1
  205. package/dist/cli/index.d.ts.map +1 -1
  206. package/dist/cli/index.js +12 -4
  207. package/dist/cli/index.js.map +1 -1
  208. package/dist/env/types.d.ts +13 -0
  209. package/dist/env/types.d.ts.map +1 -1
  210. package/dist/env/types.js +1 -1
  211. package/dist/env/types.js.map +1 -1
  212. package/dist/migrations/003-remove-hooks-node.migration.d.ts +22 -0
  213. package/dist/migrations/003-remove-hooks-node.migration.d.ts.map +1 -0
  214. package/dist/migrations/003-remove-hooks-node.migration.js +103 -0
  215. package/dist/migrations/003-remove-hooks-node.migration.js.map +1 -0
  216. package/dist/migrations/index.d.ts +1 -0
  217. package/dist/migrations/index.d.ts.map +1 -1
  218. package/dist/migrations/index.js +1 -1
  219. package/dist/migrations/index.js.map +1 -1
  220. package/dist/providers/plugins/sso/sso.http-client.js +2 -2
  221. package/dist/providers/plugins/sso/sso.http-client.js.map +1 -1
  222. package/dist/providers/plugins/sso/sso.setup-steps.d.ts.map +1 -1
  223. package/dist/providers/plugins/sso/sso.setup-steps.js +14 -10
  224. package/dist/providers/plugins/sso/sso.setup-steps.js.map +1 -1
  225. package/dist/skills/core/SkillDiscovery.d.ts +83 -0
  226. package/dist/skills/core/SkillDiscovery.d.ts.map +1 -0
  227. package/dist/skills/core/SkillDiscovery.js +237 -0
  228. package/dist/skills/core/SkillDiscovery.js.map +1 -0
  229. package/dist/skills/core/SkillManager.d.ts +86 -0
  230. package/dist/skills/core/SkillManager.d.ts.map +1 -0
  231. package/dist/skills/core/SkillManager.js +155 -0
  232. package/dist/skills/core/SkillManager.js.map +1 -0
  233. package/dist/skills/core/types.d.ts +120 -0
  234. package/dist/skills/core/types.d.ts.map +1 -0
  235. package/dist/skills/core/types.js +20 -0
  236. package/dist/skills/core/types.js.map +1 -0
  237. package/dist/skills/index.d.ts +12 -0
  238. package/dist/skills/index.d.ts.map +1 -0
  239. package/dist/skills/index.js +12 -0
  240. package/dist/skills/index.js.map +1 -0
  241. package/dist/skills/utils/content-loader.d.ts +25 -0
  242. package/dist/skills/utils/content-loader.d.ts.map +1 -0
  243. package/dist/skills/utils/content-loader.js +161 -0
  244. package/dist/skills/utils/content-loader.js.map +1 -0
  245. package/dist/skills/utils/frontmatter.d.ts +60 -0
  246. package/dist/skills/utils/frontmatter.d.ts.map +1 -0
  247. package/dist/skills/utils/frontmatter.js +114 -0
  248. package/dist/skills/utils/frontmatter.js.map +1 -0
  249. package/dist/skills/utils/pattern-matcher.d.ts +60 -0
  250. package/dist/skills/utils/pattern-matcher.d.ts.map +1 -0
  251. package/dist/skills/utils/pattern-matcher.js +97 -0
  252. package/dist/skills/utils/pattern-matcher.js.map +1 -0
  253. package/dist/utils/auth.d.ts +22 -0
  254. package/dist/utils/auth.d.ts.map +1 -0
  255. package/dist/utils/auth.js +50 -0
  256. package/dist/utils/auth.js.map +1 -0
  257. package/dist/utils/cli-updater.d.ts +70 -0
  258. package/dist/utils/cli-updater.d.ts.map +1 -0
  259. package/dist/utils/cli-updater.js +339 -0
  260. package/dist/utils/cli-updater.js.map +1 -0
  261. package/dist/utils/config.d.ts +6 -1
  262. package/dist/utils/config.d.ts.map +1 -1
  263. package/dist/utils/config.js +13 -0
  264. package/dist/utils/config.js.map +1 -1
  265. package/dist/utils/installation-detector.d.ts +22 -0
  266. package/dist/utils/installation-detector.d.ts.map +1 -0
  267. package/dist/utils/installation-detector.js +49 -0
  268. package/dist/utils/installation-detector.js.map +1 -0
  269. package/dist/utils/native-installer.d.ts +49 -0
  270. package/dist/utils/native-installer.d.ts.map +1 -0
  271. package/dist/utils/native-installer.js +225 -0
  272. package/dist/utils/native-installer.js.map +1 -0
  273. package/dist/utils/processes.js +1 -1
  274. package/dist/utils/profile.d.ts +2 -0
  275. package/dist/utils/profile.d.ts.map +1 -1
  276. package/dist/utils/profile.js +5 -0
  277. package/dist/utils/profile.js.map +1 -1
  278. package/dist/utils/sdk-client.d.ts +15 -0
  279. package/dist/utils/sdk-client.d.ts.map +1 -0
  280. package/dist/utils/sdk-client.js +92 -0
  281. package/dist/utils/sdk-client.js.map +1 -0
  282. package/dist/utils/version-utils.d.ts +50 -0
  283. package/dist/utils/version-utils.d.ts.map +1 -0
  284. package/dist/utils/version-utils.js +92 -0
  285. package/dist/utils/version-utils.js.map +1 -0
  286. package/package.json +11 -3
  287. package/scripts/copy-mr-skill-to-global.ts +252 -0
  288. package/scripts/demo-hooks.sh +125 -0
  289. package/scripts/test-hooks.sh +196 -0
  290. package/dist/agents/plugins/claude/plugin/claude-templates/templates/INDEX.md +0 -205
  291. package/dist/agents/plugins/claude/plugin/claude-templates/templates/TEMPLATE_SIZES.md +0 -74
  292. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/layered-architecture.md.template +0 -143
  293. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/project-structure.md.template +0 -127
  294. package/dist/agents/plugins/claude/plugin/commands/codemie-pr.md +0 -25
@@ -370,97 +370,64 @@ Adapt your review to align with these established project patterns.
370
370
 
371
371
  ---
372
372
 
373
- ## Quick Reference Checklist for [PROJECT_NAME] Reviews
374
-
375
- **[INSTRUCTIONS FOR GENERATION]**: Customize this checklist based on the 10 pattern categories identified above. Each category should have 2-5 concrete checks.
376
-
377
- ### [CATEGORY_1: e.g., Database & Data Access]
378
- - [ ] [CHECK_1]
379
- - [ ] [CHECK_2]
380
- - [ ] [CHECK_3]
381
- - [ ] [CHECK_4]
382
-
383
- ### [CATEGORY_2: e.g., Type Safety & Structure]
384
- - [ ] [CHECK_1]
385
- - [ ] [CHECK_2]
386
- - [ ] [CHECK_3]
387
- - [ ] [CHECK_4]
388
-
389
- ### [CATEGORY_3: e.g., Error Handling & Logging]
390
- - [ ] [CHECK_1]
391
- - [ ] [CHECK_2]
392
- - [ ] [CHECK_3]
393
- - [ ] [CHECK_4]
394
-
395
- ### [CATEGORY_4: e.g., Architecture & Patterns]
396
- - [ ] [CHECK_1]
397
- - [ ] [CHECK_2]
398
- - [ ] [CHECK_3]
399
- - [ ] [CHECK_4]
400
-
401
- ### [CATEGORY_5: e.g., Async & Performance]
402
- - [ ] [CHECK_1]
403
- - [ ] [CHECK_2]
404
- - [ ] [CHECK_3]
405
- - [ ] [CHECK_4]
406
-
407
- ### [CATEGORY_6: e.g., Security & Best Practices]
408
- - [ ] [CHECK_1]
409
- - [ ] [CHECK_2]
410
- - [ ] [CHECK_3]
411
- - [ ] [CHECK_4]
373
+ ## Quick Reference Checklist
374
+
375
+ **[GENERATION INSTRUCTION]**: Create checklist items matching the pattern categories above.
376
+
377
+ ### Security
378
+ - [ ] No hardcoded secrets/credentials
379
+ - [ ] Input validation on all external data
380
+ - [ ] Parameterized queries (no string concatenation)
381
+ - [ ] Proper authentication/authorization checks
382
+
383
+ ### Performance
384
+ - [ ] No N+1 query patterns
385
+ - [ ] Pagination for large datasets
386
+ - [ ] No blocking calls in async context
387
+ - [ ] Appropriate data structures
388
+
389
+ ### Code Quality
390
+ - [ ] Functions under complexity threshold
391
+ - [ ] No significant duplication
392
+ - [ ] Proper error handling
393
+ - [ ] Type safety maintained
394
+
395
+ ### [PROJECT_NAME] Patterns
396
+ - [ ] [PROJECT_SPECIFIC_CHECK_1]
397
+ - [ ] [PROJECT_SPECIFIC_CHECK_2]
398
+ - [ ] [PROJECT_SPECIFIC_CHECK_3]
399
+ - [ ] [PROJECT_SPECIFIC_CHECK_4]
412
400
 
413
401
  ---
414
402
 
415
- ## When to Escalate
403
+ ## Edge Cases
416
404
 
417
- - If changes span >[PROJECT_THRESHOLD] files, suggest breaking into smaller reviewable chunks
418
- - If architectural concerns arise, recommend discussing with [APPROPRIATE_ROLE]
419
- - If you're uncertain about project-specific conventions, ask for clarification
420
- - If critical security issues are found, emphasize immediate remediation
405
+ **Large diffs (>30 files)**: Ask user to prioritize or focus on high-risk files first.
406
+ **No changes detected**: Prompt user to specify commit SHA, branch comparison, or stage changes.
407
+ **Binary/generated files**: Skip and note: "Skipped N binary/generated files (*.min.js, dist/*, etc.)"
408
+ **Uncertain about conventions**: Ask for clarification rather than assuming.
421
409
 
422
- ## Final Reminders
410
+ ---
411
+
412
+ ## Review Principles
423
413
 
424
- - Focus on Git-tracked changes only (unless explicitly asked otherwise)
425
- - Every critical/major issue MUST have an actionable example
426
- - Balance thoroughness with practicality—don't nitpick minor style issues
427
- - Apply [PROJECT_NAME]-specific best practices from the checklist above
428
- - Your goal is to improve code quality while respecting the developer's time and effort
429
- - Always end with encouragement and acknowledgment of good practices observed
414
+ 1. **Be Constructive** - Frame as learning opportunities
415
+ 2. **Be Specific** - Always include file paths and line numbers
416
+ 3. **Prioritize** - Critical/major first; don't overwhelm with minor issues
417
+ 4. **Explain Why** - Help developers understand the reasoning
418
+ 5. **Provide Solutions** - Every issue needs an actionable fix example
419
+ 6. **Acknowledge Good Work** - Note well-written code and good practices
430
420
 
431
421
  ---
432
422
 
433
- ## Generation Instructions Summary
423
+ ## Generation Instructions
434
424
 
435
425
  **For LLM generating project-specific agent from this template:**
436
426
 
437
- 1. **Read project documentation** (README, CONTRIBUTING, ARCHITECTURE, etc.)
438
- 2. **Analyze static analysis configs** (ESLint, Pylint, SonarQube, etc.)
439
- 3. **Study codebase patterns**:
440
- - Identify top 10 most critical pattern categories
441
- - Find good and bad examples for each
442
- - Extract common anti-patterns
443
- - Document established conventions
444
- 4. **Extract project metadata**:
445
- - Primary language(s) and versions
446
- - Frameworks and their versions
447
- - Architectural style
448
- - Testing approach
449
- - Exception/error handling patterns
450
- - Logging approach
451
- 5. **Populate placeholders**:
452
- - Replace [ALL_CAPS_PLACEHOLDERS] with project-specific values
453
- - Generate concrete code examples in project's style
454
- - Customize thresholds based on project standards
455
- 6. **Validate completeness**:
456
- - All pattern categories have examples
457
- - Quick reference checklist matches pattern categories
458
- - Examples use project's actual language/framework syntax
459
- - Security and performance patterns are project-relevant
460
-
461
- **Key Sections to Customize**:
462
- - Project-Specific Context Awareness
463
- - Special Detection Rules
464
- - [PROJECT_NAME]-Specific Best Practices (MOST IMPORTANT)
465
- - Quick Reference Checklist
466
- - Example Code Review Format (use project's language)
427
+ 1. **Discover project metadata**: Read package.json/pyproject.toml/go.mod etc.
428
+ 2. **Read documentation**: README, CONTRIBUTING, ARCHITECTURE files
429
+ 3. **Extract linting rules**: Parse .eslintrc, pylintrc, ruff.toml etc.
430
+ 4. **Sample codebase**: Identify 5-8 critical pattern categories with examples
431
+ 5. **Populate placeholders**: Replace all [PLACEHOLDERS] with project values
432
+ 6. **Generate examples**: Use project's actual language and framework syntax
433
+ 7. **Validate**: Ensure all pattern categories have working code examples
@@ -0,0 +1,337 @@
1
+ ---
2
+ name: refactor-cleaner
3
+ description: |-
4
+ Use this agent for dead code cleanup, duplicate elimination, and dependency pruning.
5
+ Triggers: "clean up code", "remove dead code", "find unused", "remove duplicates", "prune dependencies", "refactor cleanup".
6
+ Runs analysis tools to identify unused code and safely removes it with full documentation.
7
+ tools: Read, Write, Edit, Bash, Grep, Glob
8
+ model: inherit
9
+ color: orange
10
+ ---
11
+
12
+ # Refactor & Dead Code Cleaner Template
13
+
14
+ **Purpose**: This template guides generation of project-specific refactoring agents that safely identify and remove dead code, duplicates, and unused dependencies.
15
+
16
+ ---
17
+
18
+ ## Core Mission
19
+
20
+ Keep the codebase lean and maintainable by:
21
+ - Detecting and removing unused code, exports, and files
22
+ - Eliminating duplicate code through consolidation
23
+ - Pruning unused dependencies
24
+ - Documenting all changes for traceability
25
+ - **Never breaking functionality**
26
+
27
+ ---
28
+
29
+ ## Context Discovery
30
+
31
+ **[GENERATION INSTRUCTION]**: Analyze project to identify:
32
+ - `.codemie/guides/` folder (if exists) for cleanup guidelines
33
+ - Available analysis tools (from package.json, Makefile, or installed globally)
34
+ - Critical code paths that must never be removed
35
+ - Project structure and module organization
36
+ - Test commands and build verification
37
+
38
+ ---
39
+
40
+ ## Analysis Tools
41
+
42
+ **[GENERATION INSTRUCTION]**: Identify which tools are available in the project. Common options by ecosystem:
43
+
44
+ | Ecosystem | Dead Code | Unused Deps | Unused Exports |
45
+ |-----------|-----------|-------------|----------------|
46
+ | JavaScript/TypeScript | knip, ts-prune | depcheck, knip | ts-prune, knip |
47
+ | Python | vulture, dead | pip-autoremove | pylint |
48
+ | Java | UCDetector, SpotBugs | mvn dependency:analyze | — |
49
+ | Go | deadcode, unused | go mod tidy | — |
50
+
51
+ **[TEMPLATE]**:
52
+ ```bash
53
+ # Primary analysis tool
54
+ [PRIMARY_TOOL_COMMAND]
55
+
56
+ # Unused dependencies
57
+ [UNUSED_DEPS_COMMAND]
58
+
59
+ # Unused exports/functions
60
+ [UNUSED_EXPORTS_COMMAND]
61
+
62
+ # Additional checks
63
+ [ADDITIONAL_CHECKS]
64
+ ```
65
+
66
+ ---
67
+
68
+ ## Workflow
69
+
70
+ ### Phase 1: Analysis
71
+
72
+ 1. Run detection tools
73
+ 2. Collect and categorize findings:
74
+ - **SAFE**: Unused private exports, unused dependencies, dead files
75
+ - **CAREFUL**: Potentially used via dynamic imports/reflection
76
+ - **RISKY**: Public API, shared utilities, external integrations
77
+
78
+ ### Phase 2: Verification
79
+
80
+ For each item flagged for removal:
81
+ - [ ] Grep for all references (including string patterns)
82
+ - [ ] Check for dynamic imports/reflection usage
83
+ - [ ] Verify not part of public API
84
+ - [ ] Review git history for context
85
+ - [ ] Confirm not in critical paths list
86
+
87
+ ### Phase 3: Safe Removal
88
+
89
+ Process in order (safest first):
90
+ 1. Unused dependencies
91
+ 2. Unused internal exports/functions
92
+ 3. Unused files
93
+ 4. Duplicate code consolidation
94
+
95
+ After each batch:
96
+ - [ ] Build succeeds
97
+ - [ ] Tests pass
98
+ - [ ] Commit changes
99
+ - [ ] Update deletion log
100
+
101
+ ### Phase 4: Documentation
102
+
103
+ Update `[DELETION_LOG_PATH]` with all changes.
104
+
105
+ ---
106
+
107
+ ## Critical Paths - NEVER REMOVE
108
+
109
+ **[GENERATION INSTRUCTION]**: Identify from codebase analysis:
110
+ - Authentication/authorization code
111
+ - Payment/transaction processing
112
+ - Core business logic
113
+ - External API integrations
114
+ - Database connections
115
+ - Real-time/websocket handlers
116
+ - Public API exports
117
+
118
+ **[TEMPLATE]**:
119
+ ```
120
+ NEVER REMOVE without explicit approval:
121
+ - [CRITICAL_PATH_1]: [DESCRIPTION]
122
+ - [CRITICAL_PATH_2]: [DESCRIPTION]
123
+ - [CRITICAL_PATH_3]: [DESCRIPTION]
124
+ - [CRITICAL_PATH_4]: [DESCRIPTION]
125
+ - [CRITICAL_PATH_5]: [DESCRIPTION]
126
+ ```
127
+
128
+ ---
129
+
130
+ ## Safe to Remove
131
+
132
+ **[TEMPLATE]**:
133
+ ```
134
+ Generally safe to remove after verification:
135
+ - Unused components in [COMPONENTS_DIR]
136
+ - Deprecated utilities in [UTILS_DIR]
137
+ - Test files for deleted features
138
+ - Commented-out code blocks
139
+ - Unused types/interfaces
140
+ - Old migration files (verify first)
141
+ ```
142
+
143
+ ---
144
+
145
+ ## Common Patterns
146
+
147
+ ### Unused Imports
148
+ ```[language]
149
+ # ❌ Remove unused
150
+ [unused_import_example]
151
+
152
+ # ✅ Keep only used
153
+ [clean_import_example]
154
+ ```
155
+
156
+ ### Dead Code
157
+ ```[language]
158
+ # ❌ Remove unreachable/unused
159
+ [dead_code_example]
160
+ ```
161
+
162
+ ### Duplicates
163
+ ```
164
+ # ❌ Multiple similar implementations
165
+ [duplicate_files_example]
166
+
167
+ # ✅ Consolidate to one
168
+ [consolidated_example]
169
+ ```
170
+
171
+ ---
172
+
173
+ ## Deletion Log Format
174
+
175
+ Create/update `[DELETION_LOG_PATH]`:
176
+
177
+ ```markdown
178
+ # Code Deletion Log
179
+
180
+ ## [YYYY-MM-DD] Cleanup Session
181
+
182
+ ### Dependencies Removed
183
+ | Package | Reason | Size Impact |
184
+ |---------|--------|-------------|
185
+ | name | unused | -XX KB |
186
+
187
+ ### Files Deleted
188
+ | File | Reason | Replacement |
189
+ |------|--------|-------------|
190
+ | path | unused | N/A or new-path |
191
+
192
+ ### Duplicates Consolidated
193
+ | Removed | Kept | Reason |
194
+ |---------|------|--------|
195
+ | old-path | new-path | identical |
196
+
197
+ ### Exports Removed
198
+ | File | Exports | Reason |
199
+ |------|---------|--------|
200
+ | path | fn1, fn2 | no references |
201
+
202
+ ### Summary
203
+ - Files deleted: X
204
+ - Dependencies removed: X
205
+ - Lines removed: X
206
+ - Bundle/build impact: -XX KB
207
+
208
+ ### Verification
209
+ - [ ] Build passes
210
+ - [ ] Tests pass
211
+ - [ ] Manual testing done
212
+ ```
213
+
214
+ ---
215
+
216
+ ## Safety Checklist
217
+
218
+ **Before removing**:
219
+ - [ ] Detection tool flagged it
220
+ - [ ] Grep found no references
221
+ - [ ] Not in critical paths list
222
+ - [ ] Not dynamically imported
223
+ - [ ] Git history reviewed
224
+ - [ ] Working on feature branch
225
+
226
+ **After each batch**:
227
+ - [ ] Build succeeds
228
+ - [ ] Tests pass
229
+ - [ ] Changes committed
230
+ - [ ] Deletion log updated
231
+
232
+ ---
233
+
234
+ ## Error Recovery
235
+
236
+ If something breaks:
237
+
238
+ ```bash
239
+ # 1. Immediate rollback
240
+ git revert HEAD
241
+ [INSTALL_COMMAND]
242
+ [BUILD_COMMAND]
243
+ [TEST_COMMAND]
244
+
245
+ # 2. Investigate why detection missed it
246
+
247
+ # 3. Add to "NEVER REMOVE" list
248
+
249
+ # 4. Document the edge case
250
+ ```
251
+
252
+ ---
253
+
254
+ ## When NOT to Run
255
+
256
+ - During active feature development
257
+ - Before production deployment
258
+ - Without adequate test coverage
259
+ - On unfamiliar code
260
+ - When codebase is unstable
261
+
262
+ ---
263
+
264
+ ## Generation Instructions
265
+
266
+ **For LLM generating project-specific agent from this template:**
267
+
268
+ ### Step 1: Discover Analysis Tools
269
+
270
+ Check for available tools:
271
+ - package.json scripts and devDependencies
272
+ - Makefile targets
273
+ - pyproject.toml/setup.py tools
274
+ - pom.xml plugins
275
+ - Global installations
276
+
277
+ Populate `[PRIMARY_TOOL_COMMAND]`, `[UNUSED_DEPS_COMMAND]`, etc.
278
+
279
+ ### Step 2: Identify Critical Paths
280
+
281
+ Analyze codebase for code that must never be removed:
282
+ - Auth modules
283
+ - Payment/billing code
284
+ - Core API handlers
285
+ - Database clients
286
+ - Third-party integrations
287
+ - Real-time functionality
288
+
289
+ Populate the "NEVER REMOVE" section with specific paths.
290
+
291
+ ### Step 3: Map Project Structure
292
+
293
+ Identify:
294
+ - Where components/modules live
295
+ - Where utilities are stored
296
+ - Test file locations
297
+ - Build output directories (to ignore)
298
+
299
+ ### Step 4: Extract Commands
300
+
301
+ Find actual commands for:
302
+ - Running analysis tools
303
+ - Building the project
304
+ - Running tests
305
+ - Installing dependencies
306
+
307
+ ### Step 5: Create Language-Specific Examples
308
+
309
+ Generate examples for:
310
+ - Unused imports pattern
311
+ - Dead code pattern
312
+ - Duplicate code pattern
313
+
314
+ Using project's actual language syntax.
315
+
316
+ ### Step 6: Set Deletion Log Path
317
+
318
+ Determine appropriate location:
319
+ - `docs/DELETION_LOG.md`
320
+ - `DELETION_LOG.md`
321
+ - `.github/DELETION_LOG.md`
322
+
323
+ ### Step 7: Finalize Agent
324
+
325
+ - Remove all `[GENERATION INSTRUCTION]` blocks
326
+ - Remove this "Generation Instructions" section
327
+ - Replace all `[PLACEHOLDERS]`
328
+ - **Target agent size: 120-180 lines**
329
+
330
+ ### Validation
331
+
332
+ - [ ] Analysis tool commands are valid
333
+ - [ ] Critical paths identified and listed
334
+ - [ ] Build/test commands accurate
335
+ - [ ] Examples use project's language
336
+ - [ ] Deletion log path specified
337
+ - [ ] No `[PLACEHOLDERS]` remain