From claude-commands
Automates PR creation with upstream tracking and validates branch setup. Prevents common git errors using GitHub CLI best practices.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-commands:pr-workflow-managerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Provide Claude with best practices for creating and managing pull requests with proper upstream tracking, ensuring consistent PR workflows and preventing common git configuration issues.
Provide Claude with best practices for creating and managing pull requests with proper upstream tracking, ensuring consistent PR workflows and preventing common git configuration issues.
| Scenario | Command |
|---|---|
| Create PR with upstream | gh pr create && git branch --set-upstream-to=origin/$(git branch --show-current) |
| Set upstream for existing PR | git branch --set-upstream-to=origin/$(git branch --show-current) |
| Check upstream status | git branch -vv |
| Create PR from issue | gh issue develop <number> --checkout && git push -u origin HEAD |
| View PR status | gh pr view |
| List all PRs | gh pr list |
Use the bundled script for complete PR creation with all best practices:
skills/pr_workflow_manager/scripts/create_pr_with_upstream.sh [--title "PR Title"] [--body "PR Description"]
The script:
-u flag)gh pr creategit push -u origin HEAD && gh pr creategit branch --set-upstream-to=origin/$(git branch --show-current)git push (upstream already set)gh pr view or gh pr checksgh issue develop <number> --checkout && git push -u origin HEAD && gh pr creategit push -u origin HEAD OR manually set with git branch --set-upstream-to=origin/BRANCH_NAME-u on first push: Prevents "no tracking information" errorsgit branch -vv to verify tracking is configuredgit push and git pull work without argumentsgh pr commands work correctlygit push --force-with-lease safetySolution: git branch --set-upstream-to=origin/$(git branch --show-current)
Solution: Run upstream setup command above, then git branch -vv to verify
Solution: gh pr edit --base new-base-branch
Solution: git rebase -i HEAD~N (where N is number of commits), then git push --force-with-lease
Include in every PR description:
This skill integrates with:
/pr command - Complete PR workflow automation/push command - Branch pushing with PR creation/pushl command - Push with automatic labelingCRITICAL: Always verify the correct PR remote branch before working on merge conflicts or PR operations.
gh pr view <number> --json headRefNamegit log --oneline --all --grep="<PR-number>"git fetch origin <actual-branch-name>git reset --hard origin/<actual-branch-name>git log --oneline -5# WRONG - Don't guess
git fetch origin pull/3096/head:pr-3096
# CORRECT - Verify first
gh pr view 3096 --json headRefName # Returns actual branch name
git fetch origin claude/byok-settings-feature-0WgQP
git reset --hard origin/claude/byok-settings-feature-0WgQP
Root Cause Prevention: Multiple branches may exist with similar names. Always verify from PR metadata.
git branch -vv outputnpx claudepluginhub jleechanorg/claude-commands --plugin claude-commandsCreates GitHub Pull Requests using GitHub CLI: detects existing PRs for branches, pushes changes, generates titles/bodies from commits. Handles monorepos/submodules. Use for /create-pr or PR/review requests.
Fixes missing remote branch tracking after creating PRs, preventing 'no remote' and 'no upstream' status issues.
Creates GitHub pull requests with formatted descriptions, labels, issue references, draft mode, reviewers, and base branch selection from pushed branches. Use for 'create PR' or 'submit for review'.