SuperAPI AI Directory

commit

General & other

View repository

Updated 10-16 03:16

About this skill

commit

Stage and commit. Conventional commits. No push.

Protocol

Run in parallel first:

git status
git diff HEAD
git log --oneline -5

Then sequentially:

  1. Understand the why — read the diff, understand what changed and why
  2. Stage specific files — by name, never git add -A or git add .
  3. Draft the message — see format below
  4. Commit via heredoc (preserves formatting)
  5. Verify with git status

Commit message format

type(scope): short description (≤72 chars)

Optional body if nuance is lost without it.

Co-Authored-By: <agent-name> <agent-email>

The Co-Authored-By trailer is optional — fill in the agent identity your harness provides, or omit the line entirely if the project doesn't want it.

Types: feat, fix, refactor, chore, docs, test, style

Focus on the why, not the what. The diff already shows what changed.

Use a heredoc to preserve formatting:

git commit -m "$(cat <<'EOF'
type(scope): short description

Co-Authored-By: <agent-name> <agent-email>
EOF
)"

Rules

  • Never amend unless explicitly asked — create new commits instead
  • Never --no-verify — don't skip hooks
  • Never force-push to main/master
  • No push, no PR — hand off to the gh skill for that
  • Hook fails? Fix the issue, re-stage, create a new commit (not amend)
  • Don't commit .env, credentials, or large binaries — warn the user

Gotchas

  • Heredoc commit messages with backticks or $ need single-quoted delimiter (<<'EOF' not <<EOF)
  • If prek hook fails, the commit did NOT happen — create a new commit after fixing, never amend
  • Co-Authored-By trailer is optional — use the agent identity your harness exposes, or drop the line if the project doesn't track agent authorship
  • Empty git diff HEAD after staging means nothing new was added — check git diff --cached instead