Create well-formatted git commits with conventional commit format and proper staging
/plugin marketplace add claudeforge/marketplace/plugin install intelligent-commit@claudeforge-marketplaceCreate meaningful git commits following conventional commit standards with proper staging and validation.
Run the command when you have changes to commit:
/commit
The command will analyze your changes and create appropriate commits.
Commits follow this structure:
<type>(<scope>): <description>
[optional body]
[optional footer]
Feature Addition
feat(auth): add password reset functionality
Implement email-based password reset flow with token generation
and expiration handling.
Closes #145
Bug Fix
fix(validation): handle special characters in usernames
Previously usernames with dashes caused validation errors.
Updated regex pattern to allow hyphens and underscores.
Refactoring
refactor(api): extract common error handling logic
Move duplicate error handling code into reusable middleware
to improve maintainability.
1. Check Status
git status
git diff
2. Analyze Changes
3. Run Pre-Commit Checks
npm run lint
npm test
4. Stage Files
git add src/auth.ts src/auth.test.ts
5. Create Commit
git commit -m "feat(auth): add two-factor authentication"
If you have multiple unrelated changes, split them:
Example: Both feature work and bug fix in working directory
# Commit the feature first
git add src/features/export.ts src/features/export.test.ts
git commit -m "feat(export): add CSV export functionality"
# Then commit the bug fix
git add src/validation.ts
git commit -m "fix(validation): correct email regex pattern"
Good Messages
feat(api): add rate limiting middleware
fix(db): prevent SQL injection in user queries
docs(readme): update installation instructions
Bad Messages
update stuff
fixed bug
WIP
changes
Use scopes to indicate the area of change:
auth: Authentication/authorizationapi: API endpointsui: User interfacedb: Databaseconfig: Configurationdeps: DependenciesThe command runs these checks:
# Lint code
npm run lint
# Type check (TypeScript)
npm run typecheck
# Run tests
npm test
# Check build
npm run build
If any check fails, the commit is blocked until fixed.
For breaking changes, add exclamation mark and footer:
feat(api)!: redesign user endpoint structure
BREAKING CHANGE: User API response format has changed.
Old format: { name, email }
New format: { profile: { name, email } }
See migration guide for details.
To update the last commit:
# Add forgotten files
git add forgotten-file.ts
git commit --amend --no-edit
# Update commit message
git commit --amend -m "new message"
Commit Blocked by Tests: Fix failing tests before committing
Lint Errors: Run npm run lint --fix to auto-fix issues
Unclear What Changed: Review git diff carefully
Too Many Changes: Split into multiple focused commits
Before committing, verify: