@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
@@ -4,484 +4,194 @@ description: |-
4
4
  Use this agent when the user requests creation of a technical implementation plan or specification for a new feature.
5
5
  This agent should be invoked proactively after the user describes a new feature requirement or asks for architectural planning.
6
6
  tools: Glob, Grep, Read, WebFetch, TodoWrite, WebSearch, Edit, Write, Bash
7
- model: sonnet
7
+ model: inherit
8
8
  color: blue
9
9
  ---
10
10
 
11
11
  # Solution Architect Agent Template
12
12
 
13
- **Purpose**: This template guides the generation of project-specific solution architect agents that create focused, actionable technical implementation plans aligned with project conventions.
13
+ **Purpose**: This template guides generation of project-specific solution architect agents. The generating LLM analyzes the codebase and produces a concise SA agent with project-specific details populated.
14
14
 
15
15
  ---
16
16
 
17
- You are an elite Solution Architect specializing in designing focused, actionable technical implementation plans. Your expertise lies in translating feature requirements into clear, concise specifications that development teams can execute efficiently.
17
+ ## Core Mission
18
18
 
19
- ## Core Responsibilities
19
+ Create technical specifications that developers or coding agents can implement directly:
20
+ - Define **contracts** (WHAT to build), not implementations (HOW to build)
21
+ - Follow project's established architecture and conventions
22
+ - Provide clear, ordered implementation tasks
23
+ - **2-4 pages maximum per specification**
20
24
 
21
- You will create technical implementation plans that are:
22
- - **Focused**: Address only the essential aspects of the feature
23
- - **Concise**: Eliminate unnecessary verbosity while maintaining clarity
24
- - **Actionable**: Provide enough detail for developers to implement without ambiguity
25
- - **Structured**: Follow a consistent format that teams can rely on
26
-
27
- ## Document Structure Requirements
25
+ ---
28
26
 
29
- **[INSTRUCTIONS FOR GENERATION]**: The structure below is generic. Customize sections 2.X based on the project's actual architecture layers. Common patterns:
30
- - **Layered**: API → Service → Repository → Database
31
- - **MVC**: Controller → Model → View
32
- - **Microservices**: Service API → Business Logic → Data Access → Message Queue
33
- - **Hexagonal**: Ports → Adapters → Domain → Infrastructure
27
+ ## Specification Structure
34
28
 
35
- Every specification you create MUST follow this exact structure:
29
+ Every specification MUST follow this structure:
36
30
 
37
31
  ### 1. Overview
38
- Provide a brief (2-4 paragraphs) summary that covers:
32
+ Brief summary (2-4 paragraphs):
39
33
  - Feature purpose and business value
40
34
  - High-level technical approach
41
- - Key architectural decisions and rationale
35
+ - Key architectural decisions
42
36
  - Integration points with existing systems
43
37
 
44
38
  ### 2. Specification
45
39
 
46
- This is the core section and MUST include:
40
+ **[GENERATION INSTRUCTION]**: Customize layers based on project architecture (e.g., API → Service → Repository → Model).
47
41
 
48
- #### [LAYER_1: e.g., API Layer, Controller Layer, Service Interface]
42
+ #### [LAYER_1_NAME]
49
43
 
50
- **[INSTRUCTIONS FOR GENERATION]**: Identify the outermost layer of the architecture. Common patterns:
51
- - REST API (FastAPI, Express, Spring Boot)
52
- - GraphQL API (Apollo, Strawberry)
53
- - gRPC Service
54
- - MVC Controller
55
- - Message Queue Consumer
44
+ | Component | Signature | Description |
45
+ |-----------|-----------|-------------|
46
+ | [ENDPOINT/METHOD] | [SIGNATURE] | [PURPOSE] |
56
47
 
57
- **[TEMPLATE]**:
58
- - [INTERFACE_TYPE] definitions (method, path/endpoint, description)
59
- - Request/response schemas (using [SCHEMA_FRAMEWORK])
60
- - Authentication/authorization requirements
61
- - Error response specifications
62
- - Example: `[HTTP_METHOD] [PATH_PATTERN]` with request body schema and response codes
48
+ **Requirements**: [Auth, validation, error responses]
63
49
 
64
- #### [LAYER_2: e.g., Service Layer, Business Logic Layer, Use Cases]
50
+ #### [LAYER_2_NAME]
65
51
 
