Command Palette

Search for a command to run...

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

git-pr-helper

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

Git workflow assistant for pull request creation, branch management, and merge coordination. Use when creating PRs, merging branches, resolving conflicts, or…

centminmodот centminmod★ 32 звезды на GitHub6 установок в других каталогах

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

Git PR Helper

Expert at managing git workflows for pull requests, merges, and branch management with a focus on safety, quality, and best practices.

Core Mission

Assist with pull request creation, branch management, merge coordination, and conflict resolution while ensuring code quality and preventing data loss.

When to Use This Skill

Use this skill when:

  • Creating a pull request from a feature branch
  • Merging branches (feature → main/master)
  • Resolving merge conflicts
  • Cleaning up old session or feature branches
  • Generating PR descriptions from commits
  • Checking if work is ready to merge
  • Recovering from git mistakes

Do NOT use this skill for:

  • Preventing file deletion (use git hooks + CLAUDE.md instead)
  • Creating session branches at workflow start (use CLAUDE.md guidance)
  • Enforcing branch policies (use git hooks instead)

Skill Capabilities

1. Pull Request Creation

Purpose: Create high-quality pull requests with comprehensive descriptions

Create PR with Generated Description

To create a PR:

  1. Verify we're on a feature branch:

    CURRENT_BRANCH=$(git branch --show-current)
    if [ "$CURRENT_BRANCH" = "main" ] || [ "$CURRENT_BRANCH" = "master" ]; then
        echo "❌ ERROR: Cannot create PR from main/master branch"
        exit 1
    fi
    echo "✓ Current branch: $CURRENT_BRANCH"
    
  2. Check git status is clean:

    if [ -n "$(git status --porcelain)" ]; then
        echo "⚠️  WARNING: Uncommitted changes detected"
        git status --short
        echo ""
        echo "Commit these changes before creating PR? (y/n)"
        # Ask user via AskUserQuestion tool
    else
        echo "✓ Working tree clean"
    fi
    
  3. Determine base branch:

    # Try to detect default branch
    BASE_BRANCH=$(git remote show origin 2>/dev/null | grep 'HEAD branch' | cut -d' ' -f5)
    
    # Fallback to checking what exists
    if [ -z "$BASE_BRANCH" ]; then
        if git show-ref --verify --quiet refs/heads/main; then
            BASE_BRANCH="main"
        elif git show-ref --verify --quiet refs/heads/master; then
            BASE_BRANCH="master"
        else
            echo "⚠️  Cannot detect base branch. Please specify manually."
        fi
    fi
    
    echo "Base branch: $BASE_BRANCH"
    
  4. Get all commits on this branch:

    # Get commit history since branch diverged from base
    git log $BASE_BRANCH..HEAD --oneline
    
    # Get detailed commit info
    git log $BASE_BRANCH..HEAD --format="%h %s%n%b" --reverse
    
  5. Get diff summary:

    # File changes summary
    git diff $BASE_BRANCH...HEAD --stat
    
    # List changed files
    git diff $BASE_BRANCH...HEAD --name-only
    
  6. Generate PR description:

    Analyze commits and changes to create:

    ## Summary
    - [Brief bullet points of main changes]
    - [Focus on WHY, not WHAT]
    - [User-facing impact]
    
    ## Changes Made
    - [Detailed technical changes]
    - [Components affected]
    - [API changes if applicable]
    
    ## Testing
    - [ ] Unit tests added/updated
    - [ ] Manual testing completed
    - [ ] Edge cases considered
    - [ ] Documentation updated
    
    ## Related Issues
    Closes #[issue-number] (if applicable)
    
    ## Notes for Reviewers
    [Any context reviewers should know]
    [Areas needing special attention]
    
  7. Check if remote tracking branch exists:

    if git rev-parse --verify --quiet origin/$CURRENT_BRANCH >/dev/null 2>&1; then
        echo "✓ Remote branch exists"
    else
        echo "⚠️  Remote branch does not exist. Need to push first."
        echo "Push now? (y/n)"
        # If yes: git push -u origin $CURRENT_BRANCH
    fi
    
  8. Create PR using GitHub CLI:

    gh pr create \
        --title "[Generated title from commits]" \
        --body "$(cat <<'EOF'
    [Generated PR description]
    EOF
    )" \
        --base "$BASE_BRANCH" \
        --head "$CURRENT_BRANCH"
    
  9. Update CLAUDE-activeContext.md (if exists):

    if [ -f CLAUDE-activeContext.md ]; then
        # Add PR link to active context
        PR_URL=$(gh pr view --json url -q .url)
        echo "PR created: $PR_URL" >> CLAUDE-activeContext.md
    fi
    

Generate PR Description Only

To generate a PR description without creating the PR:

  1. Follow steps 1-6 above
  2. Output the generated description for user review
  3. Ask if user wants to create PR with this description

2. Merge Coordination

Purpose: Safely merge branches with conflict detection and resolution guidance

Check Merge Readiness

To check if branch is ready to merge:

echo "=== MERGE READINESS CHECK ==="
echo ""

# 1. Check current branch
CURRENT_BRANCH=$(git branch --show-current)
BASE_BRANCH=${BASE_BRANCH:-main}

if [ "$CURRENT_BRANCH" = "$BASE_BRANCH" ]; then
    echo "❌ ERROR: Already on base branch $BASE_BRANCH"
    exit 1
fi

echo "✓ Feature branch: $CURRENT_BRANCH"
echo ""

# 2. Check for uncommitted changes
if
Полный SKILL.md на GitHub

Установить git-pr-helper в Claude Code и Claude Desktop

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

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

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

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

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

Bash
Read
Write
Edit
Glob
Grep

FAQ

Что делает скилл git-pr-helper?

Git workflow assistant for pull request creation, branch management, and merge coordination. Use when creating PRs, merging branches, resolving conflicts, or cleaning up session branches. Provides intelligent PR descriptions, safety checks, and workflow guidance.

Как установить скилл git-pr-helper?

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

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

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

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

Сравнить git-pr-helper с