@codemieai/code 0.0.28 → 0.0.29

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 (368) hide show
  1. package/README.md +8 -10
  2. package/bin/agent-executor.js +1 -1
  3. package/dist/agents/codemie-code/config.d.ts.map +1 -1
  4. package/dist/agents/codemie-code/config.js +0 -1
  5. package/dist/agents/codemie-code/config.js.map +1 -1
  6. package/dist/agents/core/AgentCLI.d.ts.map +1 -1
  7. package/dist/agents/core/AgentCLI.js +4 -8
  8. package/dist/agents/core/AgentCLI.js.map +1 -1
  9. package/dist/agents/core/BaseAgentAdapter.d.ts +17 -9
  10. package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
  11. package/dist/agents/core/BaseAgentAdapter.js +75 -67
  12. package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
  13. package/dist/agents/core/extension/BaseExtensionInstaller.d.ts +258 -0
  14. package/dist/agents/core/extension/BaseExtensionInstaller.d.ts.map +1 -0
  15. package/dist/agents/core/extension/BaseExtensionInstaller.js +522 -0
  16. package/dist/agents/core/extension/BaseExtensionInstaller.js.map +1 -0
  17. package/dist/agents/core/lifecycle-helpers.d.ts.map +1 -1
  18. package/dist/agents/core/lifecycle-helpers.js +16 -2
  19. package/dist/agents/core/lifecycle-helpers.js.map +1 -1
  20. package/dist/agents/core/metrics/index.d.ts +0 -2
  21. package/dist/agents/core/metrics/index.d.ts.map +1 -1
  22. package/dist/agents/core/metrics/index.js +0 -3
  23. package/dist/agents/core/metrics/index.js.map +1 -1
  24. package/dist/agents/core/metrics/types.d.ts +4 -232
  25. package/dist/agents/core/metrics/types.d.ts.map +1 -1
  26. package/dist/agents/core/metrics/types.js +2 -2
  27. package/dist/agents/core/session/BaseProcessor.d.ts +72 -0
  28. package/dist/agents/core/session/BaseProcessor.d.ts.map +1 -0
  29. package/dist/agents/core/session/BaseProcessor.js +9 -0
  30. package/dist/agents/core/session/BaseProcessor.js.map +1 -0
  31. package/dist/agents/core/session/BaseSessionAdapter.d.ts +99 -0
  32. package/dist/agents/core/session/BaseSessionAdapter.d.ts.map +1 -0
  33. package/dist/agents/core/session/BaseSessionAdapter.js +9 -0
  34. package/dist/agents/core/session/BaseSessionAdapter.js.map +1 -0
  35. package/dist/agents/core/session/SessionStore.d.ts +23 -0
  36. package/dist/agents/core/session/SessionStore.d.ts.map +1 -0
  37. package/dist/agents/core/session/SessionStore.js +75 -0
  38. package/dist/agents/core/session/SessionStore.js.map +1 -0
  39. package/dist/agents/core/session/session-config.d.ts +27 -0
  40. package/dist/agents/core/session/session-config.d.ts.map +1 -0
  41. package/dist/agents/core/session/session-config.js +61 -0
  42. package/dist/agents/core/session/session-config.js.map +1 -0
  43. package/dist/agents/core/session/types.d.ts +87 -0
  44. package/dist/agents/core/session/types.d.ts.map +1 -0
  45. package/dist/agents/core/session/types.js +8 -0
  46. package/dist/agents/core/session/types.js.map +1 -0
  47. package/dist/agents/core/session/utils/jsonl-reader.d.ts +15 -0
  48. package/dist/agents/core/session/utils/jsonl-reader.d.ts.map +1 -0
  49. package/dist/agents/core/session/utils/jsonl-reader.js +33 -0
  50. package/dist/agents/core/session/utils/jsonl-reader.js.map +1 -0
  51. package/dist/agents/core/session/utils/jsonl-writer.d.ts +26 -0
  52. package/dist/agents/core/session/utils/jsonl-writer.d.ts.map +1 -0
  53. package/dist/agents/core/session/utils/jsonl-writer.js +56 -0
  54. package/dist/agents/core/session/utils/jsonl-writer.js.map +1 -0
  55. package/dist/agents/core/types.d.ts +78 -11
  56. package/dist/agents/core/types.d.ts.map +1 -1
  57. package/dist/agents/plugins/claude/claude-message-types.d.ts +74 -0
  58. package/dist/agents/plugins/claude/claude-message-types.d.ts.map +1 -0
  59. package/dist/agents/plugins/claude/claude-message-types.js +8 -0
  60. package/dist/agents/plugins/claude/claude-message-types.js.map +1 -0
  61. package/dist/agents/plugins/claude/claude.plugin-installer.d.ts +53 -0
  62. package/dist/agents/plugins/claude/claude.plugin-installer.d.ts.map +1 -0
  63. package/dist/agents/plugins/claude/claude.plugin-installer.js +63 -0
  64. package/dist/agents/plugins/claude/claude.plugin-installer.js.map +1 -0
  65. package/dist/agents/plugins/claude/claude.plugin.d.ts +26 -0
  66. package/dist/agents/plugins/claude/claude.plugin.d.ts.map +1 -0
  67. package/dist/agents/plugins/{claude.plugin.js → claude/claude.plugin.js} +20 -11
  68. package/dist/agents/plugins/claude/claude.plugin.js.map +1 -0
  69. package/dist/agents/plugins/claude/claude.session.d.ts +60 -0
  70. package/dist/agents/plugins/claude/claude.session.d.ts.map +1 -0
  71. package/dist/agents/plugins/claude/claude.session.js +339 -0
  72. package/dist/agents/plugins/claude/claude.session.js.map +1 -0
  73. package/dist/agents/plugins/claude/plugin/.claude-plugin/local-install.json +15 -0
  74. package/dist/agents/plugins/claude/plugin/.claude-plugin/plugin.json +9 -0
  75. package/dist/agents/plugins/claude/plugin/README.md +299 -0
  76. package/dist/agents/plugins/claude/plugin/claude-templates/README.md +539 -0
  77. package/dist/agents/plugins/claude/plugin/claude-templates/templates/CLAUDE.md.template +511 -0
  78. package/dist/agents/plugins/claude/plugin/claude-templates/templates/INDEX.md +205 -0
  79. package/dist/agents/plugins/claude/plugin/claude-templates/templates/TEMPLATE_SIZES.md +74 -0
  80. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/api/api-patterns.md.template +207 -0
  81. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/layered-architecture.md.template +143 -0
  82. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/project-structure.md.template +127 -0
  83. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/data/database-patterns.md.template +168 -0
  84. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/development/development-practices.md.template +210 -0
  85. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/integration/external-integrations.md.template +160 -0
  86. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/security/security-practices.md.template +170 -0
  87. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/standards/code-quality.md.template +150 -0
  88. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/standards/git-workflow.md.template +177 -0
  89. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/testing/testing-patterns.md.template +143 -0
  90. package/dist/agents/plugins/claude/plugin/commands/README.md +0 -0
  91. package/dist/agents/plugins/claude/plugin/commands/codemie-catchup.md +10 -0
  92. package/dist/agents/plugins/claude/plugin/commands/codemie-init.md +731 -0
  93. package/dist/agents/plugins/claude/plugin/commands/memory-add.md +44 -0
  94. package/dist/agents/plugins/claude/plugin/commands/memory-init.md +18 -0
  95. package/dist/agents/plugins/claude/plugin/commands/memory-refresh.md +54 -0
  96. package/dist/agents/plugins/claude/plugin/hooks/hooks.json +71 -0
  97. package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.d.ts +51 -0
  98. package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.d.ts.map +1 -0
  99. package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js +840 -0
  100. package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js.map +1 -0
  101. package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.d.ts +37 -0
  102. package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.d.ts.map +1 -0
  103. package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js +275 -0
  104. package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js.map +1 -0
  105. package/dist/agents/plugins/gemini/extension/README.md +88 -0
  106. package/dist/agents/plugins/gemini/extension/gemini-extension.json +11 -0
  107. package/dist/agents/plugins/gemini/extension/hooks/hooks.json +65 -0
  108. package/dist/agents/plugins/gemini/gemini.extension-installer.d.ts +49 -0
  109. package/dist/agents/plugins/gemini/gemini.extension-installer.d.ts.map +1 -0
  110. package/dist/agents/plugins/gemini/gemini.extension-installer.js +63 -0
  111. package/dist/agents/plugins/gemini/gemini.extension-installer.js.map +1 -0
  112. package/dist/agents/plugins/gemini/gemini.hook-transformer.d.ts +43 -0
  113. package/dist/agents/plugins/gemini/gemini.hook-transformer.d.ts.map +1 -0
  114. package/dist/agents/plugins/gemini/gemini.hook-transformer.js +57 -0
  115. package/dist/agents/plugins/gemini/gemini.hook-transformer.js.map +1 -0
  116. package/dist/agents/plugins/gemini/gemini.plugin.d.ts +32 -0
  117. package/dist/agents/plugins/gemini/gemini.plugin.d.ts.map +1 -0
  118. package/dist/agents/plugins/gemini/gemini.plugin.js +136 -0
  119. package/dist/agents/plugins/gemini/gemini.plugin.js.map +1 -0
  120. package/dist/agents/plugins/gemini/gemini.session-adapter.d.ts +68 -0
  121. package/dist/agents/plugins/gemini/gemini.session-adapter.d.ts.map +1 -0
  122. package/dist/agents/plugins/gemini/gemini.session-adapter.js +268 -0
  123. package/dist/agents/plugins/gemini/gemini.session-adapter.js.map +1 -0
  124. package/dist/agents/plugins/gemini/session/processors/gemini.conversations-processor.d.ts +36 -0
  125. package/dist/agents/plugins/gemini/session/processors/gemini.conversations-processor.d.ts.map +1 -0
  126. package/dist/agents/plugins/gemini/session/processors/gemini.conversations-processor.js +186 -0
  127. package/dist/agents/plugins/gemini/session/processors/gemini.conversations-processor.js.map +1 -0
  128. package/dist/agents/plugins/gemini/session/processors/gemini.metrics-processor.d.ts +32 -0
  129. package/dist/agents/plugins/gemini/session/processors/gemini.metrics-processor.d.ts.map +1 -0
  130. package/dist/agents/plugins/gemini/session/processors/gemini.metrics-processor.js +193 -0
  131. package/dist/agents/plugins/gemini/session/processors/gemini.metrics-processor.js.map +1 -0
  132. package/dist/agents/plugins/gemini/session/utils/token-aggregator.d.ts +26 -0
  133. package/dist/agents/plugins/gemini/session/utils/token-aggregator.d.ts.map +1 -0
  134. package/dist/agents/plugins/gemini/session/utils/token-aggregator.js +38 -0
  135. package/dist/agents/plugins/gemini/session/utils/token-aggregator.js.map +1 -0
  136. package/dist/agents/plugins/gemini/session/utils/tool-aggregator.d.ts +33 -0
  137. package/dist/agents/plugins/gemini/session/utils/tool-aggregator.d.ts.map +1 -0
  138. package/dist/agents/plugins/gemini/session/utils/tool-aggregator.js +58 -0
  139. package/dist/agents/plugins/gemini/session/utils/tool-aggregator.js.map +1 -0
  140. package/dist/agents/plugins/gemini/session/utils/turn-detector.d.ts +70 -0
  141. package/dist/agents/plugins/gemini/session/utils/turn-detector.d.ts.map +1 -0
  142. package/dist/agents/plugins/gemini/session/utils/turn-detector.js +86 -0
  143. package/dist/agents/plugins/gemini/session/utils/turn-detector.js.map +1 -0
  144. package/dist/agents/registry.d.ts +7 -2
  145. package/dist/agents/registry.d.ts.map +1 -1
  146. package/dist/agents/registry.js +17 -8
  147. package/dist/agents/registry.js.map +1 -1
  148. package/dist/cli/commands/analytics/data-loader.d.ts +1 -1
  149. package/dist/cli/commands/analytics/data-loader.js +1 -1
  150. package/dist/cli/commands/analytics/index.js +1 -1
  151. package/dist/cli/commands/analytics/index.js.map +1 -1
  152. package/dist/cli/commands/doctor/checks/PythonCheck.d.ts +13 -0
  153. package/dist/cli/commands/doctor/checks/PythonCheck.d.ts.map +1 -1
  154. package/dist/cli/commands/doctor/checks/PythonCheck.js +90 -31
  155. package/dist/cli/commands/doctor/checks/PythonCheck.js.map +1 -1
  156. package/dist/cli/commands/hook.d.ts +7 -0
  157. package/dist/cli/commands/hook.d.ts.map +1 -0
  158. package/dist/cli/commands/hook.js +788 -0
  159. package/dist/cli/commands/hook.js.map +1 -0
  160. package/dist/cli/commands/setup.d.ts.map +1 -1
  161. package/dist/cli/commands/setup.js +3 -4
  162. package/dist/cli/commands/setup.js.map +1 -1
  163. package/dist/cli/commands/update.d.ts.map +1 -1
  164. package/dist/cli/commands/update.js +2 -1
  165. package/dist/cli/commands/update.js.map +1 -1
  166. package/dist/cli/first-time.d.ts +4 -0
  167. package/dist/cli/first-time.d.ts.map +1 -1
  168. package/dist/cli/first-time.js +26 -13
  169. package/dist/cli/first-time.js.map +1 -1
  170. package/dist/cli/index.js +2 -0
  171. package/dist/cli/index.js.map +1 -1
  172. package/dist/frameworks/core/types.d.ts +1 -1
  173. package/dist/frameworks/plugins/speckit.plugin.d.ts.map +1 -1
  174. package/dist/frameworks/plugins/speckit.plugin.js +1 -2
  175. package/dist/frameworks/plugins/speckit.plugin.js.map +1 -1
  176. package/dist/migrations/002-consolidate-sessions.migration.d.ts +50 -0
  177. package/dist/migrations/002-consolidate-sessions.migration.d.ts.map +1 -0
  178. package/dist/migrations/002-consolidate-sessions.migration.js +220 -0
  179. package/dist/migrations/002-consolidate-sessions.migration.js.map +1 -0
  180. package/dist/migrations/index.d.ts +1 -0
  181. package/dist/migrations/index.d.ts.map +1 -1
  182. package/dist/migrations/index.js +3 -2
  183. package/dist/migrations/index.js.map +1 -1
  184. package/dist/providers/core/types.d.ts +1 -1
  185. package/dist/providers/plugins/ollama/ollama.template.d.ts.map +1 -1
  186. package/dist/providers/plugins/ollama/ollama.template.js +2 -10
  187. package/dist/providers/plugins/ollama/ollama.template.js.map +1 -1
  188. package/dist/providers/plugins/sso/index.d.ts +1 -1
  189. package/dist/providers/plugins/sso/index.d.ts.map +1 -1
  190. package/dist/providers/plugins/sso/index.js +1 -1
  191. package/dist/providers/plugins/sso/index.js.map +1 -1
  192. package/dist/providers/plugins/sso/proxy/plugins/index.d.ts +1 -1
  193. package/dist/providers/plugins/sso/proxy/plugins/index.d.ts.map +1 -1
  194. package/dist/providers/plugins/sso/proxy/plugins/index.js +3 -3
  195. package/dist/providers/plugins/sso/proxy/plugins/index.js.map +1 -1
  196. package/dist/providers/plugins/sso/proxy/plugins/sso.session-sync.plugin.d.ts +40 -0
  197. package/dist/providers/plugins/sso/proxy/plugins/sso.session-sync.plugin.d.ts.map +1 -0
  198. package/dist/providers/plugins/sso/proxy/plugins/sso.session-sync.plugin.js +194 -0
  199. package/dist/providers/plugins/sso/proxy/plugins/sso.session-sync.plugin.js.map +1 -0
  200. package/dist/providers/plugins/sso/proxy/proxy-http-client.d.ts +1 -0
  201. package/dist/providers/plugins/sso/proxy/proxy-http-client.d.ts.map +1 -1
  202. package/dist/providers/plugins/sso/proxy/proxy-http-client.js +40 -6
  203. package/dist/providers/plugins/sso/proxy/proxy-http-client.js.map +1 -1
  204. package/dist/providers/plugins/sso/session/BaseProcessor.d.ts +72 -0
  205. package/dist/providers/plugins/sso/session/BaseProcessor.d.ts.map +1 -0
  206. package/dist/providers/plugins/sso/session/BaseProcessor.js +9 -0
  207. package/dist/providers/plugins/sso/session/BaseProcessor.js.map +1 -0
  208. package/dist/providers/plugins/sso/session/BaseSessionAdapter.d.ts +99 -0
  209. package/dist/providers/plugins/sso/session/BaseSessionAdapter.d.ts.map +1 -0
  210. package/dist/providers/plugins/sso/session/BaseSessionAdapter.js +9 -0
  211. package/dist/providers/plugins/sso/session/BaseSessionAdapter.js.map +1 -0
  212. package/dist/providers/plugins/sso/session/SessionSyncer.d.ts +36 -0
  213. package/dist/providers/plugins/sso/session/SessionSyncer.d.ts.map +1 -0
  214. package/dist/providers/plugins/sso/session/SessionSyncer.js +140 -0
  215. package/dist/providers/plugins/sso/session/SessionSyncer.js.map +1 -0
  216. package/dist/providers/plugins/sso/session/processors/conversations/conversation-api-client.d.ts +26 -0
  217. package/dist/providers/plugins/sso/session/processors/conversations/conversation-api-client.d.ts.map +1 -0
  218. package/dist/providers/plugins/sso/session/processors/conversations/conversation-api-client.js +146 -0
  219. package/dist/providers/plugins/sso/session/processors/conversations/conversation-api-client.js.map +1 -0
  220. package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.d.ts +23 -0
  221. package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.d.ts.map +1 -0
  222. package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.js +171 -0
  223. package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.js.map +1 -0
  224. package/dist/providers/plugins/sso/session/processors/conversations/conversation-types.d.ts +69 -0
  225. package/dist/providers/plugins/sso/session/processors/conversations/conversation-types.d.ts.map +1 -0
  226. package/dist/providers/plugins/sso/session/processors/conversations/conversation-types.js +7 -0
  227. package/dist/providers/plugins/sso/session/processors/conversations/conversation-types.js.map +1 -0
  228. package/dist/providers/plugins/sso/session/processors/metrics/MetricsWriter.d.ts +30 -0
  229. package/dist/providers/plugins/sso/session/processors/metrics/MetricsWriter.d.ts.map +1 -0
  230. package/dist/providers/plugins/sso/session/processors/metrics/MetricsWriter.js +79 -0
  231. package/dist/providers/plugins/sso/session/processors/metrics/MetricsWriter.js.map +1 -0
  232. package/dist/providers/plugins/sso/{metrics/sync/sso.metrics-aggregator.d.ts → session/processors/metrics/metrics-aggregator.d.ts} +6 -5
  233. package/dist/providers/plugins/sso/session/processors/metrics/metrics-aggregator.d.ts.map +1 -0
  234. package/dist/providers/plugins/sso/{metrics/sync/sso.metrics-aggregator.js → session/processors/metrics/metrics-aggregator.js} +20 -12
  235. package/dist/providers/plugins/sso/session/processors/metrics/metrics-aggregator.js.map +1 -0
  236. package/dist/providers/plugins/sso/{metrics/sync/sso.metrics-sender.d.ts → session/processors/metrics/metrics-api-client.d.ts} +18 -11
  237. package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.d.ts.map +1 -0
  238. package/dist/providers/plugins/sso/{metrics/sync/sso.metrics-sender.js → session/processors/metrics/metrics-api-client.js} +143 -15
  239. package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.js.map +1 -0
  240. package/dist/providers/plugins/sso/{metrics/sync/sso.metrics-post-processor.d.ts → session/processors/metrics/metrics-post-processor.d.ts} +3 -3
  241. package/dist/providers/plugins/sso/session/processors/metrics/metrics-post-processor.d.ts.map +1 -0
  242. package/dist/providers/plugins/sso/{metrics/sync/sso.metrics-post-processor.js → session/processors/metrics/metrics-post-processor.js} +3 -3
  243. package/dist/providers/plugins/sso/session/processors/metrics/metrics-post-processor.js.map +1 -0
  244. package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.d.ts +24 -0
  245. package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.d.ts.map +1 -0
  246. package/dist/providers/plugins/sso/{metrics/sync/sso.metrics-sync.plugin.js → session/processors/metrics/metrics-sync-processor.js} +94 -165
  247. package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.js.map +1 -0
  248. package/dist/providers/plugins/sso/{metrics/sync/sso.metrics-types.d.ts → session/processors/metrics/metrics-types.d.ts} +2 -1
  249. package/dist/providers/plugins/sso/session/processors/metrics/metrics-types.d.ts.map +1 -0
  250. package/dist/providers/plugins/sso/{metrics/sync/sso.metrics-types.js → session/processors/metrics/metrics-types.js} +1 -1
  251. package/dist/providers/plugins/sso/session/processors/metrics/metrics-types.js.map +1 -0
  252. package/dist/providers/plugins/sso/session/utils/jsonl-reader.d.ts +15 -0
  253. package/dist/providers/plugins/sso/session/utils/jsonl-reader.d.ts.map +1 -0
  254. package/dist/providers/plugins/sso/session/utils/jsonl-reader.js +33 -0
  255. package/dist/providers/plugins/sso/session/utils/jsonl-reader.js.map +1 -0
  256. package/dist/providers/plugins/sso/session/utils/jsonl-writer.d.ts +26 -0
  257. package/dist/providers/plugins/sso/session/utils/jsonl-writer.d.ts.map +1 -0
  258. package/dist/providers/plugins/sso/{metrics/sync/sso.jsonl-writer.js → session/utils/jsonl-writer.js} +11 -27
  259. package/dist/providers/plugins/sso/session/utils/jsonl-writer.js.map +1 -0
  260. package/dist/providers/plugins/sso/sso.template.d.ts.map +1 -1
  261. package/dist/providers/plugins/sso/sso.template.js +71 -44
  262. package/dist/providers/plugins/sso/sso.template.js.map +1 -1
  263. package/dist/utils/file-operations.d.ts +20 -0
  264. package/dist/utils/file-operations.d.ts.map +1 -0
  265. package/dist/utils/file-operations.js +48 -0
  266. package/dist/utils/file-operations.js.map +1 -0
  267. package/dist/utils/logger.d.ts +2 -1
  268. package/dist/utils/logger.d.ts.map +1 -1
  269. package/dist/utils/logger.js +12 -4
  270. package/dist/utils/logger.js.map +1 -1
  271. package/dist/utils/paths.d.ts +20 -5
  272. package/dist/utils/paths.d.ts.map +1 -1
  273. package/dist/utils/paths.js +23 -5
  274. package/dist/utils/paths.js.map +1 -1
  275. package/dist/utils/processes.d.ts +2 -0
  276. package/dist/utils/processes.d.ts.map +1 -1
  277. package/dist/utils/processes.js +6 -1
  278. package/dist/utils/processes.js.map +1 -1
  279. package/package.json +9 -9
  280. package/scripts/copy-plugins.js +57 -0
  281. package/scripts/license-check.js +23 -0
  282. package/bin/codemie-codex.js +0 -18
  283. package/bin/codemie-deepagents.js +0 -18
  284. package/dist/agents/core/BaseMetricsAdapter.d.ts +0 -165
  285. package/dist/agents/core/BaseMetricsAdapter.d.ts.map +0 -1
  286. package/dist/agents/core/BaseMetricsAdapter.js +0 -308
  287. package/dist/agents/core/BaseMetricsAdapter.js.map +0 -1
  288. package/dist/agents/core/metrics/MetricsOrchestrator.d.ts +0 -81
  289. package/dist/agents/core/metrics/MetricsOrchestrator.d.ts.map +0 -1
  290. package/dist/agents/core/metrics/MetricsOrchestrator.js +0 -417
  291. package/dist/agents/core/metrics/MetricsOrchestrator.js.map +0 -1
  292. package/dist/agents/core/metrics/core/DeltaWriter.d.ts +0 -49
  293. package/dist/agents/core/metrics/core/DeltaWriter.d.ts.map +0 -1
  294. package/dist/agents/core/metrics/core/DeltaWriter.js +0 -152
  295. package/dist/agents/core/metrics/core/DeltaWriter.js.map +0 -1
  296. package/dist/agents/core/metrics/core/FileSnapshotter.d.ts +0 -22
  297. package/dist/agents/core/metrics/core/FileSnapshotter.d.ts.map +0 -1
  298. package/dist/agents/core/metrics/core/FileSnapshotter.js +0 -74
  299. package/dist/agents/core/metrics/core/FileSnapshotter.js.map +0 -1
  300. package/dist/agents/core/metrics/core/SessionCorrelator.d.ts +0 -34
  301. package/dist/agents/core/metrics/core/SessionCorrelator.d.ts.map +0 -1
  302. package/dist/agents/core/metrics/core/SessionCorrelator.js +0 -157
  303. package/dist/agents/core/metrics/core/SessionCorrelator.js.map +0 -1
  304. package/dist/agents/core/metrics/core/SyncStateManager.d.ts +0 -69
  305. package/dist/agents/core/metrics/core/SyncStateManager.d.ts.map +0 -1
  306. package/dist/agents/core/metrics/core/SyncStateManager.js +0 -283
  307. package/dist/agents/core/metrics/core/SyncStateManager.js.map +0 -1
  308. package/dist/agents/core/metrics/session/SessionStore.d.ts +0 -43
  309. package/dist/agents/core/metrics/session/SessionStore.d.ts.map +0 -1
  310. package/dist/agents/core/metrics/session/SessionStore.js +0 -146
  311. package/dist/agents/core/metrics/session/SessionStore.js.map +0 -1
  312. package/dist/agents/core/metrics-config.d.ts +0 -38
  313. package/dist/agents/core/metrics-config.d.ts.map +0 -1
  314. package/dist/agents/core/metrics-config.js +0 -96
  315. package/dist/agents/core/metrics-config.js.map +0 -1
  316. package/dist/agents/plugins/claude.metrics.d.ts +0 -102
  317. package/dist/agents/plugins/claude.metrics.d.ts.map +0 -1
  318. package/dist/agents/plugins/claude.metrics.js +0 -656
  319. package/dist/agents/plugins/claude.metrics.js.map +0 -1
  320. package/dist/agents/plugins/claude.plugin.d.ts +0 -19
  321. package/dist/agents/plugins/claude.plugin.d.ts.map +0 -1
  322. package/dist/agents/plugins/claude.plugin.js.map +0 -1
  323. package/dist/agents/plugins/codex.metrics.d.ts +0 -69
  324. package/dist/agents/plugins/codex.metrics.d.ts.map +0 -1
  325. package/dist/agents/plugins/codex.metrics.js +0 -483
  326. package/dist/agents/plugins/codex.metrics.js.map +0 -1
  327. package/dist/agents/plugins/codex.plugin.d.ts +0 -21
  328. package/dist/agents/plugins/codex.plugin.d.ts.map +0 -1
  329. package/dist/agents/plugins/codex.plugin.js +0 -222
  330. package/dist/agents/plugins/codex.plugin.js.map +0 -1
  331. package/dist/agents/plugins/deepagents.plugin.d.ts +0 -21
  332. package/dist/agents/plugins/deepagents.plugin.d.ts.map +0 -1
  333. package/dist/agents/plugins/deepagents.plugin.js +0 -104
  334. package/dist/agents/plugins/deepagents.plugin.js.map +0 -1
  335. package/dist/agents/plugins/gemini.metrics.d.ts +0 -99
  336. package/dist/agents/plugins/gemini.metrics.d.ts.map +0 -1
  337. package/dist/agents/plugins/gemini.metrics.js +0 -475
  338. package/dist/agents/plugins/gemini.metrics.js.map +0 -1
  339. package/dist/agents/plugins/gemini.plugin.d.ts +0 -16
  340. package/dist/agents/plugins/gemini.plugin.d.ts.map +0 -1
  341. package/dist/agents/plugins/gemini.plugin.js +0 -80
  342. package/dist/agents/plugins/gemini.plugin.js.map +0 -1
  343. package/dist/agents/plugins/history-parser.d.ts +0 -52
  344. package/dist/agents/plugins/history-parser.d.ts.map +0 -1
  345. package/dist/agents/plugins/history-parser.js +0 -155
  346. package/dist/agents/plugins/history-parser.js.map +0 -1
  347. package/dist/providers/plugins/sso/metrics/sync/sso.jsonl-writer.d.ts +0 -28
  348. package/dist/providers/plugins/sso/metrics/sync/sso.jsonl-writer.d.ts.map +0 -1
  349. package/dist/providers/plugins/sso/metrics/sync/sso.jsonl-writer.js.map +0 -1
  350. package/dist/providers/plugins/sso/metrics/sync/sso.lifecycle-handler.d.ts +0 -62
  351. package/dist/providers/plugins/sso/metrics/sync/sso.lifecycle-handler.d.ts.map +0 -1
  352. package/dist/providers/plugins/sso/metrics/sync/sso.lifecycle-handler.js +0 -157
  353. package/dist/providers/plugins/sso/metrics/sync/sso.lifecycle-handler.js.map +0 -1
  354. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-aggregator.d.ts.map +0 -1
  355. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-aggregator.js.map +0 -1
  356. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-api-client.d.ts +0 -32
  357. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-api-client.d.ts.map +0 -1
  358. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-api-client.js +0 -159
  359. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-api-client.js.map +0 -1
  360. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-post-processor.d.ts.map +0 -1
  361. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-post-processor.js.map +0 -1
  362. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-sender.d.ts.map +0 -1
  363. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-sender.js.map +0 -1
  364. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-sync.plugin.d.ts +0 -36
  365. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-sync.plugin.d.ts.map +0 -1
  366. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-sync.plugin.js.map +0 -1
  367. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-types.d.ts.map +0 -1
  368. package/dist/providers/plugins/sso/metrics/sync/sso.metrics-types.js.map +0 -1
