Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

claude-git-branching

БесплатноБез исполняемых скриптовНе проверен

Expert Git workflow management for Claude Code sessions with branch naming conventions, push retry logic, conflict resolution, and PR automation specifically…

jackspaceот jackspace★ 16 звёзд на GitHub23 установки в других каталогах

Об этом скилле

Claude Git Branching

Master Git workflows optimized for Claude Code development sessions with intelligent branching, retry logic, and automated PR creation.

Overview

This skill provides battle-tested Git workflows specifically designed for Claude Code sessions, including:

  • Claude-specific branch naming conventions
  • Automatic push retry with exponential backoff
  • Multi-repository coordination
  • Conflict-free collaboration patterns
  • Automated PR creation and management

When to Use

Use this skill when:

  • Starting a new Claude Code development session
  • Managing multiple feature branches across sessions
  • Dealing with intermittent network issues during push
  • Creating PRs from Claude-generated code
  • Coordinating work across multiple repositories
  • Following team Git conventions for AI-assisted development
  • Handling merge conflicts in long-running sessions

Branch Naming Conventions

Claude Code Standard Format

# Standard format
claude/[feature-name]-[session-id]

# Examples
claude/harvest-claude-skills-01MtCwKhDQhWyZCgwfkhdVG5
claude/fix-auth-bug-01NAB2cDE3FgHiJ4KlM5NoPq
claude/add-api-endpoints-01PQRsT6UvWxY7ZaBcD8EfGh

Format requirements:

  • Prefix: Must start with claude/
  • Feature name: Kebab-case description of work
  • Session ID: Unique identifier for the session
  • Maximum length: 100 characters recommended

Why this format?

  • ✅ Clear AI-assisted development marker
  • ✅ Prevents conflicts with human developer branches
  • ✅ Traceable to specific session
  • ✅ Easy to filter and manage
  • ✅ Works with GitHub access controls (required for push)

Alternative Formats

# Team-based
claude/[team]/[feature]-[session-id]
claude/backend/api-optimization-01ABC

# Priority-based
claude/[priority]/[feature]-[session-id]
claude/urgent/security-patch-01DEF

# Issue-based
claude/issue-[number]-[session-id]
claude/issue-1234-01GHI

Branch Creation Workflow

Step 1: Check Current State

# Verify current branch
git branch --show-current

# Check status
git status

# View recent branches
git branch -a | grep "claude/" | head -10

Step 2: Create Feature Branch

# From main/master
git checkout main
git pull origin main

# Create Claude branch
FEATURE="add-user-authentication"
SESSION_ID="01MtCwKhDQhWyZCgwfkhdVG5"
BRANCH="claude/${FEATURE}-${SESSION_ID}"

git checkout -b "$BRANCH"
echo "Created branch: $BRANCH"

Step 3: Verify Branch Name

# Ensure proper format
CURRENT_BRANCH=$(git branch --show-current)

if [[ ! "$CURRENT_BRANCH" =~ ^claude/.+-[0-9A-Za-z]{20,}$ ]]; then
    echo "⚠️  Warning: Branch name doesn't match Claude format"
    echo "Expected: claude/[feature-name]-[session-id]"
    echo "Got: $CURRENT_BRANCH"
fi

Push with Retry Logic

Standard Push Pattern

#!/bin/bash
# push-with-retry.sh - Push with exponential backoff

BRANCH=$(git branch --show-current)
MAX_RETRIES=4
RETRY_COUNT=0
DELAYS=(2 4 8 16)  # Exponential backoff in seconds

echo "Pushing branch: $BRANCH"

while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
    if git push -u origin "$BRANCH"; then
        echo "✓ Successfully pushed to origin/$BRANCH"
        exit 0
    else
        EXIT_CODE=$?
        RETRY_COUNT=$((RETRY_COUNT + 1))

        # Check if it's a 403 error (branch name issue)
        if git push -u origin "$BRANCH" 2>&1 | grep -q "403"; then
            echo "✗ Push failed with 403 - Check branch naming convention"
            echo "Branch must start with 'claude/' and end with session ID"
            exit 1
        fi

        if [ $RETRY_COUNT -lt $MAX_RETRIES ]; then
            DELAY=${DELAYS[$RETRY_COUNT-1]}
            echo "⚠️  Push failed (attempt $RETRY_COUNT/$MAX_RETRIES)"
            echo "Retrying in ${DELAY}s..."
            sleep $DELAY
        fi
    fi
done

echo "✗ Push failed after $MAX_RETRIES attempts"
exit 1

Usage:

chmod +x push-with-retry.sh
./push-with-retry.sh

Inline Retry Pattern

# Quick inline version
for i in {1..4}; do
    if git push -u origin $(git branch --show-current); then
        echo "✓ Pushed successfully"
        break
    else
        [ $i -lt 4 ] && echo "Retry $i/4..." && sleep $((2**i))
    fi
done

Commit Best Practices

Atomic Commits

# Make focused, atomic commits
git add src/auth/login.ts
git commit -m "feat: Add JWT-based login authentication"

git add src/auth/middleware.ts
git commit -m "feat: Add auth middleware for protected routes"

git add tests/auth.test.ts
git commit -m "test: Add authentication test suite"

Commit Message Format

# Format: <type>: <description>
# Types: feat, fix, docs, refactor, test, chore, style, perf

git commit -m "$(cat <<'EOF'
feat: Add user authentication system

- Implement JWT-based authentication
- Add login/logout endpoints
- Create auth middleware
- Add session management

Closes #123
EOF
)"

Conventional Commits

# Feature
git commit -m
Полный SKILL.md на GitHub

Установить claude-git-branching в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл claude-git-branching?

Expert Git workflow management for Claude Code sessions with branch naming conventions, push retry logic, conflict resolution, and PR automation specifically designed for AI-assisted development workflows.

Как установить скилл claude-git-branching?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл claude-git-branching запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить claude-git-branching с