Loading...
Loading...
Intelligently analyze code changes and split them into multiple logical commits based on functionality and change types. This skill should be used when users want to commit code changes, especially when there are multiple unrelated changes in the working directory.
npx skill4agent add tzuchaine/ai-skills commit-helpergit statusgit diffCommit 1 (feat): User Authentication
- src/auth/login.ts
- src/auth/middleware.ts
- src/routes/auth.ts
- tests/auth.test.ts
Commit 2 (fix): Profile validation bug
- src/user/profile.ts
- tests/user.test.ts
Commit 3 (refactor): Error handling
- src/utils/errors.ts
- src/middleware/errorHandler.ts
- Multiple files using the new error handlingtype(scope): brief description
Detailed explanation of why this change was made.
What problem was solved? What was the previous behavior?
How does this change improve the codebase?featfixrefactordocstestchoreperfstyleciauthuserapidatabaseLoginFormProfilePagevalidationerror-handlingloggingfeat(auth): add JWT-based authentication system
Implemented complete authentication system using JWT tokens to replace
the previous session-based approach. This provides better scalability
for our API and supports stateless authentication across multiple servers.🔍 Analyzed X files with changes
💡 Proposed commit plan:
【Commit 1/N】type(scope): description
Files:
├─ path/to/file1.ts
├─ path/to/file2.ts
└─ path/to/file3.ts
Commit message:
type(scope): brief description
Detailed body explaining why...
【Commit 2/N】type(scope): description
Files:
├─ path/to/file4.ts
└─ path/to/file5.ts
Commit message:
type(scope): brief description
Detailed body explaining why...
---
⚠️ Next: Code quality checks (linter + type checking)
Do you approve this commit plan? (yes/no/adjust)npm run linteslint .prettier --check .tsc --noEmitnpm run type-checkmypy .git add file1 file2 file3git commit -m "$(cat <<'EOF'
type(scope): brief description
Detailed body explaining the change and its rationale.
Additional context if needed.
EOF
)"git add -Agit add .✅ Successfully created N commits:
1. abc1234 - feat(auth): add JWT authentication
2. def5678 - fix(user): fix profile validation
3. ghi9012 - refactor(api): improve error handling
All changes committed locally.
Use 'git push' to push to remote when ready.User: Please commit my code
Claude: 🔍 Analyzing code changes...
[Runs git status and git diff]
🔍 Analyzed 8 files with changes
💡 Proposed commit plan (3 commits):
【Commit 1/3】feat(auth): implement user login system
Files:
├─ src/auth/login.ts (new file)
├─ src/auth/types.ts (modified)
├─ src/routes/auth.ts (new file)
└─ tests/auth/login.test.ts (new file)
Commit message:
feat(auth): implement user login system
Added JWT-based login functionality with email/password authentication.
Includes token generation, validation middleware, and complete test coverage.
【Commit 2/3】fix(validation): correct email regex
Files:
├─ src/utils/validation.ts (modified)
└─ tests/utils/validation.test.ts (modified)
Commit message:
fix(validation): correct email regex
Fixed email validation regex to properly handle plus signs and subdomains.
The previous regex would reject valid emails like user+tag@subdomain.example.com.
【Commit 3/3】docs(readme): update installation instructions
Files:
└─ README.md (modified)
Commit message:
docs(readme): update installation instructions
Updated setup guide to include new environment variables needed for
authentication system. Added troubleshooting section for common JWT
configuration issues.
---
⚠️ Next: Code quality checks (linter + type checking)
Do you approve this commit plan?
User: Yes
Claude: ✅ Plan approved. Running code quality checks...
[Runs npm run lint]
✅ Linter passed
[Runs npm run type-check]
✅ Type check passed
Creating commits...
✅ Commit 1/3: feat(auth) - abc1234
✅ Commit 2/3: fix(validation) - def5678
✅ Commit 3/3: docs(readme) - ghi9012
✅ Successfully created 3 commits:
1. abc1234 - feat(auth): implement user login system
2. def5678 - fix(validation): correct email regex
3. ghi9012 - docs(readme): update installation instructions
All changes committed locally.
Use 'git push' to push to remote when ready.git add -pchore(deps)ℹ️ No changes detected in working directory.
Nothing to commit, working tree clean.ℹ️ All changes are already staged.
Do you want to continue with the current staging area, or reset and let
me reorganize commits? (continue/reorganize)❌ Failed to create commit: [error message]
This might be due to:
- Pre-commit hook rejected the commit
- Invalid file permissions
- Git configuration issue
Please resolve the issue and try again.