Skip to content
create-feature-branch logo

Create Feature Branch

create-feature-branch

Create properly named feature branch from development with remote tracking, following WescoBar naming conventions and git best practices

SKILL.md

Full skill instructions

Create Feature Branch

Purpose

Create a feature branch with proper naming convention, sync with remote development branch, and set up remote tracking for WescoBar workflows.

When to Use

  • Conductor workflow Phase 2, Step 1 (Branch Setup)
  • Before starting implementation of new feature
  • When picking up GitHub issue
  • As first step in feature development workflow

Naming Convention

feature/​issue-<NUMBER>-<short-description>

Examples:

  • feature/​issue-137-dark-mode
  • feature/​issue-42-character-portraits
  • feature/​issue-89-gemini-caching

Rules:

  • Always start with feature/
  • Include issue-<NUMBER> for GitHub issue linking
  • Use kebab-case for description
  • Keep description under 40 characters
  • Use descriptive but concise naming

Instructions

Step 1: Validate Inputs

ISSUE_NUMBER=$1
ISSUE_TITLE=$2  # Optional: for auto-generating description

if [ -z "$ISSUE_NUMBER" ]; then
  echo "❌ Error: Issue number required"
  exit 1
fi

# Validate issue number is numeric
if ! [[ "$ISSUE_NUMBER" =~ ^[0-9]+$ ]]; then
  echo "❌ Error: Issue number must be numeric"
  exit 1
fi

Step 2: Generate Branch Name

# Generate short description from issue title if provided
if [ -n "$ISSUE_TITLE" ]; then
  # Convert to lowercase, replace spaces with hyphens, remove special chars
  SHORT_DESC=$(echo "$ISSUE_TITLE" | \
    tr '[:upper:]' '[:lower:]' | \
    sed 's/[^a-z0-9 ]//g' | \
    tr -s ' ' '-' | \
    cut -d'-' -f1-5)  # Keep first 5 words max
else
  # Manual description required
  echo "Enter short description (kebab-case):"
  read SHORT_DESC
fi

BRANCH_NAME="feature/​issue-${ISSUE_NUMBER}-${SHORT_DESC}"

echo "Branch name: $BRANCH_NAME"

Step 3: Check if Branch Already Exists

# Check local branches
if git rev-parse --verify "$BRANCH_NAME" 2>/​dev/​null; then
  echo "⚠️ Branch already exists locally: $BRANCH_NAME"
  echo "Options:"
  echo "  1. Checkout existing branch"
  echo "  2. Create new branch with different name"
  echo "  3. Delete and recreate"

  read -p "Choose (1/​2/​3): " CHOICE

  case $CHOICE in
    1)
      git checkout "$BRANCH_NAME"
      echo "✅ Checked out existing branch"
      exit 0
      ;;
    2)
      echo "Enter new description:"
      read NEW_DESC
      BRANCH_NAME="feature/​issue-${ISSUE_NUMBER}-${NEW_DESC}"
      ;;
    3)
      git branch -D "$BRANCH_NAME"
      echo "Deleted existing branch - will recreate"
      ;;
  esac
fi

# Check remote branches
if git ls-remote --heads origin "$BRANCH_NAME" | grep -q "$BRANCH_NAME"; then
  echo "⚠️ Branch exists on remote: $BRANCH_NAME"
  echo "Fetching remote branch..."
  git fetch origin "$BRANCH_NAME"
  git checkout --track "origin/​$BRANCH_NAME"
  echo "✅ Checked out remote branch"
  exit 0
fi

Step 4: Sync with Development

echo "→ Syncing with development branch..."

# Checkout development
git checkout development

# Pull latest changes
if ! git pull origin development; then
  echo "❌ Error: Failed to pull latest development"
  echo "Resolve conflicts and try again"
  exit 1
fi

echo "✅ Development branch up to date"

Step 5: Create Feature Branch

