| name | git-workflow |
| description | Automated git workflow helpers for common development tasks like creating feature branches, cleaning up merged branches, and interactive rebasing. Use when the user mentions git branching, branch cleanup, feature workflow, or git automation. No prerequisites required - uses native git commands. |
| compatibility | Requires git installed (available in most development environments) |
| metadata | {"requires-setup":false} |
Git Workflow Automation
Automated helpers for common git workflows and branch management tasks.
No Setup Required
This skill uses native git commands and bash scripts - no additional tools or SDKs needed. Works immediately in any environment with git installed.
Quick Start
Create Feature Branch
Create a new feature branch following naming conventions:
cd /path/to/repo
bash ~/.claude/skills/git-workflow/scripts/create-feature-branch.sh
bash ~/.claude/skills/git-workflow/scripts/create-feature-branch.sh "add-user-auth"
Clean Up Merged Branches
Remove local branches that have been merged to main/master:
cd /path/to/repo
bash ~/.claude/skills/git-workflow/scripts/cleanup-merged-branches.sh --dry-run
bash ~/.claude/skills/git-workflow/scripts/cleanup-merged-branches.sh
bash ~/.claude/skills/git-workflow/scripts/cleanup-merged-branches.sh --force
Interactive Rebase Helper
Simplified interactive rebase with common options:
cd /path/to/repo
bash ~/.claude/skills/git-workflow/scripts/interactive-rebase.sh 3
bash ~/.claude/skills/git-workflow/scripts/interactive-rebase.sh abc123
bash ~/.claude/skills/git-workflow/scripts/interactive-rebase.sh main
Available Scripts
All scripts are located in the skill's scripts/ directory and can be run with bash.
| Script | Purpose | Usage |
|---|
create-feature-branch.sh | Create feature branches with naming conventions | bash script.sh [feature-name] |
cleanup-merged-branches.sh | Clean up merged branches | bash script.sh [--dry-run|--force] |
interactive-rebase.sh | Interactive rebase helper | bash script.sh <commit-count|ref> |
Workflow Examples
Starting a New Feature
git checkout main
git pull origin main
bash ~/.claude/skills/git-workflow/scripts/create-feature-branch.sh "user-authentication"
git push -u origin feature/user-authentication
Cleaning Up After PR Merge
git checkout main
git pull origin main
bash ~/.claude/skills/git-workflow/scripts/cleanup-merged-branches.sh --dry-run
bash ~/.claude/skills/git-workflow/scripts/cleanup-merged-branches.sh
Squashing Commits Before PR
bash ~/.claude/skills/git-workflow/scripts/interactive-rebase.sh 5
Safety Features
All scripts include:
- Dry run mode - Preview changes before applying
- Confirmation prompts - Ask before destructive operations
- Current branch protection - Won't delete the branch you're on
- Main/master protection - Won't delete main branches
- Uncommitted changes check - Warns if working directory is dirty
Prerequisites
- git - Installed and configured (available in most dev environments)
- bash - Standard shell (available on Linux, macOS, and Git Bash on Windows)
No additional tools, SDKs, or environment variables required.