git-commit

Analyze diffs, split into logical commits, and create Conventional Commit messages. Use when the user asks to commit, stage changes, or split work into multiple commits.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "git-commit" with this command: npx skills add lightsound/skills/lightsound-skills-git-commit

Git Commit

Create well-scoped, reviewable commits with Conventional Commit messages.

Conventional Commit Format

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]
TypePurpose
featNew feature
fixBug fix
docsDocumentation only
styleFormatting/style (no logic)
refactorCode refactor (no feature/fix)
perfPerformance improvement
testAdd/update tests
buildBuild system/dependencies
ciCI/config changes
choreMaintenance/misc
revertRevert commit

Breaking changes: feat!: summary or BREAKING CHANGE: footer.

Workflow

1. Inspect working tree

git status
git diff --stat
git diff

2. Decide commit boundaries

Split when changes contain unrelated concerns:

  • feature vs refactor
  • backend vs frontend
  • formatting vs logic
  • tests vs production code
  • dependency bumps vs behavior changes

Default to multiple small commits when in doubt.

3. Stage only what belongs in the next commit

git add path/to/file
git add -p            # patch staging for mixed changes in one file
git restore --staged -p  # unstage a hunk

4. Sanity check staged changes

git diff --cached

Verify:

  • No secrets or tokens
  • No debug logging (console.log, debugger, etc.)
  • No unrelated formatting churn

5. Describe the commit in 1-2 sentences

Answer: "What changed?" + "Why?"

If you cannot describe it cleanly, the commit is too big or mixed — go back to step 2.

6. Write the commit message

git commit -m "$(cat <<'EOF'
<type>[scope]: <description>

<body: what/why>

<footer>
EOF
)"
  • Description: imperative mood, present tense, <72 chars
  • Body: what and why, not implementation diary
  • Footer: Closes #123, Refs #456, BREAKING CHANGE: if needed

7. Verify

Run the repo's fastest meaningful check (lint, typecheck, or unit tests) before moving on.

8. Repeat

Go back to step 3 for the next commit. Continue until the working tree is clean or all intended changes are committed.

Deliverable

For each commit, provide:

  • The commit message
  • A one-line summary (what/why)

Safety Protocol

  • NEVER update git config
  • NEVER force push to main/master
  • NEVER skip hooks (--no-verify) unless user explicitly asks
  • NEVER run destructive commands (--force, hard reset) without explicit request
  • If commit fails due to hooks, fix the issue and create a NEW commit (don't amend)

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

git-commit

No summary provided by upstream source.

Repository SourceNeeds Review
General

git-commit

No summary provided by upstream source.

Repository SourceNeeds Review
General

git-commit

No summary provided by upstream source.

Repository SourceNeeds Review