feat: Git結尾commit規範

This commit is contained in:
2026-05-19 10:30:08 +08:00
parent bd2c1421ce
commit 3e504b04ba
2 changed files with 27 additions and 14 deletions
+1 -14
View File
@@ -21,20 +21,7 @@ alwaysApply: true
## Git:改完末尾附 commit
每做完**一項**改動並已寫入檔案,回覆末尾附(**勿**為此反覆跑 `git status``git diff`):
```bash
git add .
git commit -m "類型 修改重點"
```
| 項目 | 約定 |
|------|------|
| 類型 | `feat``fix``style` 三選一 |
| 重點 | **15 字以內**(標點計入) |
| add | **一律 `git add .`**,禁止只 add 單檔 |
- 只說「檢查」、未改檔 → 不附 commit。多項獨立交辦 → 每項各附一段。
見 **`git-commit-required.mdc`**(格式、死線、禁止為 commit 跑終端機檢查)。
## Git:禁止擅自 push
+26
View File
@@ -0,0 +1,26 @@
---
description: 當使用者完成程式碼修改、改檔任務後,必須強制執行的結尾規範。
globs: "*"
alwaysApply: true
---
# Git commit 訊息絕對規範
只要本次對話中**有任何改檔、寫 Code、生成程式碼、調整結構的任務完成**,你(AI)在回覆結尾**必須、強制、主動**附上 commit 指令,絕對不准等使用者開口要!
> ⚠️ **死線警告**:若本次對話完全沒有改動任何檔案、純屬聊天或觀念問答,則「不必」附上。
**禁止**為了附 commit 而跑 `git status``git diff``git log`;只貼指令,由站主在本機執行。
### 輸出格式(一字不差):
```bash
git add .
git commit -m "type: 重點"
```
| 項目 | 約定 |
|------|------|
| type | `feat``fix``style` 三選一 |
| 重點 | **15 字以內**(標點計入) |
| add | **一律 `git add .`**,禁止只 add 單檔 |