commit
/commit - Smart Commit Command
Section titled “/commit - Smart Commit Command”Purpose
Section titled “Purpose”Create a well-formatted commit with auto-generated message based on staged changes.
/commit [optional message hint]Arguments
Section titled “Arguments”$ARGUMENTS: Optional hint for commit message focus (e.g., “auth”, “bugfix”, “refactor”)
Create a commit for staged changes with hint: $ARGUMENTS
Workflow
Section titled “Workflow”Step 1: Analyze Changes
Section titled “Step 1: Analyze Changes”-
Check Status
Terminal window git status -
View Staged Changes
Terminal window git diff --staged -
Review Recent Commits
Terminal window git log --oneline -5
Step 2: Categorize Changes
Section titled “Step 2: Categorize Changes”Determine commit type:
feat: New featurefix: Bug fixdocs: Documentationstyle: Formattingrefactor: Code restructuringtest: Adding testschore: Maintenance
Step 3: Generate Message
Section titled “Step 3: Generate Message”Follow conventional commit format:
type(scope): subject
body (optional)
footer (optional)Step 4: Create Commit
Section titled “Step 4: Create Commit”git commit -m "$(cat <<'EOF'type(scope): subject
- Change 1- Change 2
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>EOF)"Commit Message Guidelines
Section titled “Commit Message Guidelines”Subject Line
Section titled “Subject Line”- Max 50 characters
- Imperative mood (“Add” not “Added”)
- No period at end
- Capitalize first letter
- Wrap at 72 characters
- Explain what and why
- Use bullet points for multiple changes
Examples
Section titled “Examples”Feature
Section titled “Feature”feat(auth): add password reset functionality
- Add reset token generation- Implement email sending- Add rate limiting for reset requests
Closes #123Bug Fix
Section titled “Bug Fix”fix(api): handle null user in profile endpoint
The profile endpoint crashed when accessing deleted users.Added null check and proper 404 response.
Fixes #456Refactor
Section titled “Refactor”refactor(database): extract query builders
Split large database service into focused modulesfor better maintainability and testing.Documentation
Section titled “Documentation”docs(readme): update installation instructions
- Add prerequisites section- Update configuration examples- Fix broken linkstest(auth): add missing login tests
- Add test for invalid credentials- Add test for locked account- Add test for expired sessionchore(deps): update dependencies
- Update React to 18.2- Update TypeScript to 5.3- Remove unused packagesOutput
Section titled “Output”Commit Created
Section titled “Commit Created”## Commit Created
**Hash**: `abc1234`**Branch**: `feature/auth-improvements`
### Messagefeat(auth): add OAuth2 login support
- Implement Google OAuth provider
- Implement GitHub OAuth provider
- Add session token generation
- Update user model for OAuth data
Closes #789
### Files Changed| Status | File ||--------|------|| M | src/auth/providers.ts || A | src/auth/oauth/google.ts || A | src/auth/oauth/github.ts || M | src/models/user.ts || A | tests/auth/oauth.test.ts |
### Stats- 5 files changed- 234 insertions(+)- 12 deletions(-)
### Next Steps```bash# Push to remotegit push -u origin feature/auth-improvements
# Create PRgh pr create## Pre-Commit Checks
Before committing:- [ ] No secrets in staged files- [ ] No debug statements- [ ] No TODO comments (unless intentional)- [ ] Code is formatted
## Amending Commits
If pre-commit hooks modify files:```bash# Stage modified files and amendgit add -Agit commit --amend --no-editVariations
Section titled “Variations”Modify behavior via CLAUDE.md:
- Commit message format
- Required sections
- Issue reference format
- Co-author settings
Gap Analysis Rule
Section titled “Gap Analysis Rule”Always identify gaps and suggest next steps to users. In case there is no gaps anymore, then AI should clearly state that there is no gap left.