@codemieai/code 0.0.1 → 0.0.3

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 (244) hide show
  1. package/.codemie/guides/git-workflow.md +493 -0
  2. package/CLAUDE.md +130 -761
  3. package/README.md +283 -695
  4. package/bin/codemie-claude.js +122 -0
  5. package/bin/codemie-code.js +90 -15
  6. package/bin/codemie-codex.js +138 -0
  7. package/bin/codemie.js +1 -1
  8. package/config.example.json +10 -0
  9. package/dist/agents/adapters/claude-code.d.ts +2 -2
  10. package/dist/agents/adapters/claude-code.d.ts.map +1 -1
  11. package/dist/agents/adapters/claude-code.js +20 -42
  12. package/dist/agents/adapters/claude-code.js.map +1 -1
  13. package/dist/agents/adapters/codemie-code.d.ts +11 -2
  14. package/dist/agents/adapters/codemie-code.d.ts.map +1 -1
  15. package/dist/agents/adapters/codemie-code.js +93 -25
  16. package/dist/agents/adapters/codemie-code.js.map +1 -1
  17. package/dist/agents/adapters/codex.d.ts +2 -2
  18. package/dist/agents/adapters/codex.d.ts.map +1 -1
  19. package/dist/agents/adapters/codex.js +31 -24
  20. package/dist/agents/adapters/codex.js.map +1 -1
  21. package/dist/agents/codemie-code/agent.d.ts +89 -0
  22. package/dist/agents/codemie-code/agent.d.ts.map +1 -0
  23. package/dist/agents/codemie-code/agent.js +523 -0
  24. package/dist/agents/codemie-code/agent.js.map +1 -0
  25. package/dist/agents/codemie-code/config.d.ts +40 -0
  26. package/dist/agents/codemie-code/config.d.ts.map +1 -0
  27. package/dist/agents/codemie-code/config.js +276 -0
  28. package/dist/agents/codemie-code/config.js.map +1 -0
  29. package/dist/agents/codemie-code/filters.d.ts +91 -0
  30. package/dist/agents/codemie-code/filters.d.ts.map +1 -0
  31. package/dist/agents/codemie-code/filters.js +328 -0
  32. package/dist/agents/codemie-code/filters.js.map +1 -0
  33. package/dist/agents/codemie-code/index.d.ts +78 -0
  34. package/dist/agents/codemie-code/index.d.ts.map +1 -0
  35. package/dist/agents/codemie-code/index.js +259 -0
  36. package/dist/agents/codemie-code/index.js.map +1 -0
  37. package/dist/agents/codemie-code/prompts.d.ts +11 -0
  38. package/dist/agents/codemie-code/prompts.d.ts.map +1 -0
  39. package/dist/agents/codemie-code/prompts.js +31 -0
  40. package/dist/agents/codemie-code/prompts.js.map +1 -0
  41. package/dist/agents/codemie-code/streaming/events.d.ts +7 -0
  42. package/dist/agents/codemie-code/streaming/events.d.ts.map +1 -0
  43. package/dist/agents/codemie-code/streaming/events.js +7 -0
  44. package/dist/agents/codemie-code/streaming/events.js.map +1 -0
  45. package/dist/agents/codemie-code/streaming/formatter.d.ts +2 -0
  46. package/dist/agents/codemie-code/streaming/formatter.d.ts.map +1 -0
  47. package/dist/agents/codemie-code/streaming/formatter.js +2 -0
  48. package/dist/agents/codemie-code/streaming/formatter.js.map +1 -0
  49. package/dist/agents/codemie-code/streaming/ui.d.ts +2 -0
  50. package/dist/agents/codemie-code/streaming/ui.d.ts.map +1 -0
  51. package/dist/agents/codemie-code/streaming/ui.js +2 -0
  52. package/dist/agents/codemie-code/streaming/ui.js.map +1 -0
  53. package/dist/agents/codemie-code/tokenUtils.d.ts +108 -0
  54. package/dist/agents/codemie-code/tokenUtils.d.ts.map +1 -0
  55. package/dist/agents/codemie-code/tokenUtils.js +220 -0
  56. package/dist/agents/codemie-code/tokenUtils.js.map +1 -0
  57. package/dist/agents/codemie-code/toolMetadata.d.ts +15 -0
  58. package/dist/agents/codemie-code/toolMetadata.d.ts.map +1 -0
  59. package/dist/agents/codemie-code/toolMetadata.js +315 -0
  60. package/dist/agents/codemie-code/toolMetadata.js.map +1 -0
  61. package/dist/agents/codemie-code/tools/command.d.ts +2 -0
  62. package/dist/agents/codemie-code/tools/command.d.ts.map +1 -0
  63. package/dist/agents/codemie-code/tools/command.js +2 -0
  64. package/dist/agents/codemie-code/tools/command.js.map +1 -0
  65. package/dist/agents/codemie-code/tools/filesystem.d.ts +2 -0
  66. package/dist/agents/codemie-code/tools/filesystem.d.ts.map +1 -0
  67. package/dist/agents/codemie-code/tools/filesystem.js +2 -0
  68. package/dist/agents/codemie-code/tools/filesystem.js.map +1 -0
  69. package/dist/agents/codemie-code/tools/git.d.ts +2 -0
  70. package/dist/agents/codemie-code/tools/git.d.ts.map +1 -0
  71. package/dist/agents/codemie-code/tools/git.js +2 -0
  72. package/dist/agents/codemie-code/tools/git.js.map +1 -0
  73. package/dist/agents/codemie-code/tools/index.d.ts +19 -0
  74. package/dist/agents/codemie-code/tools/index.d.ts.map +1 -0
  75. package/dist/agents/codemie-code/tools/index.js +239 -0
  76. package/dist/agents/codemie-code/tools/index.js.map +1 -0
  77. package/dist/agents/codemie-code/tools/security.d.ts +2 -0
  78. package/dist/agents/codemie-code/tools/security.d.ts.map +1 -0
  79. package/dist/agents/codemie-code/tools/security.js +2 -0
  80. package/dist/agents/codemie-code/tools/security.js.map +1 -0
  81. package/dist/agents/codemie-code/types.d.ts +254 -0
  82. package/dist/agents/codemie-code/types.d.ts.map +1 -0
  83. package/dist/agents/codemie-code/types.js +35 -0
  84. package/dist/agents/codemie-code/types.js.map +1 -0
  85. package/dist/agents/codemie-code/ui.d.ts +83 -0
  86. package/dist/agents/codemie-code/ui.d.ts.map +1 -0
  87. package/dist/agents/codemie-code/ui.js +624 -0
  88. package/dist/agents/codemie-code/ui.js.map +1 -0
  89. package/dist/agents/registry.d.ts +1 -1
  90. package/dist/agents/registry.d.ts.map +1 -1
  91. package/dist/agents/registry.js +7 -13
  92. package/dist/agents/registry.js.map +1 -1
  93. package/dist/cli/commands/config.d.ts +3 -0
  94. package/dist/cli/commands/config.d.ts.map +1 -0
  95. package/dist/cli/commands/config.js +323 -0
  96. package/dist/cli/commands/config.js.map +1 -0
  97. package/dist/cli/commands/doctor.d.ts.map +1 -1
  98. package/dist/cli/commands/doctor.js +113 -69
  99. package/dist/cli/commands/doctor.js.map +1 -1
  100. package/dist/cli/commands/env.d.ts +3 -0
  101. package/dist/cli/commands/env.d.ts.map +1 -0
  102. package/dist/cli/commands/env.js +19 -0
  103. package/dist/cli/commands/env.js.map +1 -0
  104. package/dist/cli/commands/install.js +27 -33
  105. package/dist/cli/commands/install.js.map +1 -1
  106. package/dist/cli/commands/list.js +18 -24
  107. package/dist/cli/commands/list.js.map +1 -1
  108. package/dist/cli/commands/run.d.ts.map +1 -1
  109. package/dist/cli/commands/run.js +307 -21
  110. package/dist/cli/commands/run.js.map +1 -1
  111. package/dist/cli/commands/setup.d.ts +3 -0
  112. package/dist/cli/commands/setup.d.ts.map +1 -0
  113. package/dist/cli/commands/setup.js +357 -0
  114. package/dist/cli/commands/setup.js.map +1 -0
  115. package/dist/cli/commands/uninstall.js +24 -30
  116. package/dist/cli/commands/uninstall.js.map +1 -1
  117. package/dist/cli/commands/version.d.ts.map +1 -1
  118. package/dist/cli/commands/version.js +11 -16
  119. package/dist/cli/commands/version.js.map +1 -1
  120. package/dist/cli/index.js +47 -31
  121. package/dist/cli/index.js.map +1 -1
  122. package/dist/env/manager.js +9 -46
  123. package/dist/env/manager.js.map +1 -1
  124. package/dist/index.d.ts +6 -13
  125. package/dist/index.d.ts.map +1 -1
  126. package/dist/index.js +6 -43
  127. package/dist/index.js.map +1 -1
  128. package/dist/utils/async-tips.d.ts.map +1 -1
  129. package/dist/utils/async-tips.js +16 -55
  130. package/dist/utils/async-tips.js.map +1 -1
  131. package/dist/utils/clipboard.d.ts +16 -0
  132. package/dist/utils/clipboard.d.ts.map +1 -0
  133. package/dist/utils/clipboard.js +179 -0
  134. package/dist/utils/clipboard.js.map +1 -0
  135. package/dist/utils/config-loader.d.ts +96 -0
  136. package/dist/utils/config-loader.d.ts.map +1 -0
  137. package/dist/utils/config-loader.js +351 -0
  138. package/dist/utils/config-loader.js.map +1 -0
  139. package/dist/utils/dirname.d.ts +7 -0
  140. package/dist/utils/dirname.d.ts.map +1 -0
  141. package/dist/utils/dirname.js +11 -0
  142. package/dist/utils/dirname.js.map +1 -0
  143. package/dist/utils/errors.js +7 -17
  144. package/dist/utils/errors.js.map +1 -1
  145. package/dist/utils/exec.js +3 -6
  146. package/dist/utils/exec.js.map +1 -1
  147. package/dist/utils/first-time.d.ts +34 -0
  148. package/dist/utils/first-time.d.ts.map +1 -0
  149. package/dist/utils/first-time.js +245 -0
  150. package/dist/utils/first-time.js.map +1 -0
  151. package/dist/utils/health-checker.d.ts +20 -0
  152. package/dist/utils/health-checker.d.ts.map +1 -0
  153. package/dist/utils/health-checker.js +168 -0
  154. package/dist/utils/health-checker.js.map +1 -0
  155. package/dist/utils/logger.js +12 -18
  156. package/dist/utils/logger.js.map +1 -1
  157. package/dist/utils/model-fetcher.d.ts +21 -0
  158. package/dist/utils/model-fetcher.d.ts.map +1 -0
  159. package/dist/utils/model-fetcher.js +137 -0
  160. package/dist/utils/model-fetcher.js.map +1 -0
  161. package/dist/utils/tips.d.ts.map +1 -1
  162. package/dist/utils/tips.js +13 -52
  163. package/dist/utils/tips.js.map +1 -1
  164. package/package.json +17 -23
  165. package/scripts/README.md +80 -0
  166. package/scripts/release.sh +156 -0
  167. package/dist/agents/adapters/aider.d.ts +0 -12
  168. package/dist/agents/adapters/aider.d.ts.map +0 -1
  169. package/dist/agents/adapters/aider.js +0 -80
  170. package/dist/agents/adapters/aider.js.map +0 -1
  171. package/dist/cli/cli.d.ts +0 -4
  172. package/dist/cli/cli.d.ts.map +0 -1
  173. package/dist/cli/cli.js +0 -107
  174. package/dist/cli/cli.js.map +0 -1
  175. package/dist/cli/commands/mcp.d.ts +0 -3
  176. package/dist/cli/commands/mcp.d.ts.map +0 -1
  177. package/dist/cli/commands/mcp.js +0 -459
  178. package/dist/cli/commands/mcp.js.map +0 -1
  179. package/dist/code/agent-events.d.ts +0 -39
  180. package/dist/code/agent-events.d.ts.map +0 -1
  181. package/dist/code/agent-events.js +0 -4
  182. package/dist/code/agent-events.js.map +0 -1
  183. package/dist/code/agent.d.ts +0 -19
  184. package/dist/code/agent.d.ts.map +0 -1
  185. package/dist/code/agent.js +0 -144
  186. package/dist/code/agent.js.map +0 -1
  187. package/dist/code/config.d.ts +0 -13
  188. package/dist/code/config.d.ts.map +0 -1
  189. package/dist/code/config.js +0 -41
  190. package/dist/code/config.js.map +0 -1
  191. package/dist/code/index.d.ts +0 -19
  192. package/dist/code/index.d.ts.map +0 -1
  193. package/dist/code/index.js +0 -400
  194. package/dist/code/index.js.map +0 -1
  195. package/dist/code/prompts.d.ts +0 -2
  196. package/dist/code/prompts.d.ts.map +0 -1
  197. package/dist/code/prompts.js +0 -45
  198. package/dist/code/prompts.js.map +0 -1
  199. package/dist/code/tools/command.d.ts +0 -8
  200. package/dist/code/tools/command.d.ts.map +0 -1
  201. package/dist/code/tools/command.js +0 -83
  202. package/dist/code/tools/command.js.map +0 -1
  203. package/dist/code/tools/diff-utils.d.ts +0 -2
  204. package/dist/code/tools/diff-utils.d.ts.map +0 -1
  205. package/dist/code/tools/diff-utils.js +0 -45
  206. package/dist/code/tools/diff-utils.js.map +0 -1
  207. package/dist/code/tools/filesystem.d.ts +0 -11
  208. package/dist/code/tools/filesystem.d.ts.map +0 -1
  209. package/dist/code/tools/filesystem.js +0 -442
  210. package/dist/code/tools/filesystem.js.map +0 -1
  211. package/dist/code/tools/git.d.ts +0 -7
  212. package/dist/code/tools/git.d.ts.map +0 -1
  213. package/dist/code/tools/git.js +0 -111
  214. package/dist/code/tools/git.js.map +0 -1
  215. package/dist/code/tools/mcp.d.ts +0 -13
  216. package/dist/code/tools/mcp.d.ts.map +0 -1
  217. package/dist/code/tools/mcp.js +0 -230
  218. package/dist/code/tools/mcp.js.map +0 -1
  219. package/dist/data/tips.json +0 -118
  220. package/dist/ui/terminal-ui.d.ts +0 -73
  221. package/dist/ui/terminal-ui.d.ts.map +0 -1
  222. package/dist/ui/terminal-ui.js +0 -900
  223. package/dist/ui/terminal-ui.js.map +0 -1
  224. package/dist/utils/env-mapper.d.ts +0 -40
  225. package/dist/utils/env-mapper.d.ts.map +0 -1
  226. package/dist/utils/env-mapper.js +0 -122
  227. package/dist/utils/env-mapper.js.map +0 -1
  228. package/docs/USER_GUIDE.md +0 -573
  229. package/tests/agent-direct.test.mjs +0 -45
  230. package/tests/agent-output.test.mjs +0 -64
  231. package/tests/codemie-code.test.mjs +0 -42
  232. package/tests/context7-only.test.mjs +0 -42
  233. package/tests/conversation-flow.test.mjs +0 -63
  234. package/tests/interactive-simulation.test.mjs +0 -60
  235. package/tests/live-output.test.mjs +0 -53
  236. package/tests/mcp-context7.test.mjs +0 -105
  237. package/tests/mcp-e2e.test.mjs +0 -109
  238. package/tests/mcp-time-server.test.mjs +0 -58
  239. package/tests/streaming.test.mjs +0 -57
  240. package/tests/test-helpers.mjs +0 -94
  241. package/tests/text-wrapping.test.mjs +0 -33
  242. package/tests/tool-count.test.mjs +0 -81
  243. package/tests/ui-format.test.mjs +0 -39
  244. package/tests/ui-state.test.mjs +0 -72
@@ -0,0 +1,493 @@
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.