---
name: commit-craft
description: Turn a messy set of code changes into clean, focused commits with clear messages that say what changed and why. Use when the user asks to commit, tidy commits, write a commit message, or prepare a branch for review.
license: Proprietary — Lendskill original
---
# Commit Craft
## Steps
1. **Look at everything**: `git status` and `git diff` (staged and unstaged). Never commit files you have not read the diff for.
2. **Group changes by intent** — one logical change per commit: a refactor, a feature, a fix, a formatting pass. Formatting and behaviour changes never share a commit.
3. **Stage precisely** with `git add -p` or by path.
4. **Exclude** secrets (.env, keys, tokens), build output, local config and large binaries. If one is already tracked, warn the user.
5. **Write the message**:
- Subject: imperative mood, about 50 characters, no trailing period ("Fix rounding in invoice totals").
- Blank line, then a body wrapped at 72 characters explaining *why* and any side effects.
- Reference the issue or ticket if there is one.
- Follow the repo's existing convention (e.g. Conventional Commits `feat:`/`fix:`) if its history uses one.
6. **Check each commit builds** when that matters for bisecting.
## Rules
- Never rewrite history that others have pulled unless the user explicitly asks.
- Do not push unless asked.
## Output format
The planned commits (subject, files, one-line reason), then the commands run and the resulting `git log --oneline`.