@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
@@ -1,616 +1,345 @@
1
1
  # Codemie Subagents - Generate Project-Specific Subagent Files
2
2
 
3
3
  **Command Name**: `codemie-subagents`
4
- **Description**: Generate project-specific subagent files from templates - analyze codebase and create AI-optimized subagent definitions
5
- **Category**: Subagent Generation
6
- **Complexity**: Medium-High
4
+ **Description**: Generate project-specific subagent files from templates by analyzing codebase and existing guides
5
+ **Output**: AI-optimized subagent definitions in `.claude/agents/`
7
6
 
8
7
  ---
8
+ ## Additional user's input
9
+ Additional context/input from user: $ARGUMENTS. Might be empty by default.
9
10
 
10
11
  ## Purpose
11
12
 
12
- This command analyzes any software project and generates project-specific subagent files from templates, including:
13
- - Unit Tester Agent - specialized for project's testing patterns
14
- - Solution Architect Agent - tailored to project's architecture
15
- - Code Review Agent - customized for project's code standards
16
-
17
- Generated agents are placed in `.claude/agents/` directory for immediate use by Claude Code.
13
+ Analyze project and generate tailored subagent files:
14
+ - **Unit Tester Agent** - Project's testing patterns and framework
15
+ - **Solution Architect Agent** - Project's architecture and conventions
16
+ - **Code Review Agent** - Project's code standards and linting rules
17
+ - **Refactor Cleaner Agent** - Project's cleanup tools and critical paths
18
18
 
19
19
  ---
20
20
 
21
21
  ## Prerequisites
22
22
 
23
- Before running this command:
24
- - [ ] Project is cloned and accessible
25
- - [ ] You have read access to the codebase
26
- - [ ] Codemie templates are available at `.codemie/claude-templates/templates/agents/`
23
+ - [ ] Project is accessible
24
+ - [ ] Templates exist at `.codemie/claude-templates/templates/agents/`
25
+ - [ ] (Optional) Backup existing `.claude/agents/` if updating agents
27
26
 
28
- **Note**: The templates directory should be located in `.codemie/claude-templates/` within the project.
27
+ **Safety Note**: If existing agents are found, original content will be preserved during updates. However, creating a backup before running this command is recommended for recovery purposes.
29
28
 
30
29
  ---
31
30
 
32
- ## 🚨 CRITICAL SIZE LIMITS
33
-
34
- **MANDATORY**: Each generated subagent must be **300-500 lines maximum**.
35
-
36
- ### Enforcement Strategy
31
+ ## 🚨 SIZE LIMITS
37
32
 
38
- **During Generation**:
39
- - ✅ Use brief, focused examples (10-20 lines max)
40
- - ✅ Focus on contracts: function signatures, patterns, conventions
41
- - ✅ Use tables for pattern references instead of long explanations
42
- - ✅ ONE representative example per pattern category
43
- - ✅ Reference file:line for detailed examples instead of copying entire code
44
- - ❌ NO extensive code blocks (keep under 20 lines)
45
- - ❌ NO multiple variations of same pattern
46
- - ❌ NO verbose tutorials or walkthroughs
47
- - ❌ NO redundant explanations
33
+ **Each generated subagent: 150-300 lines maximum**
48
34
 
49
- **Validation**:
50
- After generating each subagent, count lines:
51
- ```bash
52
- wc -l .claude/agents/[agent-name].md
53
- ```
54
- If > 500 lines: **STOP and condense before continuing**.
35
+ | ✅ Do | ❌ Don't |
36
+ |-------|---------|
37
+ | Brief examples (10-15 lines) | Extensive code blocks |
38
+ | Tables for patterns | Long prose explanations |
39
+ | File:line references | Full code listings |
40
+ | One example per pattern | Multiple variations |
55
41
 
56
42
  ---
57
43
 
58
- ## Execution Steps
59
-
60
- ### Phase 1: Template Discovery & Project Analysis
44
+ ## Execution
61
45
 
62
- #### Step 1.1: Discover Available Templates
46
+ ### Phase 1: Discovery
63
47
 
64
- **Task**: Find all subagent templates available for generation
48
+ #### Step 1.1: Find Templates
65
49
 
66
- **Actions**:
67
50
  ```bash
68
- # List all template files in subagents directory
69
- ls .codemie/claude-templates/templates/subagents/
51
+ ls .codemie/claude-templates/templates/agents/
70
52
  ```
71
53
 
72
- **Expected Templates**:
73
- - `code-review-agent-template.md.template` - Code review specialized agent
74
- - `solution-architect-agent.md.template` - Architecture planning agent
75
- - `unit-tester-agent.md.template` - Testing specialized agent
54
+ Expected: `code-review-agent-template.md`, `solution-architect-agent.md`, `unit-tester-agent.md`, `refactor-cleaner-agent.md`
76
55
 
