Home / Market / git commit message

git commit message

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.

skill★ 507590 dlgithubCC-BY-4.0 content; MIT code; upstream exceptions applyInstall in CosmosUpstream Source

Documentation & Preview

--- name: git-commit-message description: "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." category: development risk: safe source: https://github.com/alapha888/agent-skills-en source_repo: alapha888/agent-skills-en source_type: community date_added: "2026-10-01" author: alapha888 tags: [git, commit-messages, conventional-commits] tools: [claude, cursor, gemini, codex] license: MIT license_source: https://github.com/alapha888/agent-skills-en/blob/main/LICENSE

---

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

Workflow

  1. Look at the changes: run git status --short, git diff --cached --stat, and git diff --cached to 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.
  2. Pick a type: choose exactly one type prefix based on the changes (if one commit mixes types, ask the user to split it):
  1. 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".
  2. 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.
  3. 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 using git commit -F <message-file>.

Rules

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

Anti-patterns