Commit Discipline
Hard gate
NEVER commit unless the user explicitly says to commit in this conversation.
- •No
git commit,git commit --amend, rebase/squash, or any git operation that creates or rewrites commits unless explicitly asked. - •Default: make code changes, show a tight diff summary, and ask for approval.
- •If the user asks for a commit message, only provide the message — do not commit unless they also explicitly say to commit.
- •If tests exist for the changes being committed, they must be run first.
- •Prefer scoped tests for the changed area (page dir or specific files).
Pre-commit staging hygiene
- •Always stage explicit file paths only (no
git add .,-A,-u,-i,git commit -a). - •Do not reset or unstage anything as part of this workflow (no
git reset,git restore --staged, orgit reset --mixed) unless the user explicitly asks for it. - •Never stage unrelated files or any untracked files unless the user explicitly asked to include them.
- •Before committing, run
git diff --stagedand confirm only the intended files are staged. If anything unexpected is staged, STOP and ask.
Speed rule (no back-and-forth on commit failures)
- •If the user explicitly asked you to commit and the commit fails due to
sandbox/permissions or
.git/index.lock, automatically retry using the appropriate permissions and clear a stale lock (seegit-troubleshooting.mdc).