Commit the current changes with a Conventional Commits message.
Steps
Assess the working tree. Run
git status --shortandgit diff(orgit diff --stagedif changes are already staged) to see what changed and why.- Completion criterion: the changed files and their purpose are known.
Stage changes. If nothing is staged, run
git add ..- Completion criterion: at least one change is staged.
Draft the message. Pick a Conventional Commits prefix based on the diff:
feat— new featurefix— bug fixdocs— documentation onlystyle— formatting, missing semicolons, etc.refactor— code change that neither fixes a bug nor adds a featuretest— adding or correcting testschore— build process or auxiliary tool/library changes Then write a short imperative description in<type>: <description>format. Use English unless the user requested another language.- Completion criterion: the message follows the format and matches the change.
Commit. Run
git commit -m "<message>".- Completion criterion: the commit succeeds and its hash is shown.
Failure modes
- No changes to commit: stop and report.
gitnot in a repository: stop and report.- Multiple unrelated changes: consider splitting into multiple commits and ask the user.