ai-engineering-init 1.7.0 → 1.8.0

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 (118) hide show
  1. package/.claude/hooks/skill-forced-eval.js +46 -62
  2. package/.claude/settings.json +10 -1
  3. package/.claude/skills/api-development/SKILL.md +179 -130
  4. package/.claude/skills/architecture-design/SKILL.md +102 -212
  5. package/.claude/skills/backend-annotations/SKILL.md +166 -220
  6. package/.claude/skills/bug-detective/SKILL.md +225 -186
  7. package/.claude/skills/code-patterns/SKILL.md +127 -244
  8. package/.claude/skills/collaborating-with-codex/SKILL.md +96 -113
  9. package/.claude/skills/crud-development/SKILL.md +226 -307
  10. package/.claude/skills/data-permission/SKILL.md +131 -202
  11. package/.claude/skills/database-ops/SKILL.md +158 -355
  12. package/.claude/skills/error-handler/SKILL.md +224 -285
  13. package/.claude/skills/file-oss-management/SKILL.md +174 -169
  14. package/.claude/skills/git-workflow/SKILL.md +123 -341
  15. package/.claude/skills/json-serialization/SKILL.md +121 -137
  16. package/.claude/skills/performance-doctor/SKILL.md +83 -89
  17. package/.claude/skills/redis-cache/SKILL.md +134 -185
  18. package/.claude/skills/scheduled-jobs/SKILL.md +187 -224
  19. package/.claude/skills/security-guard/SKILL.md +168 -276
  20. package/.claude/skills/sms-mail/SKILL.md +266 -228
  21. package/.claude/skills/social-login/SKILL.md +257 -195
  22. package/.claude/skills/tenant-management/SKILL.md +172 -188
  23. package/.claude/skills/utils-toolkit/SKILL.md +214 -222
  24. package/.claude/skills/websocket-sse/SKILL.md +251 -172
  25. package/.claude/skills/workflow-engine/SKILL.md +178 -250
  26. package/.codex/skills/api-development/SKILL.md +179 -130
  27. package/.codex/skills/architecture-design/SKILL.md +102 -212
  28. package/.codex/skills/backend-annotations/SKILL.md +166 -220
  29. package/.codex/skills/bug-detective/SKILL.md +225 -186
  30. package/.codex/skills/code-patterns/SKILL.md +127 -244
  31. package/.codex/skills/collaborating-with-codex/SKILL.md +96 -113
  32. package/.codex/skills/crud-development/SKILL.md +226 -307
  33. package/.codex/skills/data-permission/SKILL.md +131 -202
  34. package/.codex/skills/database-ops/SKILL.md +158 -355
  35. package/.codex/skills/error-handler/SKILL.md +224 -285
  36. package/.codex/skills/file-oss-management/SKILL.md +174 -169
  37. package/.codex/skills/git-workflow/SKILL.md +123 -341
  38. package/.codex/skills/json-serialization/SKILL.md +121 -137
  39. package/.codex/skills/performance-doctor/SKILL.md +83 -89
  40. package/.codex/skills/redis-cache/SKILL.md +134 -185
  41. package/.codex/skills/scheduled-jobs/SKILL.md +187 -224
  42. package/.codex/skills/security-guard/SKILL.md +168 -276
  43. package/.codex/skills/sms-mail/SKILL.md +266 -228
  44. package/.codex/skills/social-login/SKILL.md +257 -195
  45. package/.codex/skills/tenant-management/SKILL.md +172 -188
  46. package/.codex/skills/utils-toolkit/SKILL.md +214 -222
  47. package/.codex/skills/websocket-sse/SKILL.md +251 -172
  48. package/.codex/skills/workflow-engine/SKILL.md +178 -250
  49. package/.cursor/hooks/cursor-skill-eval.js +66 -6
  50. package/.cursor/skills/api-development/SKILL.md +179 -130
  51. package/.cursor/skills/architecture-design/SKILL.md +102 -212
  52. package/.cursor/skills/backend-annotations/SKILL.md +166 -220
  53. package/.cursor/skills/bug-detective/SKILL.md +225 -186
  54. package/.cursor/skills/code-patterns/SKILL.md +127 -244
  55. package/.cursor/skills/collaborating-with-codex/SKILL.md +96 -113
  56. package/.cursor/skills/crud-development/SKILL.md +226 -307
  57. package/.cursor/skills/data-permission/SKILL.md +131 -202
  58. package/.cursor/skills/database-ops/SKILL.md +158 -355
  59. package/.cursor/skills/error-handler/SKILL.md +224 -285
  60. package/.cursor/skills/file-oss-management/SKILL.md +174 -169
  61. package/.cursor/skills/git-workflow/SKILL.md +123 -341
  62. package/.cursor/skills/json-serialization/SKILL.md +121 -137
  63. package/.cursor/skills/performance-doctor/SKILL.md +83 -89
  64. package/.cursor/skills/redis-cache/SKILL.md +134 -185
  65. package/.cursor/skills/scheduled-jobs/SKILL.md +187 -224
  66. package/.cursor/skills/security-guard/SKILL.md +168 -276
  67. package/.cursor/skills/sms-mail/SKILL.md +266 -228
  68. package/.cursor/skills/social-login/SKILL.md +257 -195
  69. package/.cursor/skills/tenant-management/SKILL.md +172 -188
  70. package/.cursor/skills/utils-toolkit/SKILL.md +214 -222
  71. package/.cursor/skills/websocket-sse/SKILL.md +251 -172
  72. package/.cursor/skills/workflow-engine/SKILL.md +178 -250
  73. package/AGENTS.md +49 -540
  74. package/CLAUDE.md +73 -119
  75. package/README.md +37 -6
  76. package/bin/index.js +5 -1
  77. package/package.json +1 -1
  78. package/src/skills/api-development/SKILL.md +179 -130
  79. package/src/skills/architecture-design/SKILL.md +102 -212
  80. package/src/skills/backend-annotations/SKILL.md +166 -220
  81. package/src/skills/bug-detective/SKILL.md +225 -186
  82. package/src/skills/code-patterns/SKILL.md +127 -244
  83. package/src/skills/collaborating-with-codex/SKILL.md +96 -113
  84. package/src/skills/crud-development/SKILL.md +226 -307
  85. package/src/skills/data-permission/SKILL.md +131 -202
  86. package/src/skills/database-ops/SKILL.md +158 -355
  87. package/src/skills/error-handler/SKILL.md +224 -285
  88. package/src/skills/file-oss-management/SKILL.md +174 -169
  89. package/src/skills/git-workflow/SKILL.md +123 -341
  90. package/src/skills/json-serialization/SKILL.md +121 -137
  91. package/src/skills/performance-doctor/SKILL.md +83 -89
  92. package/src/skills/redis-cache/SKILL.md +134 -185
  93. package/src/skills/scheduled-jobs/SKILL.md +187 -224
  94. package/src/skills/security-guard/SKILL.md +168 -276
  95. package/src/skills/sms-mail/SKILL.md +266 -228
  96. package/src/skills/social-login/SKILL.md +257 -195
  97. package/src/skills/tenant-management/SKILL.md +172 -188
  98. package/src/skills/utils-toolkit/SKILL.md +214 -222
  99. package/src/skills/websocket-sse/SKILL.md +251 -172
  100. package/src/skills/workflow-engine/SKILL.md +178 -250
  101. package/.claude/skills/skill-creator/LICENSE.txt +0 -202
  102. package/.claude/skills/skill-creator/SKILL.md +0 -479
  103. package/.claude/skills/skill-creator/agents/analyzer.md +0 -274
  104. package/.claude/skills/skill-creator/agents/comparator.md +0 -202
  105. package/.claude/skills/skill-creator/agents/grader.md +0 -223
  106. package/.claude/skills/skill-creator/assets/eval_review.html +0 -146
  107. package/.claude/skills/skill-creator/eval-viewer/generate_review.py +0 -471
  108. package/.claude/skills/skill-creator/eval-viewer/viewer.html +0 -1325
  109. package/.claude/skills/skill-creator/references/schemas.md +0 -430
  110. package/.claude/skills/skill-creator/scripts/__init__.py +0 -0
  111. package/.claude/skills/skill-creator/scripts/aggregate_benchmark.py +0 -401
  112. package/.claude/skills/skill-creator/scripts/generate_report.py +0 -326
  113. package/.claude/skills/skill-creator/scripts/improve_description.py +0 -248
  114. package/.claude/skills/skill-creator/scripts/package_skill.py +0 -136
  115. package/.claude/skills/skill-creator/scripts/quick_validate.py +0 -103
  116. package/.claude/skills/skill-creator/scripts/run_eval.py +0 -310
  117. package/.claude/skills/skill-creator/scripts/run_loop.py +0 -332
  118. package/.claude/skills/skill-creator/scripts/utils.py +0 -47
