commit-coachlisted
Install: claude install-skill tsurutanmen/claude-plugins
# commit-coach
The plugin's hook runs before every Bash command. For the git commands below it
dry-runs the command against the repository and, when something would be lost,
asks the user with a plain-words list of exactly what. When nothing would be
lost it says nothing.
| Command | What it checks |
|---|---|
| `git reset --hard [ref]` | uncommitted changes (`git status`), and commits the branch would move back past |
| `git clean -f[d][x]` | the files `git clean -n` with the same flags would remove |
| `git checkout -- <paths>`, `git checkout .`, `git restore <paths>` | files with unstaged changes under those paths |
| `git push --force`, `-f`, `+refspec` | commits on the remote-tracking branch that are not in HEAD (as of the last fetch) |
| `git commit --amend` | whether HEAD is already on the upstream branch |
| `git branch -D <name>` | commits on that branch that no other branch or remote branch has |
| `git stash clear`, `git stash drop` | the stash entries that would be deleted |
## When the hook asks
1. Read the list in the hook's message to the user in plain words: what would be
lost and whether git can bring it back.
2. If the user did not ask for that loss, use the safer command the message
names (`git stash`, `git clean -n`, `--force-with-lease`, `git branch -d`, a new
commit instead of `--amend`) instead of retrying the same command.
3. Never try to get around the hook, for example by splitting the command or
calling git through another program. T