Commit Message
Overview
Gives the user a ready-to-run git commit command in their own voice. The user stages and commits; this skill only reads.
Steps
- With the Bash tool, run in parallel:
git status --short --branch and git diff --cached --stat
- Pick what to describe:
- Anything staged: the staged changes (
git diff --cached)
- Nothing staged: all changes (
git diff HEAD), plus untracked ?? files, read directly
- No changes at all: reply
No changes to commit. and stop
- For a large diff, run the matching
--stat first and read only the files that carry the change. Skip lockfiles and generated files.
- Write the message, then the reply.
The message
- Summary: opens with an -ing verb (Adding, Fixing, Updating, Removing, Moving) and joins separate changes with a plus sign, as in
Adding task timeout fix + workflow rename. 72 characters max.
- Body: only when the summary can't cover the change in 72 characters. One line, comma-separated, same voice, 160 characters max.
- Characters: plain words and punctuation. Rephrase anything that would need
", $, a backtick, \ or !, so the command runs unchanged in PowerShell and bash.
The reply
Exactly these parts, in order:
- Nothing staged: the line
Nothing is staged. To stage everything: then a bash block containing git add -A
- Something staged while other changes or new files are not: the line
Only staged changes are included.
- A
bash block with the command, one -m for the summary and a second -m for the body:
git commit -m "Fixing event-loop stall on segment rotation + concurrency races" -m "Flushing PCM off-thread, locking Whisper and playback, unique clip names, Dockerfile env name fix. Adding config.py, pinned deps, tests."
Asked for shorter: drop the body. With no body, tighten the summary.
New files get read, not staged. The user runs git add and git commit.
1---2name: commit-message3description: Use when asked to write, generate, draft, or shorten a git commit message4---56# Commit Message78## Overview910Gives the user a ready-to-run `git commit` command in their own voice. The user stages and commits; this skill only reads.1112## Steps13141. With the Bash tool, run in parallel: `git status --short --branch` and `git diff --cached --stat`152. Pick what to describe:16 - Anything staged: the staged changes (`git diff --cached`)17 - Nothing staged: all changes (`git diff HEAD`), plus untracked `??` files, read directly18 - No changes at all: reply `No changes to commit.` and stop193. For a large diff, run the matching `--stat` first and read only the files that carry the change. Skip lockfiles and generated files.204. Write the message, then the reply.2122## The message2324- **Summary:** opens with an -ing verb (Adding, Fixing, Updating, Removing, Moving) and joins separate changes with a plus sign, as in `Adding task timeout fix + workflow rename`. 72 characters max.25- **Body:** only when the summary can't cover the change in 72 characters. One line, comma-separated, same voice, 160 characters max.26- **Characters:** plain words and punctuation. Rephrase anything that would need `"`, `$`, a backtick, `\` or `!`, so the command runs unchanged in PowerShell and bash.2728## The reply2930Exactly these parts, in order:31321. Nothing staged: the line `Nothing is staged. To stage everything:` then a `bash` block containing `git add -A`332. Something staged while other changes or new files are not: the line `Only staged changes are included.`343. A `bash` block with the command, one `-m` for the summary and a second `-m` for the body:3536```bash37git commit -m "Fixing event-loop stall on segment rotation + concurrency races" -m "Flushing PCM off-thread, locking Whisper and playback, unique clip names, Dockerfile env name fix. Adding config.py, pinned deps, tests."38```3940Asked for shorter: drop the body. With no body, tighten the summary.4142New files get read, not staged. The user runs `git add` and `git commit`.