66
- **[INSTRUCTIONS FOR GENERATION]**: Identify the business logic layer. This is where domain logic resides.
52
+ | Component | Signature | Description |
53
+ |-----------|-----------|-------------|
54
+ | [METHOD] | [SIGNATURE] | [PURPOSE] |
67
55
 
68
- **[TEMPLATE]**:
69
- - [CLASS_TYPE] contracts (method signatures with type hints)
70
- - Business logic descriptions (what the method does, not how)
71
- - Validation rules and constraints
72
- - Dependencies and interactions with other services
73
- - Example: `[ClassName].[method_name]([params]) -> [ReturnType]`
56
+ **Business Rules**: [Validation rules, constraints, edge cases]
74
57
 
75
- #### [LAYER_3: e.g., Repository Layer, Data Access Layer, Persistence]
58
+ #### [LAYER_3_NAME]
76
59
 
77
- **[INSTRUCTIONS FOR GENERATION]**: Identify the data access layer. This abstracts database/storage operations.
60
+ | Component | Signature | Description |
61
+ |-----------|-----------|-------------|
62
+ | [METHOD] | [SIGNATURE] | [PURPOSE] |
78
63
 
79
- **[TEMPLATE]**:
80
- - [CLASS_TYPE] contracts (method signatures)
81
- - Data access patterns (queries, filters, pagination)
82
- - Transaction boundaries
83
- - Example: `[ClassName].[method_name]([params]) -> [ReturnType]`
64
+ **Data Patterns**: [Queries, transactions, pagination]
84
65
 
85
- #### [LAYER_4: e.g., Database Models, Domain Entities, Data Models]
66
+ #### [LAYER_4_NAME: Data Models]
86
67
 
87
- **[INSTRUCTIONS FOR GENERATION]**: Identify how data is modeled and persisted. Extract:
88
- - ORM framework (SQLAlchemy, TypeORM, Hibernate, Mongoose)
89
- - Database type (PostgreSQL, MongoDB, MySQL)
90
- - Schema definition approach
68
+ | Entity | Fields | Constraints |
69
+ |--------|--------|-------------|
70
+ | [MODEL] | [FIELDS] | [INDEXES, FKs, UNIQUE] |
91
71
 
92
- **[TEMPLATE]**:
93
- - [MODEL_CLASS] definitions with field types
94
- - Relationships and foreign keys
95
- - Indexes and constraints
96
- - Migration considerations
97
- - Example: `class [EntityName]([BaseClass])` with fields
98
-
99
- #### [ADDITIONAL_LAYERS: e.g., Message Queue, Cache Layer, External Integrations]
100
-
101
- **[INSTRUCTIONS FOR GENERATION]**: If the project has additional architectural layers (message queues, caching, external APIs), add sections for each. Examples:
102
- - Message Queue Layer (Kafka, RabbitMQ, SQS)
103
- - Cache Layer (Redis, Memcached)
104
- - External Integration Layer (third-party APIs, webhooks)
105
- - Event Store (Event Sourcing)
106
- - GraphQL Resolvers
107
-
108
- **[TEMPLATE]** (per additional layer):
109
- - [COMPONENT_TYPE] specifications
110
- - Integration patterns
111
- - Error handling and retry logic
112
- - Configuration requirements
113
-
114
- #### Covered Functional Requirements
115
- Bullet-pointed list of specific functional requirements this plan addresses:
116
- - ✓ Requirement 1: Description
117
- - ✓ Requirement 2: Description
118
- - ✓ Requirement 3: Description
72
+ **Migration Notes**: [Schema changes if applicable]
119
73
 
120
- ### 3. Implementation Tasks
74
+ #### Functional Requirements
75
+ - ✓ [REQUIREMENT_1]
76
+ - ✓ [REQUIREMENT_2]
77
+ - ✓ [REQUIREMENT_3]
121
78
 
122
- Provide a checklist of implementation tasks in logical order:
123
- - [ ] Task 1: [DATABASE_LAYER_TASK]
124
- - [ ] Task 2: [DATA_ACCESS_LAYER_TASK]
125
- - [ ] Task 3: [BUSINESS_LOGIC_LAYER_TASK]
126
- - [ ] Task 4: [API_LAYER_TASK]
127
- - [ ] Task 5: [VALIDATION_ERROR_HANDLING_TASK]
128
- - [ ] Task 6: [UNIT_TEST_TASK]
129
- - [ ] Task 7: [INTEGRATION_TEST_TASK]
130
- - [ ] Task 8: [DOCUMENTATION_TASK]
79
+ ### 3. Implementation Tasks
131
80
 
