git-commit
Installation
SKILL.md
Git Commit
Workflow
Use this workflow before running git commit.
- Inspect repository state with
git status --short. - Inspect staged changes with
git diff --cached --statandgit diff --cached. - If there are unstaged changes, determine whether they are relevant to the requested commit. Do not stage unrelated changes without explicit user intent.
- Verify that no
.envfile is staged. If any.envfile is staged, stop and unstage it unless the user explicitly asks for a different non-secret env example file. - Verify
.envis ignored by checking.gitignoreor the repository's ignore rules. If it is missing, add an ignore entry only when doing so is within the user's requested change scope; otherwise mention it before committing. - Scan staged changes for likely secrets, credentials, tokens, private keys, and hardcoded connection strings. Stop if a likely secret is present.
- Run the smallest relevant verification for the staged changes when practical, such as focused tests, lint, typecheck, or build. If verification cannot be run, mention why in the final response.
- Create the commit only after the staged diff, safety checks, and message are aligned.
Safety Checks
Treat these as blockers unless the user explicitly resolves them: