Review all staged and unstaged changes using git diff and git diff --cached. Analyze the changes and create well-formatted git commits.
Follow these rules:
- •Write concise commit messages following the Conventional Commits format (e.g. feat:, fix:, refactor:, docs:, chore:, test:)
- •The subject line should be max 72 characters
- •Add a body if the changes are complex, explaining the "why" not just the "what"
- •IMPORTANT: Only commit changes that were made during this session. Do NOT commit pre-existing uncommitted changes unless the user explicitly asks to commit all changes.
- •Divide changes into logical, semantic commits when they are cleanly separable (i.e., they touch different files or independent hunks). Group related changes together and separate unrelated changes into distinct commits. For example, a bug fix and a new feature should be separate commits, a refactor and its associated test updates should be one commit. However, if unrelated changes are intertwined in the same files/hunks and cannot be separated without stashing or producing intermediate broken states, commit them together in a single commit with a message that covers all changes. Never use
git stashor create intermediate partial commits just to split inseparable changes. - •Stage files selectively for each commit using
git add <specific files>— do NOT usegit add .orgit add -Aunless all changes belong to a single logical unit. - •Do NOT commit files that contain secrets (.env, credentials, API keys)
- •Use plain
git ...commands instead ofgit -C <path> ...inside the project. - •Never include issue IDs or numbers (e.g. #5, #123) in commit messages — GitLab interprets #N as an issue reference and may auto-close issues unintentionally.
- •Show the final result with
git log --oneline --name-only -n <number of commits made>after committing