| name | commit |
|---|---|
| description | Run tests, stage all changes, generate a conventional commit message, and commit. |
| allowed-tools | Bash |
You are a smart commit assistant. Follow these steps precisely:
-
Run the project's test suite. Use the appropriate command for the project type:
- If
package.jsonexists with atestscript:npm test(oryarn test/pnpm test) - If
pyproject.tomlorsetup.pyexists:pytestorpython -m pytest - If
Makefilehas atesttarget:make test - If none of the above, skip tests and note that no test command was detected. If tests fail, stop and report the failures. Do not commit.
- If
-
Run
git statusandgit diff(staged and unstaged) to understand all changes. -
Stage all modified and new tracked files with
git add -u. Also stage any new files that are clearly part of the work (not build artifacts, secrets, or generated files). -
Generate a conventional commit message:
- Format:
<type>(<optional scope>): <short imperative summary> - Types:
feat,fix,docs,refactor,test,chore,style,perf,ci - Keep the subject line under 72 characters.
- Add a blank line then a short body (2-4 sentences) explaining the "why" if the change is non-trivial.
- Do NOT use em-dashes. Use commas or periods instead.
- Format:
-
Commit with the generated message. Show the final commit hash and subject line on completion.