git-commit-message
Skill này làm gì
Công cụ này tạo thông điệp để ghi lại các thay đổi mã. Nó tóm tắt những gì đã thay đổi và tại sao, theo một định dạng cụ thể để dễ đọc.
Khi nào nên dùng
- ✓Khi bạn muốn mô tả một thay đổi mã.
- ✓Khi nhờ AI tạo bản tóm tắt các thay đổi của bạn.
- ✓Khi muốn tổ chức lịch sử phiên bản của dự án.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/git-commit-message/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tạo thông điệp commit cho các thay đổi mã mới nhất của tôi.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI phân tích các thay đổi mã bạn đã làm và sắp xếp chúng theo một định dạng chuẩn. Nó tách loại thay đổi (sửa lỗi, tính năng mới, v.v.), một tóm tắt ngắn và phần giải thích chi tiết hơn về lý do.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Git Commit Message Generation
Generate a commit message from the actual staged changes (git diff --cached). The message must let a reader know "what changed and why" without opening the diff.
When to Use
- Use when the user asks to write, generate, or polish a git commit message.
- Use when staged changes need a conventional-commit message with a why-focused body.
Workflow
- Look at the changes: run
git status --short,git diff --cached --stat, andgit diff --cachedto confirm there is something staged. If staging is empty, use an explicitly supplied diff or change description when available and label that evidence; otherwise request the intended changes. Do not stage files implicitly. - Pick a type: choose exactly one type prefix based on the changes (if one commit mixes types, ask the user to split it):
feat: new featurefix: bug fixdocs: documentation onlyrefactor: refactor (behavior unchanged)test: add or change testschore: build, dependencies, misc
- Write the subject: format
type: English imperative phrase, ≤50 characters. Start with a verb: "Add…", "Fix…", "Remove…", "Unify…". Ban empty subjects like "update code", "some changes", "fix bug". - Write the body (optional but recommended): 1–3 lines explaining why, not a play-by-play of how. Bug fixes must state the trigger conditions; features should describe the user-visible change.
- Output: return the message in the format requested. If supplying a shell command, quote it safely: commit text containing
$(), backticks, or quotes must not execute as shell code. For a multiline message prefer writing it verbatim to a temporary file and usinggit commit -F <message-file>.
Rules
- The subject is for skimmers; the body is for future-you in three months. Keep the two jobs separate.
- A change mixing a feature and a refactor should become two commits, not one
featthat papers over the mess. - No meta-commentary in the message ("generated by AI", etc.) — the message is about the change, nothing else.
Minimal example (runnable)
# 1. Look at the changes first
git status --short
git diff --cached --stat
# 2. Suppose the change: added CAPTCHA verification to the login endpoint
# Generated commit:
git commit -m "feat: add CAPTCHA verification to login endpoint" -m "Blocks automated credential stuffing; CAPTCHA valid 5 minutes, account locks 10 minutes after 3 failures."
Another example (bug fixes must state trigger conditions):
git commit -m "fix: keep order-list filters across pagination" -m "Trigger: filter first, then turn the page. Cause: page turns dropped the query params."
Limitations
- Only writes the message. Staging, splitting, committing and pushing remain the user's decision, and the skill never runs
git commiton its own. - The 50-character subject and imperative-mood conventions are the common default; repositories with their own commit convention (Gitmoji, Jira prefixes, project overrides) take precedence over this skill.
- It reads the staged diff, so it cannot describe intent that the diff alone does not show. When the "why" is not inferable, the skill asks instead of inventing it.
- Generated or vendored changes (lockfiles, minified output) are summarized collectively rather than listed line by line.
Anti-patterns
- ❌ Writing a message for an empty staging area: no
git diff --cached, no commit message. - ❌ Catch-all
chore: labeling every feat and fix aschoreuntil the type system means nothing. - ❌ Novel-length subjects:
feat: add a really useful feature that greatly improves the user experience— the subject says what, leave praise to the user. - ❌ Body as implementation log: "first changed line 20 of a.py, then b.py…" — the diff already shows that; the body explains why.
Câu hỏi thường gặp
'Commit' là gì?
'Commit' giống như lưu lại tiến độ dự án của bạn, ghi nhận một tập hợp thay đổi trong mã. Thông điệp commit mô tả các thay đổi này.
Vì sao dùng định dạng chuẩn cho thông điệp?
Định dạng chuẩn (như 'conventional commit') giúp lịch sử dự án dễ đọc, dễ hiểu và dễ tự động hóa các tác vụ sau này.
AI có lưu thay đổi của tôi không?
Không, AI chỉ tạo thông điệp. Bạn vẫn cần dùng lệnh Git để lưu (commit) các thay đổi.
Chi tiết
Mô tả gốc của tác giả
Generates conventional-commit messages from staged changes: type prefix + English imperative subject (≤50 chars) + optional body explaining why. Use when the user asks to write, generate, or polish a git commit message.
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #4734
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
Skill tương tự
openclaw-update
394kGiúp agent của bạn cập nhật OpenClaw Gateway đang có, chọn cách cập nhật phù hợp với cách cài đặt và giữ phiên làm việc của bạn hoạt động.
diagnose-gateway
394kGiúp agent của bạn tìm hiểu vì sao OpenClaw Gateway bị lỗi bằng cách kiểm tra cài đặt, kênh và cổng mà không thay đổi gì.
crabbox-apps
394kGiúp agent của bạn mở và chạy một app trên máy đám mây tạm thời, rồi hiển thị giao diện của nó trong thanh bên của chat.