commit
Create focused local Git commits from an existing worktree. Use when asked to inspect changes, stage selected files or hunks, verify the staged diff, or make a local commit; do not use for pushing, re
SKILL.mdskills/commit/SKILL.md
GitHubCommit
Create reviewable local commits without sweeping unrelated work into the index.
Core Rules
- Read repository guidance before staging. Preserve worktree changes that the user did not put in scope.
- Inspect
git status --short, the unstaged diff, and the staged diff before deciding what belongs together. - Never use
git add .,git add -A, or another repository-wide staging shortcut. - Stage explicit paths or deliberate hunks. Keep unrelated, generated, secret-bearing, and temporary files out of the commit.
- Verify the exact staged patch before committing. Do not infer that a clean test run makes an unreviewed staged diff safe.
- Do not amend, reset, rebase, cherry-pick, push, force-push, change branches, or open a pull request unless the user separately and explicitly authorizes that operation.
Workflow
- Establish scope:
- identify the requested outcome and current branch
- inventory staged, unstaged, untracked, conflicted, generated, and ignored files
- separate pre-existing user work from changes created for the current task
- Review changes:
- inspect relevant unstaged and staged diffs
- check new files before staging them
- stop on unresolved conflicts, suspected credentials, unexpected binaries, or unclear ownership
- Form one semantic change set. If the work contains independent concerns, commit only the requested group or explain the proposed split.
- Run the smallest relevant validation required by repository guidance. Treat a failing required check as a blocker unless the user explicitly accepts the known failure.
- Stage only the chosen paths or hunks.
- Verify with the equivalent of:
git diff --cached --checkgit diff --cached --statgit diff --cached
- Write a concise imperative commit message that describes the behavior or repository outcome. Add a body only when the reason, compatibility impact, or validation context would otherwise be lost.
- Create the local commit, then inspect the resulting commit summary and
git status --short. - Report the commit identifier, message, validation performed, and any intentionally uncommitted changes. Do not push automatically.
Commit Boundaries
- Keep code, tests, generated package copies, and directly related documentation together when they implement one behavior.
- Split unrelated refactors, formatting churn, dependency changes, and opportunistic cleanup.
- Include generated files only when repository guidance requires them and the canonical source change is in the same commit.
- Do not stage a file merely because it is modified. Inclusion requires a clear relationship to the commit's purpose.
- Prefer leaving an ambiguous file unstaged and naming it over guessing ownership.
Tool Output
- Use RTK when available for verbose, non-destructive Git inspection such as
rtk git statusorrtk git diff. - Inspect raw Git output before making staging, secret-exposure, conflict, or commit-boundary decisions when filtered output omits material detail.
Honest Opinion
Use honest opinion: when it adds decision value: reviews, audits, recommendations, plans, tradeoffs, or implementation close-outs with a material risk or gap. Be brutally honest and evidence-based. Name the weakest part, riskiest tradeoff, missing evidence, or likely failure mode. Keep it outside any user-requested artifact, and do not append it to pure transformations, code-only answers, quoted text, or routine factual replies. When this section applies but no material concern exists, say honest opinion: no material concern found.
Output Shape
After a commit, report:
- commit identifier and message
- staged scope included in the commit
- validation performed and result
- intentionally uncommitted or unresolved changes
- confirmation that no push occurred