@codemieai/code 0.0.33 → 0.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/README.md +78 -7
  2. package/bin/codemie-claude-acp.js +21 -0
  3. package/bin/codemie-opencode.js +11 -0
  4. package/bin/codemie.js +13 -0
  5. package/dist/agents/codemie-code/agent.d.ts +38 -4
  6. package/dist/agents/codemie-code/agent.d.ts.map +1 -1
  7. package/dist/agents/codemie-code/agent.js +333 -178
  8. package/dist/agents/codemie-code/agent.js.map +1 -1
  9. package/dist/agents/codemie-code/index.d.ts +2 -1
  10. package/dist/agents/codemie-code/index.d.ts.map +1 -1
  11. package/dist/agents/codemie-code/index.js +36 -7
  12. package/dist/agents/codemie-code/index.js.map +1 -1
  13. package/dist/agents/codemie-code/prompts.d.ts +12 -5
  14. package/dist/agents/codemie-code/prompts.d.ts.map +1 -1
  15. package/dist/agents/codemie-code/prompts.js +53 -6
  16. package/dist/agents/codemie-code/prompts.js.map +1 -1
  17. package/dist/agents/codemie-code/toolMetadata.d.ts.map +1 -1
  18. package/dist/agents/codemie-code/toolMetadata.js +9 -8
  19. package/dist/agents/codemie-code/toolMetadata.js.map +1 -1
  20. package/dist/agents/codemie-code/tools/assistant-invocation.d.ts +47 -0
  21. package/dist/agents/codemie-code/tools/assistant-invocation.d.ts.map +1 -0
  22. package/dist/agents/codemie-code/tools/assistant-invocation.js +129 -0
  23. package/dist/agents/codemie-code/tools/assistant-invocation.js.map +1 -0
  24. package/dist/agents/codemie-code/tools/index.d.ts +70 -4
  25. package/dist/agents/codemie-code/tools/index.d.ts.map +1 -1
  26. package/dist/agents/codemie-code/tools/index.js +57 -44
  27. package/dist/agents/codemie-code/tools/index.js.map +1 -1
  28. package/dist/agents/codemie-code/tools/planning.d.ts +6 -5
  29. package/dist/agents/codemie-code/tools/planning.d.ts.map +1 -1
  30. package/dist/agents/codemie-code/tools/planning.js +12 -10
  31. package/dist/agents/codemie-code/tools/planning.js.map +1 -1
  32. package/dist/agents/codemie-code/types.d.ts +27 -3
  33. package/dist/agents/codemie-code/types.d.ts.map +1 -1
  34. package/dist/agents/codemie-code/types.js +24 -0
  35. package/dist/agents/codemie-code/types.js.map +1 -1
  36. package/dist/agents/codemie-code/ui/autocomplete.d.ts +98 -0
  37. package/dist/agents/codemie-code/ui/autocomplete.d.ts.map +1 -0
  38. package/dist/agents/codemie-code/ui/autocomplete.js +145 -0
  39. package/dist/agents/codemie-code/ui/autocomplete.js.map +1 -0
  40. package/dist/agents/codemie-code/ui/keyHandlers.d.ts +112 -0
  41. package/dist/agents/codemie-code/ui/keyHandlers.d.ts.map +1 -0
  42. package/dist/agents/codemie-code/ui/keyHandlers.js +415 -0
  43. package/dist/agents/codemie-code/ui/keyHandlers.js.map +1 -0
  44. package/dist/agents/codemie-code/ui/mentions.d.ts +86 -0
  45. package/dist/agents/codemie-code/ui/mentions.d.ts.map +1 -0
  46. package/dist/agents/codemie-code/ui/mentions.js +122 -0
  47. package/dist/agents/codemie-code/ui/mentions.js.map +1 -0
  48. package/dist/agents/codemie-code/ui/terminalCodes.d.ts +38 -0
  49. package/dist/agents/codemie-code/ui/terminalCodes.d.ts.map +1 -0
  50. package/dist/agents/codemie-code/ui/terminalCodes.js +42 -0
  51. package/dist/agents/codemie-code/ui/terminalCodes.js.map +1 -0
  52. package/dist/agents/codemie-code/ui/todoPanel.d.ts.map +1 -1
  53. package/dist/agents/codemie-code/ui/todoPanel.js +3 -4
  54. package/dist/agents/codemie-code/ui/todoPanel.js.map +1 -1
  55. package/dist/agents/codemie-code/ui.d.ts +8 -7
  56. package/dist/agents/codemie-code/ui.d.ts.map +1 -1
  57. package/dist/agents/codemie-code/ui.js +87 -145
  58. package/dist/agents/codemie-code/ui.js.map +1 -1
  59. package/dist/agents/core/AgentCLI.d.ts +5 -0
  60. package/dist/agents/core/AgentCLI.d.ts.map +1 -1
  61. package/dist/agents/core/AgentCLI.js +25 -1
  62. package/dist/agents/core/AgentCLI.js.map +1 -1
  63. package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
  64. package/dist/agents/core/BaseAgentAdapter.js +90 -27
  65. package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
  66. package/dist/agents/core/extension/BaseExtensionInstaller.d.ts +7 -1
  67. package/dist/agents/core/extension/BaseExtensionInstaller.d.ts.map +1 -1
  68. package/dist/agents/core/extension/BaseExtensionInstaller.js +58 -15
  69. package/dist/agents/core/extension/BaseExtensionInstaller.js.map +1 -1
  70. package/dist/agents/core/session/BaseSessionAdapter.d.ts +25 -0
  71. package/dist/agents/core/session/BaseSessionAdapter.d.ts.map +1 -1
  72. package/dist/agents/core/session/discovery-types.d.ts +53 -0
  73. package/dist/agents/core/session/discovery-types.d.ts.map +1 -0
  74. package/dist/agents/core/session/discovery-types.js +8 -0
  75. package/dist/agents/core/session/discovery-types.js.map +1 -0
  76. package/dist/agents/core/types.d.ts +62 -0
  77. package/dist/agents/core/types.d.ts.map +1 -1
  78. package/dist/agents/plugins/claude/claude-acp.plugin.d.ts +27 -0
  79. package/dist/agents/plugins/claude/claude-acp.plugin.d.ts.map +1 -0
  80. package/dist/agents/plugins/claude/claude-acp.plugin.js +63 -0
  81. package/dist/agents/plugins/claude/claude-acp.plugin.js.map +1 -0
  82. package/dist/agents/plugins/claude/claude-message-types.d.ts +1 -0
  83. package/dist/agents/plugins/claude/claude-message-types.d.ts.map +1 -1
  84. package/dist/agents/plugins/claude/claude.plugin.d.ts +44 -1
  85. package/dist/agents/plugins/claude/claude.plugin.d.ts.map +1 -1
  86. package/dist/agents/plugins/claude/claude.plugin.js +263 -12
  87. package/dist/agents/plugins/claude/claude.plugin.js.map +1 -1
  88. package/dist/agents/plugins/claude/claude.session.d.ts.map +1 -1
  89. package/dist/agents/plugins/claude/claude.session.js +14 -7
  90. package/dist/agents/plugins/claude/claude.session.js.map +1 -1
  91. package/dist/agents/plugins/claude/plugin/.claude-plugin/plugin.json +1 -1
  92. package/dist/agents/plugins/claude/plugin/README.md +40 -2
  93. package/dist/agents/plugins/claude/plugin/claude-templates/README.md +5 -5
  94. package/dist/agents/plugins/claude/plugin/claude-templates/templates/CLAUDE.md.template +177 -436
  95. package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/code-review-agent-template.md.template +49 -82
  96. package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/refactor-cleaner-agent.md.template +337 -0
  97. package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/solution-architect-agent.md.template +129 -419
  98. package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/unit-tester-agent.md.template +146 -693
  99. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/api/api-patterns.md.template +110 -138
  100. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/architecture.md.template +197 -0
  101. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/data/database-patterns.md.template +171 -91
  102. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/development/development-practices.md.template +219 -131
  103. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/security/security-practices.md.template +223 -98
  104. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/standards/code-quality.md.template +131 -95
  105. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/testing/testing-patterns.md.template +247 -75
  106. package/dist/agents/plugins/claude/plugin/commands/README.md +133 -0
  107. package/dist/agents/plugins/claude/plugin/commands/codemie-init.md +336 -544
  108. package/dist/agents/plugins/claude/plugin/commands/codemie-subagents.md +233 -504
  109. package/dist/agents/plugins/claude/plugin/commands/memory-add.md +311 -30
  110. package/dist/agents/plugins/claude/plugin/commands/memory-refresh.md +218 -39
  111. package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.d.ts.map +1 -1
  112. package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js +43 -8
  113. package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js.map +1 -1
  114. package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.d.ts.map +1 -1
  115. package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js +68 -40
  116. package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js.map +1 -1
  117. package/dist/agents/plugins/gemini/gemini.plugin.d.ts.map +1 -1
  118. package/dist/agents/plugins/gemini/gemini.plugin.js +0 -3
  119. package/dist/agents/plugins/gemini/gemini.plugin.js.map +1 -1
  120. package/dist/agents/plugins/opencode/index.d.ts +8 -0
  121. package/dist/agents/plugins/opencode/index.d.ts.map +1 -0
  122. package/dist/agents/plugins/opencode/index.js +12 -0
  123. package/dist/agents/plugins/opencode/index.js.map +1 -0
  124. package/dist/agents/plugins/opencode/opencode-message-types.d.ts +207 -0
  125. package/dist/agents/plugins/opencode/opencode-message-types.d.ts.map +1 -0
  126. package/dist/agents/plugins/opencode/opencode-message-types.js +59 -0
  127. package/dist/agents/plugins/opencode/opencode-message-types.js.map +1 -0
  128. package/dist/agents/plugins/opencode/opencode-model-configs.d.ts +65 -0
  129. package/dist/agents/plugins/opencode/opencode-model-configs.d.ts.map +1 -0
  130. package/dist/agents/plugins/opencode/opencode-model-configs.js +184 -0
  131. package/dist/agents/plugins/opencode/opencode-model-configs.js.map +1 -0
  132. package/dist/agents/plugins/opencode/opencode.paths.d.ts +62 -0
  133. package/dist/agents/plugins/opencode/opencode.paths.d.ts.map +1 -0
  134. package/dist/agents/plugins/opencode/opencode.paths.js +148 -0
  135. package/dist/agents/plugins/opencode/opencode.paths.js.map +1 -0
  136. package/dist/agents/plugins/opencode/opencode.plugin.d.ts +35 -0
  137. package/dist/agents/plugins/opencode/opencode.plugin.d.ts.map +1 -0
  138. package/dist/agents/plugins/opencode/opencode.plugin.js +338 -0
  139. package/dist/agents/plugins/opencode/opencode.plugin.js.map +1 -0
  140. package/dist/agents/plugins/opencode/opencode.session.d.ts +77 -0
  141. package/dist/agents/plugins/opencode/opencode.session.d.ts.map +1 -0
  142. package/dist/agents/plugins/opencode/opencode.session.js +424 -0
  143. package/dist/agents/plugins/opencode/opencode.session.js.map +1 -0
  144. package/dist/agents/plugins/opencode/opencode.storage-utils.d.ts +25 -0
  145. package/dist/agents/plugins/opencode/opencode.storage-utils.d.ts.map +1 -0
  146. package/dist/agents/plugins/opencode/opencode.storage-utils.js +96 -0
  147. package/dist/agents/plugins/opencode/opencode.storage-utils.js.map +1 -0
  148. package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.d.ts +30 -0
  149. package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.d.ts.map +1 -0
  150. package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.js +116 -0
  151. package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.js.map +1 -0
  152. package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.d.ts +102 -0
  153. package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.d.ts.map +1 -0
  154. package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.js +584 -0
  155. package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.js.map +1 -0
  156. package/dist/agents/registry.d.ts +1 -1
  157. package/dist/agents/registry.d.ts.map +1 -1
  158. package/dist/agents/registry.js +5 -1
  159. package/dist/agents/registry.js.map +1 -1
  160. package/dist/cli/commands/assistants/chat.d.ts +11 -0
  161. package/dist/cli/commands/assistants/chat.d.ts.map +1 -0
  162. package/dist/cli/commands/assistants/chat.js +201 -0
  163. package/dist/cli/commands/assistants/chat.js.map +1 -0
  164. package/dist/cli/commands/assistants/constants.d.ts +81 -0
  165. package/dist/cli/commands/assistants/constants.d.ts.map +1 -0
  166. package/dist/cli/commands/assistants/constants.js +75 -0
  167. package/dist/cli/commands/assistants/constants.js.map +1 -0
  168. package/dist/cli/commands/assistants/generators/claude-agent-generator.d.ts +26 -0
  169. package/dist/cli/commands/assistants/generators/claude-agent-generator.d.ts.map +1 -0
  170. package/dist/cli/commands/assistants/generators/claude-agent-generator.js +115 -0
  171. package/dist/cli/commands/assistants/generators/claude-agent-generator.js.map +1 -0
  172. package/dist/cli/commands/assistants/index.d.ts +11 -0
  173. package/dist/cli/commands/assistants/index.d.ts.map +1 -0
  174. package/dist/cli/commands/assistants/index.js +28 -0
  175. package/dist/cli/commands/assistants/index.js.map +1 -0
  176. package/dist/cli/commands/assistants/list.d.ts +11 -0
  177. package/dist/cli/commands/assistants/list.d.ts.map +1 -0
  178. package/dist/cli/commands/assistants/list.js +323 -0
  179. package/dist/cli/commands/assistants/list.js.map +1 -0
  180. package/dist/cli/commands/doctor/checks/AgentsCheck.d.ts +5 -0
  181. package/dist/cli/commands/doctor/checks/AgentsCheck.d.ts.map +1 -1
  182. package/dist/cli/commands/doctor/checks/AgentsCheck.js +29 -0
  183. package/dist/cli/commands/doctor/checks/AgentsCheck.js.map +1 -1
  184. package/dist/cli/commands/install.d.ts.map +1 -1
  185. package/dist/cli/commands/install.js +104 -13
  186. package/dist/cli/commands/install.js.map +1 -1
  187. package/dist/cli/commands/opencode-metrics.d.ts +13 -0
  188. package/dist/cli/commands/opencode-metrics.d.ts.map +1 -0
  189. package/dist/cli/commands/opencode-metrics.js +200 -0
  190. package/dist/cli/commands/opencode-metrics.js.map +1 -0
  191. package/dist/cli/commands/self-update.d.ts +3 -0
  192. package/dist/cli/commands/self-update.d.ts.map +1 -0
  193. package/dist/cli/commands/self-update.js +55 -0
  194. package/dist/cli/commands/self-update.js.map +1 -0
  195. package/dist/cli/commands/setup.d.ts.map +1 -1
  196. package/dist/cli/commands/setup.js +113 -0
  197. package/dist/cli/commands/setup.js.map +1 -1
  198. package/dist/cli/commands/skill.d.ts +6 -0
  199. package/dist/cli/commands/skill.d.ts.map +1 -0
  200. package/dist/cli/commands/skill.js +196 -0
  201. package/dist/cli/commands/skill.js.map +1 -0
  202. package/dist/cli/commands/update.d.ts.map +1 -1
  203. package/dist/cli/commands/update.js +34 -6
  204. package/dist/cli/commands/update.js.map +1 -1
  205. package/dist/cli/index.d.ts.map +1 -1
  206. package/dist/cli/index.js +12 -4
  207. package/dist/cli/index.js.map +1 -1
  208. package/dist/env/types.d.ts +13 -0
  209. package/dist/env/types.d.ts.map +1 -1
  210. package/dist/env/types.js +1 -1
  211. package/dist/env/types.js.map +1 -1
  212. package/dist/migrations/003-remove-hooks-node.migration.d.ts +22 -0
  213. package/dist/migrations/003-remove-hooks-node.migration.d.ts.map +1 -0
  214. package/dist/migrations/003-remove-hooks-node.migration.js +103 -0
  215. package/dist/migrations/003-remove-hooks-node.migration.js.map +1 -0
  216. package/dist/migrations/index.d.ts +1 -0
  217. package/dist/migrations/index.d.ts.map +1 -1
  218. package/dist/migrations/index.js +1 -1
  219. package/dist/migrations/index.js.map +1 -1
  220. package/dist/providers/plugins/sso/sso.http-client.js +2 -2
  221. package/dist/providers/plugins/sso/sso.http-client.js.map +1 -1
  222. package/dist/providers/plugins/sso/sso.setup-steps.d.ts.map +1 -1
  223. package/dist/providers/plugins/sso/sso.setup-steps.js +14 -10
  224. package/dist/providers/plugins/sso/sso.setup-steps.js.map +1 -1
  225. package/dist/skills/core/SkillDiscovery.d.ts +83 -0
  226. package/dist/skills/core/SkillDiscovery.d.ts.map +1 -0
  227. package/dist/skills/core/SkillDiscovery.js +237 -0
  228. package/dist/skills/core/SkillDiscovery.js.map +1 -0
  229. package/dist/skills/core/SkillManager.d.ts +86 -0
  230. package/dist/skills/core/SkillManager.d.ts.map +1 -0
  231. package/dist/skills/core/SkillManager.js +155 -0
  232. package/dist/skills/core/SkillManager.js.map +1 -0
  233. package/dist/skills/core/types.d.ts +120 -0
  234. package/dist/skills/core/types.d.ts.map +1 -0
  235. package/dist/skills/core/types.js +20 -0
  236. package/dist/skills/core/types.js.map +1 -0
  237. package/dist/skills/index.d.ts +12 -0
  238. package/dist/skills/index.d.ts.map +1 -0
  239. package/dist/skills/index.js +12 -0
  240. package/dist/skills/index.js.map +1 -0
  241. package/dist/skills/utils/content-loader.d.ts +25 -0
  242. package/dist/skills/utils/content-loader.d.ts.map +1 -0
  243. package/dist/skills/utils/content-loader.js +161 -0
  244. package/dist/skills/utils/content-loader.js.map +1 -0
  245. package/dist/skills/utils/frontmatter.d.ts +60 -0
  246. package/dist/skills/utils/frontmatter.d.ts.map +1 -0
  247. package/dist/skills/utils/frontmatter.js +114 -0
  248. package/dist/skills/utils/frontmatter.js.map +1 -0
  249. package/dist/skills/utils/pattern-matcher.d.ts +60 -0
  250. package/dist/skills/utils/pattern-matcher.d.ts.map +1 -0
  251. package/dist/skills/utils/pattern-matcher.js +97 -0
  252. package/dist/skills/utils/pattern-matcher.js.map +1 -0
  253. package/dist/utils/auth.d.ts +22 -0
  254. package/dist/utils/auth.d.ts.map +1 -0
  255. package/dist/utils/auth.js +50 -0
  256. package/dist/utils/auth.js.map +1 -0
  257. package/dist/utils/cli-updater.d.ts +70 -0
  258. package/dist/utils/cli-updater.d.ts.map +1 -0
  259. package/dist/utils/cli-updater.js +339 -0
  260. package/dist/utils/cli-updater.js.map +1 -0
  261. package/dist/utils/config.d.ts +6 -1
  262. package/dist/utils/config.d.ts.map +1 -1
  263. package/dist/utils/config.js +13 -0
  264. package/dist/utils/config.js.map +1 -1
  265. package/dist/utils/installation-detector.d.ts +22 -0
  266. package/dist/utils/installation-detector.d.ts.map +1 -0
  267. package/dist/utils/installation-detector.js +49 -0
  268. package/dist/utils/installation-detector.js.map +1 -0
  269. package/dist/utils/native-installer.d.ts +49 -0
  270. package/dist/utils/native-installer.d.ts.map +1 -0
  271. package/dist/utils/native-installer.js +225 -0
  272. package/dist/utils/native-installer.js.map +1 -0
  273. package/dist/utils/processes.js +1 -1
  274. package/dist/utils/profile.d.ts +2 -0
  275. package/dist/utils/profile.d.ts.map +1 -1
  276. package/dist/utils/profile.js +5 -0
  277. package/dist/utils/profile.js.map +1 -1
  278. package/dist/utils/sdk-client.d.ts +15 -0
  279. package/dist/utils/sdk-client.d.ts.map +1 -0
  280. package/dist/utils/sdk-client.js +92 -0
  281. package/dist/utils/sdk-client.js.map +1 -0
  282. package/dist/utils/version-utils.d.ts +50 -0
  283. package/dist/utils/version-utils.d.ts.map +1 -0
  284. package/dist/utils/version-utils.js +92 -0
  285. package/dist/utils/version-utils.js.map +1 -0
  286. package/package.json +11 -3
  287. package/scripts/copy-mr-skill-to-global.ts +252 -0
  288. package/scripts/demo-hooks.sh +125 -0
  289. package/scripts/test-hooks.sh +196 -0
  290. package/dist/agents/plugins/claude/plugin/claude-templates/templates/INDEX.md +0 -205
  291. package/dist/agents/plugins/claude/plugin/claude-templates/templates/TEMPLATE_SIZES.md +0 -74
  292. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/layered-architecture.md.template +0 -143
  293. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/project-structure.md.template +0 -127
  294. package/dist/agents/plugins/claude/plugin/commands/codemie-pr.md +0 -25
