Commit with conventions
Help the user create a properly formatted commit following this project's commit conventions.
Steps
- •
Run
git statusandgit diff --stagedto see what's being committed. If nothing is staged, rungit diffto see unstaged changes. - •
Stage the relevant files (prefer specific files over
git add -A), unless the user explicitly asks to commit all changes. - •
Analyze the changes and determine:
- •The appropriate category (one of:
feature,fix,refactor,docs,tests,chore) - •A concise purpose stated as a new capability, not what was done
- •The appropriate category (one of:
- •
Propose a commit message following the pattern:
<category>: <purpose>- •Feature purpose describes a new capability from pov of system, not the action taken by devs (e.g.,
feature: generates survey from spreadsheet, notadded survey generation) - •Fix purpose describes what is fixed, not what was broken (e.g.,
fix: link for generated survey, notfixed broken link) - •Docs purpose describes what is changed, not what actions were done (e.g.,
docs: README includes feature usage details, notchanged README) - •Tests purpose describes purpose of changes, not what was done (e.g.,
tests: failing test for bugortests: no redundancy in DB happy cases, notadded failing test)
- •Feature purpose describes a new capability from pov of system, not the action taken by devs (e.g.,
- •
Rules:
- •All lowercase
- •One thing per commit
- •If two highly related things, only mention major one:
<category>: <does something>
- •
Do not list minor or related changes in subject line; use bullet points in message body for each change if needed.
- •
Run the commit; do not ask the user to confirm or adjust the message before committing.
- •
For multi-line commits, use a HEREDOC to preserve formatting:
shellgit commit -m "$(cat <<'EOF' docs: branching conventions updated - added release branch pattern - clarified per-workflow differences EOF )"
Category reference
- •
feature: adding a new feature - •
fix: fixing a bug - •
refactor: changing code without changing its behavior - •
docs: fix documentation or metadata (e.g., bump version numbers) - •
tests: write necessary tests - •
chore: everything else (formatting, cleaning useless code, etc.)
Examples
- •
feature: new survey chart - •
fix: link for generated survey - •
refactor: survey chart uses new data structure - •
docs: README includes feature usage details - •
tests: failing test for bug - •
chore: upgrade to python 3.8
Important
- •Do NOT add a
Co-Authored-Byline or reference AI in the commit message. - •Do NOT push after committing unless the user explicitly asks.