Agent skill
aif-commit
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".
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/aif-commit
SKILL.md
Conventional Commit Generator
Generate commit messages following the Conventional Commits specification.
Workflow
-
Analyze Changes
- Run
git statusto see staged files - Run
git diff --cachedto see staged changes - If nothing staged, show warning and suggest staging
- Run
-
Determine Commit Type
feat: New featurefix: Bug fixdocs: Documentation onlystyle: Code style (formatting, semicolons)refactor: Code change that neither fixes a bug nor adds a featureperf: Performance improvementtest: Adding or modifying testsbuild: Build system or dependenciesci: CI configurationchore: Maintenance tasks
-
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 functionality
Bug 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 #123
Breaking change:
feat(api)!: change response format for user endpoint
BREAKING CHANGE: user endpoint now returns nested profile object
Behavior
When invoked:
- Check for staged changes
- Analyze the diff content
- Propose a commit message
- Ask for confirmation or modifications
- Execute
git commitwith the message - 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
- If staged changes contain unrelated work (e.g., a feature + a bugfix, or changes to independent modules), suggest splitting into separate commits:
- Show which files/hunks belong to which commit
- Ask for confirmation
- Unstage all:
git reset HEAD - Stage and commit each group separately using
git add <files>+git commit - Offer to push only after all commits are done
- NEVER add
Co-Authored-Byor any other trailer attributing authorship to the AI. Commits must not contain AI co-author lines
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?