Instruction file imported from tsui24/SU26_SEP490_G2_BE (
.cursor/rules/commit-message.mdc). Copyright stays with the author.
Commit message
Dùng Conventional Commits — tiếng Anh cho type/scope, mô tả ngắn gọn.
Cấu trúc
<type>(<scope>): <subject>
[optional body]
- subject: imperative, ≤72 ký tự, không chấm cuối dòng
- scope (tùy chọn): module —
auth,user,order,api,config,db
Type
| Type | Khi dùng |
|---|---|
feat |
Tính năng mới |
fix |
Sửa bug |
refactor |
Đổi cấu trúc, không đổi hành vi |
test |
Thêm/sửa test |
docs |
Tài liệu |
chore |
Build, deps, tooling |
perf |
Tối ưu hiệu năng |
ci |
Pipeline CI |
Ví dụ
feat(auth): add JWT login endpoint
fix(user): prevent duplicate email on register
refactor(order): extract validation to service layer
test(auth): add integration test for login API
Trên nhánh feature
- Mỗi commit nên là một thay đổi logic rõ ràng.
- Trước merge
dev: có thể squash nếu team yêu cầu PR sạch (hỏi user trước khi squash/rebase interactive).
Agent tạo commit
git status,git diff,git log -5để bám style repo.- Không stage/commit file secrets.
- Message phản ánh why, không chỉ liệt kê file.