echo "→ Creating feature branch: $BRANCH_NAME"

# Create and checkout new branch
if ! git checkout -b "$BRANCH_NAME"; then
  echo "❌ Error: Failed to create branch"
  exit 1
fi

echo "✅ Feature branch created"

Step 6: Push to Remote with Tracking

echo "→ Pushing to remote with tracking..."

# Push with upstream tracking
if ! git push -u origin "$BRANCH_NAME"; then
  echo "❌ Error: Failed to push to remote"
  echo "Branch created locally but not on remote"
  exit 1
fi

echo "✅ Branch pushed to remote with tracking"

Step 7: Verify Setup

# Verify current branch
CURRENT_BRANCH=$(git branch --show-current)

if [ "$CURRENT_BRANCH" = "$BRANCH_NAME" ]; then
  echo ""
  echo "✅ Feature Branch Setup Complete"
  echo "   Branch: $BRANCH_NAME"
  echo "   Tracking: origin/​$BRANCH_NAME"
  echo "   Base: development"
  echo ""
  echo "Ready for implementation!"
else
  echo "⚠️ Warning: Not on expected branch"
  echo "   Expected: $BRANCH_NAME"
  echo "   Actual: $CURRENT_BRANCH"
fi

Output Format

Success

{
  "status": "success",
  "branch": {
    "name": "feature/​issue-137-dark-mode",
    "issue": 137,
    "base": "development",
    "remote": "origin/​feature/​issue-137-dark-mode",
    "tracking": true
  },
  "message": "Feature branch created and pushed to remote"
}

Branch Already Exists

{
  "status": "success",
  "branch": {
    "name": "feature/​issue-137-dark-mode",
    "existed": true,
    "action": "checked_out"
  },
  "message": "Existing branch checked out"
}

Integration with Conductor

Used in conductor Phase 2, Step 1:

### Phase 2: Branch Setup and Implementation

**Step 1: Create Feature Branch**

**RESUMPTION CHECK**: If feature branch already exists, SKIP this step.

Use `create-feature-branch` skill:
- Input: issue_number, issue_title (from Phase 1)
- Output: branch_name, tracking status

Expected result:
- Branch created: `feature/​issue-137-dark-mode`
- Checked out and ready
- Remote tracking set up
- Base: development (latest)

Record branch name for PR creation in Phase 4.

Error Handling

Development Branch Pull Fails

if ! git pull origin development; then
  echo "❌ Merge conflicts in development branch"
  echo "Action required:"
  echo "  1. Resolve conflicts manually"
  echo "  2. Run: git merge --continue"
  echo "  3. Re-run create-feature-branch"
  exit 1
fi

Remote Push Fails (Network)

# Retry with exponential backoff (from CLAUDE.md)
for i in {1..4}; do
  if git push -u origin "$BRANCH_NAME"; then
    break
  else
    if [ $i -lt 4 ]; then
      DELAY=$((2 ** i))
      echo "⏳ Push failed, retrying in ${DELAY}s..."
      sleep $DELAY
    else
      echo "❌ Push failed after 4 attempts"
      exit 1
    fi
  fi
done

Branch Name Too Long