@@ -1,397 +1,179 @@
1
1
  ---
2
2
  name: git-workflow
3
3
  description: |
4
- 当需要进行 Git 版本控制操作时自动使用此 Skill。
5
-
6
- 触发场景:
7
- - 提交代码
8
- - 创建/合并分支
9
- - 查看提交历史
10
- - 解决冲突
11
- - 回滚代码
12
-
13
- 触发词:git、提交、commit、分支、合并、push、pull、冲突、回滚、版本、历史
4
+ 通用 Git 工作流指南。涵盖分支策略、提交规范、PR 流程、冲突解决等。
5
+ 触发场景:Git 操作、分支管理、提交规范、代码合并。
6
+ 触发词:Git、分支、提交、合并、rebase、PR。
7
+ 注意:如果项目有专属技能(如 `leniu-git-workflow`),优先使用专属版本。
14
8
  ---
15
9
 
16
10
  # Git 工作流指南
17
11
 
18
- ## ⚠️ 本项目提交规范(必须遵守)
12
+ > 通用模板。如果项目有专属技能(如 `leniu-git-workflow`),优先使用。
19
13
 
20
- ### 核心原则
14
+ ## 核心规范
21
15
 
22
- 1. **只提交当前会话的改动**:只 `git add` 当前聊天中修改或新增的文件
23
- 2. **不提交配置文件**:排除 `.env*`、`application*.yml` 等配置
24
- 3. **默认只提交到本地**:执行 `git add` + `git commit`,**不自动 push**
25
- 4. **明确指定才推送**:只有用户明确说"推送"、"push"、"提交到远程"时才执行 `git push`
26
-
27
- ### 提交信息格式
16
+ ### 分支策略(Git Flow)
28
17
 
