Git · apply by default
/git-commit
Prepare coherent commits with accurate messages and deliberate staging
Use for an explicit bounded commit or undoing one; git-split designs several coherent commits.
Make it your own.
In Claude Code, use the slash command and add your context. In Codex, select git-commit from the just-vibe skill picker, then send the same brief.
Version 0.11.0 also supports /jv git-commit, /just-vibe git-commit and /jv:git-commit in Claude. See shortcut setup and context examples.
/just-vibe:git-commit Commit only the verified checkout fix; preserve other staged and unstaged work./just-vibe:git-commit Commit only the bug fix when the same file contains unrelated staged edits./just-vibe:git-commit Inspect commit readiness with missing identity or a rejected hook; do not bypass either.What the agent does
- Resolve the repository, HEAD, configured user identity and exact requested commit membership. Inspect both the index and worktree, including untracked files; record unrelated staged and unstaged changes before touching the index.
- Separate intended changes by hunk, not merely path. If a file mixes user staging with the requested fix, use deliberate patch selection or a temporary index based on HEAD; a whole-file add or commit --only can include unrelated worktree content.
- Review the actual candidate tree and verify it independently when unrelated worktree changes could affect the result. With a temporary index, stage only intended blobs/tests and run the normal commit path with that index so required hooks still run. Preserve a recoverable record of the original real index until post-commit reconciliation succeeds.
- After committing through a temporary index, reconcile intended committed changes into the real index while retaining unrelated staged hunks. Verify HEAD contains only the intended change, HEAD-to-index retains the user’s staged work, and index-to-worktree retains the user’s unstaged work. Do not blindly restore an old index against the new HEAD.
- Use the existing user identity and describe the change without agent/model self-attribution or agent Co-authored-by trailers. Inspect actual committed content and message, including hook changes. A failed hook leaves the operation incomplete; inspect state before retrying and never bypass it.
Inputs
- intended changes, commit scope, and message preferences. A direct commit request authorizes the bounded commit.
Optional context: scope, references, constraints, successCriteria, environment, mode, budget.
Scope
- Reads
- Deliberate staging and commit creation; no push, amend, or unrelated content.
- Writes
- Apply: only the requested local changes and relevant isolated verification. Inspect/plan requests remain inspection/planning. External actions require their exact action and target in session authorization.
- Mode
- Apply; intended changes, commit scope, and message preferences. A direct commit request authorizes the bounded commit; a request to undo a commit authorizes only a non-destructive reset or revert.
- Prerequisites
- Git, exact repository/worktree, and readable refs/index. Record branch, HEAD, staged/unstaged/untracked state before mutation. Preserve unrelated edits and never default to broad staging, hard reset, clean, force push, or history rewriting.
Expected output
- Commit hash and included scope, candidate-tree verification, actual message/identity, and evidence that unrelated staged, unstaged and untracked work remains.
How the work is checked
- The committed tree contains only the requested change and works without unrelated worktree edits. The user’s unrelated HEAD-to-index and index-to-worktree differences survive. Required hooks and attribution checks pass.
When to stop or clarify
- Resolve ambiguous pre-staged content before committing. Never disable hooks or change global identity to force success.
Handling missing context
- Infer
- Read repository root, HEAD, branch, refs and staged/unstaged/untracked distinctions; use the configured human identity.
- Assume
- Limit an ambiguous inspection to the current repository and report that scope; preserve all existing changes.
- Ask
- Before mutation, resolve uncertain commit membership, destination ref or history-rewrite intent; do not ask again about already authorized exact actions.
Technical guidance
- Evidence
- Capture the user's initial index and worktree distinctions and the exact requested commit membership.
- Method
- Use deliberate hunks or the existing temporary-index procedure; inspect the candidate tree and normal hook results before committing.
- Pitfall
- A path-limited commit can include unwanted unstaged hunks, and blindly restoring an old index can stage a reversal.
- Check
- Compare old HEAD to new HEAD, new HEAD to index and index to worktree; preserve unrelated staging and inspect the resulting author/message.
Situational decisions
When unrelated changes are staged in a file that also contains the requested fix: Build a candidate that excludes those hunks and verify all three trees afterward. If hunks depend on each other and membership is genuinely ambiguous, preserve the recoverable state and ask only about that dependency.
When the candidate passes in the mixed worktree but fails in isolation: Identify the undeclared dependency. Do not claim the commit is verified or silently include unrelated user work to make it pass.
When the request is to undo a commit: For an unpublished local commit, move the branch to its parent with git reset --soft or --mixed, preserving the worktree and index; for a published commit, create a revert with git revert. Never use --hard unless the user explicitly asks to discard the changes.
The coding agent follows this workflow using its available tools. Installation does not grant service access or guarantee an outcome. Read the compatibility notes.