77
- **Output**: Array of template file names and paths
78
-
79
- **Confidence Check**: Can you find at least 1 template file?
80
- - ✅ YES → Continue to Step 1.2
81
- - ❌ NO → Report error (templates directory missing)
56
+ If no templates found Report error and stop.
82
57
 
83
58
  ---
84
59
 
85
- #### Step 1.2: Analyze Project Structure
86
-
87
- **Task**: Understand project organization, tech stack, and patterns
60
+ #### Step 1.1b: Check Existing Agents
88
61
 
89
- **Actions**:
90
62
  ```bash
91
- # Identify project type and structure
92
- - Check for package.json, requirements.txt, pom.xml, Cargo.toml, go.mod, etc.
93
- - Identify language(s) and frameworks
94
- - Map directory structure
95
- - Find configuration files (tsconfig.json, .eslintrc, pytest.ini, etc.)
96
- - Locate test directories and files
97
- - Find architecture patterns (MVC, layered, microservices, etc.)
63
+ ls .claude/agents/ 2>/dev/null
98
64
  ```
99
65
 
100
- **Critical Information to Extract**:
101
- - **Programming Language(s)**: TypeScript, Python, Java, Go, Rust, etc.
102
- - **Framework(s)**: Express, FastAPI, Spring Boot, Gin, etc.
103
- - **Build Tools**: npm, pip, maven, cargo, etc.
104
- - **Testing Framework**: Vitest, Jest, pytest, JUnit, Go test, etc.
105
- - **Linting Tools**: ESLint, Pylint, Checkstyle, golangci-lint, etc.
106
- - **Project Structure**: Monorepo/multi-package vs single package
107
- - **Key Directories**: src/, tests/, lib/, internal/, etc.
108
-
109
- **Output**: Project analysis document with all extracted information
110
-
111
- ---
112
-
113
- #### Step 1.3: Read Existing Documentation
66
+ **Purpose**: Identify existing agents to update rather than recreate
114
67
 
115
- **Task**: Check for existing documentation to understand conventions
68
+ **Agent Name Variations to Match**:
69
+ | Template | Possible Existing Names |
70
+ |----------|------------------------|
71
+ | unit-tester-agent.md | unit-tester.md, tester.md, unit-test-agent.md, test-agent.md |
72
+ | solution-architect-agent.md | solution-architect.md, architect.md, architecture-agent.md |
73
+ | code-review-agent.md | code-review.md, reviewer.md, review-agent.md, code-reviewer.md |
74
+ | refactor-cleaner-agent.md | refactor-cleaner.md, refactor.md, cleaner.md, cleanup-agent.md |
116
75
 
117
- **Actions**:
118
- ```bash
119
- # Read existing docs (if they exist)
120
- - README.md - project overview, setup, conventions
121
- - CONTRIBUTING.md - contribution guidelines, code standards
122
- - CLAUDE.md - existing AI instructions (if present)
123
- - .codemie/guides/ - existing guides
124
- - docs/ directory - additional documentation
125
- ```
76
+ **Match Logic**:
77
+ - Exact match (e.g., `solution-architect-agent.md`)
78
+ - Partial match (e.g., `architect.md` matches solution-architect template)
79
+ - Keyword match (e.g., `tester.md` matches unit-tester template)
126
80
 
127
- **Extract**:
128
- - Code style conventions
129
- - Testing requirements
130
- - Review standards
131
- - Architecture decisions
132
- - Common patterns and anti-patterns
81
+ **Record Results**:
82
+ - List all existing agents found
83
+ - Map each to corresponding template (if match found)
84
+ - Note unmatched agents (leave unchanged)
133
85
 
134
86
  ---
135
87
 
136
- ### Phase 2: Template Loading & Validation
88
+ #### Step 1.2: Read Project Context (PRIORITY ORDER)
137
89
 
