Command Palette

Search for a command to run...

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

git-branch-pr-workflow

БесплатноЗапускает вложенные скриптыНе проверен

Branch management and PR workflows — git switch/restore, GitHub MCP. Use when creating branches, opening PRs, or working with feature branches.

laurigatesот laurigates★ 61 звезда на GitHub4 установки в других каталогах

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

Git Branch PR Workflow

When to Use This Skill

Use this skill when... Use the alternative when...
Designing the overall branch + PR workflow (main-branch dev, MCP integration) Use git-branch-naming to pick or audit a single branch name
Choosing between git switch, git restore, and feature-branch push patterns Use git-rebase-patterns for linear-history cleanup and stacked PRs
Creating PRs through GitHub MCP tools rather than gh pr create Use git-pr to create PRs from a pushed branch via the gh CLI
Coordinating commit -> push -> PR end-to-end Use git-commit-push-pr for the consolidated commit+push+PR macro

Expert guidance for branch management, pull request workflows, and GitHub integration using modern Git commands and linear history practices.

Core Expertise

  • Main-Branch Development: Work on main locally, push to remote feature branches for PRs
  • Modern Git Commands: Use git switch and git restore instead of checkout
  • Branch Naming: See git-branch-naming skill
  • Linear History: Rebase-first workflow, squash merging - see git-rebase-patterns for advanced patterns
  • GitHub MCP Integration: Use mcp__github__* tools instead of gh CLI

Main-Branch Development (Preferred)

Develop directly on main, push to remote feature branches for PRs. This eliminates local branch management overhead.

Basic Workflow

# All work happens on main
git switch main
git pull origin main

# Make changes, commit on main
git add file.ts
git commit -m "feat(auth): add OAuth2 support"

# Push to remote feature branch (creates PR target)
git push origin main:feat/auth-oauth2

# Create PR using GitHub MCP (head: feat/auth-oauth2, base: main)

Multi-PR Workflow (Sequential Commits)

When you have commits for multiple PRs on main, push specific commit ranges to different remote branches:

# Commits on main:
# abc1234 feat(auth): add OAuth2 support       <- PR #1
# def5678 feat(auth): add token refresh        <- PR #1
# ghi9012 fix(api): handle timeout edge case   <- PR #2

# Push first 2 commits to auth feature branch
git push origin abc1234^..def5678:feat/auth-oauth2

# Push remaining commit to fix branch
git push origin ghi9012^..ghi9012:fix/api-timeout

# Alternative: push from a specific commit to HEAD
git push origin def5678..HEAD:fix/api-timeout

Commit range patterns:

  • git push origin <start>^..<end>:<remote-branch> - Push commit range (inclusive)
  • git push origin <commit>..<commit>:<remote-branch> - Push range (exclusive start)
  • git push origin <commit>..HEAD:<remote-branch> - Push from commit to current HEAD
  • git push origin main:<remote-branch> - Push entire main to remote branch

Benefits

  • No local branch juggling - Always on main
  • Always on latest main - No branch drift
  • Clean local state - No stale branches to clean up
  • Remote branches are ephemeral - Deleted after PR merge
  • Simpler mental model - One local branch, many remote targets

Modern Git Commands (2025)

Use git switch for branches and git restore for files instead of git checkout / git reset. See references/modern-git-commands.md for the forms and the legacy-to-modern migration table.

Branch Naming

For comprehensive branch naming conventions including type prefixes, issue linking, and validation patterns, see git-branch-naming.

Quick reference: {type}/{issue}-{description} (e.g., feat/123-user-auth)

Linear History Workflow

Main-branch development (above) is preferred. For a local feature branch (multi-day or experimental work), squash merging, and interactive rebase cleanup, see references/local-feature-branches.md.

Advanced Rebase Patterns

For advanced rebase techniques including --reapply-cherry-picks, --update-refs, --onto, stacked PR workflows, and combining flags, see git-rebase-patterns.

GitHub MCP Integration

Use GitHub MCP tools for all GitHub operations:

# Get repository information
mcp__github__get_me()  # Get authenticated user info

# List and create PRs
mcp__github__list_pull_requests(owner="owner", repo="repo")
mcp__github__create_pull_request(
  owner="owner",
  repo="repo",
  title="feat: add authentication",
  head="feat/auth",
  base="main",
  body="## Summary\n- JWT authentication\n- OAuth support\n\nCloses #123"
)

# Update PRs
mcp__github__update_pull_request(
  owner="owner",
  repo="repo",
  pullNumber=42,
  title="Updated title",
  state="open"
)

# List and create issues
mcp__github__list_issues(owner="owner", repo="repo")

Best Practices

Always force-push with --force-with-lease, never to main/shared branches. For the daily rebase-onto-main routine and rebase conflict handling, see [references/l

Полный SKILL.md на GitHub

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

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

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

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

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

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

Bash(bash ${CLAUDE_PLUGIN_ROOT}/skills/git-branch-pr-workflow/scripts/pr-context.sh *)
Bash(git switch *)
Bash(git pull *)
Bash(git fetch *)
Bash(git status *)
Bash(git add *)
Bash(git commit *)
Bash(git push *)
Bash(git log *)
Bash(git diff *)
Bash(git restore *)
Bash(git rebase *)
Bash(git merge *)
Read
mcp__github__create_pull_request
mcp__github__list_pull_requests
mcp__github__update_pull_request

Вложенные файлы

REFERENCE.mdreferences/local-feature-branches.mdreferences/modern-git-commands.mdscripts/pr-context.sh

FAQ

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

Branch management and PR workflows — git switch/restore, GitHub MCP. Use when creating branches, opening PRs, or working with feature branches.

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

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

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

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

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

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