Git Commit

Analyze changes, stage files, and commit with Conventional Commits. Use when the user asks to commit or run git commit.

to4iki 0f88e8b 2 files · 2.1 KB Updated

File contents

Git Commit

Run only when the user asks to commit.

Procedure

  1. Run in parallel: git status / git diff / git diff --staged
  2. Stage individually with git add <files> (never git add .). Skip secrets (.env, credentials, tokens, etc.)
  3. If unrelated changes are mixed, propose separate commits
  4. Commit with Conventional Commits in English (Japanese only if the user explicitly asks). Focus the message on why:
git commit -m "$(cat <<'EOF'
<type>(<scope>): <subject>

<why if useful>
EOF
)"

Place EOF at the start of the line (no indentation). Include issue/task numbers in the body when available.

  1. Verify with git status

Gotchas

  • If there is nothing to commit, stop and tell the user
  • If a hook (e.g. pre-commit) fails, stop and ask the user to fix it

to4iki/skills/tree/main/engineering/git-commit commit 0f88e8be93

Frequently asked questions

npx skillmds@latest add to4iki/git-commit