| name | git-commit |
|---|---|
| description | Use this skill when the user asks to commit all or a requested subset of changes in the current git repository. |
- Stop and report if a merge, rebase, cherry-pick, or revert is in progress, or unmerged changes exist.
- Use the user's requested scope, or all committable changes when none is specified.
- Read
references/exclusions.md. Apply its patterns in order from the repository root according to gitignore rules. - Inspect staged, unstaged, and untracked changes in scope. Never treat excluded paths as candidates, even if they are staged or explicitly requested.
- If no candidates remain, stop and report without creating an empty commit.
- Determine separately whether project rules specify commit boundaries and messages before reading
references/guidelines.md. Read and apply only the corresponding parts for an unspecified category. - Create all determined commits without intermediate approval or plan confirmation.
- For each commit, prepare only its assigned changes without modifying the worktree or the staging state of other changes. Immediately before committing, verify that the staged diff contains only its assigned changes and no excluded paths.
- Run each
git commitseparately so its status is observed and hooks execute. On failure, stop without retrying or bypassing it; preserve prior successful commits. - After each commit, verify that the remaining changes and staging state are preserved.
These restrictions apply to the commit stage. When the request also authorizes implementation, complete that implementation and its validation before entering this stage.
- Perform only the inspections and Git operations required to create commits. Do not run tests, linters, builds, whitespace checks, or other project commands.
- Never use
--no-verify,--amend, or change git configuration. - Create local commits only; never push, create or switch branches, create tags, or create pull requests.
- Never commit secrets such as API keys, tokens, credentials, or private keys.
- Report each created commit on a separate line in the format
- `<short hash>` <subject>. - Report changes left uncommitted because they were excluded, outside the requested scope, or omitted for another reason.
- On failure, report the failed stage and its cause.
- Omit executed git commands and internal decision-making.