Git Commit
Inputs
- •Optional scope, intent, or paths to include/exclude.
Workflow
- •Review changes
- •
git status --short - •
git diff - •If staged changes exist, confirm they are in-scope; otherwise ask to reset or split.
- •If multiple unrelated changes, ask to split or specify scope.
- •
- •Stage relevant files
- •Prefer explicit paths:
git add path... - •Use
git add -pfor partial staging. - •Include new files only if clearly part of the commit intent; otherwise ask.
- •Prefer explicit paths:
- •Craft Conventional Commit message
- •Types: feat, fix, refactor, build, ci, chore, docs, style, perf, test.
- •Format:
type(scope): subject(scope optional). - •Subject: imperative, lowercase, no trailing period.
- •Breaking change: add
!orBREAKING CHANGE:body.
- •Commit
- •Prefer
./scripts/committerif present; elsecommitter(PATH). - •Otherwise
git commit -m "type(scope): subject"(add body with a second-m).
- •Prefer
- •Report
- •Show commit hash and message.
Guardrails
- •Never commit without reviewing the diff.
- •Do not stage unrelated changes; ask if uncertain.
- •If no changes, stop and explain.
- •If hooks fail, report and ask how to proceed.