@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
@@ -0,0 +1,252 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Copy /mr skill from project scope to global scope
5
+ *
6
+ * This script copies the project-level /mr skill to ~/.claude/skills/mr/
7
+ * making it available globally across all projects.
8
+ *
9
+ * Usage:
10
+ * npm run build && node dist/scripts/copy-mr-skill-to-global.js
11
+ * OR
12
+ * npx tsx scripts/copy-mr-skill-to-global.ts
13
+ */
14
+
15
+ import * as fs from 'fs/promises';
16
+ import * as path from 'path';
17
+ import { parseFrontmatter } from '../src/skills/utils/frontmatter.js';
18
+ import { SkillMetadataSchema } from '../src/skills/core/types.js';
19
+ import { resolveHomeDir } from '../src/utils/paths.js';
20
+ import { SkillManager } from '../src/skills/index.js';
21
+ import * as readline from 'readline';
22
+
23
+ interface CopyResult {
24
+ success: boolean;
25
+ message: string;
26
+ copiedFiles?: string[];
27
+ }
28
+
29
+ /**
30
+ * Validate source skill exists and has valid frontmatter
31
+ */
32
+ async function validateSourceSkill(sourceDir: string): Promise<void> {
33
+ const skillPath = path.join(sourceDir, 'SKILL.md');
34
+
35
+ // Check file exists
36
+ try {
37
+ await fs.access(skillPath, fs.constants.R_OK);
38
+ } catch {
39
+ throw new Error(`Source skill not found: ${skillPath}`);
40
+ }
41
+
42
+ // Validate frontmatter
43
+ const content = await fs.readFile(skillPath, 'utf-8');
44
+ const { metadata } = parseFrontmatter(content, skillPath);
45
+ const validated = SkillMetadataSchema.parse(metadata);
46
+
47
+ console.log(`โœ“ Source skill validated: ${validated.name}`);
48
+ console.log(` Description: ${validated.description}`);
49
+ }
50
+
51
+ /**
52
+ * Check if target already exists and prompt user for overwrite
53
+ */
54
+ async function checkTargetConflict(targetDir: string): Promise<void> {
55
+ const targetSkillPath = path.join(targetDir, 'SKILL.md');
56
+
57
+ try {
58
+ await fs.access(targetSkillPath, fs.constants.F_OK);
59
+
60
+ // File exists - prompt user
61
+ const rl = readline.createInterface({
62
+ input: process.stdin,
63
+ output: process.stdout
64
+ });
65
+
66
+ const answer = await new Promise<string>((resolve) => {
67
+ rl.question(
68
+ `\nโš ๏ธ Global /mr skill already exists. Overwrite? (y/N): `,
69
+ resolve
70
+ );
71
+ });
72
+
73
+ rl.close();
74
+
75
+ if (answer.toLowerCase() !== 'y') {
76
+ console.log('โŒ Operation cancelled by user');
77
+ process.exit(0);
78
+ }
79
+
80
+ // Create backup before overwriting
81
+ const backupDir = `${targetDir}.backup-${Date.now()}`;
82
+ await fs.rename(targetDir, backupDir);
83
+ console.log(`โœ“ Backup created: ${backupDir}`);
84
+ } catch {
85
+ // File doesn't exist - proceed
86
+ console.log('โœ“ No conflict detected');
87
+ }
88
+ }
89
+
90
+ /**
91
+ * Create necessary directories for the skill
92
+ */
93
+ async function prepareDirectories(targetDir: string): Promise<void> {
94
+ // Create main directory
95
+ await fs.mkdir(targetDir, { recursive: true });
96
+
97
+ // Create references subdirectory
98
+ const refsDir = path.join(targetDir, 'references');
99
+ await fs.mkdir(refsDir, { recursive: true });
100
+
101
+ console.log(`โœ“ Directories created: ${targetDir}`);
102
+ }
103
+
104
+ /**
105
+ * Copy all skill files from source to target
106
+ */
107
+ async function copySkillFiles(
108
+ sourceDir: string,
109
+ targetDir: string
110
+ ): Promise<string[]> {
111
+ const filesToCopy = [
112
+ { source: 'SKILL.md', target: 'SKILL.md' },
113
+ { source: 'references/branch-naming.md', target: 'references/branch-naming.md' },
114
+ { source: 'references/examples.md', target: 'references/examples.md' },
115
+ ];
116
+
117
+ const copiedFiles: string[] = [];
118
+
119
+ for (const { source, target } of filesToCopy) {
120
+ const sourcePath = path.join(sourceDir, source);
121
+ const targetPath = path.join(targetDir, target);
122
+
123
+ // Ensure subdirectory exists
124
+ const targetSubdir = path.dirname(targetPath);
125
+ await fs.mkdir(targetSubdir, { recursive: true });
126
+
127
+ // Copy file
128
+ await fs.copyFile(sourcePath, targetPath);
129
+ copiedFiles.push(source);
130
+
131
+ console.log(`โœ“ Copied: ${source}`);
132
+ }
133
+
134
+ return copiedFiles;
135
+ }
136
+
137
+ /**
138
+ * Validate the copied skill has valid frontmatter
139
+ */
140
+ async function validateCopiedSkill(skillPath: string): Promise<void> {
141
+ // Verify file exists
142
+ await fs.access(skillPath, fs.constants.R_OK);
143
+
144
+ // Validate frontmatter
145
+ const content = await fs.readFile(skillPath, 'utf-8');
146
+ const { metadata } = parseFrontmatter(content, skillPath);
147
+ SkillMetadataSchema.parse(metadata);
148
+
149
+ console.log(`โœ“ Copied skill validated successfully`);
150
+ }
151
+
152
+ /**
153
+ * Test that the skill is discoverable by SkillManager
154
+ */
155
+ async function testDiscovery(): Promise<void> {
156
+ const manager = SkillManager.getInstance();
157
+ manager.reload(); // Clear cache
158
+
159
+ const skills = await manager.listSkills({
160
+ cwd: process.cwd(),
161
+ forceReload: true,
162
+ });
163
+
164
+ const mrSkills = skills.filter(s => s.metadata.name === 'mr');
165
+
166
+ if (mrSkills.length > 0) {
167
+ console.log(`โœ“ Skill discoverable (${mrSkills.length} instance(s) found)`);
168
+ mrSkills.forEach(skill => {
169
+ console.log(` Source: ${skill.source}`);
170
+ console.log(` Priority: ${skill.computedPriority}`);
171
+ console.log(` Path: ${skill.filePath}`);
172
+ });
173
+ } else {
174
+ console.warn('โš ๏ธ Skill not immediately discoverable (may need agent restart)');
175
+ }
176
+ }
177
+
178
+ /**
179
+ * Print success message with next steps
180
+ */
181
+ function printSuccess(targetDir: string, files: string[]): void {
182
+ console.log('\n' + '='.repeat(60));
183
+ console.log('โœ… Successfully copied /mr skill to global scope!');
184
+ console.log('='.repeat(60));
185
+ console.log(`\n๐Ÿ“ Location: ${targetDir}`);
186
+ console.log(`๐Ÿ“„ Files copied: ${files.length}`);
187
+ console.log(`\n๐Ÿ”„ Next steps:`);
188
+ console.log(`1. The skill is now available globally across all projects`);
189
+ console.log(`2. Use /mr in any project to create pull requests`);
190
+ console.log(`3. Run "codemie skill list" to verify it's loaded`);
191
+ console.log(`4. Run "codemie skill reload" to refresh if needed`);
192
+ console.log(`\n๐Ÿ’ก Tip: Project-level skills (if present) take priority over global skills.\n`);
193
+ }
194
+
195
+ /**
196
+ * Print error message with troubleshooting tips
197
+ */
198
+ function printError(error: unknown): void {
199
+ console.error('\n' + '='.repeat(60));
200
+ console.error('โŒ Failed to copy /mr skill');
201
+ console.error('='.repeat(60));
202
+ console.error(`\nError: ${error instanceof Error ? error.message : String(error)}`);
203
+ if (error instanceof Error && error.stack) {
204
+ console.error(`\nStack trace:\n${error.stack}`);
205
+ }
206
+ console.error(`\n๐Ÿ” Troubleshooting:`);
207
+ console.error(`- Check source exists: .codemie/skills/mr/SKILL.md`);
208
+ console.error(`- Check permissions: ~/.claude/skills/`);
209
+ console.error(`- Check disk space: df -h ~`);
210
+ console.error(`- Validate frontmatter: codemie skill validate\n`);
211
+ }
212
+
213
+ /**
214
+ * Main execution function
215
+ */
216
+ async function main(): Promise<void> {
217
+ try {
218
+ console.log('\n๐Ÿš€ Starting /mr skill copy to global scope...\n');
219
+
220
+ // Phase 1: Validate source
221
+ console.log('Phase 1: Validating source skill...');
222
+ const sourceDir = path.join(process.cwd(), '.codemie', 'skills', 'mr');
223
+ await validateSourceSkill(sourceDir);
224
+
225
+ // Phase 2: Check target
226
+ console.log('\nPhase 2: Checking target location...');
227
+ const targetDir = resolveHomeDir('.claude/skills/mr');
228
+ await checkTargetConflict(targetDir);
229
+
230
+ // Phase 3: Prepare directories
231
+ console.log('\nPhase 3: Preparing directories...');
232
+ await prepareDirectories(targetDir);
233
+
234
+ // Phase 4: Copy files
235
+ console.log('\nPhase 4: Copying skill files...');
236
+ const files = await copySkillFiles(sourceDir, targetDir);
237
+
238
+ // Phase 5: Validate
239
+ console.log('\nPhase 5: Validating copied skill...');
240
+ await validateCopiedSkill(path.join(targetDir, 'SKILL.md'));
241
+ await testDiscovery();
242
+
243
+ // Phase 6: Success feedback
244
+ printSuccess(targetDir, files);
245
+ } catch (error) {
246
+ printError(error);
247
+ process.exit(1);
248
+ }
249
+ }
250
+
251
+ // Run main function
252
+ main();
@@ -0,0 +1,125 @@
1
+ #!/bin/bash
2
+ # Demo script for testing hooks in codemie-code
3
+
4
+ set -e
5
+
6
+ GREEN='\033[0;32m'
7
+ BLUE='\033[0;34m'
8
+ YELLOW='\033[1;33m'
9
+ RED='\033[0;31m'
10
+ NC='\033[0m'
11
+
12
+ echo -e "${BLUE}โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”${NC}"
13
+ echo -e "${BLUE} CodeMie Hooks Demo${NC}"
14
+ echo -e "${BLUE}โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”${NC}"
15
+ echo ""
16
+
17
+ # Check if config exists
18
+ if [ ! -f ~/.codemie/codemie-cli.config.json ]; then
19
+ echo -e "${RED}โœ— Configuration file not found${NC}"
20
+ exit 1
21
+ fi
22
+
23
+ # Show configured hooks
24
+ echo -e "${GREEN}โœ“ Configuration loaded${NC}"
25
+ echo ""
26
+ echo "Configured Hooks:"
27
+ echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”"
28
+
29
+ # PreToolUse
30
+ echo -e "${YELLOW}PreToolUse:${NC}"
31
+ echo " โ€ข Matcher: Bash"
32
+ echo " โ€ข Action: Block 'rm -rf' commands"
33
+ echo " โ€ข Script: ~/.codemie/test-hooks/pre-tool-hook.sh"
34
+
35
+ echo ""
36
+ echo -e "${YELLOW}PostToolUse:${NC}"
37
+ echo " โ€ข Matcher: * (all tools)"
38
+ echo " โ€ข Action: Log all tool usage"
39
+ echo " โ€ข Script: ~/.codemie/test-hooks/post-tool-hook.sh"
40
+
41
+ echo ""
42
+ echo -e "${YELLOW}UserPromptSubmit:${NC}"
43
+ echo " โ€ข Action: Add context to prompts"
44
+ echo " โ€ข Script: ~/.codemie/test-hooks/prompt-hook.sh"
45
+
46
+ echo ""
47
+ echo -e "${BLUE}โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”${NC}"
48
+ echo ""
49
+
50
+ # Clear logs for clean test
51
+ rm -f ~/.codemie/hook-test.log
52
+ rm -f ~/.codemie/tool-usage.log
53
+ echo -e "${GREEN}โœ“ Logs cleared for clean test${NC}"
54
+ echo ""
55
+
56
+ # Show test scenarios
57
+ echo -e "${BLUE}Test Scenarios:${NC}"
58
+ echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”"
59
+ echo ""
60
+
61
+ echo -e "${YELLOW}Scenario 1: PreToolUse Hook Blocks Dangerous Command${NC}"
62
+ echo " Try: \"run the command: rm -rf /tmp/test\""
63
+ echo " Expected: Hook blocks it with error"
64
+ echo ""
65
+
66
+ echo -e "${YELLOW}Scenario 2: PreToolUse Hook Allows Safe Command${NC}"
67
+ echo " Try: \"run the command: echo 'Hello World'\""
68
+ echo " Expected: Command executes normally"
69
+ echo ""
70
+
71
+ echo -e "${YELLOW}Scenario 3: PostToolUse Hook Logs Tools${NC}"
72
+ echo " Try: \"read package.json and show me the name\""
73
+ echo " Expected: Tool usage logged to ~/.codemie/tool-usage.log"
74
+ echo ""
75
+
76
+ echo -e "${YELLOW}Scenario 4: UserPromptSubmit Hook Adds Context${NC}"
77
+ echo " Try any prompt and check if context is added"
78
+ echo " Expected: Agent has context about working directory"
79
+ echo ""
80
+
81
+ echo -e "${BLUE}โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”${NC}"
82
+ echo ""
83
+
84
+ echo -e "${GREEN}Monitoring:${NC}"
85
+ echo " Watch hooks in real-time:"
86
+ echo " ${BLUE}tail -f ~/.codemie/logs/debug-\$(date +%Y-%m-%d).log | grep -i hook${NC}"
87
+ echo ""
88
+ echo " Check hook logs after test:"
89
+ echo " ${BLUE}cat ~/.codemie/hook-test.log${NC}"
90
+ echo " ${BLUE}cat ~/.codemie/tool-usage.log${NC}"
91
+ echo ""
92
+
93
+ echo -e "${BLUE}โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”${NC}"
94
+ echo ""
95
+
96
+ # Ask if user wants to set API key
97
+ echo -e "${YELLOW}โš  Important: You need a valid API key to run codemie-code${NC}"
98
+ echo ""
99
+ echo "Options:"
100
+ echo " 1. Set CODEMIE_API_KEY environment variable"
101
+ echo " 2. Update ~/.codemie/codemie-cli.config.json with your key"
102
+ echo " 3. Run: codemie setup"
103
+ echo ""
104
+
105
+ read -p "Do you have an API key configured? (y/n) " -n 1 -r
106
+ echo
107
+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
108
+ echo ""
109
+ echo -e "${YELLOW}Please configure your API key first:${NC}"
110
+ echo " export CODEMIE_API_KEY='your-key-here'"
111
+ echo ""
112
+ echo "Then run:"
113
+ echo " ${BLUE}codemie-code${NC}"
114
+ echo ""
115
+ exit 0
116
+ fi
117
+
118
+ echo ""
119
+ echo -e "${GREEN}Starting codemie-code with hooks enabled...${NC}"
120
+ echo ""
121
+ echo -e "${BLUE}โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”${NC}"
122
+ echo ""
123
+
124
+ # Start codemie-code
125
+ codemie-code
@@ -0,0 +1,196 @@
1
+ #!/bin/bash
2
+ # Quick Hooks System Test Script
3
+ # Tests the hooks implementation with example scenarios
4
+
5
+ set -e
6
+
7
+ HOOKS_DIR="$HOME/.codemie/test-hooks"
8
+ LOG_FILE="$HOME/.codemie/hook-test.log"
9
+ TEST_CONFIG="$HOME/.codemie/test-hooks-config.json"
10
+
11
+ echo "๐Ÿงช CodeMie Hooks System Test"
12
+ echo "=============================="
13
+ echo ""
14
+
15
+ # Colors for output
16
+ GREEN='\033[0;32m'
17
+ RED='\033[0;31m'
18
+ YELLOW='\033[1;33m'
19
+ NC='\033[0m' # No Color
20
+
21
+ # Check if jq is installed
22
+ if ! command -v jq &> /dev/null; then
23
+ echo -e "${RED}โœ— Error: jq is required but not installed${NC}"
24
+ echo "Install with: brew install jq (macOS) or apt-get install jq (Linux)"
25
+ exit 1
26
+ fi
27
+
28
+ # Create test hooks directory
29
+ echo "๐Ÿ“ Setting up test environment..."
30
+ mkdir -p "$HOOKS_DIR"
31
+
32
+ # Create PreToolUse hook (blocks rm -rf)
33
+ cat > "$HOOKS_DIR/pre-tool-hook.sh" << 'EOF'
34
+ #!/bin/bash
35
+ TOOL_NAME=$(echo "$CODEMIE_HOOK_INPUT" | jq -r '.tool_name')
36
+ echo "[PreToolUse] Tool: $TOOL_NAME" >> ~/.codemie/hook-test.log
37
+
38
+ if [[ "$TOOL_NAME" == "Bash" ]]; then
39
+ COMMAND=$(echo "$CODEMIE_HOOK_INPUT" | jq -r '.tool_input.command')
40
+ if [[ "$COMMAND" =~ "rm -rf" ]]; then
41
+ echo '{"decision": "block", "reason": "Dangerous command blocked: rm -rf"}'
42
+ exit 0
43
+ fi
44
+ fi
45
+
46
+ echo '{"decision": "allow"}'
47
+ exit 0
48
+ EOF
49
+
50
+ # Create PostToolUse hook (logs all usage)
51
+ cat > "$HOOKS_DIR/post-tool-hook.sh" << 'EOF'
52
+ #!/bin/bash
53
+ TOOL_NAME=$(echo "$CODEMIE_HOOK_INPUT" | jq -r '.tool_name')
54
+ TIMESTAMP=$(date '+%Y-%m-%d %H:%M:%S')
55
+ echo "[$TIMESTAMP] Tool: $TOOL_NAME" >> ~/.codemie/tool-usage.log
56
+ echo '{"decision": "allow"}'
57
+ exit 0
58
+ EOF
59
+
60
+ # Create UserPromptSubmit hook (adds context)
61
+ cat > "$HOOKS_DIR/prompt-hook.sh" << 'EOF'
62
+ #!/bin/bash
63
+ echo "{
64
+ \"decision\": \"allow\",
65
+ \"additionalContext\": \"Test context: Working in $(pwd)\"
66
+ }"
67
+ exit 0
68
+ EOF
69
+
70
+ # Make scripts executable
71
+ chmod +x "$HOOKS_DIR"/*.sh
72
+
73
+ echo -e "${GREEN}โœ“ Test hooks created${NC}"
74
+ echo ""
75
+
76
+ # Run tests
77
+ echo "๐Ÿงช Running Hook Tests..."
78
+ echo "----------------------"
79
+
80
+ # Clear logs
81
+ rm -f "$LOG_FILE" "$HOME/.codemie/tool-usage.log"
82
+
83
+ # Test 1: PreToolUse allows safe commands
84
+ echo -n "Test 1: PreToolUse allows safe commands... "
85
+ export CODEMIE_HOOK_INPUT='{"hook_event_name":"PreToolUse","tool_name":"Bash","tool_input":{"command":"ls -la"},"session_id":"test","cwd":"'$(pwd)'"}'
86
+ RESULT=$("$HOOKS_DIR/pre-tool-hook.sh")
87
+ EXIT_CODE=$?
88
+
89
+ if [[ $EXIT_CODE -eq 0 ]] && echo "$RESULT" | jq -e '.decision == "allow"' > /dev/null 2>&1; then
90
+ echo -e "${GREEN}โœ“ PASS${NC}"
91
+ else
92
+ echo -e "${RED}โœ— FAIL${NC}"
93
+ echo " Expected: allow, Got: $RESULT"
94
+ fi
95
+
96
+ # Test 2: PreToolUse blocks dangerous commands
97
+ echo -n "Test 2: PreToolUse blocks dangerous commands... "
98
+ export CODEMIE_HOOK_INPUT='{"hook_event_name":"PreToolUse","tool_name":"Bash","tool_input":{"command":"rm -rf /test"},"session_id":"test","cwd":"'$(pwd)'"}'
99
+ RESULT=$("$HOOKS_DIR/pre-tool-hook.sh")
100
+ EXIT_CODE=$?
101
+
102
+ if [[ $EXIT_CODE -eq 0 ]] && echo "$RESULT" | jq -e '.decision == "block"' > /dev/null 2>&1; then
103
+ echo -e "${GREEN}โœ“ PASS${NC}"
104
+ else
105
+ echo -e "${RED}โœ— FAIL${NC}"
106
+ echo " Expected: block, Got: $RESULT"
107
+ fi
108
+
109
+ # Test 3: PreToolUse blocks specific tool
110
+ echo -n "Test 3: PreToolUse logs to file... "
111
+ if [ -f "$LOG_FILE" ] && grep -q "PreToolUse" "$LOG_FILE"; then
112
+ echo -e "${GREEN}โœ“ PASS${NC}"
113
+ else
114
+ echo -e "${RED}โœ— FAIL${NC}"
115
+ echo " Expected log file with PreToolUse entries"
116
+ fi
117
+
118
+ # Test 4: PostToolUse creates logs
119
+ echo -n "Test 4: PostToolUse creates usage logs... "
120
+ export CODEMIE_HOOK_INPUT='{"hook_event_name":"PostToolUse","tool_name":"Read","session_id":"test","cwd":"'$(pwd)'"}'
121
+ RESULT=$("$HOOKS_DIR/post-tool-hook.sh")
122
+
123
+ if [ -f "$HOME/.codemie/tool-usage.log" ] && grep -q "Tool: Read" "$HOME/.codemie/tool-usage.log"; then
124
+ echo -e "${GREEN}โœ“ PASS${NC}"
125
+ else
126
+ echo -e "${RED}โœ— FAIL${NC}"
127
+ echo " Expected usage log with Read entry"
128
+ fi
129
+
130
+ # Test 5: UserPromptSubmit adds context
131
+ echo -n "Test 5: UserPromptSubmit adds context... "
132
+ export CODEMIE_HOOK_INPUT='{"hook_event_name":"UserPromptSubmit","prompt":"test prompt","session_id":"test","cwd":"'$(pwd)'"}'
133
+ RESULT=$("$HOOKS_DIR/prompt-hook.sh")
134
+
135
+ if echo "$RESULT" | jq -e '.additionalContext != null' > /dev/null 2>&1; then
136
+ echo -e "${GREEN}โœ“ PASS${NC}"
137
+ else
138
+ echo -e "${RED}โœ— FAIL${NC}"
139
+ echo " Expected additionalContext in result"
140
+ fi
141
+
142
+ # Test 6: Hook JSON output is valid
143
+ echo -n "Test 6: Hook output is valid JSON... "
144
+ export CODEMIE_HOOK_INPUT='{"hook_event_name":"PreToolUse","tool_name":"Test","session_id":"test","cwd":"'$(pwd)'"}'
145
+ RESULT=$("$HOOKS_DIR/pre-tool-hook.sh")
146
+
147
+ if echo "$RESULT" | jq '.' > /dev/null 2>&1; then
148
+ echo -e "${GREEN}โœ“ PASS${NC}"
149
+ else
150
+ echo -e "${RED}โœ— FAIL${NC}"
151
+ echo " Hook output is not valid JSON: $RESULT"
152
+ fi
153
+
154
+ # Test 7: Hook execution time
155
+ echo -n "Test 7: Hook performance (< 100ms)... "
156
+ export CODEMIE_HOOK_INPUT='{"hook_event_name":"PreToolUse","tool_name":"Test","session_id":"test","cwd":"'$(pwd)'"}'
157
+ START=$(date +%s%N)
158
+ "$HOOKS_DIR/pre-tool-hook.sh" > /dev/null
159
+ END=$(date +%s%N)
160
+ DURATION=$(( ($END - $START) / 1000000 )) # Convert to milliseconds
161
+
162
+ if [ $DURATION -lt 100 ]; then
163
+ echo -e "${GREEN}โœ“ PASS${NC} (${DURATION}ms)"
164
+ else
165
+ echo -e "${YELLOW}โš  SLOW${NC} (${DURATION}ms)"
166
+ fi
167
+
168
+ echo ""
169
+ echo "๐Ÿ“Š Test Summary"
170
+ echo "----------------------"
171
+ echo "Test hooks created at: $HOOKS_DIR"
172
+ echo "Logs created at:"
173
+ echo " - $LOG_FILE"
174
+ echo " - $HOME/.codemie/tool-usage.log"
175
+ echo ""
176
+ echo -e "${YELLOW}Next Steps:${NC}"
177
+ echo "1. Review test hooks: ls -la $HOOKS_DIR"
178
+ echo "2. Check logs: cat $LOG_FILE"
179
+ echo "3. View full testing guide: docs/HOOKS_TESTING.md"
180
+ echo "4. Configure hooks in your profile: ~/.codemie/codemie-cli.config.json"
181
+ echo ""
182
+ echo "Example configuration:"
183
+ echo ' "hooks": {'
184
+ echo ' "PreToolUse": ['
185
+ echo ' {'
186
+ echo ' "matcher": "Bash",'
187
+ echo ' "hooks": [{'
188
+ echo ' "type": "command",'
189
+ echo " \"command\": \"$HOOKS_DIR/pre-tool-hook.sh\","
190
+ echo ' "timeout": 5000'
191
+ echo ' }]'
192
+ echo ' }'
193
+ echo ' ]'
194
+ echo ' }'
195
+ echo ""
196
+ echo -e "${GREEN}โœ“ All basic tests passed!${NC}"