29
18
  ```
30
- <type>(<scope>): <subject>
19
+ main (production)
20
+
21
+ ├── hotfix/fix-payment-bug ← 紧急修复,从 main 拉出
22
+
23
+ develop (integration)
24
+
25
+ ├── feature/order-export ← 功能开发,从 develop 拉出
26
+ ├── feature/user-profile ← 并行开发
27
+
28
+ └── release/v1.2.0 ← 发布准备,从 develop 拉出
31
29
  ```
32
30
 
33
- > **注意**:本项目是纯后端项目,无需平台前缀。
34
-
35
- ### 提交示例
36
-
37
- ```bash
38
- # 新功能
39
- feat(system): 新增用户反馈功能
40
-
41
- # 修复 Bug
42
- fix(demo): 修复订单状态显示错误
43
-
44
- # 文档更新
45
- docs(readme): 更新安装说明
46
-
47
- # 重构
48
- refactor(common): 重构分页查询工具类
49
-
50
- # 性能优化
51
- perf(system): 优化用户列表查询性能
52
-
53
- # 测试
54
- test(demo): 添加单元测试
55
- ```
31
+ | 分支类型 | 来源 | 合并目标 | 命名 |
32
+ |---------|------|---------|------|
33
+ | `main` | - | - | `main` |
34
+ | `develop` | `main` | `main` | `develop` |
35
+ | `feature/*` | `develop` | `develop` | `feature/功能描述` |
36
+ | `release/*` | `develop` | `main` + `develop` | `release/v1.x.x` |
37
+ | `hotfix/*` | `main` | `main` + `develop` | `hotfix/问题描述` |
56
38
 
