54 lines · 2.2 KB

name: commit description: Stage and commit changes with a Conventional Commits message. Invoke with /commit "optional scope hint". Inspects the diff, picks an appropriate type and scope, writes a concise message, and commits. Does not push. user-invocable: true disable-model-invocation: true allowed-tools: Bash(git status:), Bash(git diff:), Bash(git add:), Bash(git commit:), Bash(git log:*) argument-hint: "[optional scope or context]"

/commit

Stage everything currently modified and untracked, then commit with a Conventional Commits message inferred from the diff.

Workflow

  1. Run git status and git diff --staged (plus git diff for unstaged) to see what's actually changing. If nothing is changing, stop and say so.
  2. Read git log -10 --oneline to match the repo's existing commit style — some repos use feat(bubbles): ..., others use bubbles: ..., others use sentence case. Match what's there, don't impose Conventional Commits if the repo doesn't use it.
  3. Pick a type: feat, fix, refactor, docs, test, chore, perf, build, ci, style, revert. If $ARGUMENTS is non-empty, treat it as a scope or context hint, not as the full message.
  4. Write a subject line ≤ 72 chars, imperative mood ("add", not "added"). If the change is non-obvious, add a body paragraph explaining the why — not the what (the diff already shows the what).
  5. git add -A then git commit -m "...". Show the resulting git log -1 and stop. Do not push.

Rules

  • One commit per invocation. If the diff spans unrelated changes, stop and tell the user to stage selectively instead of guessing.
  • Never amend, force, or rewrite history from this skill — those are separate, dangerous operations and belong in their own skill.
  • Never add Claude as co-author or include "Generated by" footers unless the repo's existing log shows that pattern.
  • If pre-commit hooks fail, surface the failure and stop. Don't --no-verify.

Examples

/commit on a diff that touches internal/tui/textarea/buffer.go: → feat(textarea): add gap buffer backing store

/commit "rollback" on a diff that reverts a flag default: → revert: restore default --color=auto behavior