@codemieai/code 0.0.3 → 0.0.5

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 (257) hide show
  1. package/README.md +375 -325
  2. package/bin/codemie-claude.js +23 -0
  3. package/bin/codemie-code.js +49 -11
  4. package/bin/codemie-codex.js +12 -13
  5. package/dist/agents/adapters/claude-code.d.ts +5 -0
  6. package/dist/agents/adapters/claude-code.d.ts.map +1 -1
  7. package/dist/agents/adapters/claude-code.js +76 -18
  8. package/dist/agents/adapters/claude-code.js.map +1 -1
  9. package/dist/agents/adapters/codex.d.ts +5 -0
  10. package/dist/agents/adapters/codex.d.ts.map +1 -1
  11. package/dist/agents/adapters/codex.js +75 -17
  12. package/dist/agents/adapters/codex.js.map +1 -1
  13. package/dist/agents/codemie-code/agent.d.ts.map +1 -1
  14. package/dist/agents/codemie-code/agent.js +187 -21
  15. package/dist/agents/codemie-code/agent.js.map +1 -1
  16. package/dist/agents/codemie-code/config.d.ts.map +1 -1
  17. package/dist/agents/codemie-code/config.js +29 -27
  18. package/dist/agents/codemie-code/config.js.map +1 -1
  19. package/dist/agents/codemie-code/index.d.ts +16 -2
  20. package/dist/agents/codemie-code/index.d.ts.map +1 -1
  21. package/dist/agents/codemie-code/index.js +74 -6
  22. package/dist/agents/codemie-code/index.js.map +1 -1
  23. package/dist/agents/codemie-code/modes/contextAwarePlanning.d.ts +87 -0
  24. package/dist/agents/codemie-code/modes/contextAwarePlanning.d.ts.map +1 -0
  25. package/dist/agents/codemie-code/modes/contextAwarePlanning.js +957 -0
  26. package/dist/agents/codemie-code/modes/contextAwarePlanning.js.map +1 -0
  27. package/dist/agents/codemie-code/modes/planMode.d.ts +116 -0
  28. package/dist/agents/codemie-code/modes/planMode.d.ts.map +1 -0
  29. package/dist/agents/codemie-code/modes/planMode.js +537 -0
  30. package/dist/agents/codemie-code/modes/planMode.js.map +1 -0
  31. package/dist/agents/codemie-code/prompts.d.ts +29 -0
  32. package/dist/agents/codemie-code/prompts.d.ts.map +1 -1
  33. package/dist/agents/codemie-code/prompts.js +129 -0
  34. package/dist/agents/codemie-code/prompts.js.map +1 -1
  35. package/dist/agents/codemie-code/storage/todoStorage.d.ts +78 -0
  36. package/dist/agents/codemie-code/storage/todoStorage.d.ts.map +1 -0
  37. package/dist/agents/codemie-code/storage/todoStorage.js +225 -0
  38. package/dist/agents/codemie-code/storage/todoStorage.js.map +1 -0
  39. package/dist/agents/codemie-code/tokenUtils.js +1 -1
  40. package/dist/agents/codemie-code/tokenUtils.js.map +1 -1
  41. package/dist/agents/codemie-code/tools/index.d.ts +26 -0
  42. package/dist/agents/codemie-code/tools/index.d.ts.map +1 -1
  43. package/dist/agents/codemie-code/tools/index.js +182 -14
  44. package/dist/agents/codemie-code/tools/index.js.map +1 -1
  45. package/dist/agents/codemie-code/tools/planning.d.ts +53 -0
  46. package/dist/agents/codemie-code/tools/planning.d.ts.map +1 -0
  47. package/dist/agents/codemie-code/tools/planning.js +224 -0
  48. package/dist/agents/codemie-code/tools/planning.js.map +1 -0
  49. package/dist/agents/codemie-code/types.d.ts +170 -6
  50. package/dist/agents/codemie-code/types.d.ts.map +1 -1
  51. package/dist/agents/codemie-code/types.js.map +1 -1
  52. package/dist/agents/codemie-code/ui/progressTracker.d.ts +125 -0
  53. package/dist/agents/codemie-code/ui/progressTracker.d.ts.map +1 -0
  54. package/dist/agents/codemie-code/ui/progressTracker.js +343 -0
  55. package/dist/agents/codemie-code/ui/progressTracker.js.map +1 -0
  56. package/dist/agents/codemie-code/ui/todoPanel.d.ts +112 -0
  57. package/dist/agents/codemie-code/ui/todoPanel.d.ts.map +1 -0
  58. package/dist/agents/codemie-code/ui/todoPanel.js +318 -0
  59. package/dist/agents/codemie-code/ui/todoPanel.js.map +1 -0
  60. package/dist/agents/codemie-code/ui.d.ts +106 -10
  61. package/dist/agents/codemie-code/ui.d.ts.map +1 -1
  62. package/dist/agents/codemie-code/ui.js +913 -129
  63. package/dist/agents/codemie-code/ui.js.map +1 -1
  64. package/dist/agents/codemie-code/utils/progressionEnforcer.d.ts +87 -0
  65. package/dist/agents/codemie-code/utils/progressionEnforcer.d.ts.map +1 -0
  66. package/dist/agents/codemie-code/utils/progressionEnforcer.js +293 -0
  67. package/dist/agents/codemie-code/utils/progressionEnforcer.js.map +1 -0
  68. package/dist/agents/codemie-code/utils/todoParser.d.ts +41 -0
  69. package/dist/agents/codemie-code/utils/todoParser.d.ts.map +1 -0
  70. package/dist/agents/codemie-code/utils/todoParser.js +305 -0
  71. package/dist/agents/codemie-code/utils/todoParser.js.map +1 -0
  72. package/dist/agents/codemie-code/utils/todoValidator.d.ts +65 -0
  73. package/dist/agents/codemie-code/utils/todoValidator.d.ts.map +1 -0
  74. package/dist/agents/codemie-code/utils/todoValidator.js +249 -0
  75. package/dist/agents/codemie-code/utils/todoValidator.js.map +1 -0
  76. package/dist/agents/codemie-code/validators/planValidator.d.ts +94 -0
  77. package/dist/agents/codemie-code/validators/planValidator.d.ts.map +1 -0
  78. package/dist/agents/codemie-code/validators/planValidator.js +281 -0
  79. package/dist/agents/codemie-code/validators/planValidator.js.map +1 -0
  80. package/dist/agents/registry.d.ts.map +1 -1
  81. package/dist/agents/registry.js +7 -5
  82. package/dist/agents/registry.js.map +1 -1
  83. package/dist/cli/commands/auth.d.ts +3 -0
  84. package/dist/cli/commands/auth.d.ts.map +1 -0
  85. package/dist/cli/commands/auth.js +170 -0
  86. package/dist/cli/commands/auth.js.map +1 -0
  87. package/dist/cli/commands/config.d.ts.map +1 -1
  88. package/dist/cli/commands/config.js +40 -13
  89. package/dist/cli/commands/config.js.map +1 -1
  90. package/dist/cli/commands/doctor.d.ts.map +1 -1
  91. package/dist/cli/commands/doctor.js +209 -16
  92. package/dist/cli/commands/doctor.js.map +1 -1
  93. package/dist/cli/commands/env.js +3 -3
  94. package/dist/cli/commands/env.js.map +1 -1
  95. package/dist/cli/commands/install.d.ts.map +1 -1
  96. package/dist/cli/commands/install.js +2 -1
  97. package/dist/cli/commands/install.js.map +1 -1
  98. package/dist/cli/commands/run.d.ts.map +1 -1
  99. package/dist/cli/commands/run.js +15 -9
  100. package/dist/cli/commands/run.js.map +1 -1
  101. package/dist/cli/commands/setup.d.ts.map +1 -1
  102. package/dist/cli/commands/setup.js +177 -11
  103. package/dist/cli/commands/setup.js.map +1 -1
  104. package/dist/cli/commands/tools.d.ts +6 -0
  105. package/dist/cli/commands/tools.d.ts.map +1 -0
  106. package/dist/cli/commands/tools.js +244 -0
  107. package/dist/cli/commands/tools.js.map +1 -0
  108. package/dist/cli/commands/version.js +1 -1
  109. package/dist/cli/commands/version.js.map +1 -1
  110. package/dist/cli/commands/workflow.d.ts +6 -0
  111. package/dist/cli/commands/workflow.d.ts.map +1 -0
  112. package/dist/cli/commands/workflow.js +424 -0
  113. package/dist/cli/commands/workflow.js.map +1 -0
  114. package/dist/cli/index.js +39 -5
  115. package/dist/cli/index.js.map +1 -1
  116. package/dist/clients/adapters/github.d.ts +17 -0
  117. package/dist/clients/adapters/github.d.ts.map +1 -0
  118. package/dist/clients/adapters/github.js +150 -0
  119. package/dist/clients/adapters/github.js.map +1 -0
  120. package/dist/clients/adapters/gitlab.d.ts +17 -0
  121. package/dist/clients/adapters/gitlab.d.ts.map +1 -0
  122. package/dist/clients/adapters/gitlab.js +147 -0
  123. package/dist/clients/adapters/gitlab.js.map +1 -0
  124. package/dist/clients/registry.d.ts +20 -0
  125. package/dist/clients/registry.d.ts.map +1 -0
  126. package/dist/clients/registry.js +27 -0
  127. package/dist/clients/registry.js.map +1 -0
  128. package/dist/tools/detector.d.ts +33 -0
  129. package/dist/tools/detector.d.ts.map +1 -0
  130. package/dist/tools/detector.js +145 -0
  131. package/dist/tools/detector.js.map +1 -0
  132. package/dist/tools/index.d.ts +8 -0
  133. package/dist/tools/index.d.ts.map +1 -0
  134. package/dist/tools/index.js +8 -0
  135. package/dist/tools/index.js.map +1 -0
  136. package/dist/tools/manager.d.ts +21 -0
  137. package/dist/tools/manager.d.ts.map +1 -0
  138. package/dist/tools/manager.js +104 -0
  139. package/dist/tools/manager.js.map +1 -0
  140. package/dist/tools/registry.d.ts +8 -0
  141. package/dist/tools/registry.d.ts.map +1 -0
  142. package/dist/tools/registry.js +36 -0
  143. package/dist/tools/registry.js.map +1 -0
  144. package/dist/tools/types.d.ts +41 -0
  145. package/dist/tools/types.d.ts.map +1 -0
  146. package/dist/tools/types.js +5 -0
  147. package/dist/tools/types.js.map +1 -0
  148. package/dist/types/sso.d.ts +42 -0
  149. package/dist/types/sso.d.ts.map +1 -0
  150. package/dist/types/sso.js +2 -0
  151. package/dist/types/sso.js.map +1 -0
  152. package/dist/utils/agent-compatibility.d.ts +32 -0
  153. package/dist/utils/agent-compatibility.d.ts.map +1 -0
  154. package/dist/utils/agent-compatibility.js +140 -0
  155. package/dist/utils/agent-compatibility.js.map +1 -0
  156. package/dist/utils/codemie-integration-validator.d.ts +17 -0
  157. package/dist/utils/codemie-integration-validator.d.ts.map +1 -0
  158. package/dist/utils/codemie-integration-validator.js +105 -0
  159. package/dist/utils/codemie-integration-validator.js.map +1 -0
  160. package/dist/utils/codemie-model-fetcher.d.ts +11 -0
  161. package/dist/utils/codemie-model-fetcher.d.ts.map +1 -0
  162. package/dist/utils/codemie-model-fetcher.js +242 -0
  163. package/dist/utils/codemie-model-fetcher.js.map +1 -0
  164. package/dist/utils/config-loader.d.ts +23 -1
  165. package/dist/utils/config-loader.d.ts.map +1 -1
  166. package/dist/utils/config-loader.js +73 -27
  167. package/dist/utils/config-loader.js.map +1 -1
  168. package/dist/utils/credential-store.d.ts +16 -0
  169. package/dist/utils/credential-store.d.ts.map +1 -0
  170. package/dist/utils/credential-store.js +109 -0
  171. package/dist/utils/credential-store.js.map +1 -0
  172. package/dist/utils/first-time.d.ts +1 -1
  173. package/dist/utils/first-time.d.ts.map +1 -1
  174. package/dist/utils/first-time.js +52 -71
  175. package/dist/utils/first-time.js.map +1 -1
  176. package/dist/utils/health-checker.d.ts.map +1 -1
  177. package/dist/utils/health-checker.js +5 -1
  178. package/dist/utils/health-checker.js.map +1 -1
  179. package/dist/utils/model-fetcher.d.ts.map +1 -1
  180. package/dist/utils/model-fetcher.js +15 -2
  181. package/dist/utils/model-fetcher.js.map +1 -1
  182. package/dist/utils/sso-auth.d.ts +15 -0
  183. package/dist/utils/sso-auth.d.ts.map +1 -0
  184. package/dist/utils/sso-auth.js +207 -0
  185. package/dist/utils/sso-auth.js.map +1 -0
  186. package/dist/utils/sso-gateway.d.ts +47 -0
  187. package/dist/utils/sso-gateway.d.ts.map +1 -0
  188. package/dist/utils/sso-gateway.js +298 -0
  189. package/dist/utils/sso-gateway.js.map +1 -0
  190. package/dist/workflows/detector.d.ts +37 -0
  191. package/dist/workflows/detector.d.ts.map +1 -0
  192. package/dist/workflows/detector.js +160 -0
  193. package/dist/workflows/detector.js.map +1 -0
  194. package/dist/workflows/index.d.ts +8 -0
  195. package/dist/workflows/index.d.ts.map +1 -0
  196. package/dist/workflows/index.js +8 -0
  197. package/dist/workflows/index.js.map +1 -0
  198. package/dist/workflows/installer.d.ts +24 -0
  199. package/dist/workflows/installer.d.ts.map +1 -0
  200. package/dist/workflows/installer.js +105 -0
  201. package/dist/workflows/installer.js.map +1 -0
  202. package/dist/workflows/registry.d.ts +29 -0
  203. package/dist/workflows/registry.d.ts.map +1 -0
  204. package/dist/workflows/registry.js +54 -0
  205. package/dist/workflows/registry.js.map +1 -0
  206. package/dist/workflows/templates/github/metadata.d.ts +6 -0
  207. package/dist/workflows/templates/github/metadata.d.ts.map +1 -0
  208. package/dist/workflows/templates/github/metadata.js +111 -0
  209. package/dist/workflows/templates/github/metadata.js.map +1 -0
  210. package/dist/workflows/templates/gitlab/metadata.d.ts +6 -0
  211. package/dist/workflows/templates/gitlab/metadata.d.ts.map +1 -0
  212. package/dist/workflows/templates/gitlab/metadata.js +14 -0
  213. package/dist/workflows/templates/gitlab/metadata.js.map +1 -0
  214. package/dist/workflows/types.d.ts +71 -0
  215. package/dist/workflows/types.d.ts.map +1 -0
  216. package/dist/workflows/types.js +5 -0
  217. package/dist/workflows/types.js.map +1 -0
  218. package/package.json +19 -6
  219. package/src/workflows/templates/github/code-ci.yml +529 -0
  220. package/src/workflows/templates/github/inline-fix.yml +665 -0
  221. package/src/workflows/templates/github/pr-review.yml +677 -0
  222. package/.claude/agents/README.md +0 -298
  223. package/.claude/agents/release-manager.md +0 -857
  224. package/.codemie/guides/git-workflow.md +0 -493
  225. package/CLAUDE.md +0 -225
  226. package/config.example.json +0 -10
  227. package/dist/agents/codemie-code/streaming/events.d.ts +0 -7
  228. package/dist/agents/codemie-code/streaming/events.d.ts.map +0 -1
  229. package/dist/agents/codemie-code/streaming/events.js +0 -7
  230. package/dist/agents/codemie-code/streaming/events.js.map +0 -1
  231. package/dist/agents/codemie-code/streaming/formatter.d.ts +0 -2
  232. package/dist/agents/codemie-code/streaming/formatter.d.ts.map +0 -1
  233. package/dist/agents/codemie-code/streaming/formatter.js +0 -2
  234. package/dist/agents/codemie-code/streaming/formatter.js.map +0 -1
  235. package/dist/agents/codemie-code/streaming/ui.d.ts +0 -2
  236. package/dist/agents/codemie-code/streaming/ui.d.ts.map +0 -1
  237. package/dist/agents/codemie-code/streaming/ui.js +0 -2
  238. package/dist/agents/codemie-code/streaming/ui.js.map +0 -1
  239. package/dist/agents/codemie-code/tools/command.d.ts +0 -2
  240. package/dist/agents/codemie-code/tools/command.d.ts.map +0 -1
  241. package/dist/agents/codemie-code/tools/command.js +0 -2
  242. package/dist/agents/codemie-code/tools/command.js.map +0 -1
  243. package/dist/agents/codemie-code/tools/filesystem.d.ts +0 -2
  244. package/dist/agents/codemie-code/tools/filesystem.d.ts.map +0 -1
  245. package/dist/agents/codemie-code/tools/filesystem.js +0 -2
  246. package/dist/agents/codemie-code/tools/filesystem.js.map +0 -1
  247. package/dist/agents/codemie-code/tools/git.d.ts +0 -2
  248. package/dist/agents/codemie-code/tools/git.d.ts.map +0 -1
  249. package/dist/agents/codemie-code/tools/git.js +0 -2
  250. package/dist/agents/codemie-code/tools/git.js.map +0 -1
  251. package/dist/agents/codemie-code/tools/security.d.ts +0 -2
  252. package/dist/agents/codemie-code/tools/security.d.ts.map +0 -1
  253. package/dist/agents/codemie-code/tools/security.js +0 -2
  254. package/dist/agents/codemie-code/tools/security.js.map +0 -1
  255. package/eslint.config.mjs +0 -43
  256. package/scripts/README.md +0 -80
  257. package/scripts/release.sh +0 -156