57
- ### 提交流程
58
-
59
- ```bash
60
- # 1. 查看当前改动
61
- git status
62
-
63
- # 2. 只添加当前会话修改的业务文件(排除配置)
64
- git add ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/xxx/
65
- # 或者添加具体文件
66
- git add path/to/file1.java path/to/file2.java
67
-
68
- # 3. 提交到本地(不 push!)
69
- git commit -m "feat(system): 新增xxx功能"
70
-
71
- # 4. 只有用户明确要求时才推送
72
- # git push # ← 用户说"推送"时才执行
73
- ```
74
-
75
- ### 不要提交的文件
76
-
77
- ```bash
78
- # ❌ 团队项目配置文件(绝对不提交,包含数据库/中间件/环境信息)
79
- core-base/src/main/resources/bootstrap.yml
80
- core-base/src/main/resources/bootstrap-dev.yml
81
- core-base/src/main/resources/ConfigSource.properties
82
- core-base/src/main/resources/license.dat
83
- core-base/src/main/resources/logback-spring.xml
84
- core-base/src/main/resources/message_*.properties
85
-
86
- # ❌ 通用配置文件(绝对不提交)
87
- ruoyi-admin/src/main/resources/application.yml
88
- ruoyi-admin/src/main/resources/application-*.yml
89
- ruoyi-common/**/resources/*.yml
90
-
91
- # ❌ 测试/迁移基础设施文件(包含本地数据源配置,不提交)
92
- **/WebMvcTestConfig.java
93
- **/DataSourceMigration.java
94
-
95
- # ❌ IDE 配置
96
- .idea/
97
- .vscode/
98
- *.iml
39
+ ### 简化策略(GitHub Flow,适合小团队)
99
40
 
100
- # ❌ 本地临时文件
101
- *.log
102
- target/
103
- logs/
104
41
  ```
105
-
106
- ---
107
-
108
- ## 提交类型说明
109
-
110
- | 类型 | 说明 | 示例 |
111
- |------|------|------|
112
- | feat | 新功能 | `feat(system): 新增用户反馈功能` |
113
- | fix | 修复Bug | `fix(demo): 修复订单状态显示错误` |
114
- | docs | 文档更新 | `docs(readme): 更新安装说明` |
115
- | style | 代码格式 | `style(system): 格式化代码` |
116
- | refactor | 重构 | `refactor(common): 重构用户模块` |
117
- | perf | 性能优化 | `perf(system): 优化查询性能` |
118
- | test | 测试 | `test(demo): 添加单元测试` |
119
- | chore | 构建/工具 | `chore: 更新依赖` |
120
-
121
- ### scope 常用范围
122
-
123
- | scope | 说明 | 对应模块 |
124
- |-------|------|----------|
125
- | system | 系统管理 | `ruoyi-modules/ruoyi-system/` |
126
- | demo | 演示模块 | `ruoyi-modules/ruoyi-demo/` |
127
- | workflow | 工作流 | `ruoyi-modules/ruoyi-workflow/` |
128
- | job | 定时任务 | `ruoyi-modules/ruoyi-job/` |
129
- | generator | 代码生成 | `ruoyi-modules/ruoyi-generator/` |
130
- | common | 通用模块 | `ruoyi-common/` |
131
- | admin | 启动模块 | `ruoyi-admin/` |
132
-
133
- ---
134
-
135
- ## 常用命令
136
-
137
- ### 基础操作
138
-
139
- ```bash
140
- # 查看状态
141
- git status
142
-
143
- # 查看改动
144
- git diff
145
- git diff --staged # 已暂存的改动
146
-
147
- # 添加文件
148
- git add . # 添加所有(谨慎使用!)
149
- git add <file> # 添加指定文件(推荐)
150
-
151
- # 提交
152
- git commit -m "提交信息"
153
-
154
- # 推送(需用户明确要求)
155
- git push
156
- git push -u origin <branch> # 首次推送并设置上游
42
+ main
43
+ ├── feature/order-export
44
+ ├── fix/login-error
45
+ └── chore/upgrade-deps
157
46
  ```
