name: commit description: Create a well-formatted conventional commit disable-model-invocation: true
Commit
Overview
Create a well-formatted, conventional commit locally. Do NOT push unless the user explicitly asks to push.
Steps
1. Format Changed Files
Run format command on all changed C++ files before staging.
2. Stage Changes
git add <files>
Or stage all changes:
git add -A
Review what's staged:
git diff --cached --stat
3. Write Commit Message
Use a temp file to avoid shell escaping issues (output/ is gitignored):
mkdir -p output/.cursor
Write the commit message to output/.cursor/commit_msg.txt following the commit convention.
4. Commit
git commit -F output/.cursor/commit_msg.txt
rm -r output/.cursor
5. Push (only if user explicitly requests)
Only push when the user says "push", "commit and push", or similar. Otherwise, stop after step 4.
git push
If the branch has no upstream yet:
git push -u origin HEAD