commit
Installation
SKILL.md
Commit
Write a commit message from the staged changes only, then commit.
Steps
- Inspect state — run these together:
git status --shortgit diff --staged --statgit diff --staged(if huge, read the stat plus diffs of the most important files)git log --format='%s' -n 20(match the repo's existing style)
- If nothing is staged, stop and tell the user. Do not
git add -Aunless they asked. - Understand why the change was made, not just what lines moved. Group the diff into one logical change; if the staged diff clearly contains several unrelated changes, say so and suggest splitting.
- Draft the message and show it to the user in a fenced code block. Stop there — do not commit yet. Ask them to approve, or reply with edits.
- Never run
git commitin the same turn as the draft, not even with--dry-runas a substitute for asking. - If they request changes, redraft and ask again.
- Never run
- Only after the user approves, commit with
git commit -m "..."(repeated-mfor body/footer). - Report the resulting
git log -1 --statbriefly.