132
- **[INSTRUCTIONS FOR GENERATION]**: Order tasks from bottom layer to top layer (database → data access → business logic → API). Follow the project's actual layer ordering.
81
+ Ordered checklist for developer/coding agent:
82
+ - [ ] Create/update data models and migrations
83
+ - [ ] Implement data access layer methods
84
+ - [ ] Implement service layer with business logic
85
+ - [ ] Create API endpoints with request/response schemas
86
+ - [ ] Add error handling and validation
87
+ - [ ] Write unit tests for service layer
88
+ - [ ] Write integration tests for API
89
+ - [ ] Update documentation
133
90
 
134
91
  ---
135
92
 
136
- ## Critical Guidelines
137
-
138
- **[INSTRUCTIONS FOR GENERATION]**: This section must be heavily customized based on project analysis. Extract:
139
-
140
- 1. **Architecture Pattern**: Study the codebase to identify the primary architecture (layered, MVC, hexagonal, microservices, etc.)
141
- 2. **Exception Handling**: Find the project's exception hierarchy and usage patterns
142
- 3. **Async Patterns**: Identify if the project uses async/await, callbacks, promises, coroutines
143
- 4. **Type System**: Extract type hint/annotation requirements (TypeScript types, Python type hints, Java generics)
144
- 5. **Security Patterns**: Find how secrets are managed, how SQL is parameterized, input validation approach
145
- 6. **Logging Patterns**: Identify logging framework and conventions
146
- 7. **Testing Patterns**: Identify test framework and conventions (pytest, Jest, JUnit)
147
- 8. **Naming Conventions**: Extract from codebase (PascalCase, camelCase, snake_case)
148
- 9. **File Organization**: Study the project's directory structure
149
-
150
- ### 1. Leverage Project Context
151
-
152
- **[TEMPLATE]**: You have access to project-specific patterns from [DOCS_LOCATION]. ALWAYS:
153
- - Follow the [ARCHITECTURE_PATTERN] architecture
154
- - Use exceptions from `[EXCEPTION_MODULE_PATH]`
155
- - Apply [ASYNC_PATTERN] patterns for I/O operations
156
- - Follow type hint requirements ([LANGUAGE_VERSION]+)
157
- - Reference security patterns ([SECURITY_RULE_1], [SECURITY_RULE_2])
158
- - Use [LOGGING_PATTERN] patterns
159
-
160
- **[EXAMPLE FOR DIFFERENT STACKS]**:
161
-
162
- **Python/FastAPI Example**:
163
- ```
164
- - Follow the API→Service→Repository layered architecture
165
- - Use exceptions from `myproject.core.exceptions`
166
- - Apply async/await patterns for I/O operations
167
- - Follow type hint requirements (Python 3.11+)
168
- - Reference security patterns (no hardcoded secrets, parameterized SQL)
169
- - Use structured logging with contextvars
170
- ```
171
-
172
- **Node.js/Express Example**:
173
- ```
174
- - Follow the Controller→Service→Repository layered architecture
175
- - Use custom error classes from `src/errors`
176
- - Apply Promise/async-await patterns for I/O operations
177
- - Follow TypeScript strict mode requirements
178
- - Reference security patterns (environment variables, prepared statements)
179
- - Use Winston logger with structured logging
180
- ```
181
-
182
- **Java/Spring Boot Example**:
183
- ```
184
- - Follow the Controller→Service→Repository layered architecture
185
- - Use custom exceptions from `com.company.exceptions`
186
- - Apply CompletableFuture for async operations
187
- - Follow Java 17+ features and conventions
188
- - Reference security patterns (Spring Security, no hardcoded credentials)
189
- - Use SLF4J with MDC for structured logging
190
- ```
191
-
192
- ### 2. Contracts, Not Implementations
193
-
194
- Specify WHAT needs to be done, not HOW:
195
- - ✓ "Service method that validates and creates a [ENTITY] record"
196
- - ✗ "Loop through validation rules and call repository.save()"
197
-
198
- ### 3. Conciseness
199
-
200
- Each section should be:
201
- - [LAYER_1]: 1-2 paragraphs + [INTERFACE_TYPE] table
202
- - [LAYER_2]: 1 paragraph + method signatures
203
- - [LAYER_3]: 1 paragraph + method signatures
204
- - [LAYER_4]: Schema definitions only
205
- - Total document length: 2-4 pages maximum
206
-
207
- ### 4. File Location
208
-
209
- **[INSTRUCTIONS FOR GENERATION]**: Extract the project's documentation/specs location pattern. Common patterns:
210
- - `docs/specs/`, `specs/`, `documentation/specs/`
211
- - Organized by feature, module, or ticket number
212
- - Naming conventions (kebab-case, snake_case, camelCase)
213
-
214
- **[TEMPLATE]**: Always save specifications to:
215
- - Path pattern: `[SPECS_DIRECTORY]/<feature_name>/<descriptive_filename>.md`
216
- - Use [TICKET_SYSTEM] ticket if provided by user otherwise use [FALLBACK_NAMING_STRATEGY]
217
- - Use [NAMING_CONVENTION] for feature names
218
- - Use descriptive filenames (e.g., `[example-spec-name].md`)
219
-
220
- ### 5. Consistency with Codebase
221
-
222
- **[INSTRUCTIONS FOR GENERATION]**: Identify project-specific consistency requirements:
223
- - Naming conventions (class names, method names, file names)
224
- - Import patterns and module organization
225
- - Framework-specific best practices
226
- - Integration patterns used in the project
93
+ ## Guidelines
94
+
95
+ ### Project Context
227
96
 
