Stage files and create commits following conventional commit standards. Analyzes the diff to determine the appropriate commit type, scope, and message. Supports granular commits (splitting unrelated changes into separate commits).
Workflow
Check state — Run
git statusandgit diff --statto see all changes (staged + unstaged + untracked).Analyze changes — Read the diff to understand:
- What files changed and in what areas
- Whether changes are related or should be split into multiple commits
- The nature of each change (new feature, bug fix, refactor, docs, test, chore)
Determine commit strategy:
- If all changes are related → single commit
- If changes span unrelated areas → suggest splitting into granular commits
- Ask the user if unsure about grouping
Stage files —
git addthe relevant files for each commit. Stage specific files by name, notgit add -Aorgit add ..Draft commit message — Follow conventional commit format:
<type>(<scope>): <description> [optional body with more detail]Types:
feat— new featurefix— bug fixrefactor— code restructure without behavior changedocs— documentation changestest— adding or updating testschore— build, config, dependency changesstyle— formatting, whitespace (no logic change)perf— performance improvement
Scope: the area of the codebase affected (e.g.,
auth,api,ui,canvas).Commit — Run
git commit -m "<message>"using a HEREDOC for multi-line messages.Report — Show the commit hash and summary. If there are remaining uncommitted changes, note them.
Rules
- If the user provides a message via
-margument, use it as-is (still stage files appropriately) - Never use
git add -Aorgit add .— always stage specific files - Never commit files that look like secrets (
.env, credentials, API keys, tokens) - If pre-commit hooks fail, fix the issue and create a NEW commit (never
--amendunless explicitly asked) - Never use
--no-verifyto skip hooks - Keep commit messages concise: subject line under 72 characters
- The body (if needed) should explain WHY, not WHAT (the diff shows what)
- Check recent
git logto match the repo's existing commit style - For granular commits, commit in logical order (e.g., refactor before feature)