158
47
 
159
- ### 分支操作
160
-
161
- ```bash
162
- # 查看分支
163
- git branch # 本地分支
164
- git branch -r # 远程分支
165
- git branch -a # 所有分支
166
-
167
- # 创建分支
168
- git branch <name>
169
- git checkout -b <name> # 创建并切换
170
-
171
- # 切换分支
172
- git checkout <name>
173
- git switch <name>
48
+ - 只有 `main` 一个长期分支
49
+ - 所有开发从 `main` 拉分支,完成后通过 PR 合并回 `main`
174
50
 
175
- # 合并分支
176
- git merge <name>
51
+ ### 提交规范(Conventional Commits)
177
52
 
178
- # 删除分支
179
- git branch -d <name> # 删除本地
180
- git push origin -d <name> # 删除远程
181
53
  ```
182
-
183
- ### 历史查看
184
-
185
- ```bash
186
- # 查看提交历史
187
- git log
188
- git log --oneline
189
- git log --oneline -10 # 最近10条
190
-
191
- # 查看某文件历史
192
- git log --follow <file>
193
-
194
- # 查看某次提交的内容
195
- git show <commit-id>
196
- ```
197
-
198
- ### 撤销操作
199
-
200
- ```bash
201
- # 撤销工作区修改
202
- git checkout -- <file>
203
- git restore <file>
204
-
205
- # 撤销暂存
206
- git reset HEAD <file>
207
- git restore --staged <file>
208
-
209
- # 撤销提交(保留修改)
210
- git reset --soft HEAD^
211
-
212
- # 撤销提交(丢弃修改)
213
- git reset --hard HEAD^
214
-
215
- # 回滚到某个提交
216
- git reset --hard <commit-id>
54
+ <type>(<scope>): <subject>
217
55
  ```
218
56
 
219
- ---
220
-
221
- ## 分支策略
222
-
223
- ### 主要分支
224
-
225
- | 分支 | 用途 | 说明 |
57
+ | type | 说明 | 示例 |
226
58
  |------|------|------|
