aif-commit
Original:🇺🇸 English
Translated
Create conventional commit messages by analyzing staged changes. Generates semantic commit messages following the Conventional Commits specification. Use when user says "commit", "save changes", or "create commit".
2installs
Sourcelee-to/ai-factory
Added on
NPX Install
npx skill4agent add lee-to/ai-factory aif-commitTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Conventional Commit Generator
Generate commit messages following the Conventional Commits specification.
Workflow
-
Analyze Changes
- Run to see staged files
git status - Run to see staged changes
git diff --cached - If nothing staged, show warning and suggest staging
- Run
-
Determine Commit Type
- : New feature
feat - : Bug fix
fix - : Documentation only
docs - : Code style (formatting, semicolons)
style - : Code change that neither fixes a bug nor adds a feature
refactor - : Performance improvement
perf - : Adding or modifying tests
test - : Build system or dependencies
build - : CI configuration
ci - : Maintenance tasks
chore
-
Identify Scope
- From file paths (e.g., →
src/auth/)auth - From argument if provided
- Optional - omit if changes span multiple areas
- From file paths (e.g.,
-
Generate Message
- Keep subject line under 72 characters
- Use imperative mood ("add" not "added")
- Don't capitalize first letter after type
- No period at end of subject
Format
<type>(<scope>): <subject>
<body>
<footer>Examples
Simple feature:
feat(auth): add password reset functionalityBug fix with body:
fix(api): handle null response from payment gateway
The payment API can return null when the gateway times out.
Added null check and retry logic.
Fixes #123Breaking change:
feat(api)!: change response format for user endpoint
BREAKING CHANGE: user endpoint now returns nested profile objectBehavior
When invoked:
- Check for staged changes
- Analyze the diff content
- Propose a commit message
- Ask for confirmation or modifications
- Execute with the message
git commit - After a successful commit, offer to push:
- Show branch/ahead status:
git status -sb - If the branch has no upstream, use:
git push -u origin <branch> - Otherwise:
git push - User choice:
- Push now
- Skip push
- Show branch/ahead status:
If argument provided (e.g., ):
/aif-commit auth- Use it as the scope
- Or as context for the commit message
Important
- Never commit secrets or credentials
- Review large diffs carefully before committing
- Suggest splitting if changes are unrelated
- Add Co-Authored-By for pair programming if mentioned