/commit Skill
Create a well-structured conventional commit from staged changes.
Usage
- •
/commit— auto-generate commit message from staged changes - •
/commit fix login bug— use provided message as basis
Steps
- •Run
git statusandgit diff --stagedto analyze changes - •If no changes are staged, check for unstaged changes and suggest what to stage
- •Determine the commit type (feat, fix, docs, refactor, test, chore, etc.)
- •Determine the scope from the changed files/directories
- •Generate a concise commit message in conventional commit format
- •If a message hint was provided, incorporate it
- •Show the proposed commit message and ask for confirmation
- •Create the commit
Commit Format
code
<type>(<scope>): <description> [body if changes are complex]
Rules
- •Never commit .env files or files containing secrets
- •Keep the subject line under 72 characters
- •Use imperative mood ("add" not "added")
- •If breaking changes exist, add
BREAKING CHANGE:footer