Generate a concise one-liner commit message by analyzing staged changes and recent git history. Use when the user wants a commit message suggestion before committing.
Generate a concise, meaningful one-liner commit message by inspecting the staged diff and recent commit history. Sometimes staged files relate to a prior commit, so the previous commit is also reviewed for context.
Run these commands to collect the necessary information:
# Get the last commit message and file summary for context
git show --stat --summary --format="%h %s" -1
# Get the last 10 commits for broader context
git log --oneline --decorate -n 10
# Get the staged diff (what will be committed)
git diff --staged
git log --oneline --decorate -n 10) to understand if the staged changes are a continuation, fix, or follow-up.Compose a single-line commit message following these rules:
<type>: <concise description>feat, fix, refactor, docs, style, test, chore, perf, ci, buildPrint only the suggested commit message — nothing else. No explanation, no alternatives.