| name | commit-message |
| description | Use when writing a git commit message, or rewording existing unpushed ones, so they match this user's format. Triggers on "commit this", "write the commit message", "fix the commit messages", "reword the commits", "clean up my commit history". The format is short and dry, no conventional-commit prefixes, no Co-Authored-By trailer, semicolons to separate multiple thoughts, and only letters digits spaces and semicolons. |
| allowed-tools | Bash(git *) |
| model | claude-haiku-4-5-20251001 |
| effort | low |
Write git commit messages in this user's format, and reword existing unpushed ones to it. The bundled scripts/allowlist-filter.sh mechanically enforces the format; you still write a good short subject. Its absolute path is this skill's base directory plus /scripts/allowlist-filter.sh.
The format
- One short, dry subject line. No body.
- No conventional-commit prefix. Do not start with
feat fix docs refactor chore build followed by a colon, or a scoped form like feat(emacs):.
- No
Co-Authored-By trailer and no "Generated with" line.
- Separate multiple thoughts with a semicolon:
add the todo command; split state from data.
- Use only letters, digits, spaces, and semicolons. No commas, colons, slashes, plus, ampersands, parentheses, or hyphens.
Writing a new commit
-
Draft a subject that follows the format.
-
Pass it through the filter to guarantee the character set, then commit:
msg="$(printf '%s' 'your subject' | sh SCRIPT)"
git commit -m "$msg"
Replace SCRIPT with the absolute path to the bundled scripts/allowlist-filter.sh.
Rewording existing UNPUSHED commits
Only rewrite commits that are NOT pushed. Confirm the range first with git log origin/<branch>..HEAD; never touch pushed history.
-
Back up the branch:
git branch backup/pre-msg-rewrite
-
Rewrite the messages in the unpushed range with the bundled filter (SCRIPT is its absolute path):
FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch -f --msg-filter 'sh SCRIPT' -- origin/<branch>..HEAD
-
Verify only messages changed, not content:
git diff --stat backup/pre-msg-rewrite HEAD
An empty result means the trees match and only messages changed.
-
Do not force-push. Leave pushing to the user.
Rules
- Never rewrite pushed history.
- The filter is mechanical (subject only, prefix stripped, character set enforced); the quality of the subject is on you.
- Merge commit subjects are left untouched by the filter.