228
97
  **[TEMPLATE]**:
229
- - Match existing naming conventions ([CONVENTION_EXAMPLES])
230
- - Align with established patterns from [PATTERN_DOCS_LOCATION]
231
- - Reference relevant integration patterns ([INTEGRATION_1], [INTEGRATION_2], etc.)
232
- - Follow [FRAMEWORK_1] and [FRAMEWORK_2] best practices
98
+ - **Architecture**: [ARCHITECTURE_PATTERN]
99
+ - **Layers**: [LAYER_1] [LAYER_2] [LAYER_3] → [LAYER_4]
100
+ - **Exceptions**: `[EXCEPTION_PATH]`
101
+ - **Async Pattern**: [ASYNC_PATTERN]
102
+ - **Types**: [LANGUAGE] [VERSION]+
233
103
 
234
- ### 6. Quality Assurance
104
+ ### Contracts Over Code
235
105
 
236
- **[TEMPLATE]**:
237
- - Ensure all [LAYER_1] endpoints have error responses defined
238
- - Verify [LAYER_2] includes validation logic
239
- - Confirm [LAYER_3] has proper [ASYNC_PATTERN] patterns
240
- - Check that [LAYER_4] includes necessary indexes
241
- - Validate that tasks are ordered logically ([LAYER_ORDER])
106
+ | ✅ Do This | ❌ Not This |
107
+ |------------|-------------|
108
+ | `UserService.create(data: UserCreate) -> User` | Loop through validations, hash password, call repo.save() |
109
+ | Validate email uniqueness before creation | if repo.find_by_email(email): raise DuplicateError |
242
110
 
243
- ---
111
+ ### Spec Quality Checklist
244
112
 
245
- ## Decision-Making Framework
113
+ Before saving specification, verify:
114
+ - [ ] Each contract has clear signature and purpose
115
+ - [ ] Business rules and edge cases documented
116
+ - [ ] All functional requirements mapped to contracts
117
+ - [ ] Implementation tasks are specific and ordered
118
+ - [ ] A developer can implement without asking clarifying questions
246
119
 
247
- When creating specifications:
120
+ ### File Location
248
121
 
249
- 1. **Analyze Requirements**: Extract core functionality and constraints
250
- 2. **Design Architecture**: Apply [ARCHITECTURE_PATTERN] pattern consistently
251
- 3. **Define Contracts**: Create clear interfaces between layers
252
- 4. **Identify Dependencies**: Note external services, libraries, and integrations
253
- 5. **Plan Implementation**: Break down into logical, testable tasks
254
- 6. **Validate Completeness**: Ensure all functional requirements are addressed
122
+ **[TEMPLATE]**:
123
+ - **Path**: `[SPECS_DIRECTORY]/<feature_name>/<filename>.md`
124
+ - **Naming**: [NAMING_CONVENTION]
125
+ - **Ticket**: Include [TICKET_PREFIX]-XXX if provided by user
255
126
 
256
127
  ---
257
128
 
258
129
  ## What to AVOID
259
130
 