@@ -1,207 +1,179 @@
1
- # API Patterns
2
-
3
- ## Quick Summary
4
-
5
- API endpoint patterns for [PROJECT_NAME]: CRUD operations, validation, authentication, and error responses.
6
-
7
- **Category**: API
8
- **Complexity**: Medium
9
- **Prerequisites**: [FRAMEWORK], HTTP, [AUTH_METHOD]
10
-
11
1
  ---
2
+ # API Patterns Guide
12
3
 
13
- ## 🚨 SIZE LIMIT WARNING
4
+ ## Overview
14
5
 
15
- **This generated guide MUST be 200-400 lines maximum.**
6
+ <!--
7
+ GENERATION INSTRUCTIONS:
8
+ 1. Scan codebase for API routes, controllers, middleware
9
+ 2. Extract ACTUAL patterns used (don't invent)
10
+ 3. Fill each section with REAL file paths and code
11
+ 4. Keep examples minimal (5-15 lines, one per pattern)
12
+ 5. Final output: 150-300 lines
13
+ -->
16
14
 
17
- **When filling this template**:
18
- - Code examples: 5-15 lines (NEVER > 20)
19
- - ONE example per pattern
20
- - ✅ Use file:line references, not full code
21
- - ✅ Use tables for multiple patterns
22
- - ❌ NO multiple examples for same pattern
23
- - ❌ NO verbose explanations
24
- - ❌ NO copying entire functions
25
-
26
- **Validate line count after generation**: `wc -l [this-file]`
27
- **If > 400 lines**: Condense immediately before continuing!
15
+ **Project**: [Extract from package.json/config]
16
+ **Stack**: [Detect framework, language, auth library]
17
+ **Base URL**: [Find in config/env]
28
18
 
29
19
  ---
30
20
 
31
- ## Endpoint Structure
21
+ ## File Structure
32
22
 
33
- ```
34
- [base_url]/
35
- ├── [resource1]/
36
- │ ├── GET / List all
37
- │ ├── POST / Create
38
- │ ├── GET /:id Get one
39
- │ ├── PUT /:id Update
40
- │ └── DELETE /:id Delete
41
- └── [resource2]/
42
- ```
23
+ <!-- Find and document where API code lives -->
43
24
 
44
- **Source**: `[path/to/routes]`
25
+ | Purpose | Path |
26
+ |---------|------|
27
+ | Routes/Endpoints | `[scan for router files]` |
28
+ | Controllers/Handlers | `[scan for controller pattern]` |
29
+ | Middleware | `[scan for middleware folder]` |
30
+ | Validation | `[scan for validators/schemas]` |
31
+ | Models/Types | `[scan for models/entities]` |
45
32
 
46
33
  ---
47
34
 
48
- ## CRUD Patterns
35
+ ## Endpoint Pattern
49
36
 
50
- ### Create (POST)
37
+ <!-- Extract ONE canonical endpoint showing the full pattern -->
51
38
 
52
- ```[language]
53
- # Source: [file:lines]
54
- [create_endpoint]
39
+ ```[detected_language]
40
+ // Source: [actual_file:lines]
41
+ [extract representative endpoint - prefer one with auth + validation]
55
42
  ```
56
43
 
57
- **Status**: 201 Created | 400 Bad Request | 401 Unauthorized
44
+ **To add new endpoint, replicate this structure:**
45
+ 1. Define route in `[routes_file]`
46
+ 2. Add handler in `[controllers_path]`
47
+ 3. Add validation in `[validators_path]` (if needed)
58
48
 
59
49
  ---
60
50
 
61
- ### Read (GET)
51
+ ## Validation Pattern
62
52
 
63
- ```[language]
64
- # Source: [file:lines]
65
- [read_endpoint]
66
- ```
53
+ <!-- Find how this codebase validates requests -->
67
54
 
68
- **Status**: 200 OK | 404 Not Found
55
+ **Approach**: [Detect: Zod/Joi/Yup/Pydantic/class-validator/custom]
69
56
 
70
- ---
71
-
72
- ### Update (PUT/PATCH)
73
-
74
- ```[language]
75
- # Source: [file:lines]
76
- [update_endpoint]
57
+ ```[lang]
58
+ // Source: [actual_file:lines]
59
+ [extract one validation schema example]
77
60
  ```
78
61
 
79
- **Status**: 200 OK | 404 Not Found | 400 Bad Request
62
+ **Usage:**
63
+ ```[lang]
64
+ // How validation is applied to routes
65
+ [extract middleware/decorator usage]
66
+ ```
80
67
 
81
68
  ---
82
69
 
83
- ### Delete (DELETE)
70
+ ## Authentication
84
71
 
85
- ```[language]
86
- # Source: [file:lines]
87
- [delete_endpoint]
72
+ <!-- Find auth middleware/guards -->
73
+
74
+ **Method**: [Detect: JWT/Session/API Key/OAuth]
75
+
76
+ ```[lang]
77
+ // Source: [actual_file:lines]
78
+ [extract auth middleware]
88
79
  ```
89
80
 
90
- **Status**: 204 No Content | 404 Not Found
81
+ **Protect route:** `[extract exact syntax used]`
82
+ **Access user:** `[extract how user object is accessed]`
91
83
 
92
84
  ---
93
85
 
94
- ## Request Validation
86
+ ## Response Patterns
87
+
88
+ <!-- Find consistent response structures -->
95
89
 
96
- ```[language]
97
- # Source: [file:lines]
98
- [validation_example]
90
+ **Success format:**
91
+ ```json
92
+ [extract actual success response structure from code]
99
93
  ```
100
94
 
101
- **Validation Error Response**:
95
+ **Error format:**
102
96
  ```json
103
- {
104
- "error": {
105
- "code": "VALIDATION_ERROR",
106
- "message": "Validation failed",
107
- "details": [
108
- {"field": "[field]", "message": "[error]"}
109
- ]
110
- }
111
- }
97
+ [extract actual error response structure from code]
112
98
  ```
113
99
 
100
+ **Helper/Utility** (if exists): `[path to response helpers]`
101
+
114
102
  ---
115
103
 
116
- ## Authentication & Authorization
104
+ ## Status Codes
117
105
 
118
- ```[language]
119
- # Source: [file:lines]
120
- [auth_middleware]
121
- ```
106
+ <!-- Extract from actual handlers OR document conventions found -->
122
107
 
123
- **Status**: 401 Unauthorized | 403 Forbidden
108
+ | Operation | Success | Common Errors |
109
+ |-----------|---------|---------------|
110
+ | Create | [find in POST handlers] | [find error codes] |
111
+ | Read | [find in GET handlers] | [find error codes] |
112
+ | Update | [find in PUT/PATCH] | [find error codes] |
113
+ | Delete | [find in DELETE] | [find error codes] |
124
114
 
125
115
  ---
126
116
 
127
- ## Pagination
128
-
129
- ```[language]
130
- # Source: [file:lines]
131
- [pagination_example]
132
- ```
117
+ ## Error Handling
133
118
 
134
- **Query Params**: `page`, `limit`, `sort`, `order`
119
+ <!-- Find centralized error handling -->
135
120
 
136
- **Response**:
137
- ```json
138
- {
139
- "data": [],
140
- "pagination": {
141
- "page": 1,
142
- "limit": 20,
143
- "total": 100,
144
- "pages": 5
145
- }
146
- }
121
+ ```[lang]
122
+ // Source: [actual_file:lines]
123
+ [extract error handler/middleware or throwing pattern]
147
124
  ```
148
125
 
126
+ **Throw errors using:** `[extract exact syntax]`
127
+
149
128
  ---
150
129
 
151
- ## Error Responses
130
+ ## Pagination
152
131
 
153
- | Status | Type | Example |
154
- |--------|------|---------|
155
- | 400 | Bad Request | Invalid input |
156
- | 401 | Unauthorized | Missing/invalid token |
157
- | 403 | Forbidden | Insufficient permissions |
158
- | 404 | Not Found | Resource doesn't exist |
159
- | 422 | Unprocessable | Validation failed |
160
- | 500 | Server Error | Internal error |
132
+ <!-- Find if pagination exists, extract pattern -->
161
133
 
162
- **Format**:
163
- ```json
164
- {
165
- "error": {
166
- "code": "[ERROR_CODE]",
167
- "message": "[human-readable]",
168
- "details": "[additional info]"
169
- }
170
- }
134
+ ```[lang]
135
+ // Source: [actual_file:lines]
136
+ [extract pagination implementation]
171
137
  ```
172
138
 
139
+ **Params**: [extract actual query param names used]
140
+ **Defaults**: page=`[find]`, limit=`[find]`
141
+
173
142
  ---
174
143
 
175
- ## Rate Limiting
144
+ ## Conventions
176
145
 
177
- ```[language]
178
- # Source: [file:lines]
179
- [rate_limit_config]
180
- ```
146
+ <!-- Extract by analyzing multiple endpoints -->
181
147
 
182
- **Headers**:
183
- - `X-RateLimit-Limit`: Max requests
184
- - `X-RateLimit-Remaining`: Requests left
185
- - `X-RateLimit-Reset`: Reset time
148
+ | Aspect | Convention Used |
149
+ |--------|-----------------|
150
+ | Route naming | `[kebab-case/camelCase/snake_case]` |
151
+ | Controller methods | `[naming pattern found]` |
152
+ | Async handling | `[async/await, promises, try/catch wrapper]` |
153
+ | ID parameter | `[id/:id/uuid format]` |
186
154
 
187
155
  ---
188
156
 
189
- ## Best Practices
157
+ ## Anti-Patterns
190
158
 
191
- | DO | DON'T |
192
- |-------|----------|
193
- | Use proper HTTP methods | GET for mutations |
194
- | Return appropriate status codes | Always 200 |
195
- | Validate all input | Trust client data |
196
- | Use consistent naming | Mix conventions |
197
- | Version your API | Break clients |
159
+ <!-- Document what NOT to do based on codebase patterns -->
160
+
161
+ | Avoid | Use Instead | Reason |
162
+ |----------|----------------|--------|
163
+ | [detect inconsistencies or deprecated patterns] | [correct pattern from code] | [why] |
198
164
 
199
165
  ---
200
166
 
201
- ## References
167
+ ## Quick Reference
202
168
 
203
- - **Routes**: `[path/to/routes]`
204
- - **Models**: `[path/to/models]`
205
- - **API Docs**: [URL]
169
+ <!-- Condensed lookup table -->
206
170
 
207
- ---
171
+ | Task | Syntax | Example |
172
+ |------|--------|---------|
173
+ | Define route | `[extract]` | `[file:line]` |
174
+ | Add validation | `[extract]` | `[file:line]` |
175
+ | Protect route | `[extract]` | `[file:line]` |
176
+ | Return success | `[extract]` | `[file:line]` |
177
+ | Throw error | `[extract]` | `[file:line]` |
178
+
179
+ ---
@@ -0,0 +1,197 @@
1
+ ---
2
+ # Architecture Guide
3
+
4
+ <!--
5
+ GENERATION INSTRUCTIONS:
6
+ 1. Identify architectural style (layered/modular/hexagonal/clean/microservices)
7
+ 2. Detect design patterns by scanning code structures
8
+ 3. Map actual dependencies between components
9
+ 4. Extract from: imports, folder structure, class relationships
10
+ 5. Output: 300 lines max
11
+ -->
12
+
13
+ **Project**: [Extract from config]
14
+ **Style**: [Detect: Layered | Modular | Hexagonal | Clean | Microservices | Monolith]
15
+ **Language**: [Detect] | **Framework**: [Detect]
16
+
17
+ ---
18
+
19
+ ## Architecture Overview
20
+
21
+ <!-- Generate diagram based on detected style -->
22
+
23
+ ```
24
+ [Generate ASCII diagram showing main components and their relationships]
25
+ ```
26
+
27
+ **Key Decision**: [Extract or infer WHY this architecture - scalability/simplicity/team structure]
28
+
29
+ ---
30
+
31
+ ## Component Structure
32
+
33
+ <!-- Scan and document actual project organization -->
34
+
35
+ ```
36
+ [root]/
37
+ ├── [component1]/ [Detected purpose]
38
+ ├── [component2]/ [Detected purpose]
39
+ ├── [component3]/ [Detected purpose]
40
+ ├── [shared/common]/ [Detected purpose]
41
+ └── [entry point]
42
+ ```
43
+
44
+ ---
45
+
46
+ ## Design Patterns Detected
47
+
48
+ <!-- Scan codebase for these patterns, document only those found -->
49
+
50
+ | Pattern | Usage | Location |
51
+ |---------|-------|----------|
52
+ | [Repository] | [How it's used] | `[file:line]` |
53
+ | [Factory] | [How it's used] | `[file:line]` |
54
+ | [Singleton] | [How it's used] | `[file:line]` |
55
+ | [Dependency Injection] | [How it's used] | `[file:line]` |
56
+ | [Observer/Event] | [How it's used] | `[file:line]` |
57
+ | [Strategy] | [How it's used] | `[file:line]` |
58
+
59
+ ### Primary Pattern: [Most significant pattern]
60
+
61
+ ```[lang]
62
+ // Source: [file:lines]
63
+ [Extract canonical example of main pattern]
64
+ ```
65
+
66
+ **When to use**: [Detect from usage context]
67
+
68
+ ---
69
+
70
+ ## Layer/Module Responsibilities
71
+
72
+ <!-- Adapt based on detected architecture style -->
73
+
74
+ | Component | Responsibility | Depends On | Depended By |
75
+ |-----------|----------------|------------|-------------|
76
+ | [Layer/Module 1] | [Detected role] | [List] | [List] |
77
+ | [Layer/Module 2] | [Detected role] | [List] | [List] |
78
+ | [Layer/Module 3] | [Detected role] | [List] | [List] |
79
+
80
+ ---
81
+
82
+ ## Dependency Rules
83
+
84
+ <!-- Extract from imports analysis -->
85
+
86
+ ```
87
+ [Component A] ──► [Component B] ──► [Component C]
88
+
89
+
90
+ [Shared/Core]
91
+ ```
92
+
93
+ | Rule | Enforced By |
94
+ |------|-------------|
95
+ | [e.g., Controllers never import Repositories directly] | [Convention / Linter / DI Container] |
96
+ | [e.g., Domain has no external dependencies] | [Convention / Module boundary] |
97
+
98
+ **Violations to avoid:**
99
+ - ❌ [Detected anti-pattern or rule]
100
+ - ❌ [Detected anti-pattern or rule]
101
+
102
+ ---
103
+
104
+ ## Data Flow
105
+
106
+ <!-- Trace a typical request through the system -->
107
+
108
+ ```
109
+ [Entry] → [Component1] → [Component2] → [Component3] → [Storage/External]
110
+ │ │ │ │
111
+ │ [Transform] [Process] [Persist]
112
+ │ │ │ │
113
+ └───────────┴──────────────┴──────────────┘
114
+ Response
115
+ ```
116
+
117
+ **Example flow** (`[common operation]`):
118
+ 1. `[entry point]` receives request
119
+ 2. `[component]` validates/transforms
120
+ 3. `[component]` executes logic
121
+ 4. `[component]` persists/fetches data
122
+ 5. Response returns through chain
123
+
124
+ ---
125
+
126
+ ## Key Abstractions
127
+
128
+ <!-- Find interfaces/base classes that define contracts -->
129
+
130
+ | Abstraction | Purpose | Implementations |
131
+ |-------------|---------|-----------------|
132
+ | `[Interface/Base]` | [Contract purpose] | `[file:line]` |
133
+ | `[Interface/Base]` | [Contract purpose] | `[file:line]` |
134
+
135
+ ```[lang]
136
+ // Source: [file:lines]
137
+ [Extract key interface/abstract class]
138
+ ```
139
+
140
+ ---
141
+
142
+ ## Adding New Features
143
+
144
+ <!-- Document extension points based on existing patterns -->
145
+
146
+ ### To add new [entity/resource/feature]:
147
+
148
+ 1. **[Component1]**: Create `[path/pattern]`
149
+ 2. **[Component2]**: Create `[path/pattern]`
150
+ 3. **[Component3]**: Create `[path/pattern]`
151
+ 4. **Wire up**: [How components connect - DI/imports/registration]
152
+
153
+ ### To add new [integration/external service]:
154
+
155
+ 1. Create adapter in `[path]`
156
+ 2. Implement interface `[interface name]`
157
+ 3. Register in `[config/di location]`
158
+
159
+ ---
160
+
161
+ ## Configuration & Environment
162
+
163
+ <!-- Find how config flows through architecture -->
164
+
165
+ | Config Type | Location | Accessed Via |
166
+ |-------------|----------|--------------|
167
+ | Environment | `[.env / env files]` | `[config module/pattern]` |
168
+ | App Config | `[config files]` | `[how injected/imported]` |
169
+ | Secrets | `[secrets handling]` | `[access pattern]` |
170
+
171
+ ---
172
+
173
+ ## Boundaries Summary
174
+
175
+ <!-- Concise rules for AI to follow -->
176
+
177
+ | ✅ DO | ❌ DON'T |
178
+ |-------|----------|
179
+ | [Detected convention] | [Detected anti-pattern] |
180
+ | [Detected convention] | [Detected anti-pattern] |
181
+ | [Detected convention] | [Detected anti-pattern] |
182
+ | Follow existing [pattern] for new code | Introduce new patterns without reason |
183
+
184
+ ---
185
+
186
+ ## Quick Reference
187
+
188
+ | Need | Location | Pattern |
189
+ |------|----------|---------|
190
+ | Entry point | `[path]` | - |
191
+ | Business logic | `[path]` | [pattern] |
192
+ | Data access | `[path]` | [pattern] |
193
+ | External services | `[path]` | [pattern] |
194
+ | Shared utilities | `[path]` | - |
195
+ | Configuration | `[path]` | [pattern] |
196
+
197
+ ---