commit-and-push
Create a git commit and push
When & Why to Use This Skill
This Claude skill automates the essential Git workflow by intelligently analyzing code diffs to generate descriptive commit messages, staging changes, and pushing them to remote repositories. It enhances developer productivity by streamlining the transition from local development to version control, including automatic Pull Request (PR) creation for feature branches.
Use Cases
- Automated Commit Management: Automatically analyze staged and unstaged changes to create meaningful, context-aware commit messages without manual typing.
- Streamlined GitHub Workflows: Detect feature branches and automatically trigger 'gh pr create' to initiate the code review process immediately after pushing.
- Efficient Code Shipping: Rapidly push updates to the main branch or remote origins, ensuring that the CI/CD pipeline is triggered as soon as development tasks are completed.
- Consistent Version Control: Maintain a clean and professional git history by ensuring every push follows a standardized analysis and commitment process.
| name | commit-and-push |
|---|---|
| allowed-tools | Bash(git add:*), Bash(git status:*), Bash(git commit:*), Bash(git push:*), Bash(gh pr create:*) |
| description | Create a git commit and push |
Context
- Current git status: !
git status - Current git diff (staged and unstaged changes): !
git diff HEAD - Current branch: !
git branch --show-current - Recent commits: !
git log --oneline -10
Your task
- Analyze the diff in depth - understand what changed and why
- Create a single commit with a clear, descriptive message
- Push to origin
- If on a feature branch: create a PR using
gh pr create - If on main: just push (no PR needed)