Loading...
Loading...
Best practices for creating clean, atomic git commits with good messages. Use when: (1) staging and committing changes, (2) writing commit messages, (3) deciding what to group in a single commit, (4) handling pre-commit hook failures, (5) choosing between amend and new commit. Triggers on "commit", "stage", "git add", "write a commit message", or "commit my changes".
npx skill4agent add onsager-ai/dev-skills git-commitgit addgit commitgit amendWhat does the user need?
Stage + commit changes?
→ Check what changed: git status + git diff --staged
→ Group related changes (atomic commit rule below)
→ Write message in conventional format
→ If hook fails: fix root cause, re-stage, new commit
Amend the last commit?
→ ONLY if NOT yet pushed to remote
→ OK for: missing file, minor message fix, small oversight
→ New commit instead: substantial change, already pushed
Write a commit message only?
→ Follow conventional format below
→ Lead with "why", not "what"
Hook failure?
→ Read the full hook output
→ Fix the root cause — never use --no-verify<type>(<scope>): <subject>
<body> ← optional; explain *why*, not *what*
<footer> ← optional; breaking changes, refs| Type | When |
|---|---|
| New feature or capability |
| Bug fix |
| Code restructure, no behavior change |
| Documentation only |
| Adding or fixing tests |
| Build, tooling, dependency updates |
| Performance improvement |
| CI/CD workflow changes |
BREAKING CHANGE:!feat!:git addconsole.logTODO: remove.gitignorefeat(auth): add OAuth2 login flow
Replaces username/password form. Supports Google and GitHub as providers.
Token refresh is handled automatically by the auth middleware.fix(publish): handle missing platform binary gracefully
Previously threw unhandled error when the platform package was absent.
Now logs a clear message and exits with code 1.feat!: change publish config to support multiple binaries
BREAKING CHANGE: `binary` field renamed to `binaries` array.
Migrate: `binary: 'my-cli'` → `binaries: [{ name: 'my-cli', ... }]`chore(deps): upgrade pnpm to 10.6.2--no-verifynpx skills add -g onsager-ai/dev-skills --skill git-commit -a claude-code -y