@@ -0,0 +1,731 @@
1
+ # Codemie Init - Generate Project Documentation
2
+
3
+ **Command Name**: `codemie-init`
4
+ **Description**: Initialize Codemie documentation for any project - analyze structure and generate AI-optimized guides
5
+ **Category**: Documentation Generation
6
+ **Complexity**: High
7
+
8
+ ---
9
+
10
+ ## Purpose
11
+
12
+ This command analyzes any software project and generates AI-optimized documentation for Claude Code, including:
13
+ - Main CLAUDE.md file with project-specific patterns and workflows
14
+ - Detailed guides for relevant architectural patterns and practices
15
+ - Properly structured .codemie/guides/ directory with categorized documentation
16
+
17
+ ---
18
+
19
+ ## Prerequisites
20
+
21
+ Before running this command:
22
+ - [ ] Project is cloned and accessible
23
+ - [ ] You have read access to the codebase
24
+ - [ ] Codemie templates are available at `.codemie/claude-templates/templates/`
25
+
26
+ **Note**: The templates directory should be located in `.codemie/claude-templates/` within the project.
27
+
28
+ ---
29
+
30
+ ## 🚨 CRITICAL SIZE LIMITS
31
+
32
+ **MANDATORY**: Each generated guide must be **200-400 lines maximum**.
33
+
34
+ ### Enforcement Strategy
35
+
36
+ **During Generation**:
37
+ - ✅ Use brief code examples (5-15 lines max, never > 20)
38
+ - ✅ Focus on contracts: function signatures, return types, status codes
39
+ - ✅ Use tables for patterns instead of long explanations
40
+ - ✅ ONE example per pattern (not multiple variations)
41
+ - ✅ Reference file:line instead of copying entire functions
42
+ - ❌ NO extensive code blocks
43
+ - ❌ NO multiple examples for same pattern
44
+ - ❌ NO verbose explanations
45
+ - ❌ NO tutorial walkthroughs
46
+
47
+ **Validation**:
48
+ After generating each guide, count lines:
49
+ ```bash
50
+ wc -l .codemie/guides/[category]/[guide].md
51
+ ```
52
+ If > 400 lines: **STOP and condense before continuing**.
53
+
54
+ ---
55
+
56
+ ## Execution Steps
57
+
58
+ ### Phase 1: Project Discovery & Analysis
59
+
60
+ #### Step 1.1: Analyze Project Structure
61
+
62
+ **Task**: Discover project organization, tech stack, and patterns
63
+
64
+ **Actions**:
65
+ ```bash
66
+ # Identify project type and structure
67
+ - Check for package.json, requirements.txt, pom.xml, Cargo.toml, etc.
68
+ - Identify language(s) and frameworks
69
+ - Map directory structure
70
+ - Find configuration files
71
+ ```
72
+
73
+ **Output**: Create analysis document with:
74
+ - Programming language(s)
75
+ - Framework(s) and versions
76
+ - Build tools
77
+ - Testing frameworks
78
+ - Key directories (src/, tests/, config/, etc.)
79
+ - Dependency management approach
80
+
81
+ **Confidence Check**: Can you identify the tech stack with 80%+ confidence?
82
+ - ✅ YES → Continue to Step 1.2
83
+ - ❌ NO → Ask user for clarification
84
+
85
+ ---
86
+
87
+ #### Step 1.2: Identify Architectural Patterns
88
+
89
+ **Task**: Detect architectural patterns used in the project
90
+
91
+ **Actions**:
92
+ ```bash
93
+ # Use Glob and Grep to identify patterns
94
+ - Check for layered architecture (controllers/routes, services, repositories)
95
+ - Identify if REST API, GraphQL, or other
96
+ - Look for ORM usage (models directory)
97
+ - Find database configurations
98
+ - Check for agent/AI patterns (if LangChain, LangGraph, etc.)
99
+ - Identify testing structure
100
+ - Check for CI/CD configuration
101
+ ```
102
+
103
+ **Questions to Answer**:
104
+ - What's the main architecture pattern? (MVC, layered, clean architecture, etc.)
105
+ - Is there an API layer? What type?
106
+ - Is there a service layer?
107
+ - Is there a data/repository layer?
108
+ - What testing approach is used?
109
+ - What external integrations exist?
110
+
111
+ **Output**: List of architectural patterns found
112
+
113
+ ---
114
+
115
+ #### Step 1.3: Read Existing Documentation
116
+
117
+ **Task**: Check for existing documentation to understand context
118
+
119
+ **Actions**:
120
+ ```bash
121
+ # Read existing docs (if they exist)
122
+ - README.md
123
+ - CONTRIBUTING.md
124
+ - docs/ directory
125
+ - Any architectural decision records (ADRs)
126
+ ```
127
+
128
+ **Extract**:
129
+ - Project purpose
130
+ - Setup instructions
131
+ - Build/run commands
132
+ - Testing commands
133
+ - Deployment process
134
+ - Known patterns or conventions
135
+
136
+ ---
137
+
138
+ ### Phase 2: Template Selection & Customization
139
+
140
+ #### Step 2.1: Load Reference Templates
141
+
142
+ **Task**: Load the main CLAUDE.md template and understand its structure
143
+
144
+ **Actions**:
145
+ ```bash
146
+ # Read template
147
+ - .codemie/claude-templates/templates/CLAUDE.md.template
148
+ ```
149
+
150
+ **Understand**:
151
+ - What sections need to be filled
152
+ - What placeholders exist ([PROJECT_NAME], [LANGUAGE], etc.)
153
+ - Which sections are universal vs project-specific
154
+
155
+ ---
156
+
157
+ #### Step 2.2: Identify Required Guides
158
+
159
+ **Task**: Based on Phase 1 analysis, determine which guide templates are relevant
160
+
161
+ **Decision Matrix**:
162
+
163
+ | Found Pattern/Feature | Required Guides | Priority |
164
+ |----------------------|-----------------|----------|
165
+ | REST API endpoints | api/api-patterns.md | P0 (Required) |
166
+ | Layered architecture | architecture/layered-architecture.md | P0 (Required) |
167
+ | Database/ORM usage | data/database-patterns.md | P0 (Required) |
168
+ | Service layer | architecture/service-layer-patterns.md | P1 (Optional) |
169
+ | Testing framework | testing/testing-patterns.md | P0 (Required) |
170
+ | Error handling | development/error-handling.md | P0 (Required) |
171
+ | Logging | development/logging-patterns.md | P0 (Required) |
172
+ | Security features | development/security-patterns.md | P0 (Required) |
173
+ | Setup/installation | development/setup-guide.md | P0 (Required) |
174
+ | Git repository | standards/git-workflow.md | P0 (Required) |
175
+ | Linting/formatting | standards/code-quality.md | P0 (Required) |
176
+ | Agent patterns (LangChain) | agents/agent-patterns.md | P0 (if found) |
177
+ | Workflow orchestration | workflows/workflow-patterns.md | P1 (if found) |
178
+ | External APIs | integration/external-integrations.md | P1 (if found) |
179
+
180
+ **Output**: List of guide templates to use with priorities
181
+
182
+ **User Confirmation**: Present the list and ask:
183
+ ```
184
+ I've identified the following guides to create for your project:
185
+
186
+ Required (P0):
187
+ - [List P0 guides]
188
+
189
+ Optional (P1):
190
+ - [List P1 guides]
191
+
192
+ Would you like me to:
193
+ 1. Generate all required and optional guides
194
+ 2. Generate only required guides
195
+ 3. Customize this list
196
+ ```
197
+
198
+ ---
199
+
200
+ ### Phase 3: Guide Generation
201
+
202
+ #### Step 3.1: Create Base Directory
203
+
204
+ **Task**: Create base .codemie/guides/ directory
205
+
206
+ **Actions**:
207
+ ```bash
208
+ # Create base directory ONLY
209
+ mkdir -p .codemie/guides
210
+ ```
211
+
212
+ **IMPORTANT**: Do NOT create category subdirectories yet. Only create them when you actually generate a guide for that category.
213
+
214
+ ---
215
+
216
+ #### Step 3.2: Generate Each Guide (Iterative)
217
+
218
+ **For Each Selected Guide Template**:
219
+
220
+ **Step 3.2.1: Load Template**
221
+ ```bash
222
+ # Load guide template
223
+ - Read .codemie/claude-templates/templates/guides/[category]/[guide].md.template
224
+ ```
225
+
226
+ **Step 3.2.2: Analyze Project for Guide-Specific Patterns**
227
+
228
+ **Actions**: Use Glob, Grep, and Read to find relevant code examples
229
+
230
+ **For Error Handling Guide**:
231
+ - Search for exception classes
232
+ - Find error handler implementations
233
+ - Identify error response patterns
234
+ - Example: `grep -r "class.*Exception" src/`
235
+
236
+ **For API Patterns Guide**:
237
+ - Find route/endpoint definitions
238
+ - Identify request/response models
239
+ - Find authentication middleware
240
+ - Example: `grep -r "@app.route\|@router\|@RestController" src/`
241
+
242
+ **For Database Patterns Guide**:
243
+ - Find model definitions
244
+ - Identify query patterns
245
+ - Find transaction usage
246
+ - Example: `grep -r "class.*Model\|@Entity\|models.Model" src/`
247
+
248
+ **For Architecture Guide**:
249
+ - Map out layer structure
250
+ - Find examples of layer communication
251
+ - Identify dependency injection patterns
252
+
253
+ **For Testing Guide**:
254
+ - Find test structure
255
+ - Identify testing frameworks used
256
+ - Find fixture/mock patterns
257
+ - Example: `ls -la tests/`
258
+
259
+ **For Setup Guide**:
260
+ - Extract setup commands from README
261
+ - Find environment configuration
262
+ - Identify dependency installation process
263
+
264
+ **Output**: Collection of:
265
+ - File paths with line numbers
266
+ - Code examples
267
+ - Pattern instances
268
+ - Configuration snippets
269
+
270
+ **Step 3.2.3: Fill Template Placeholders**
271
+
272
+ **🚨 SIZE LIMIT ENFORCEMENT**:
273
+ **Target: 200-400 lines for the final guide**
274
+
275
+ **Replace Generic Placeholders**:
276
+ - `[PROJECT_NAME]` → Actual project name
277
+ - `[LANGUAGE]` → Detected language(s)
278
+ - `[FRAMEWORK]` → Detected framework(s)
279
+ - `[DATABASE_NAME]` → Detected database
280
+ - `[TEST_FRAMEWORK]` → Detected test framework
281
+ - `[file.ext:lines]` → Actual file paths from analysis
282
+ - `[code_example]` → **BRIEF** code snippets (5-15 lines, never > 20)
283
+
284
+ **Add Project-Specific Content** (KEEP CONCISE):
285
+ - Fill "FILL IN" sections with **essential patterns only**
286
+ - Add **ONE brief code example** per pattern (5-15 lines)
287
+ - Document **key commands only** (not every variation)
288
+ - Include **minimal** configuration snippets (< 10 lines)
289
+ - Use **file:line references** instead of copying entire functions
290
+ - Use **tables** for multiple patterns instead of code blocks
291
+
292
+ **Examples of Brevity**:
293
+ ```python
294
+ # GOOD: Brief, focused (8 lines)
295
+ @router.post("/users")
296
+ async def create_user(user: UserCreate):
297
+ try:
298
+ return await UserService.create(user)
299
+ except ValidationError as e:
300
+ raise HTTPException(400, str(e))
301
+ # Source: api/users.py:23-28
302
+
303
+ # BAD: Too long (50+ lines showing entire function with error handling, logging, etc.)
304
+ ```
305
+
306
+ **Step 3.2.4: Write Guide File**
307
+
308
+ **Actions**:
309
+ ```bash
310
+ # Create category directory if it doesn't exist
311
+ mkdir -p .codemie/guides/[category]
312
+
313
+ # Write completed guide
314
+ # Save to .codemie/guides/[category]/[guide].md
315
+ ```
316
+
317
+ **🚨 MANDATORY SIZE VALIDATION**:
318
+ ```bash
319
+ # Count lines immediately after writing
320
+ LINE_COUNT=$(wc -l < .codemie/guides/[category]/[guide].md)
321
+
322
+ # Check if within limit
323
+ if [ $LINE_COUNT -gt 400 ]; then
324
+ echo "⚠️ WARNING: Guide is $LINE_COUNT lines (limit: 400)"
325
+ echo "MUST condense before continuing!"
326
+ # STOP and condense the guide
327
+ fi
328
+ ```
329
+
330
+ **Validation Checklist**:
331
+ - [ ] **Guide is 200-400 lines** (MANDATORY)
332
+ - [ ] All placeholders replaced
333
+ - [ ] Code examples are brief (5-15 lines, max 20)
334
+ - [ ] File paths are accurate
335
+ - [ ] Commands are correct
336
+ - [ ] No "FILL IN" or "[PLACEHOLDER]" remains
337
+ - [ ] Used tables for patterns (not long code blocks)
338
+ - [ ] ONE example per pattern (not multiple)
339
+
340
+ **If > 400 Lines**:
341
+ 1. Remove redundant code examples
342
+ 2. Convert multiple examples to ONE representative example
343
+ 3. Use tables instead of code blocks where possible
344
+ 4. Replace code blocks with file:line references
345
+ 5. Remove verbose explanations
346
+ 6. Re-validate line count
347
+
348
+ ---
349
+
350
+ #### Step 3.3: Track Progress
351
+
352
+ **Use TodoWrite** to track guide creation:
353
+
354
+ ```
355
+ - [ ] Create development/error-handling.md
356
+ - [ ] Create development/logging-patterns.md
357
+ - [ ] Create development/security-patterns.md
358
+ - [ ] Create development/setup-guide.md
359
+ - [ ] Create api/api-patterns.md
360
+ - [ ] Create architecture/layered-architecture.md
361
+ - [ ] Create data/database-patterns.md
362
+ - [ ] Create testing/testing-patterns.md
363
+ - [ ] Create standards/code-quality.md
364
+ - [ ] Create standards/git-workflow.md
365
+ ```
366
+
367
+ Mark each as in_progress when working on it, completed when done.
368
+
369
+ ---
370
+
371
+ ### Phase 4: Generate Main CLAUDE.md
372
+
373
+ #### Step 4.1: Load and Customize CLAUDE.md Template
374
+
375
+ **Task**: Create the main CLAUDE.md file with project-specific content
376
+
377
+ **Actions**:
378
+
379
+ **4.1.1: Replace Basic Placeholders**
380
+ - `[PROJECT_NAME]` → Actual project name
381
+ - `[LANGUAGE]` → Programming language
382
+ - `[FRAMEWORK]` → Main framework
383
+ - `[DATABASE_NAME]` → Database name
384
+ - Environment policy placeholders
385
+
386
+ **4.1.2: Fill Guide References Section**
387
+
388
+ Based on generated guides, populate the "Guide References by Category" section:
389
+
390
+ ```markdown
391
+ **API Development**:
392
+ - API patterns: .codemie/guides/api/api-patterns.md
393
+
394
+ **Architecture**:
395
+ - Layered architecture: .codemie/guides/architecture/layered-architecture.md
396
+
397
+ **Data & Database**:
398
+ - Database patterns: .codemie/guides/data/database-patterns.md
399
+
400
+ **Development Practices**:
401
+ - Error handling: .codemie/guides/development/error-handling.md
402
+ - Logging patterns: .codemie/guides/development/logging-patterns.md
403
+ - Security patterns: .codemie/guides/development/security-patterns.md
404
+ - Setup guide: .codemie/guides/development/setup-guide.md
405
+
406
+ **Standards**:
407
+ - Code quality: .codemie/guides/standards/code-quality.md
408
+ - Git workflow: .codemie/guides/standards/git-workflow.md
409
+
410
+ **Testing**:
411
+ - Testing patterns: .codemie/guides/testing/testing-patterns.md
412
+ ```
413
+
414
+ **4.1.3: Create Task Classifier Table**
415
+
416
+ Based on project patterns, create keyword → guide mappings:
417
+
418
+ ```markdown
419
+ | Keywords | Complexity | Load Guide (P0=Required) | Also Load (P1=Optional) |
420
+ |----------|-----------|--------------------------|-------------------------|
421
+ | **api, endpoint, router** | Medium | .codemie/guides/api/api-patterns.md | - |
422
+ | **test, pytest** | Medium | .codemie/guides/testing/testing-patterns.md | - |
423
+ | **database, sql, postgres** | Medium-High | .codemie/guides/data/database-patterns.md | - |
424
+ | **error, exception** | Medium | .codemie/guides/development/error-handling.md | .codemie/guides/development/logging-patterns.md |
425
+ ```
426
+
427
+ **4.1.4: Fill Pattern Quick Reference**
428
+
429
+ Extract key patterns from generated guides and create quick reference tables:
430
+
431
+ **Error Handling Quick Ref**:
432
+ ```markdown
433
+ | When | Exception | Import From | Related Patterns |
434
+ |------|-----------|-------------|------------------|
435
+ | Validation failed | ValidationError | myproject.exceptions | Logging, API Patterns |
436
+ | Not found | NotFoundException | myproject.exceptions | API Patterns |
437
+ ```
438
+
439
+ **Logging Quick Ref**:
440
+ ```markdown
441
+ | ✅ DO | ❌ DON'T | Why | Related |
442
+ |-------|----------|-----|---------|
443
+ | [Project-specific best practice] | [Anti-pattern] | [Reason] | [Guide] |
444
+ ```
445
+
446
+ **4.1.5: Fill Development Commands**
447
+
448
+ Extract from setup guide and project analysis:
449
+
450
+ ```markdown
451
+ | Task | Command | Notes |
452
+ |------|---------|-------|
453
+ | **Setup** | npm install | First time setup |
454
+ | **Run Server** | npm run dev | Dev server (port 3000) |
455
+ | **Lint** | npm run lint | ESLint check |
456
+ | **Format** | npm run format | Prettier format |
457
+ | **Test** ⚠️ | npm test | ONLY if user requests |
458
+ ```
459
+
460
+ **4.1.6: Fill Troubleshooting Section**
461
+
462
+ Based on common issues found in README or CONTRIBUTING:
463
+
464
+ ```markdown
465
+ | Symptom | Likely Cause | Fix | Prevention |
466
+ |---------|--------------|-----|------------|
467
+ | [Common error] | [Root cause] | [Solution] | [Prevention] |
468
+ ```
469
+
470
+ **4.1.7: Fill Project Context**
471
+
472
+ **Technology Stack**:
473
+ ```markdown
474
+ | Component | Tool | Version | Purpose |
475
+ |-----------|------|---------|---------|
476
+ | Language | Python | 3.11+ | Core language |
477
+ | Framework | FastAPI | 0.104+ | REST API |
478
+ | Database | PostgreSQL | 15+ | Primary DB |
479
+ ```
480
+
481
+ **Core Components**:
482
+ ```markdown
483
+ | Component | Path | Purpose | Guide |
484
+ |-----------|------|---------|-------|
485
+ | API | src/api/ | FastAPI routers | .codemie/guides/api/api-patterns.md |
486
+ | Services | src/services/ | Business logic | .codemie/guides/architecture/layered-architecture.md |
487
+ ```
488
+
489
+ ---
490
+
491
+ #### Step 4.2: Write Final CLAUDE.md
492
+
493
+ **Actions**:
494
+ ```bash
495
+ # Write completed CLAUDE.md
496
+ - Save to ./CLAUDE.md (project root)
497
+ ```
498
+
499
+ **Validation**:
500
+ - [ ] All placeholders replaced
501
+ - [ ] Guide references are accurate
502
+ - [ ] Commands are tested
503
+ - [ ] Task classifier is populated
504
+ - [ ] Quick references are filled
505
+ - [ ] Project context is complete
506
+ - [ ] No "FILL IN" or "[PLACEHOLDER]" remains
507
+ - [ ] All internal links work
508
+
509
+ ---
510
+
511
+ ### Phase 5: Validation & Finalization
512
+
513
+ #### Step 5.1: Verify Documentation
514
+
515
+ **Actions**:
516
+
517
+ **5.1.1: Check File Existence**
518
+ ```bash
519
+ # Verify all referenced guides exist
520
+ - Check that each guide in CLAUDE.md actually exists
521
+ - Verify correct paths
522
+ ```
523
+
524
+ **5.1.2: Validate Links**
525
+ ```bash
526
+ # Check internal links
527
+ - All guide references in CLAUDE.md point to existing files
528
+ - All cross-references between guides are valid
529
+ ```
530
+
531
+ **5.1.3: Test Commands**
532
+ ```bash
533
+ # Try running documented commands
534
+ - Setup command
535
+ - Lint command
536
+ - Test command (if documented)
537
+ - Build command
538
+ ```
539
+
540
+ **5.1.4: Review Content Quality**
541
+ - [ ] Code examples are real (not placeholders)
542
+ - [ ] File paths include line numbers
543
+ - [ ] Patterns are project-specific
544
+ - [ ] No generic placeholders remain
545
+ - [ ] Guides follow AI-first writing principles (pattern-first, examples, structured)
546
+
547
+ ---
548
+
549
+ #### Step 5.2: Generate Summary Report
550
+
551
+ **Task**: Create a summary of what was generated
552
+
553
+ **Report Structure**:
554
+ ```markdown
555
+ # Documentation Generation Complete
556
+
557
+ ## Generated Files
558
+
559
+ ### Main Documentation
560
+ - ✅ CLAUDE.md (root directory)
561
+
562
+ ### Guides Generated ([N] guides)
563
+
564
+ **Development** ([X] guides):
565
+ - ✅ .codemie/guides/development/error-handling.md
566
+ - ✅ .codemie/guides/development/logging-patterns.md
567
+ - ✅ .codemie/guides/development/security-patterns.md
568
+ - ✅ .codemie/guides/development/setup-guide.md
569
+
570
+ **API** ([X] guides):
571
+ - ✅ .codemie/guides/api/api-patterns.md
572
+
573
+ **Architecture** ([X] guides):
574
+ - ✅ .codemie/guides/architecture/layered-architecture.md
575
+
576
+ **Data** ([X] guides):
577
+ - ✅ .codemie/guides/data/database-patterns.md
578
+
579
+ **Testing** ([X] guides):
580
+ - ✅ .codemie/guides/testing/testing-patterns.md
581
+
582
+ **Standards** ([X] guides):
583
+ - ✅ .codemie/guides/standards/code-quality.md
584
+ - ✅ .codemie/guides/standards/git-workflow.md
585
+
586
+ ## Project Analysis Summary
587
+
588
+ **Technology Stack**:
589
+ - Language: [Language]
590
+ - Framework: [Framework]
591
+ - Database: [Database]
592
+ - Testing: [Test Framework]
593
+ - Build Tool: [Build Tool]
594
+
595
+ **Architecture Patterns Documented**:
596
+ - [Pattern 1]
597
+ - [Pattern 2]
598
+ - [Pattern 3]
599
+
600
+ **Total Code Examples**: [N] examples from actual codebase
601
+ **Total Line References**: [N] file:line references
602
+
603
+ ## Next Steps
604
+
605
+ 1. Review generated documentation for accuracy
606
+ 2. Customize any project-specific sections that need refinement
607
+ 3. Test CLAUDE.md by asking Claude Code to perform a task
608
+ 4. Update guides as project evolves
609
+
610
+ ## How to Use
611
+
612
+ Claude Code will now:
613
+ 1. Check guides first before searching codebase
614
+ 2. Use documented patterns consistently
615
+ 3. Follow project-specific workflows
616
+ 4. Reference actual code examples from your project
617
+
618
+ Try asking Claude Code to:
619
+ - "Add a new API endpoint following project patterns"
620
+ - "Fix error handling in [file]"
621
+ - "Write tests for [component]"
622
+ ```
623
+
624
+ ---
625
+
626
+ ## Decision Gates Throughout Process
627
+
628
+ ### Gate 1: After Project Discovery (Step 1.3)
629
+ **Question**: Do I understand the tech stack and architecture?
630
+ - ✅ 80%+ confidence → Continue
631
+ - ❌ < 80% confidence → Ask user for clarification
632
+
633
+ ### Gate 2: After Template Selection (Step 2.2)
634
+ **Question**: Have I identified the right guides to generate?
635
+ - ✅ YES → Present list to user for confirmation
636
+ - ❌ UNCERTAIN → Ask user which patterns/areas are important
637
+
638
+ ### Gate 3: After Each Guide Generation (Step 3.2.4)
639
+ **Question**: Is this guide filled with real project content (not placeholders)?
640
+ - ✅ YES → Mark complete, move to next guide
641
+ - ❌ NO → Continue analyzing and filling content
642
+
643
+ ### Gate 4: After CLAUDE.md Generation (Step 4.2)
644
+ **Question**: Is CLAUDE.md complete and project-specific?
645
+ - ✅ YES → Proceed to validation
646
+ - ❌ NO → Continue filling sections
647
+
648
+ ### Gate 5: After Validation (Step 5.1)
649
+ **Question**: Do all links work and commands run?
650
+ - ✅ YES → Generate summary report and finish
651
+ - ❌ NO → Fix issues and re-validate
652
+
653
+ ---
654
+
655
+ ## Troubleshooting
656
+
657
+ ### Issue: Can't Identify Architecture Pattern
658
+
659
+ **Symptoms**: Unclear project structure
660
+ **Action**:
661
+ 1. Ask user: "What architecture pattern does your project use?"
662
+ 2. If user unsure, provide options based on directory structure
663
+ 3. Offer to create generic layered architecture guide
664
+
665
+ ### Issue: No Code Examples Found for Pattern
666
+
667
+ **Symptoms**: Template sections can't be filled with real code
668
+ **Action**:
669
+ 1. Check if pattern actually exists in project
670
+ 2. If not, ask user if they want this guide (might be aspirational)
671
+ 3. If yes but code not found, create guide with TODO for user to fill
672
+
673
+ ### Issue: Multiple Frameworks/Patterns Detected
674
+
675
+ **Symptoms**: Mixed patterns (e.g., both REST and GraphQL)
676
+ **Action**:
677
+ 1. Ask user which is primary
678
+ 2. Document both if both are important
679
+ 3. Create separate guides for each pattern
680
+
681
+ ### Issue: Documentation Takes Too Long
682
+
683
+ **Symptoms**: Many guides, large codebase
684
+ **Action**:
685
+ 1. Start with P0 guides only
686
+ 2. Generate P1 guides in follow-up
687
+ 3. Focus on most-used patterns first
688
+
689
+ ---
690
+
691
+ ## Success Criteria
692
+
693
+ Documentation generation is complete when:
694
+ - ✅ CLAUDE.md exists in project root
695
+ - ✅ All referenced guides exist
696
+ - ✅ All code examples are from actual project (no placeholders)
697
+ - ✅ All file paths are accurate with line numbers
698
+ - ✅ All commands are tested and work
699
+ - ✅ All internal links are valid
700
+ - ✅ Project-specific patterns are documented
701
+ - ✅ No "FILL IN" or "[PLACEHOLDER]" text remains
702
+ - ✅ User has reviewed and confirmed accuracy
703
+
704
+ ---
705
+
706
+ ## Example Invocation
707
+
708
+ **User**: "Generate project documentation for my FastAPI project"
709
+
710
+ **Claude Code**:
711
+ 1. Analyzes project structure (finds FastAPI, PostgreSQL, pytest)
712
+ 2. Identifies patterns (layered architecture, REST API, SQLAlchemy)
713
+ 3. Selects templates (API, architecture, database, testing, etc.)
714
+ 4. Generates 8 guides with real code examples
715
+ 5. Creates CLAUDE.md with project-specific content
716
+ 6. Validates all links and commands
717
+ 7. Presents summary report
718
+
719
+ **Result**: Complete, project-specific Claude Code documentation ready to use
720
+
721
+ ---
722
+
723
+ ## Notes
724
+
725
+ - **Time Estimate**: 10-30 minutes depending on project size and complexity
726
+ - **Token Usage**: High - lots of reading and writing
727
+ - **User Interaction**: 2-3 confirmation points for guide selection
728
+ - **Customization**: Output should be 80% ready, 20% may need user refinement
729
+ - **Maintenance**: Documentation should be updated as project evolves
730
+
731
+ ---