Reviews staged Git changes and prepares scoped commit messages; use when asked to create a commit or message. Never stage or commit without explicit permission; do not use for code review (use dotnet-code-review).
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Git Commit?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/k4ndev-git-commit)
---
name: git-commit
description: Reviews staged Git changes and prepares scoped commit messages; use when asked to create a commit or message. Never stage or commit without explicit permission; do not use for code review (use dotnet-code-review).
---
# Git Commit
## Purpose
Produce an accurate, scoped commit message and create a commit only with explicit user authorization.
## Scope
Git status, staged diff, commit subject/body, and safe commit execution.
## When to use
- User asks for a commit, commit message, or logical commit grouping.
- User asks to inspect whether staged files match a requested commit scope.
## Do not use for
- Reviewing code correctness/security: use `dotnet-code-review`.
- Automatically staging, amending, rebasing, force-pushing, or rewriting history without explicit authorization.
## Required context
Inspect current branch, `git status`, staged diff, unstaged changes, user-requested scope, repository conventions, and any commit policy. Do not expose secrets in output.
## Workflow
1. Read status and staged diff; distinguish staged from unstaged/untracked work.
2. Check that the staged content matches the explicit requested scope; do not add files automatically.
3. Propose a concise imperative subject; use `type(scope): summary` only if repository convention supports it (`feat`, `fix`, `refactor`, `test`, `docs`, `build`, `ci`, `perf`, `security`, `chore`).
4. Add a body only for rationale, constraints, or breaking behavior; avoid restating the diff.
5. Before execution, confirm the user's request clearly authorizes committing and ensure staged content is the intended set.
6. Run the exact commit command only when authorized; verify Git's result and report the commit ID/message.
## Decision rules
- “Prepare a commit message” authorizes drafting, not committing.
- Never stage unstaged files or include unrelated generated files/secrets.
- Do not amend/rebase/force push unless explicit permission identifies that operation.
## Expected output format
Show the proposed subject and optional body, scope concerns, and exact staged-file count. After authorized commit, report verified hash and command outcome; otherwise state that no commit was made.
## Common mistakes
- Assuming all working-tree changes should be committed, silently staging files, writing a vague “updates” subject, or claiming a commit succeeded without Git confirmation.
## Edge cases
- Partially staged files require checking staged diff, not only the working-tree file.
- Merge/rebase state or hooks may prevent commit; report the actual failure without bypassing safeguards.
- A secret in staged content should be flagged without reproducing it.
## Examples
See [commit examples](examples.md) for scoped subjects and unsafe staging behavior.
## Test scenarios
- Positive: “Create a commit message for the already-staged bug fix; do not commit.”
- Negative: “Review this staged SQL injection risk” routes to `security-audit` / `dotnet-code-review`.
- Boundary: “Commit these changes now” activates this skill but requires verifying the staged diff before running Git.
## Related skills
`dotnet-code-review`, `testing-quality`, `dependency-audit`.