227
- | 5.X | 主分支 | 生产/发布代码(本项目主分支) |
228
- | dev | 开发分支 | 日常开发代码 |
229
- | feature/* | 功能分支 | 新功能开发 |
230
- | fix/* | 修复分支 | Bug修复 |
231
- | release/* | 发布分支 | 版本发布 |
232
-
233
- ### 工作流程
234
-
235
- ```bash
236
- # 1. 从 dev 创建功能分支
237
- git checkout dev
238
- git pull
239
- git checkout -b feature/user-feedback
240
-
241
- # 2. 开发并提交(只提交当前会话改动的业务文件)
242
- git add ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/feedback/
243
- git commit -m "feat(system): 新增用户反馈功能"
59
+ | `feat` | 新功能 | `feat(order): 新增订单导出` |
60
+ | `fix` | 修复 Bug | `fix(auth): 修复 token 过期未刷新` |
61
+ | `docs` | 文档 | `docs: 更新 API 文档` |
62
+ | `style` | 格式 | `style: 统一缩进为 4 空格` |
63
+ | `refactor` | 重构 | `refactor(user): 拆分用户服务` |
64
+ | `perf` | 性能 | `perf(query): 优化列表查询 N+1` |
65
+ | `test` | 测试 | `test(order): 补充订单创建单测` |
66
+ | `chore` | 构建/工具 | `chore: 升级 Spring Boot 3.2` |
67
+ | `ci` | CI/CD | `ci: 添加 GitHub Actions 流水线` |
244
68
 
245
- # 3. 用户明确要求时才推送到远程
246
- git push -u origin feature/user-feedback
69
+ **规则**:
70
+ - subject 使用中文或英文,但全项目统一
71
+ - 不超过 72 字符
72
+ - 不以句号结尾
73
+ - 使用祈使语气("添加"而非"添加了")
247
74
 
248
- # 4. 创建 Pull Request 合并到 dev
75
+ ### 提交行为规范
249
76
 
250
- # 5. 合并后删除功能分支
251
- git checkout dev
252
- git pull
253
- git branch -d feature/user-feedback
254
- ```
255
-
256
- ---
77
+ 1. **只提交当前会话的改动**:精确 `git add` 修改的文件,不要 `git add .`
78
+ 2. **不提交配置文件**:排除 `.env*`、`application-*.yml` 等环境配置
79
+ 3. **默认只提交到本地**:执行 `git add` + `git commit`,不自动 push
80
+ 4. **明确指定才推送**:只有用户明确说"推送"、"push"时才执行 `git push`
257
81
 
258
- ## 冲突解决
82
+ ## 代码示例
259
83
 
260
- ### 合并冲突
84
+ ### 常用 Git 操作
261
85
 
262
86
  ```bash
263
- # 1. 拉取最新代码
264
- git pull
87
+ # 创建功能分支
88
+ git checkout develop
89
+ git pull origin develop
90
+ git checkout -b feature/order-export
265
91
 
266
- # 2. 如果有冲突,Git 会提示
267
- # Auto-merging xxx.java
268
- # CONFLICT (content): Merge conflict in xxx.java
92
+ # 开发完成,合并前更新
93
+ git fetch origin
94
+ git rebase origin/develop
269
95
 
270
- # 3. 打开冲突文件,手动解决
271
- # <<<<<<< HEAD
272
- # 当前分支的代码
273
- # =======
274
- # 要合并的代码
275
- # >>>>>>> feature/xxx
276
-
277
- # 4. 解决后添加并提交
278
- git add .
279
- git commit -m "fix: 解决合并冲突"
280
- ```
281
-
282
- ### 变基冲突
283
-
284
- ```bash
285
- # 1. 变基
286
- git rebase dev
287
-
288
- # 2. 如果有冲突,解决后
96
+ # 解决冲突后继续
289
97
  git add .
290
98
  git rebase --continue
291
99
 
292
- # 3. 放弃变基
293
- git rebase --abort
100
+ # 推送并创建 PR
101
+ git push -u origin feature/order-export
102
+ gh pr create --base develop --title "feat(order): 新增订单导出功能"
294
103
  ```
295
104
 
296
- ---
105
+ ### 常用 Git 修复操作
297
106
 
298
- ## 实用技巧
107
+ ```bash
108
+ # 修改最后一次提交信息
109
+ git commit --amend -m "fix(order): 修复订单金额计算"
299
110
 
300
- ### 暂存修改
111
+ # 撤销最后一次提交(保留修改)
112
+ git reset --soft HEAD~1
301
113
 
302
- ```bash
303
114
  # 暂存当前修改
304
115
  git stash
116
+ git stash pop
305
117
 
306
- # 查看暂存列表
307
- git stash list
308
-
309
- # 恢复暂存
310
- git stash pop # 恢复并删除
311
- git stash apply # 恢复但保留
118
+ # 挑选某个提交到当前分支
119
+ git cherry-pick <commit-hash>
312
120
 
313
- # 删除暂存
314
- git stash drop
315
- git stash clear # 清空所有
121
+ # 查看某个文件的修改历史
122
+ git log --oneline -20 -- path/to/file
316
123
  ```
317
124
 
318
- ### 修改提交
125
+ ### PR / Code Review 规范
319
126
 
320
- ```bash
321
- # 修改最后一次提交信息
322
- git commit --amend -m "新的提交信息"
127
+ 1. **PR 大小**:单个 PR 不超过 400 行变更(不含自动生成代码)
128
+ 2. **PR 描述**:说明改了什么、为什么改、如何测试
129
+ 3. **自查清单**:
130
+ - [ ] 代码能编译通过
131
+ - [ ] 新功能有对应测试
132
+ - [ ] 没有遗留 TODO / 调试代码
133
+ - [ ] 数据库变更有迁移脚本
134
+ 4. **Review 要点**:
135
+ - 逻辑正确性 > 代码风格
136
+ - 关注边界条件和异常处理
137
+ - 检查安全隐患(SQL 注入、XSS 等)
323
138
 
324
- # 追加到最后一次提交
325
- git add .
326
- git commit --amend --no-edit
327
- ```
139
+ ### .gitignore 推荐配置
328
140
 
329
- ### Cherry-pick
141
+ ```gitignore
142
+ # IDE
143
+ .idea/
144
+ *.iml
145
+ .vscode/
146
+ *.swp
330
147
 
331
- ```bash
332
- # 把某个提交应用到当前分支
333
- git cherry-pick <commit-id>
334
- ```
148
+ # Build
149
+ target/
150
+ build/
151
+ dist/
152
+ node_modules/
335
153
 
336
- ### 查看某人的提交
154
+ # Environment
155
+ .env
156
+ .env.local
157
+ *.local
337
158
 
338
- ```bash
339
- git log --author="作者名"
159
+ # OS
160
+ .DS_Store
161
+ Thumbs.db
162
+
163
+ # Logs
164
+ *.log
165
+ logs/
340
166
  ```
341
167
 
342
- ---
168
+ ## 常见错误
343
169
 
344
- ## 注意事项
345
-
346
- ### 禁止操作
347
-
348
- 1. **不要强制推送到主分支**
349
- ```bash
350
- # 禁止(团队主分支为 master)
351
- git push --force origin master
352
- git push --force origin main
353
- ```
354
-
355
- 2. **不要在主分支直接开发**
356
- ```bash
357
- # ❌ 禁止(团队主分支为 master,不在此分支直接提交)
358
- git checkout master
359
- # 直接修改代码...
360
- ```
361
-
362
- 3. **不要提交敏感信息和配置文件**
363
- ```bash
364
- # ❌ 禁止提交
365
- application.yml
366
- application-dev.yml
367
- application-prod.yml
368
- bootstrap.yml
369
- bootstrap-dev.yml
370
- ConfigSource.properties
371
- license.dat
372
- logback-spring.xml
373
- message_*.properties
374
- credentials.json
375
- password.txt
376
- # ❌ 禁止提交(包含本地数据源/测试环境配置)
377
- WebMvcTestConfig.java
378
- DataSourceMigration.java
379
- ```
380
-
381
- 4. **不要自动 push(除非用户明确要求)**
382
- ```bash
383
- # ❌ 默认不执行
384
- git push
385
-
386
- # ✅ 只有用户说"推送到远程"时才执行
387
- git push
388
- ```
389
-
390
- ### 最佳实践
391
-
392
- 1. **只提交当前会话改动**:不要 `git add .`,精确添加修改的文件
393
- 2. **排除配置文件**:配置文件包含本地环境信息,不应提交
394
- 3. **清晰的提交信息**:包含类型 + 范围 + 描述
395
- 4. **默认只本地提交**:`git add` + `git commit`,不自动 push
396
- 5. **频繁小步提交**:便于追踪和回滚
397
- 6. **Code Review**:通过 PR 合并代码
170
+ | 错误 | 正确做法 |
171
+ |------|---------|
172
+ | 直接在 main 上开发 | 创建功能分支 |
173
+ | 提交信息写"update"、"fix bug" | 按 Conventional Commits 规范 |
174
+ | 一个 PR 包含多个不相关改动 | 拆分为多个 PR |
175
+ | `git push --force` 到公共分支 | 只对个人分支 force push |
176
+ | 提交 .env、密钥文件 | 加入 .gitignore |
177
+ | merge 前不更新目标分支 | 先 rebase/merge 最新代码 |
178
+ | 忽略 CI 失败直接合并 | 修复 CI 后再合并 |
179
+ | `git add .` 一把梭 | 精确添加修改的业务文件 |