§ reference · skill

commit

Reads the working tree, groups related changes into logical commits, and writes descriptive messages in the repo's style. Never amends, never adds AI attribution.

arguments [message] [--baseline <path>]

§ 01 · purpose

Purpose

Closes the implementation loop. Analyses staged + unstaged changes, splits them into atomic commits grouped by purpose (feature · fix · refactor · docs), and commits using the repo's style. Order is interchangeable with code-review.

§ 02 · when to use

When to use it

  • Work is finished and ready to land.
  • You want help splitting a noisy working tree into clean atomic commits.
  • Skip when the directory is not a git repo. commit stops and asks you to git init.

§ 03 · inputs

Inputs

Name Required Source
$ARGUMENTS (commit hint) no Free-text hint or message. Empty falls back to inference from session history + git diff
--baseline <path> no Workflow-supplied run-start snapshot of paths that were already dirty before the run began
--baseline <path>
Peeled off the arguments before the message hint. Its presence re-runs the git-changes snapshot with the baseline threaded and treats that output as authoritative; paths reported as pre-existing are out of scope and are never staged.

§ 04 · outputs

Outputs

Artifact Path Format
One or more git commits current branch imperative-mood messages, repo-style

§ 05 · key steps

Key steps

  1. Verify git availability Why: Stops early when the directory is not a git repo. No commit attempt, no surprising side effects.
  2. Read session context + git diff Why: In-session runs leverage conversation history; cold runs rely on diff inspection. Both produce a why-not-just-what view that drives commit message quality.
  3. Group files into atomic commits Why: One logical change per commit. Mixed concerns (feature + bug + unrelated refactor) get split so future bisects land on the actual cause.
  4. Confirm the plan with the developer before staging Why: ask_user_question shows the planned files and messages first. Catches grouping mistakes cheaply; correcting after a commit means a reset.
  5. Stage by-name and commit; never -A or . Why: Specific git add avoids accidental capture of .env, build artifacts, or unrelated WIP. Messages are written as if the user wrote them. No Claude attribution, no co-author lines. Under a workflow baseline, paths listed as pre-existing are left dirty and never staged.

§ 06 · related skills

upstream implementvalidate
downstream code-reviewchangelog