/git:commitfrom git
Commit the current work in well-scoped commits and push: reviews every staged, unstaged and untracked change, splits unrelated concerns into separate commits, writes messages that carry the reasoning from the conversation, runs pre-commit hooks without bypassing them and pushes to the upstream branch. Use when the user says "commit", "commit this", "commit my changes", "make a commit", "save my work", "let's commit", "push this up" or "record this in git", or otherwise asks for finished work to be captured in git, even if they do not say "commit". Opening or merging a pull request belongs to the sibling pr skill.
Ships in git. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You turn the working tree into one or more reviewed, well-scoped commits and push them.
Invoking this skill is the user's instruction to commit and then push, so push without asking again once the commits are made.
The skill never rewrites history: no --amend, no rebase, no force-push, no hook bypass.
It stops and reports instead of guessing when the diff holds a secret, when staging is ambiguous, when a merge or rebase is in progress, or when the push is rejected.
Copy this checklist into your reply and tick it off as you go.
Commit progress:
- [ ] 1. State gathered, untracked files included
- [ ] 2. Every changed and new file reviewed (secret found: stop)
- [ ] 3. Grouping decided and shown before any git add
- [ ] 4. Messages written from the diff and the conversation
- [ ] 5. Each group staged, verified and committed (hook failure: fix, re-stage, commit again)
- [ ] 6. Pushed, and the final state reported
Committing is the moment the user's description of their change is written into history, so check it against the diff instead of transcribing it.
Run these in parallel:
git status --porcelain=v1 --branch --untracked-files=all
git diff --cached
git diff
git log --oneline -10
git diff does not show untracked files, so read every ?? entry from the status output with Read.
For a binary file or one over 1 MB, report its path and size instead of reading it, and ask whether it belongs in the repository.
Stop and ask before going further if the status shows a merge, rebase, cherry-pick or bisect in progress, or a detached HEAD.
Read the conversation for the reasoning behind the change: the bug report, the root cause that was established, the alternatives ruled out, the design decision taken. That reasoning goes into the message bodies.
Check every changed and new file for:
.env files, internal URLs or personal data..DS_Store.If a file contains a secret, stop and tell the user which file and line, and do not stage anything.
If a generated or local file such as __pycache__/ or .venv/ shows up as untracked, propose a .gitignore entry instead of committing it.
Keep the changes together when they implement one idea, however many files they touch. Split them when they are distinct concerns, for example a bug fix next to an unrelated feature, a dependency bump next to logic changes, formatting mixed with behaviour changes, or config for an unrelated service.
If the user had already staged a set of files, treat it as their intended first commit and say so, unless the review found a problem in it.
Before touching git add, list each planned commit with its files and a one-line reason.
A single commit needs no plan, only the message.
Match the convention in git log.
Where the repository has none, use <type>: <description> with type one of feat, fix, refactor, docs, test or chore, a subject under 72 characters in the imperative mood, and no full stop.
Write a body whenever the conversation holds research, a root-cause analysis, a debugging session, a design decision or a trade-off. The body explains why and what was learned: what caused the bug, why this approach, which alternatives were ruled out. A change with no such context gets a subject only.
Write the body to this register:
End every message with the model-agnostic trailer Co-Authored-By: Claude <[email protected]>.
Name the platform and never a model version, because the harness rotates models and a version string goes stale.
fix: count boundary values once in sliding window aggregation
The window range check used an inclusive upper bound, so values exactly
on the boundary were counted in two windows. Under high-frequency input
this inflated the aggregated metrics by up to a factor of two. The check
now uses an exclusive upper bound, which matches the documented contract.
Co-Authored-By: Claude <[email protected]>
For each planned commit, stage its files by path and check the result:
git add path/to/file1 path/to/file2
git diff --cached --stat
Use git add -A only when every remaining change belongs in this commit.
If the staged set is not what the plan says, fix it with git restore --staged <path> before committing.
Commit through a heredoc so the body keeps its line breaks:
git commit -m "$(cat <<'EOF'
<type>: <description>
<body>
Co-Authored-By: Claude <[email protected]>
EOF
)"
If a pre-commit hook fails, the commit was not created.
Read the hook output.
If the hook rewrote files itself (a formatter, an end-of-file fixer), re-stage only the rewritten files that belong to this commit.
If it reports a problem it cannot fix, such as a lint error or a failed type check, report it to the user and agree the fix before editing code.
Then run the same git commit again, never --amend, because amending would rewrite the previous, unrelated commit.
Confirm each commit with git log --oneline -3, then move to the next group.
git push
If the branch has no upstream, run git push -u origin HEAD.
If the repository has no remote, report that the commits are local and stop.
If the push is rejected as non-fast-forward, report the error verbatim and ask how to proceed: suggest git pull --rebase, and do not run it or force-push on your own.
Finish with the commits created (hash and subject) and the branch they were pushed to.
git diff HEAD leaves out untracked files, so a new file holding a key is invisible to a review that only reads diffs.| Prohibited | Reason |
|---|---|
--no-verify, -n on commit, -c core.hooksPath=... | Bypasses the pre-commit hooks |
--no-gpg-sign, -c commit.gpgsign=false | Bypasses signing |
--amend, git rebase, git reset on commits | Rewrites history the user did not ask to change |
git push --force, --force-with-lease, +refspec | Overwrites upstream history |
git add -A or git add . while splitting | Pulls files into the wrong commit |
Committing a secret, credential or .env file | The leak is permanent once pushed |
| Skipping the review of untracked files | New files are where secrets usually arrive |
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
2 skills in this plugin
npx claudepluginhub carelvniekerk/agentic-skills --plugin git