Git Flow Feature Branch

Command

by davila7 · Added 5mo ago

Claude

Install

npx claude-code-templates@latest --command=cli-tool/components/commands/git --yes

Add to Claude

claude mcp add git-flow-feature-branch

About


allowed-tools: Bash(git:*) argument-hint: <feature-name> description: Create a new Git Flow feature branch from develop with proper naming and tracking

Git Flow Feature Branch

Create new feature branch: $ARGUMENTS

Current Repository State

  • Current branch: !git branch --show-current
  • Git status: !git status --porcelain
  • Develop branch status: !git log develop..origin/develop --oneline 2>/dev/null | head -5 || echo "No remote tracking for develop"

Task

Create a Git Flow feature branch following these steps:

1. Pre-Flight Validation

  • Check git repository: Verify we're in a valid git repository
  • Validate feature name: Ensure $ARGUMENTS is provided and follows naming conventions:
    • ✅ Valid: user-authentication, payment-integration, dashboard-redesign
    • ❌ Invalid: feat1, My_Feature, empty name
  • Check for uncommitted changes:
    • If changes exist, warn user and ask to commit/stash first
    • OR offer to stash changes automatically
  • Verify develop branch exists: Ensure develop branch is present

2. Create Feature Branch

Execute the following workflow:

# Switch to develop branch
git checkout develop

# Pull latest changes from remote
git pull origin develop

# Create feature branch with Git Flow naming convention
git checkout -b feature/$ARGUMENTS

# Set up remote tracking
git push -u origin feature/$ARGUMENTS

3. Provide Status Report

After successful creation, display:

✓ Switched to develop branch
✓ Pulled latest changes from origin/develop
✓ Created branch: feature/$ARGUMENTS
✓ Set up remote tracking: origin/feature/$ARGUMENTS
✓ Pushed branch to remote

🌿 Feature Branch Ready

Branch: feature/$ARGUMENTS
Base: develop
Status: Clean working directory

🎯 Next Steps:
1. Start implementing your feature
2. Make commits using conventional format:
   git commit -m "feat: your changes"
3. Push changes regularly: git push
4. When complete, use /finish to merge back to develop

Tags

CodeAnalysisaitmplclaude-code-templates

From Our Store

View all →
Claude Code

Claude Code Power User Kit

$39+

Advanced Claude Code skills and configurations

OpenClaw

OpenClaw Business Starter Kit

$59+

Set Up Your AI Assistant in 60 Minutes