git-commit
Installation
SKILL.md
Git Commit
Overview
Use this skill to turn a staged diff into one clear Conventional Commits message, show it plainly, and commit it safely after confirmation.
When to Use
- User asks to commit staged changes
- User asks for a commit message for a staged diff
/commitis invoked
When Not to Use
- No staged changes exist
- Task is about unstaged changes only
- User asks about commit conventions in general
- User explicitly does not want a commit prepared
Workflow
- Run
git diff --cached. - If the staged diff is empty, say there are no staged changes and stop.
- Analyze the diff in this order:
- find the
PRIMARY intent: the main outcome of the diff, not file type or implementation detail - choose the most specific
type - add
scopeonly if one area clearly dominates - write a short, concrete
description - add
bodyonly for non-obvious WHY, IMPACT, CONTEXT, or RISK - add
footeronly for structured info, especially breaking changes - add
!andBREAKING CHANGE:only for real breaking changes
- find the
- Generate exactly one commit message.
- Present it plainly, ask for confirm, edit, or cancel, and commit only after confirmation.
- Use
git commit -m "<subject>"only for a single-line message; ifbodyorfooterexists, preserve newlines withgit commit -F <file>.
Selection Rules
feat: adds behavior or capabilityfix: corrects broken behaviorperf: improves performance without changing intended behaviorrefactor: restructures code without behavior changedocs: docs, comments, or examples onlytest: tests onlystyle: formatting, lint, or whitespace onlybuild: build, packaging, dependencies, or artifactsci: CI or release automation onlychore: maintenance with no better typerevert: reverts a previous commit- behavior change beats refactor: add =>
feat, fix =>fix, perf =>perf - docs/tests plus real code change => use the real code-change type
- dependency or tooling change that fixes runtime behavior =>
fix; otherwisebuildorchore - avoid
chorewhen a more specific type fits
Message Rules
- Base format:
<type>(<scope>): <description> scope,body, andfooterare optional- Use short scopes like
auth,api,ui,rules; omitscopefor cross-cutting or repo-wide changes - Do not invent a scope just to fill the format
descriptionmust be one line, preferably 50 characters or fewer- Use imperative mood like
add,fix,remove, start with lowercase, and do not end with a period - Describe the result, not the implementation steps
- Avoid vague summaries like
fix bug,update code,make changes - Default: omit the
body; if used, keep it to 1-2 short lines - Do not restate the diff or list files, functions, or steps
- Use breaking markers only for real consumer-facing breakage
Hard Bans
- Never mention AI generation
- Never output multiple options
- Never add markdown fences around the proposed message
- Never choose
typefrom file extension alone - Never force
scope,body, orfooter - Never flatten a multiline message into one
-mstring
Related skills