138
- #### Step 2.1: Create Todo List for Templates
139
-
140
- **Task**: Create todo tasks for each discovered template
141
-
142
- **Actions**:
143
- ```typescript
144
- // For each template file found in Step 1.1:
145
- // - Create todo item: "Generate [agent-name] from template"
146
- // Example todos:
147
- // - [ ] Generate unit-tester agent from template
148
- // - [ ] Generate solution-architect agent from template
149
- // - [ ] Generate code-review agent from template
90
+ **First**: Check `.codemie/guides/` folder
91
+ ```bash
92
+ # If exists, read ALL guides first - this is the primary source
93
+ ls .codemie/guides/ 2>/dev/null && cat .codemie/guides/*.md
150
94
  ```
151
95
 
152
- **Output**: Todo list with one task per template
153
-
154
- ---
155
-
156
- #### Step 2.2: Load Each Template
157
-
158
- **Task**: Read and parse each template file
159
-
160
- **For Each Template**:
161
-
162
- **Step 2.2.1: Read Template Content**
96
+ **Second**: Read standard documentation
163
97
  ```bash
164
- # Read template file
165
- cat .codemie/claude-templates/templates/subagents/[template-file]
98
+ cat README.md CONTRIBUTING.md ARCHITECTURE.md CLAUDE.md 2>/dev/null
166
99
  ```
167
100
 
168
- **Step 2.2.2: Identify Placeholders**
101
+ **Third**: Analyze codebase for missing information
102
+ - Package files (package.json, pyproject.toml, pom.xml, go.mod)
103
+ - Config files (tsconfig.json, .eslintrc, pytest.ini)
104
+ - Directory structure
105
+ - Sample source and test files
169
106
 
170
- Common placeholders to find:
171
- - `[PROJECT_NAME]` - Project name
172
- - `[LANGUAGE]` - Programming language
173
- - `[FRAMEWORK]` - Main framework
174
- - `[TEST_FRAMEWORK]` - Testing framework
175
- - `[BUILD_TOOL]` - Build tool (npm, cargo, maven, etc.)
176
- - `[LINTER]` - Linting tool
177
- - `[PROJECT_STRUCTURE]` - Directory structure overview
178
- - `[ARCHITECTURE_PATTERN]` - Main architecture pattern
179
- - `[code_example]` - Code snippet placeholders
180
- - `[file.ext:lines]` - File reference placeholders
181
- - `FILL IN` sections - Areas needing project-specific content
182
-
183
- **Output**: List of placeholders per template and sections to fill
107
+ **Extract**:
108
+ | Item | Source Priority |
109
+ |------|-----------------|
110
+ | Architecture pattern | guides/ → ARCHITECTURE.md → directory structure |
111
+ | Code conventions | guides/ → CONTRIBUTING.md → linter configs |
112
+ | Testing patterns | guides/ test files → package.json |
113
+ | Critical paths | guides/ → core business logic analysis |
184
114
 
185
115
  ---
186
116
 
187
- ### Phase 3: Subagent Generation (Iterative)
117
+ ### Phase 2: Generate or Update Each Agent
188
118
 
189
- **For Each Template** (mark as in_progress, then completed):
119
+ For each template, create a todo item and process:
190
120
 
191
- #### Step 3.1: Gather Template-Specific Information
121
+ #### Step 2.0: Determine Action (Create vs Update)
192
122
 
193
- **For Unit Tester Agent**:
194
- - Testing framework and version
195
- - Test file locations and naming patterns (e.g., `*.test.ts`, `*_test.go`, `test_*.py`)
196
- - Mock/fixture patterns used in project
197
- - Coverage requirements (if documented)
198
- - Test commands (npm test, pytest, go test, etc.)
199
- - Example test files (2-3 representative examples)
200
- - Common testing utilities and helpers
123
+ **For each template**:
124
+ 1. Check if matching existing agent was found in Step 1.1b
125
+ 2. Decide action:
126
+ - **UPDATE**: Existing agent found → Review and adjust existing file
127
+ - **CREATE**: No existing agent → Generate from template
201
128
 
202
- **Actions**:
203
- ```bash
204
- # Find test files and patterns
205
- find . -name "*.test.ts" -o -name "*_test.go" -o -name "test_*.py"
206
- # Find test configuration
207
- grep -r "test" package.json tsconfig.json pytest.ini go.mod
208
- # Read example test files
209
- cat [test-file-path] # 2-3 representative examples
210
- ```
129
+ **Update Priority**:
130
+ - If existing agent is outdated (missing project info, has placeholders) → UPDATE
131
+ - If existing agent is custom/non-template based → ASK USER before updating
132
+ - If uncertain ASK USER: "Found existing [agent-name]. Update it or create new?"
133
+
134
+ ---
211
135
 
212
- **For Solution Architect Agent**:
213
- - Project architecture pattern (layered, hexagonal, microservices, etc.)
214
- - Key directories and their purposes
215
- - Layer/module dependencies and communication patterns
216
- - Technology stack summary
217
- - Integration points (databases, APIs, external services)
218
- - Configuration management approach
136
+ #### Step 2.1: Load Template or Existing Agent
219
137
 
220
- **Actions**:
138
+ **If CREATE (no existing agent)**:
221
139
  ```bash
222
- # Map directory structure
223
- tree -L 2 -d
224
- # Find architectural patterns
225
- grep -r "interface\|abstract\|Repository\|Service\|Controller" src/
226
- # Find integration points
227
- grep -r "database\|api\|http\|grpc" config/ src/
140
+ cat .codemie/claude-templates/templates/agents/[template-file]
228
141
  ```
229
142
 
230
- **For Code Review Agent**:
231
- - Code style configuration (.eslintrc, .pylintrc, etc.)
232
- - Linting rules and enforcement level
233
- - Formatter configuration (prettier, black, gofmt, etc.)
234
- - Code review checklist (if in CONTRIBUTING.md)
235
- - Common code smells documented in project
236
- - Type safety requirements (TypeScript strict mode, mypy, etc.)
143
+ Identify all `[PLACEHOLDERS]` and `[GENERATION INSTRUCTION]` blocks.
237
144
 
238
- **Actions**:
145
+ **If UPDATE (existing agent found)**:
239
146
  ```bash
240
- # Find linting configuration
241
- cat .eslintrc* .pylintrc* .golangci.yml
242
- # Find formatter configuration
243
- cat .prettierrc* pyproject.toml .rustfmt.toml
244
- # Read contribution guidelines
245
- cat CONTRIBUTING.md | grep -A 10 "review\|style\|lint"
147
+ # Read both template and existing agent
148
+ cat .codemie/claude-templates/templates/agents/[template-file]
149
+ cat .claude/agents/[existing-agent-file]
246
150
  ```
247
151
 
248
- **🚨 SIZE LIMIT ENFORCEMENT**:
249
- **Target: 300-500 lines for final agent**
250
-
251
- Gather information selectively:
252
- - Focus on **essential patterns only**
253
- - Collect **1-2 representative examples** per category
254
- - Prefer **file:line references** over full code listings
255
- - Use **tables** to summarize multiple patterns compactly
152
+ **Compare and Identify**:
153
+ - Sections in template that are missing in existing agent
154
+ - Outdated information in existing agent
155
+ - Placeholders that need replacement
156
+ - Project-specific updates needed (new patterns, tools, conventions)
256
157
 
257
158
  ---
258
159
 
259
- #### Step 3.2: Fill Template Placeholders
260
-
261
- **Step 3.2.1: Replace Generic Placeholders**
262
-
263
- Replace all standard placeholders with actual values from project analysis:
264
- - `[PROJECT_NAME]` → Actual project name (from package.json, README, etc.)
265
- - `[LANGUAGE]` → Detected language(s)
266
- - `[FRAMEWORK]` → Detected framework(s)
267
- - `[TEST_FRAMEWORK]` → Detected test framework
268
- - `[BUILD_TOOL]` → npm, cargo, maven, etc.
269
- - `[LINTER]` → ESLint, Pylint, etc.
270
- - `[PROJECT_STRUCTURE]` → Brief directory structure (5-10 lines)
271
- - `[ARCHITECTURE_PATTERN]` → Identified pattern
272
-
273
- **Step 3.2.2: Fill Code Examples (KEEP BRIEF)**
274
-
275
- For each `[code_example]` placeholder:
276
- - Use **actual code from codebase** (never generic examples)
277
- - Keep examples **10-20 lines maximum**
278
- - Add source reference: `// Source: file.ts:23-42`
279
- - Focus on **pattern demonstration**, not complete implementations
280
-
281
- **Example**:
282
- ```typescript
283
- // GOOD: Brief, focused example (15 lines)
284
- describe('UserService', () => {
285
- it('should create user with valid data', async () => {
286
- const mockRepo = { save: vi.fn().mockResolvedValue(user) };
287
- const service = new UserService(mockRepo);
288
-
289
- const result = await service.createUser(validData);
290
-
291
- expect(result).toEqual(user);
292
- expect(mockRepo.save).toHaveBeenCalledWith(validData);
293
- });
294
- });
295
- // Source: tests/services/user.test.ts:45-56
296
- ```
297
-
298
- **Step 3.2.3: Fill "FILL IN" Sections**
160
+ #### Step 2.2: Gather Agent-Specific Information
299
161
 
300
- For sections marked "FILL IN":
301
- - Add **project-specific content only**
302
- - Use **tables** for multiple patterns:
303
- ```markdown
304
- | Pattern | File Location | Key Characteristics |
305
- |---------|--------------|---------------------|
306
- | [Pattern1] | file.ts:line | Brief description |
307
- ```
308
- - Keep explanations **concise** (1-2 sentences max per item)
309
- - Use **bullet lists** for quick reference
162
+ **Unit Tester**:
163
+ - Test framework, version, plugins
164
+ - Test directory and file patterns
165
+ - Mocking approach
166
+ - 1-2 representative test examples
310
167
 
311
- **Step 3.2.4: Replace File References**
168
+ **Solution Architect**:
169
+ - Architecture layers and their names
170
+ - Specs directory location
171
+ - Naming conventions
172
+ - Tech stack summary
312
173
 
313
- For each `[file.ext:lines]` placeholder:
314
- - Find **actual relevant files** from codebase analysis
315
- - Use **real file paths** with line numbers
316
- - Example: `src/services/user.ts:23-45` instead of `[service.ts:lines]`
174
+ **Code Review**:
175
+ - Linting tools and configs
176
+ - Severity thresholds
177
+ - 5-7 critical pattern categories
178
+ - Git workflow commands
317
179
 
318
- ---
319
-
320
- #### Step 3.3: Create Output Directory
180
+ **Refactor Cleaner**:
181
+ - Available analysis tools (knip, depcheck, vulture, etc.)
182
+ - Critical paths that must never be removed
183
+ - Deletion log location
184
+ - Build/test verification commands
321
185
 
322
- **Task**: Ensure output directory exists
323
-
324
- **Actions**:
325
- ```bash
326
- # Create directory if it doesn't exist
327
- mkdir -p .claude/agents
328
- ```
329
-
330
- **Note**: Only create this directory once, not per agent.
186
+ **Source Priority**: Always check `.codemie/guides/` first, then analyze code.
331
187
 
332
188
  ---
333
189
 
334
- #### Step 3.4: Write Generated Subagent File
335
-
336
- **Task**: Write completed subagent to file
337
-
338
- **Actions**:
190
+ #### Step 2.3: Populate Template or Update Existing
191
+
192
+ **If CREATE (from template)**:
193
+ 1. **Replace all `[PLACEHOLDERS]`** with discovered values
194
+ 2. **Fill pattern examples** using actual project code (brief, 10-15 lines)
195
+ 3. **Remove all `[GENERATION INSTRUCTION]`** blocks
196
+ 4. **Remove "Generation Instructions"** section from template
197
+
198
+ **If UPDATE (existing agent)**:
199
+ 1. **Preserve custom content**: Keep user-added sections, custom examples, specific instructions
200
+ 2. **Update outdated sections**:
201
+ - Replace old tool versions with current versions
202
+ - Update file paths if structure changed
203
+ - Refresh pattern examples with current codebase code
204
+ - Add missing sections from template
205
+ 3. **Replace remaining placeholders** (if any)
206
+ 4. **Enhance with new patterns**: Add newly discovered patterns not in original
207
+ 5. **Maintain structure**: Keep existing organization unless template structure changed significantly
208
+
209
+ **Update Strategy**:
210
+ - **Section-by-section merge**: Compare template sections with existing agent sections
211
+ - **Preserve > Replace**: Keep existing content unless clearly outdated or incorrect
212
+ - **Add > Remove**: Add missing information rather than removing custom content
213
+ - **Validate > Assume**: Check if existing examples still exist in codebase
339
214
 
340
- **Step 3.4.1: Determine Output Filename**
215
+ ---
341
216
 
342
- Template filename Output filename:
343
- - `code-review-agent-template.md.template` → `code-review-agent.md`
344
- - `solution-architect-agent.md.template` → `solution-architect-agent.md`
345
- - `unit-tester-agent.md.template` → `unit-tester-agent.md`
217
+ #### Step 2.4: Write and Validate
346
218
 
347
- **Step 3.4.2: Write File**
348
219
  ```bash
349
- # Write completed agent file
350
- # Save to .claude/agents/[agent-name].md
351
- ```
352
-
353
- **🚨 MANDATORY SIZE VALIDATION**:
354
- ```bash
355
- # Count lines immediately after writing
356
- LINE_COUNT=$(wc -l < .claude/agents/[agent-name].md)
357
-
358
- # Check if within limit
359
- if [ $LINE_COUNT -lt 300 ]; then
360
- echo "⚠️ WARNING: Agent is only $LINE_COUNT lines (minimum: 300)"
361
- echo "Consider adding more detail or examples"
362
- elif [ $LINE_COUNT -gt 500 ]; then
363
- echo "⚠️ ERROR: Agent is $LINE_COUNT lines (maximum: 500)"
364
- echo "MUST condense before continuing!"
365
- # STOP and condense the agent
366
- fi
220
+ mkdir -p .claude/agents
221
+ # Write agent file (create new or overwrite existing)
367
222
  ```
368
223
 
369
- **Validation Checklist**:
370
- - [ ] **Agent is 300-500 lines** (MANDATORY)
371
- - [ ] All placeholders replaced with actual values
372
- - [ ] Code examples are from actual codebase (not generic)
373
- - [ ] Code examples are brief (10-20 lines max)
374
- - [ ] File paths are accurate with line numbers
375
- - [ ] Commands are correct for the project
376
- - [ ] No "FILL IN" or "[PLACEHOLDER]" remains
377
- - [ ] Used tables for pattern summaries
378
- - [ ] ONE representative example per pattern category
379
-
380
- **If > 500 Lines** (MUST FIX):
381
- 1. Remove redundant code examples (keep only most representative)
382
- 2. Convert multiple examples to a single comprehensive example
383
- 3. Replace code blocks with file:line references
384
- 4. Use tables instead of long prose descriptions
385
- 5. Remove verbose explanations (keep only essential info)
386
- 6. Consolidate similar patterns into single entries
387
- 7. Re-validate line count
388
-
389
- **If < 300 Lines** (CONSIDER):
390
- 1. Add more pattern examples if relevant
391
- 2. Expand key sections with project-specific details
392
- 3. Add troubleshooting section if missing
393
- 4. Ensure all template sections are filled
224
+ **Checklist (CREATE)**:
225
+ - [ ] No `[PLACEHOLDER]` text remains
226
+ - [ ] No `[GENERATION INSTRUCTION]` blocks remain
227
+ - [ ] Examples are from actual codebase
228
+ - [ ] File paths are accurate
229
+ - [ ] Commands are valid for project
230
+
231
+ **Checklist (UPDATE)**:
232
+ - [ ] Custom content preserved (user additions not lost)
233
+ - [ ] Outdated information refreshed
234
+ - [ ] New sections from template added if relevant
235
+ - [ ] Examples validated against current codebase
236
+ - [ ] File paths updated if project structure changed
237
+ - [ ] Tool versions/commands current
238
+ - [ ] No regression (agent still functional after update)
239
+
240
+ **Action Logging**:
241
+ Record for summary report:
242
+ - Agent name
243
+ - Action taken (CREATED or UPDATED)
244
+ - Key changes made (if updated)
245
+
246
+ Mark todo complete, proceed to next template.
394
247
 
395
248
  ---
396
249
 
397
- #### Step 3.5: Mark Todo Complete
250
+ ### Phase 3: Finalize
398
251
 
399
- **Actions**:
400
- - Mark current agent generation todo as "completed"
401
- - Move to next template
252
+ #### Step 3.1: Verify All Agents
402
253
 
403
- ---
404
-
405
- ### Phase 4: Validation & Finalization
406
-
407
- #### Step 4.1: Verify Generated Agents
408
-
409
- **For Each Generated Agent**:
410
-
411
- **4.1.1: Check File Existence**
412
254
  ```bash
413
- # Verify all agents were created
414
- ls -lh .claude/agents/
255
+ ls -la .claude/agents/
256
+ wc -l .claude/agents/*.md
415
257
  ```
416
258
 
417
- **4.1.2: Validate Content Quality**
418
- - [ ] No placeholder text remains (`[...]`, `FILL IN`)
419
- - [ ] Code examples are real (not pseudo-code)
420
- - [ ] File references are accurate (actual files exist)
421
- - [ ] Commands are correct for project environment
422
- - [ ] Line count is within 300-500 range
423
-
424
- **4.1.3: Test Sample Commands (Optional)**
425
- ```bash
426
- # Try running documented commands to ensure they work
427
- # Example: npm test (from unit-tester agent)
428
- # Example: npm run lint (from code-review agent)
429
- ```
259
+ Confirm:
260
+ - All agents created
261
+ - All within size limits
262
+ - No placeholder text remains
430
263
 
431
264
  ---
432
265
 
433
- #### Step 4.2: Generate Summary Report
434
-
435
- **Task**: Create summary of what was generated
266
+ #### Step 3.2: Summary Report
436
267
 
437
- **Report Structure**:
438
268
  ```markdown
439
269
  # Subagent Generation Complete
440
270
 
441
- ## Generated Agents ([N] agents)
442
-
443
- - ✅ .claude/agents/unit-tester-agent.md ([X] lines)
444
- - ✅ .claude/agents/solution-architect-agent.md ([Y] lines)
445
- - ✅ .claude/agents/code-review-agent.md ([Z] lines)
446
-
447
- ## Project Analysis Summary
448
-
449
- **Technology Stack**:
450
- - Language: [Language]
451
- - Framework: [Framework]
452
- - Testing: [Test Framework]
453
- - Build Tool: [Build Tool]
454
- - Linter: [Linter]
455
-
456
- **Architecture Pattern**: [Pattern]
457
-
458
- **Key Directories**:
459
- - [dir1/] - [purpose]
460
- - [dir2/] - [purpose]
461
- - [dir3/] - [purpose]
462
-
463
- ## Subagent Capabilities
464
-
465
- **Unit Tester Agent**:
466
- - Specialized for [Test Framework]
467
- - Knows project test patterns in [test-dir/]
468
- - Configured for [specific testing approach]
469
-
470
- **Solution Architect Agent**:
471
- - Understands [Architecture Pattern]
472
- - Knows layer structure and dependencies
473
- - Tailored for [Project Type] architecture
474
-
475
- **Code Review Agent**:
476
- - Enforces [Linter] rules
477
- - Knows project code standards
478
- - Checks [specific quality requirements]
479
-
480
- ## Next Steps
481
-
482
- 1. Review generated agents for accuracy
483
- 2. Customize any project-specific sections if needed
484
- 3. Use agents via Claude Code for specialized tasks:
485
- - "Write tests for [component]" → Uses unit-tester agent
486
- - "Design architecture for [feature]" → Uses solution-architect agent
487
- - "Review code in [file]" → Uses code-review agent
488
-
489
- ## How to Use
490
-
491
- These agents are automatically available to Claude Code in this project.
492
- Claude Code will select the appropriate agent based on your task.
493
-
494
- You can also explicitly request an agent:
495
- - "Use the unit-tester agent to write tests for authentication"
496
- - "Use the solution-architect agent to plan the new feature"
497
- - "Use the code-review agent to check this PR"
271
+ ## Agents Processed
272
+ | Agent | Lines | Action | Key Changes |
273
+ |-------|-------|--------|-------------|
274
+ | unit-tester-agent.md | X | CREATED/UPDATED | [If updated: list changes] |
275
+ | solution-architect-agent.md | Y | CREATED/UPDATED | [If updated: list changes] |
276
+ | code-review-agent.md | Z | CREATED/UPDATED | [If updated: list changes] |
277
+ | refactor-cleaner-agent.md | W | CREATED/UPDATED | [If updated: list changes] |
278
+
279
+ ## Actions Taken
280
+ - **Created**: X new agents
281
+ - **Updated**: Y existing agents
282
+ - **Preserved**: Z unmatched agents (left unchanged)
283
+
284
+ ## Project Context Used
285
+ - **Guides**: [list of .codemie/guides/ files read, or "none found"]
286
+ - **Tech Stack**: [Language], [Framework], [Test Framework]
287
+ - **Architecture**: [Pattern]
288
+
289
+ ## Update Details (if applicable)
290
+ - Outdated paths updated: [list]
291
+ - New patterns added: [list]
292
+ - Tool versions refreshed: [list]
293
+ - Custom content preserved: [yes/no, details]
294
+
295
+ ## Usage
296
+ Agents are automatically available to Claude Code.
297
+ Explicit invocation: "Use the [agent-name] agent to [task]"
498
298
  ```
499
299
 
500
300
  ---
501
301
 
502
- ## Decision Gates Throughout Process
503
-
504
- ### Gate 1: After Template Discovery (Step 1.1)
505
- **Question**: Did I find at least 1 template file?
506
- - ✅ YES → Continue to project analysis
507
- - ❌ NO → Report error (check template directory path)
302
+ ## Decision Gates
508
303
 
509
- ### Gate 2: After Project Analysis (Step 1.3)
510
- **Question**: Do I have enough information about the project?
511
- - 80%+ confidence Continue to generation
512
- - < 80% confidence Ask user for clarification
513
-
514
- ### Gate 3: After Each Agent Generation (Step 3.4)
515
- **Question**: Is the agent within size limits (300-500 lines)?
516
- - YES Mark complete, move to next
517
- - NO Condense (if > 500) or expand (if < 300)
518
-
519
- ### Gate 4: After All Agents Generated (Step 4.1)
520
- **Question**: Are all agents complete and valid?
521
- - ✅ YES → Generate summary report and finish
522
- - ❌ NO → Fix issues and re-validate
304
+ | Gate | Condition | Pass | Fail |
305
+ |------|-----------|------|------|
306
+ | Templates exist | ≥1 template found | Continue | Stop with error |
307
+ | Existing agents check | Checked .claude/agents/ | Continue | Continue (assume no existing) |
308
+ | Update decision | Clear CREATE or UPDATE action | Continue | Ask user for preference |
309
+ | Custom content | Identified custom sections in existing agent | Preserve during update | Proceed with standard update |
310
+ | Project understood | ≥80% info gathered | Continue | Ask user for clarification |
311
+ | Agent size | 100-300 lines | Continue | Condense/expand as needed |
312
+ | Validation | No placeholders remain | Complete | Fix and revalidate |
313
+ | Update safety | Custom content preserved (if applicable) | Complete | Review and fix |
523
314
 
524
315
  ---
525
316
 
526
317
  ## Troubleshooting
527
318
 
528
- ### Issue: Template Directory Not Found
529
-
530
- **Symptoms**: Cannot find `.codemie/claude-templates/templates/subagents/`
531
- **Action**:
532
- 1. Check if templates are in alternate location
533
- 2. Ask user for correct template path
534
- 3. Verify project has been set up with codemie-init first
535
-
536
- ### Issue: Cannot Determine Project Language/Framework
537
-
538
- **Symptoms**: Unclear tech stack from project files
539
- **Action**:
540
- 1. Ask user: "What language and framework does your project use?"
541
- 2. Look for alternate configuration files
542
- 3. Check README.md for explicit mention
543
-
544
- ### Issue: No Test Files Found
545
-
546
- **Symptoms**: Cannot find tests for unit-tester agent
547
- **Action**:
548
- 1. Check alternate test directory names (test/, __tests__/, spec/)
549
- 2. Check alternate file patterns (*.spec.ts, *.test.js)
550
- 3. Ask user where tests are located
551
- 4. If no tests exist, note in agent that tests should be created
552
-
553
- ### Issue: Generated Agent Too Large (> 500 Lines)
554
-
555
- **Symptoms**: Line count exceeds limit
556
- **Action**:
557
- 1. Remove redundant code examples (keep most representative)
558
- 2. Replace code blocks with file:line references
559
- 3. Use tables instead of prose for pattern lists
560
- 4. Consolidate similar patterns
561
- 5. Remove verbose explanations
562
-
563
- ### Issue: Generated Agent Too Small (< 300 Lines)
564
-
565
- **Symptoms**: Line count below minimum
566
- **Action**:
567
- 1. Check if all template sections were filled
568
- 2. Add more representative examples if relevant
569
- 3. Expand troubleshooting or pattern sections
570
- 4. Add project-specific details from analysis
319
+ | Issue | Action |
320
+ |-------|--------|
321
+ | Templates not found | Check path, ask user for correct location |
322
+ | Existing agent name doesn't match | Use partial/keyword matching logic (Step 1.1b) |
323
+ | Uncertain if existing agent is custom | Ask user: "Found [agent]. Update or preserve?" |
324
+ | Existing agent very different from template | Ask user before updating, risk losing custom content |
325
+ | Agent has placeholders after update | Re-gather project info, re-populate |
326
+ | Update causes agent to exceed size limit | Condense: prioritize new info, remove outdated examples |
327
+ | Unclear tech stack | Check `.codemie/guides/` first, then ask user |
328
+ | No test files found | Check alternate patterns, note in agent |
329
+ | Agent too large (>300) | Condense: use references, tables, single examples |
330
+ | Missing critical info | Check guides/, then analyze code, then ask user |
331
+ | Custom sections lost during update | Restore from backup (existing file), merge manually |
571
332
 
572
333
  ---
573
334
 
574
335
  ## Success Criteria
575
336
 
576
- Subagent generation is complete when:
577
- - ✅ All template files processed
578
- - ✅ All agents generated in `.claude/agents/`
579
- - ✅ All agents are 300-500 lines
580
- - ✅ All code examples are from actual codebase
581
- - ✅ All file references are accurate
582
- - ✅ All commands are correct
583
- - ✅ No placeholders or "FILL IN" text remains
584
- - ✅ Agents are project-specific (not generic)
585
- - ✅ Summary report generated
586
-
587
- ---
588
-
589
- ## Example Invocation
590
-
591
- **User**: "Generate subagents for my TypeScript project"
592
-
593
- **Claude Code**:
594
- 1. Discovers 3 templates (unit-tester, solution-architect, code-review)
595
- 2. Analyzes project (finds TypeScript, Vitest, ESLint, layered architecture)
596
- 3. Creates todo list with 3 agent generation tasks
597
- 4. Generates unit-tester agent (uses actual test examples from tests/)
598
- 5. Generates solution-architect agent (uses actual architecture from src/)
599
- 6. Generates code-review agent (uses actual ESLint config)
600
- 7. Validates all agents (sizes OK, no placeholders)
601
- 8. Presents summary report with capabilities
602
-
603
- **Result**: project-specific subagent files ready to use in `.claude/agents/`.
604
- IMPORTANT: put agents into ".claude/agents" folder.
605
-
606
- ---
607
-
608
- ## Notes
609
-
610
- - **Time Estimate**: 5-15 minutes depending on project size
611
- - **Token Usage**: Medium - reading templates and codebase samples
612
- - **User Interaction**: 0-1 confirmation points (only if unclear project structure)
613
- - **Customization**: Output should be 90% ready, 10% may need refinement
614
- - **Updates**: Re-run command when project patterns change significantly
615
-
616
- ---
337
+ - All templates processed
338
+ - ✅ Existing agents checked and mapped to templates
339
+ - ✅ All agents in `.claude/agents/`
340
+ - ✅ All agents 100-300 lines
341
+ - ✅ No placeholders remain
342
+ - ✅ Project-specific content (not generic)
343
+ - ✅ Custom content preserved (if updating existing agents)
344
+ - ✅ Outdated information refreshed (if updating)
345
+ - ✅ Summary report generated with actions taken (CREATE/UPDATE)