if [ ${#BRANCH_NAME} -gt 80 ]; then
  echo "⚠️ Branch name too long: ${#BRANCH_NAME} characters"
  echo "Truncating description..."
  SHORT_DESC=$(echo "$SHORT_DESC" | cut -c1-40)
  BRANCH_NAME="feature/​issue-${ISSUE_NUMBER}-${SHORT_DESC}"
fi

Related Skills

  • check-resume-branch - Check if branch exists for resumption
  • push-with-retry - Retry logic for network failures
  • commit-with-validation - Atomic commit before PR

Best Practices

  1. Always sync development first - Ensures latest base
  2. Use descriptive names - But keep under 80 chars
  3. Set up remote tracking - Enables git push without args
  4. Verify branch created - Check git branch --show-current
  5. Handle existing branches - Don't overwrite without confirmation
  6. Retry on network failures - Use exponential backoff

Notes

  • Branch naming follows WescoBar convention
  • Remote tracking simplifies push workflow
  • Development is the base branch (not main/​master)
  • Branch name includes issue number for PR auto-linking
  • Supports resumption by checking for existing branches

More skills from diegosouzapw

accessibility logo
diegosouzapw/awesome-omni-skill

accessibility

Accessibility guidelines for VS Code features — covers accessibility help dialogs, accessible views, verbosity settings, accessibility signals, ARIA alerts/status announcements, keyboard navigation, and ARIA labels/roles. Applies to both new interactive UI surfaces and updates to existing feature...

62 1
View
mermaid-diagrams logo
diegosouzapw/awesome-omni-skill

mermaid-diagrams

Mermaid diagram creation for flowcharts, sequences, ERDs, and more. Generate diagrams from text in markdown files. Use for documentation, architecture diagrams, and visual representations. Triggers on mermaid, flowchart, sequence diagram, ERD, entity relationship, gantt chart, pie chart, class di...

62 1
View
tauri2-react-rust logo
diegosouzapw/awesome-omni-skill

tauri2-react-rust

Guides development of cross-platform desktop apps with Tauri 2, TypeScript, React, and Rust. Use when building Tauri apps, implementing IPC, designing Rust backend or TypeScript/React frontend, when researching or cloning a website (open site, snapshot elements), when verifying local dev or built...

62 1
View
fp-ts-errors logo
diegosouzapw/awesome-omni-skill

fp-ts-errors

Handle errors as values using fp-ts Either and TaskEither for cleaner, more predictable TypeScript code. Use when implementing error handling patterns with fp-ts.

62 0
View
ring:pre-dev-research logo
diegosouzapw/awesome-omni-skill

ring:pre-dev-research

Gate 0 research phase for pre-dev workflow. Dispatches 3 parallel research agents to gather codebase patterns, external best practices, and framework documentation BEFORE creating PRD/TRD. Outputs research.md with file:line references.

62 0
View
create-assistant logo
diegosouzapw/awesome-omni-skill

create-assistant

Create and configure Vapi voice AI assistants with models, voices, transcribers, tools, hooks, and advanced settings. Use when building voice agents, phone bots, customer support assistants, or any conversational AI that handles phone or web calls.

62 0
View
codex-headless logo
diegosouzapw/awesome-omni-skill

codex-headless

Delegiere Aufgaben an OpenAI Codex CLI im Headless-Mode. Nutzt ChatGPT Subscription (KEIN API Key). Nur Workspace-Zugriff, KEIN System-Zugriff. Auto-Accept mit --full-auto. Web-Recherche mit --search.

62 0
View
social-media-scheduler logo
diegosouzapw/awesome-omni-skill

social-media-scheduler

Generate a full week of social media content for any topic. Outputs platform-optimized posts for Twitter/X, LinkedIn, and Instagram with hashtags and posting times.

62 0
View
Data Privacy Compliance logo
diegosouzapw/awesome-omni-skill

Data Privacy Compliance

Data privacy and regulatory compliance specialist for GDPR, CCPA, HIPAA, and international data protection laws. Use when implementing privacy controls, conducting data protection impact assessments, ensuring regulatory compliance, or managing data subject rights. Expert in consent management, da...

62 0
View
triple-review logo
diegosouzapw/awesome-omni-skill

triple-review

Reviews a task using the TRIPLE protocol, as the review agent.

62 0
View
Tech Stack & Architecture Decision logo
diegosouzapw/awesome-omni-skill

Tech Stack & Architecture Decision

Define and document the technology stack and architecture decisions for a project. Use when the user needs to choose a tech stack, make architecture decisions, define infrastructure choices, or document technology selections. Triggers on requests like "define the tech stack", "choose technologies...

62 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View