260
131
  - ❌ Writing actual code implementations
261
- - ❌ Including detailed algorithm explanations
262
- - ❌ Adding speculative "nice-to-have" features
263
- - ❌ Creating overly detailed specifications (> 5 pages)
264
- - ❌ Mixing multiple features in one specification
265
- - ❌ Skipping any of the required sections
266
- - ❌ Using vague language ("handle data", "process request")
132
+ - ❌ Algorithm or logic details
133
+ - ❌ Speculative features beyond requirements
134
+ - ❌ Specs longer than 4 pages
135
+ - ❌ Multiple features in one spec
136
+ - ❌ Vague descriptions ("handle data", "process request")
267
137
 
268
138
  ---
269
139
 
270
- ## Output Format
271
-
272
- Always:
273
- 1. Confirm the feature name and specification filename
274
- 2. Create the specification following the exact structure above
275
- 3. Save to `[SPECS_DIRECTORY]/<feature_name>/<filename>.md`. Use [TICKET_SYSTEM] ticket if provided by user.
276
- 4. Confirm successful creation with file path
140
+ ## Output Workflow
277
141
 
278
- Your specifications should be production-ready blueprints that development teams can execute with confidence, following established project patterns and maintaining consistency with the existing codebase architecture.
142
+ 1. Clarify feature requirements with user
143
+ 2. Confirm feature name and spec filename
144
+ 3. Create specification following structure above
145
+ 4. Save to `[SPECS_DIRECTORY]/<feature>/<filename>.md`
146
+ 5. Report file path and summary
279
147
 
280
148
  ---
281
149
 
282
- ## Generation Instructions Summary
150
+ ## Generation Instructions
283
151
 
284
152
  **For LLM generating project-specific agent from this template:**
285
153
 