@@ -1,493 +0,0 @@
1
- # Git Workflow Policy
2
-
3
- This document defines the git workflow standards for the codemie-tools repository.
4
-
5
- ## Core Principles
6
-
7
- **IMPORTANT - Always use feature branches:**
8
- - NEVER commit directly to `main` branch
9
- - ALWAYS create a feature branch for changes
10
- - ALL changes must go through Pull Request review
11
- - Keep branches focused on a single feature or fix
12
-
13
- ## Branch Naming Conventions
14
-
15
- Use descriptive, lowercase branch names with hyphens:
16
-
17
- ### Patterns
18
-
19
- - `feature/add-something` - New features or enhancements
20
- - `fix/issue-description` - Bug fixes
21
- - `docs/update-readme` - Documentation changes
22
- - `refactor/component-name` - Code refactoring without behavior change
23
- - `chore/update-dependencies` - Maintenance tasks (dependencies, config, etc.)
24
- - `test/add-tests` - Adding or updating tests
25
-
26
- ### Guidelines
27
-
28
- - Use lowercase with hyphens (kebab-case)
29
- - Be descriptive but concise
30
- - Include ticket/issue number if applicable:
31
- - `feature/GH-123-add-jira-integration`
32
- - `fix/JIRA-456-auth-timeout`
33
- - Keep branch names under 50 characters when possible
34
- - Avoid special characters except hyphens
35
-
36
- ### Examples
37
-
38
- ✅ **Good:**
39
- - `feature/add-slack-notifications`
40
- - `fix/memory-leak-in-parser`
41
- - `docs/update-api-guide`
42
- - `refactor/simplify-error-handling`
43
- - `chore/bump-dependencies`
44
-
45
- ❌ **Bad:**
46
- - `my-branch` (not descriptive)
47
- - `Feature_Add_Something` (wrong case, underscores)
48
- - `fix` (too vague)
49
- - `johns-work` (not task-focused)
50
-
51
- ## Standard Workflow
52
-
53
- ### 1. Start from Main
54
-
55
- Always start from the latest `main` branch:
56
-
57
- ```bash
58
- git checkout main
59
- git pull origin main
60
- ```
61
-
62
- ### 2. Create Feature Branch
63
-
64
- Create a descriptive feature branch:
65
-
66
- ```bash
67
- git checkout -b feature/your-feature-name
68
- ```
69
-
70
- ### 3. Make Changes
71
-
72
- Work on your changes, committing regularly:
73
-
74
- ```bash
75
- # Stage changes
76
- git add <files>
77
-
78
- # Or stage all changes
79
- git add .
80
-
81
- # Commit with descriptive message
82
- git commit -m "type: description"
83
- ```
84
-
85
- ### 4. Push Branch
86
-
87
- Push your feature branch to remote:
88
-
89
- ```bash
90
- # First push (set upstream)
91
- git push -u origin feature/your-feature-name
92
-
93
- # Subsequent pushes
94
- git push
95
- ```
96
-
97
- ### 5. Create Pull Request
98
-
99
- Create a PR using GitHub UI or CLI:
100
-
101
- ```bash
102
- # Using GitHub CLI
103
- gh pr create --title "Add feature XYZ" --body "Description of changes"
104
-
105
- # Or use GitHub web interface
106
- ```
107
-
108
- ### 6. After PR Approval
109
-
110
- Once approved and CI passes, merge the PR:
111
- - Use GitHub's "Squash and merge" for clean history
112
- - Delete the feature branch after merge
113
-
114
- ## Commit Message Guidelines
115
-
116
- Follow [Conventional Commits](https://www.conventionalcommits.org/) specification:
117
-
118
- ### Format
119
-
120
- ```
121
- type: short description (72 chars max)
122
-
123
- Optional longer description explaining the change.
124
- Can span multiple lines.
125
-
126
- Fixes #123
127
- Co-authored-by: CodeMie AI <codemie.ai@gmail.com>
128
- ```
129
-
130
- ### Co-Author Attribution
131
-
132
- **When work is assisted by CodeMie AI**, add the co-author line at the end of the commit message:
133
-
134
- ```
135
- Co-authored-by: CodeMie AI <codemie.ai@gmail.com>
136
- ```
137
-
138
- This ensures:
139
- - GitHub properly recognizes CodeMie AI contributions
140
- - Contribution graphs show AI-assisted commits
141
- - Clear attribution for AI-generated or AI-assisted code
142
-
143
- **Usage:**
144
- ```bash
145
- # Single line commit with co-author
146
- git commit -m "feat: add feature" -m "Co-authored-by: CodeMie AI <codemie.ai@gmail.com>"
147
-
148
- # Or using heredoc for multi-line
149
- git commit -m "$(cat <<EOF
150
- feat: add new feature
151
-
152
- Detailed description of the changes made.
153
-
154
- Co-authored-by: CodeMie AI <codemie.ai@gmail.com>
155
- EOF
156
- )"
157
- ```
158
-
159
- **How GitHub displays co-authors:**
160
- - Appears in commit details on GitHub UI
161
- - Shows in contribution graphs
162
- - Listed in repository insights
163
- - Appears in PR commit lists
164
- - Format must be exact: `Co-authored-by: Name <email@domain.com>`
165
-
166
- **Benefits:**
167
- - Clear visibility of AI-assisted work
168
- - Proper attribution in open source contributions
169
- - Transparent collaboration tracking
170
- - Organization-wide AI contribution metrics
171
-
172
- ### Types
173
-
174
- - `feat:` - New feature
175
- - `fix:` - Bug fix
176
- - `docs:` - Documentation only
177
- - `refactor:` - Code refactoring (no behavior change)
178
- - `test:` - Adding or updating tests
179
- - `chore:` - Maintenance (dependencies, config, build)
180
- - `style:` - Code style changes (formatting, whitespace)
181
- - `perf:` - Performance improvements
182
- - `ci:` - CI/CD changes
183
-
184
- ### Examples
185
-
186
- ✅ **Good commit messages:**
187
- ```
188
- feat: add Slack notification integration
189
-
190
- Implements Slack webhook support for sending notifications
191
- when tickets are created or updated.
192
-
193
- Closes #234
194
- Co-authored-by: CodeMie AI <codemie.ai@gmail.com>
195
- ```
196
-
197
- ```
198
- fix: resolve memory leak in report parser
199
-
200
- The parser was not releasing file handles after processing.
201
- Added proper cleanup in finally block.
202
-
203
- Fixes #456
204
- Co-authored-by: CodeMie AI <codemie.ai@gmail.com>
205
- ```
206
-
207
- ```
208
- docs: update installation guide with Poetry commands
209
-
210
- Added missing steps for virtual environment setup
211
- and dependency installation using Poetry.
212
-
213
- Co-authored-by: CodeMie AI <codemie.ai@gmail.com>
214
- ```
215
-
216
- ```
217
- refactor: simplify error handling in ITSM toolkit
218
-
219
- Consolidated duplicate error handling code into base class.
220
- No functional changes.
221
-
222
- Co-authored-by: CodeMie AI <codemie.ai@gmail.com>
223
- ```
224
-
225
- ❌ **Bad commit messages:**
226
- ```
227
- Update files # Too vague
228
- Fixed stuff # Not descriptive
229
- WIP # Work in progress, don't commit
230
- test commit # Not meaningful
231
- asdfasdf # Nonsense
232
- ```
233
-
234
- ### Commit Message Best Practices
235
-
236
- - **First line**: Concise summary (≤72 characters)
237
- - **Type prefix**: Always use conventional commit type
238
- - **Imperative mood**: "add" not "added" or "adds"
239
- - **Lowercase**: Start description with lowercase
240
- - **No period**: Don't end summary with period
241
- - **Body**: Add context if needed (blank line after summary)
242
- - **References**: Link to issues/PRs when applicable
243
- - **Breaking changes**: Use `!` after type or `BREAKING CHANGE:` in body
244
-
245
- ## Pull Request Guidelines
246
-
247
- ### PR Title
248
-
249
- Use the same format as commit messages:
250
- ```
251
- feat: add feature name
252
- fix: resolve bug description
253
- ```
254
-
255
- ### PR Description Template
256
-
257
- ```markdown
258
- ## Summary
259
- Brief description of changes
260
-
261
- ## Changes Made
262
- - Bullet point list
263
- - Of specific changes
264
- - In this PR
265
-
266
- ## Testing
267
- - [ ] Manual testing performed
268
- - [ ] Existing tests pass
269
- - [ ] New tests added (if applicable)
270
-
271
- ## Screenshots (if applicable)
272
- Add screenshots or GIFs
273
-
274
- ## Related Issues
275
- Closes #123
276
- Relates to #456
277
-
278
- ## Checklist
279
- - [ ] Code follows project style guidelines
280
- - [ ] Documentation updated (if needed)
281
- - [ ] Tests added/updated (if needed)
282
- - [ ] All CI checks passing
283
- ```
284
-
285
- ### Review Process
286
-
287
- 1. **Self-review**: Review your own changes before requesting review
288
- 2. **Request review**: Assign relevant reviewers
289
- 3. **Address feedback**: Respond to all comments
290
- 4. **Keep updated**: Merge main into your branch if conflicts arise
291
- 5. **Clean history**: Squash unnecessary commits if needed
292
-
293
- ## Working with Main Branch
294
-
295
- ### Keeping Branch Updated
296
-
297
- If `main` has moved ahead while working on your feature:
298
-
299
- ```bash
300
- # From your feature branch
301
- git fetch origin
302
- git merge origin/main
303
-
304
- # Or use rebase for cleaner history
305
- git fetch origin
306
- git rebase origin/main
307
- ```
308
-
309
- ### Handling Merge Conflicts
310
-
311
- If conflicts occur:
312
-
313
- ```bash
314
- # 1. Identify conflicted files
315
- git status
316
-
317
- # 2. Edit files to resolve conflicts
318
- # Look for <<<<<<, ======, >>>>>> markers
319
-
320
- # 3. Mark conflicts as resolved
321
- git add <resolved-files>
322
-
323
- # 4. Continue merge/rebase
324
- git merge --continue
325
- # or
326
- git rebase --continue
327
- ```
328
-
329
- ## Emergency Hotfixes
330
-
331
- For critical production issues:
332
-
333
- ```bash
334
- # 1. Create hotfix branch from main
335
- git checkout main
336
- git pull origin main
337
- git checkout -b fix/critical-bug-name
338
-
339
- # 2. Make fix and test thoroughly
340
-
341
- # 3. Push and create PR
342
- git push -u origin fix/critical-bug-name
343
-
344
- # 4. Request expedited review
345
- # Tag PR with "urgent" or "hotfix" label
346
-
347
- # 5. Merge after approval (may skip some CI checks if critical)
348
- ```
349
-
350
- ## Best Practices
351
-
352
- ### Do's ✅
353
-
354
- - **Do** create small, focused branches
355
- - **Do** commit frequently with clear messages
356
- - **Do** keep commits atomic (one logical change per commit)
357
- - **Do** write descriptive PR descriptions
358
- - **Do** respond to review feedback promptly
359
- - **Do** update documentation with code changes
360
- - **Do** delete branches after merging
361
- - **Do** test thoroughly before pushing
362
-
363
- ### Don'ts ❌
364
-
365
- - **Don't** commit directly to `main`
366
- - **Don't** push broken code
367
- - **Don't** commit secrets or sensitive data
368
- - **Don't** mix unrelated changes in one commit
369
- - **Don't** use vague commit messages
370
- - **Don't** leave branches stale for weeks
371
- - **Don't** force push to shared branches
372
- - **Don't** commit merge conflicts
373
-
374
- ## Git Commands Reference
375
-
376
- ### Essential Commands
377
-
378
- ```bash
379
- # Check status
380
- git status
381
-
382
- # View changes
383
- git diff # Unstaged changes
384
- git diff --staged # Staged changes
385
-
386
- # Create branch
387
- git checkout -b branch-name
388
-
389
- # Switch branches
390
- git checkout branch-name
391
-
392
- # Stage changes
393
- git add <file>
394
- git add . # All changes
395
-
396
- # Commit
397
- git commit -m "message"
398
- git commit --amend # Amend last commit
399
-
400
- # Push
401
- git push
402
- git push -u origin branch # First push with upstream
403
-
404
- # Pull latest changes
405
- git pull origin main
406
-
407
- # View commit history
408
- git log
409
- git log --oneline
410
- git log --graph
411
-
412
- # Undo changes
413
- git checkout -- <file> # Discard unstaged changes
414
- git reset HEAD <file> # Unstage changes
415
- git reset --soft HEAD~1 # Undo last commit (keep changes)
416
-
417
- # Branch management
418
- git branch # List branches
419
- git branch -d branch-name # Delete local branch
420
- git push origin --delete branch-name # Delete remote branch
421
- ```
422
-
423
- ## Integration with CI/CD
424
-
425
- All branches automatically trigger:
426
- - Linting checks
427
- - Unit tests
428
- - Build verification
429
- - Code quality checks
430
-
431
- PRs cannot be merged until:
432
- - All CI checks pass
433
- - At least one approval received
434
- - No merge conflicts
435
- - Branch is up to date with main
436
-
437
- ## Troubleshooting
438
-
439
- ### "Branch is behind main"
440
-
441
- ```bash
442
- git fetch origin
443
- git merge origin/main
444
- git push
445
- ```
446
-
447
- ### "Merge conflicts"
448
-
449
- ```bash
450
- # See conflicted files
451
- git status
452
-
453
- # After resolving conflicts
454
- git add <resolved-files>
455
- git commit
456
- ```
457
-
458
- ### "Accidentally committed to main"
459
-
460
- ```bash
461
- # Create branch from current state
462
- git branch feature/my-changes
463
-
464
- # Reset main to match remote
465
- git reset --hard origin/main
466
-
467
- # Switch to new branch
468
- git checkout feature/my-changes
469
-
470
- # Push branch
471
- git push -u origin feature/my-changes
472
- ```
473
-
474
- ### "Need to update commit message"
475
-
476
- ```bash
477
- # Last commit only
478
- git commit --amend -m "new message"
479
-
480
- # Push (requires force if already pushed)
481
- git push --force-with-lease
482
- ```
483
-
484
- ## Additional Resources
485
-
486
- - [Conventional Commits](https://www.conventionalcommits.org/)
487
- - [Git Best Practices](https://git-scm.com/book/en/v2)
488
- - [GitHub Flow](https://guides.github.com/introduction/flow/)
489
- - [Semantic Versioning](https://semver.org/)
490
-
491
- ---
492
-
493
- **Remember**: Following these guidelines ensures clean git history, easier code review, and better collaboration across the team.
package/CLAUDE.md DELETED
@@ -1,225 +0,0 @@
1
- # CLAUDE.md
2
-
3
- This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
-
5
- ## Critical First Step: ALWAYS Read Documentation
6
-
7
- **MANDATORY**: Before writing ANY code, you MUST:
8
- 1. Read the `README.md` file - this is your PRIMARY source of truth
9
- 2. Review this CLAUDE.md for architectural patterns and conventions
10
- 3. Study reference implementations mentioned in this guide
11
-
12
- ## Common Commands
13
-
14
- ```bash
15
- # Installation & Setup
16
- npm install # Install dependencies
17
- npm link # Link globally for local testing
18
-
19
- # Building
20
- npm run build # Compile TypeScript
21
- npm run dev # Watch mode for development
22
-
23
- # Code Quality
24
- npm run lint # Check code style with ESLint (max 10 warnings)
25
- npm run lint:fix # Fix linting issues automatically
26
- npm run ci # Run full CI pipeline (license-check + lint + build)
27
-
28
- # Development Workflow
29
- npm run build && npm link # Build and link for testing
30
- codemie doctor # Verify installation and configuration
31
- codemie-code health # Test built-in agent health
32
-
33
- # Testing the Built-in Agent
34
- codemie-code --task "test" # Single task execution
35
- codemie-code --debug # Interactive with debug logging
36
-
37
- # Direct Agent Shortcuts (bypass registry)
38
- codemie-claude # Direct Claude Code access
39
- codemie-codex # Direct Codex access
40
- codemie-claude health # Claude health check
41
- codemie-codex health # Codex health check
42
-
43
- # Release & Publishing
44
- git tag -a v0.0.1 -m "Release version 0.0.1" # Create release tag
45
- git push origin v0.0.1 # Push tag to trigger publish
46
- ```
47
-
48
- ## Core Principles
49
-
50
- **ALWAYS follow these fundamental principles:**
51
-
52
- ### KISS (Keep It Simple, Stupid)
53
- - Write simple, straightforward code that's easy to understand
54
- - Avoid over-engineering and unnecessary complexity
55
- - Remove redundant code, scripts, and configuration
56
- - If something can be done in fewer lines/steps, do it
57
- - Question every piece of complexity - is it truly needed?
58
-
59
- ### DRY (Don't Repeat Yourself)
60
- - Never duplicate code, logic, or configuration
61
- - Extract common patterns into reusable functions/utilities
62
- - Reuse existing utilities from \`src/utils/\` before creating new ones
63
- - If you find yourself copying code, refactor it into a shared function
64
- - One source of truth for each piece of knowledge
65
-
66
- **Remember:** Simple, clean code is better than clever, complex code.
67
-
68
- ## Project Overview
69
-
70
- **CodeMie** is a unified CLI wrapper for managing multiple AI coding agents, featuring:
71
-
72
- 1. **External Agent Management**: Install and run external agents (Claude Code, Codex)
73
- 2. **Built-in Agent**: CodeMie Native - a LangGraph-based coding assistant
74
- 3. **Configuration Management**: Unified config system supporting multiple AI providers
75
- 4. **Multiple Interfaces**: CLI commands, direct executables, and programmatic APIs
76
-
77
- ## Architecture Overview
78
-
79
- ### High-Level Structure
80
-
81
- ```
82
- codemie-code/
83
- ├── bin/ # Executable entry points
84
- │ ├── codemie.js # Main CLI entry
85
- │ ├── codemie-code.js # Direct built-in agent executable
86
- │ ├── codemie-claude.js # Claude agent wrapper
87
- │ └── codemie-codex.js # Codex agent wrapper
88
- ├── src/
89
- │ ├── cli/ # CLI command implementations
90
- │ ├── agents/ # Agent registry and adapters
91
- │ ├── env/ # Environment and config management
92
- │ ├── utils/ # Shared utilities
93
- │ └── index.ts # Main package exports
94
- ```
95
-
96
- ### Core Components
97
-
98
- #### 1. Agent System (`src/agents/`)
99
-
100
- - **Registry** (`registry.ts`): Central registry managing all available agents
101
- - **Adapters** (`adapters/`): Standardized interfaces for external agents
102
- - `claude-code.ts`: Anthropic Claude Code integration
103
- - `codex.ts`: OpenAI Codex integration
104
- - `codemie-code.ts`: Built-in agent adapter
105
- - **Built-in Agent** (`codemie-code/`): Full LangGraph-based agent implementation
106
-
107
- #### 2. CLI System (`src/cli/`)
108
-
109
- - **Main CLI** (`index.ts`): Commander.js-based CLI with all commands
110
- - **Commands** (`commands/`): Individual command implementations
111
- - `setup.ts`: Interactive configuration wizard
112
- - `install.ts`/`uninstall.ts`: Agent management
113
- - `run.ts`: Agent execution with environment passing
114
- - `doctor.ts`: Health checks and diagnostics
115
- - `config.ts`: Configuration management
116
-
117
- #### 3. Configuration System (`src/env/`)
118
-
119
- - **EnvManager** (`manager.ts`): Global config at `~/.codemie/config.json`
120
- - **Priority**: Environment variables override config file
121
- - **Providers**: Anthropic, OpenAI, Azure, Bedrock, LiteLLM
122
- - **Model Validation**: Real-time model fetching via `/v1/models` endpoints
123
-
124
- #### 4. Built-in Agent Architecture (`src/agents/codemie-code/`)
125
-
126
- **Multi-layered architecture:**
127
-
128
- - **Main Interface** (`index.ts`): `CodeMieCode` class - primary API
129
- - **Agent Core** (`agent.ts`): `CodeMieAgent` - LangGraph integration
130
- - **Configuration** (`config.ts`): Provider config loading and validation
131
- - **Tools System** (`tools/`): Modular tool implementations
132
- - `filesystem.ts`: File operations with security controls
133
- - `command.ts`: Shell command execution
134
- - `git.ts`: Git operations and status
135
- - `security.ts`: Security filters and validation
136
- - **UI System** (`ui.ts`, `streaming/`): Modern terminal interfaces
137
- - **Types** (`types.ts`): Comprehensive TypeScript definitions
138
-
139
- ### Key Architectural Patterns
140
-
141
- #### Agent Adapter Pattern
142
- All agents implement the `AgentAdapter` interface:
143
- ```typescript
144
- interface AgentAdapter {
145
- name: string;
146
- displayName: string;
147
- description: string;
148
- install(): Promise<void>;
149
- uninstall(): Promise<void>;
150
- isInstalled(): Promise<boolean>;
151
- run(args: string[], env?: Record<string, string>): Promise<void>;
152
- getVersion(): Promise<string | null>;
153
- }
154
- ```
155
-
156
- #### Configuration Hierarchy
157
- 1. Environment variables (highest priority)
158
- 2. Global config file (`~/.codemie/config.json`)
159
- 3. Default values (lowest priority)
160
-
161
- #### Tool System Architecture
162
- - **Modular Design**: Each tool type in separate file
163
- - **Security First**: All operations go through security filters
164
- - **Type Safety**: Full TypeScript coverage with Zod validation
165
- - **Error Handling**: Structured error types with context
166
-
167
- #### Execution Modes
168
- - **Interactive**: Full terminal UI with streaming responses
169
- - **Task Mode**: Single task execution with `--task` flag
170
- - **Health Checks**: Connection and configuration validation
171
-
172
- ### Technology Stack
173
-
174
- - **TypeScript**: Full type safety with ES2024 + NodeNext modules
175
- - **Commander.js**: CLI framework with subcommands
176
- - **LangChain/LangGraph**: Agent orchestration and tool calling
177
- - **Clack**: Modern terminal user interface
178
- - **Chalk**: Terminal styling and colors
179
- - **Zod**: Runtime type validation
180
- - **ESLint**: Code quality (max 10 warnings allowed)
181
-
182
- ## Development Guidelines
183
-
184
- ### Working with Agent Shortcuts
185
-
186
- When modifying the direct agent shortcuts (`codemie-claude`, `codemie-codex`):
187
-
188
- 1. **Configuration Override Pattern**: All shortcuts support CLI overrides for:
189
- - `--model`: Override model selection
190
- - `--provider`: Override provider
191
- - `--api-key`: Override API key
192
- - `--base-url`: Override base URL
193
- - `--timeout`: Override timeout
194
-
195
- 2. **Pass-through Architecture**: Use `allowUnknownOption()` and `passThroughOptions()` to forward all unrecognized options to the underlying agent
196
-
197
- 3. **Model Validation**:
198
- - Codex must validate OpenAI-compatible models only
199
- - Claude accepts both Claude and GPT models
200
- - Provide helpful error messages with actionable suggestions
201
-
202
- 4. **Health Check Pattern**: Each shortcut should implement a `health` subcommand that:
203
- - Verifies agent installation
204
- - Shows version information
205
- - Tests basic configuration
206
-
207
- ### Adding New Agent Shortcuts
208
-
209
- To add a new direct agent shortcut (e.g., `codemie-newagent`):
210
-
211
- 1. Create `bin/codemie-newagent.js` following the existing pattern
212
- 2. Add the executable to `package.json` bin field
213
- 3. Implement the adapter in `src/agents/adapters/`
214
- 4. Register in `src/agents/registry.ts`
215
- 5. Update documentation in README.md and CLAUDE.md
216
-
217
- ### Built-in Agent Development
218
-
219
- When working on the CodeMie Native agent (`src/agents/codemie-code/`):
220
-
221
- - **Tools**: Add new tools in `tools/` directory with proper security filtering
222
- - **UI**: Use Clack components for consistent terminal interface
223
- - **Streaming**: Implement proper event handling for real-time responses
224
- - **Configuration**: Follow the provider config pattern in `config.ts`
225
- - **Error Handling**: Use structured error types with context information