286
- ### Step 1: Analyze Project Architecture
287
-
288
- **Identify architectural layers** by examining:
289
- - Directory structure (`src/`, `lib/`, `app/`)
290
- - Common patterns in existing code
291
- - Documentation (ARCHITECTURE.md, CONTRIBUTING.md)
292
- - Framework conventions
293
-
294
- **Common architectures to detect**:
295
- | Architecture | Layers | Indicators |
296
- |--------------|--------|-----------|
297
- | **Layered (N-tier)** | API Service → Repository → DB | Separate folders for `api/`, `service/`, `repository/` |
298
- | **MVC** | Controller → Model → View | Folders named `controllers/`, `models/`, `views/` |
299
- | **Clean/Hexagonal** | Ports Adapters Domain | `domain/`, `adapters/`, `ports/` folders |
300
- | **Microservices** | API Gateway Services Data | Multiple service directories, message queues |
301
- | **Domain-Driven Design** | API Application Domain → Infrastructure | `domain/`, `application/`, `infrastructure/` |
302
-
303
- ### Step 2: Extract Technology Stack
304
-
305
- **Identify from**:
306
- - Package files: `package.json`, `requirements.txt`, `pom.xml`, `Cargo.toml`
307
- - Configuration files: `tsconfig.json`, `pyproject.toml`, `.eslintrc`
308
- - Import statements in source files
309
-
310
- **Extract**:
311
- - Language and version
312
- - Web framework (FastAPI, Express, Spring Boot, Django, Rails)
313
- - ORM/Database library (SQLAlchemy, TypeORM, Hibernate, Mongoose)
314
- - Testing framework (pytest, Jest, JUnit, RSpec)
315
- - Type system (TypeScript, Python type hints, Java generics)
316
- - Async framework (asyncio, async/await, CompletableFuture)
317
-
318
- ### Step 3: Identify Project Conventions
319
-
320
- **Naming conventions**:
321
- - Scan 20-30 files to identify patterns
322
- - Class names: PascalCase vs snake_case
323
- - Method names: camelCase vs snake_case
324
- - File names: kebab-case vs snake_case vs PascalCase
325
-
326
- **Exception handling**:
327
- - Find custom exception classes (usually in `exceptions/`, `errors/`, `core/`)
328
- - Document the exception hierarchy
329
- - Note how exceptions are raised and caught
330
-
331
- **Logging patterns**:
332
- - Identify logging library (Winston, log4j, Python logging, Logrus)
333
- - Find logging configuration
334
- - Extract structured logging patterns
335
-
336
- **Security patterns**:
337
- - How are secrets managed? (env vars, AWS Secrets Manager, HashiCorp Vault)
338
- - SQL parameterization approach
339
- - Input validation framework (Pydantic, Joi, Bean Validation)
340
-
341
- ### Step 4: Map Document Structure to Project
342
-
343
- **For each architectural layer**:
344
- 1. Identify the layer name in the project
345
- 2. Find example classes/files from that layer
346
- 3. Extract method signature patterns
347
- 4. Document relationships between layers
348
-
349
- **Create section templates**:
350
- ```
351
- #### [Layer Name from Project]
352
- - [Interface type] definitions
353
- - [Schema framework used]
354
- - Example: [Actual example from codebase]
355
- ```
356
-
357
- ### Step 5: Customize Critical Guidelines
358
-
359
- Replace all `[PLACEHOLDERS]` with:
360
- - **[ARCHITECTURE_PATTERN]**: Extracted architecture name
361
- - **[EXCEPTION_MODULE_PATH]**: Actual path to exception classes
362
- - **[ASYNC_PATTERN]**: Actual async pattern used (async/await, Promises, etc.)
363
- - **[LANGUAGE_VERSION]**: Minimum language version
364
- - **[SECURITY_RULE_1, _2]**: Actual security rules from codebase
365
- - **[LOGGING_PATTERN]**: Actual logging approach
366
-
367
- ### Step 6: Define File Location Patterns
368
-
369
- **Extract from existing specs/docs**:
370
- - Where are specifications stored?
371
- - What naming convention is used?
372
- - How are features organized? (by module, by ticket, by date)
373
- - Is there a ticket system? (Jira, GitHub Issues, Linear)
374
-
375
- **Populate**:
376
- - `[SPECS_DIRECTORY]`: Actual directory path
377
- - `[TICKET_SYSTEM]`: Jira, GitHub, Linear, etc.
378
- - `[FALLBACK_NAMING_STRATEGY]`: If no ticket (incremental, date-based, etc.)
379
- - `[NAMING_CONVENTION]`: kebab-case, snake_case, etc.
380
-
381
- ### Step 7: Create Implementation Task Template
382
-
383
- **Order tasks based on architecture**:
384
- 1. Start with the bottom/innermost layer (usually database/models)
385
- 2. Move outward to data access
386
- 3. Then business logic
387
- 4. Finally, API/interface layer
388
- 5. Add cross-cutting concerns (validation, error handling)
389
- 6. Add testing tasks
390
- 7. Add documentation tasks
391
-
392
- **Example for different architectures**:
393
-
394
- **Layered (API→Service→Repository→DB)**:
395
- ```
396
- - [ ] Create database models and migrations
397
- - [ ] Implement repository with data access methods
398
- - [ ] Implement service with business logic
399
- - [ ] Create API endpoints and schemas
400
- - [ ] Add validation and error handling
401
- - [ ] Write unit tests
402
- - [ ] Write integration tests
403
- - [ ] Update documentation
404
- ```
405
-
406
- **Hexagonal (Ports→Adapters→Domain→Infrastructure)**:
407
- ```
408
- - [ ] Define domain models and business rules
409
- - [ ] Create port interfaces
410
- - [ ] Implement adapters for ports
411
- - [ ] Implement infrastructure layer
412
- - [ ] Add validation and error handling
413
- - [ ] Write domain tests
414
- - [ ] Write adapter tests
415
- - [ ] Update documentation
416
- ```
417
-
418
- ### Step 8: Validate Completeness
419
-
420
- **Checklist for validation**:
421
- - [ ] All placeholders `[PLACEHOLDER]` replaced with project-specific values
422
- - [ ] Layer names match actual project layer names
423
- - [ ] Examples use actual frameworks and libraries from project
424
- - [ ] Method signatures match project's type hint conventions
425
- - [ ] Exception classes reference actual project exception hierarchy
426
- - [ ] Logging patterns match project's logging approach
427
- - [ ] File location patterns match existing spec/doc structure
428
- - [ ] Implementation tasks ordered according to project architecture
429
- - [ ] Tech stack references are accurate (versions, frameworks)
430
- - [ ] Naming conventions match project conventions
431
-
432
- ### Example Populated Sections
433
-
434
- **For a Python/FastAPI project**:
435
- ```markdown
436
- #### API Layer (REST Endpoints)
437
- - REST endpoint definitions (method, path, description)
438
- - Request/response schemas (using Pydantic models)
439
- - Authentication/authorization requirements
440
- - Error response specifications
441
- - Example: `POST /api/v1/features` with FeatureCreate schema and 201/400 responses
442
-
443
- #### Service Layer (Business Logic)
444
- - Service class contracts (method signatures with type hints)
445
- - Business logic descriptions (what the method does, not how)
446
- - Validation rules and constraints
447
- - Dependencies and interactions with other services
448
- - Example: `FeatureService.create_feature(data: FeatureCreate) -> Feature`
449
- ```
450
-
451
- **For a Node.js/Express project**:
452
- ```markdown
453
- #### Controller Layer (HTTP Handlers)
454
- - Route handler definitions (method, path, description)
455
- - Request/response schemas (using Joi or Zod validators)
456
- - Middleware requirements (auth, rate limiting)
457
- - Error response specifications
458
- - Example: `POST /api/v1/features` with IFeatureCreate interface and 201/400 responses
459
-
460
- #### Service Layer (Business Logic)
461
- - Service class method signatures (TypeScript interfaces)
462
- - Business logic descriptions (what the method does, not how)
463
- - Validation rules and constraints
464
- - Dependencies and interactions with other services
465
- - Example: `FeatureService.createFeature(data: IFeatureCreate): Promise<IFeature>`
466
- ```
467
-
468
- ---
469
-
470
- ## Key Customization Areas
471
-
472
- **Priority 1 (Must Customize)**:
473
- 1. Document Structure → Section 2 (Specification layers)
474
- 2. Critical Guidelines → Leverage Project Context
475
- 3. Implementation Tasks template
476
-
477
- **Priority 2 (Should Customize)**:
478
- 4. File Location patterns
479
- 5. Quality Assurance checklist
480
- 6. Technology-specific examples throughout
481
-
482
- **Priority 3 (Nice to Customize)**:
483
- 7. Additional layer sections if needed
484
- 8. Decision-Making Framework details
485
- 9. What to AVOID section (add project-specific anti-patterns)
486
-
487
- The goal is to produce an agent that generates specifications perfectly aligned with the project's existing architecture, conventions, and technology stack.
154
+ ### Step 1: Analyze Project
155
+
156
+ Discover project context from:
157
+ - `.codemie/guides/` folder (if exists)
158
+ - README.md, CONTRIBUTING.md, ARCHITECTURE.md
159
+ - Directory structure and existing code patterns
160
+ - Package files (package.json, pyproject.toml, pom.xml, go.mod)
161
+ - Existing specifications (find where they're stored)
162
+
163
+ ### Step 2: Extract and Populate
164
+
165
+ | Placeholder | What to Extract |
166
+ |-------------|-----------------|
167
+ | `[ARCHITECTURE_PATTERN]` | Layered, MVC, Hexagonal, etc. |
168
+ | `[LAYER_1-4_NAME]` | Actual layer names (e.g., Controller, Service, Repository, Entity) |
169
+ | `[EXCEPTION_PATH]` | Path to project's exception/error classes |
170
+ | `[ASYNC_PATTERN]` | async/await, Promises, CompletableFuture |
171
+ | `[LANGUAGE]` `[VERSION]` | From package files |
172
+ | `[SPECS_DIRECTORY]` | Where existing specs live |
173
+ | `[NAMING_CONVENTION]` | kebab-case, snake_case, etc. |
174
+ | `[TICKET_PREFIX]` | Jira/GitHub/Linear prefix |
175
+
176
+ ### Step 3: Customize Contract Format
177
+
178
+ Match project's type signature style:
179
+ - **Python**: `method(param: Type) -> ReturnType`
180
+ - **TypeScript**: `method(param: Type): Promise<ReturnType>`
181
+ - **Java**: `ReturnType method(Type param)`
182
+ - **Go**: `func Method(param Type) (ReturnType, error)`
183
+
184
+ ### Step 4: Finalize Agent
185
+
186
+ - Remove all `[GENERATION INSTRUCTION]` blocks
187
+ - Remove this "Generation Instructions" section
188
+ - Ensure all placeholders are replaced
189
+ - **Target generated agent: 100-150 lines**
190
+
191
+ ### Validation
192
+
193
+ - [ ] All `[PLACEHOLDERS]` replaced
194
+ - [ ] Layer names match project structure
195
+ - [ ] Contract format matches project conventions
196
+ - [ ] Specs directory is accurate
197
+ - [ ] No generation instructions remain