From claude-commands
Provides best practices, GitHub CLI commands, and bash script for creating PRs with upstream tracking and maintaining workflows. Useful for PR creation, git tracking fixes, and standardization.
npx claudepluginhub joshuarweaver/cascade-code-general-misc-2 --plugin jleechanorg-claude-commandsThis skill uses the workspace's default tool permissions.
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.
Ensures proper Git remote branch tracking after PR creation to fix 'no remote' and 'no upstream' status issues. Guides -u flag pushes, upstream setup, and auto-config.
Creates 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.
Guides Git branch management and GitHub PR workflows using main-branch development, modern git switch/restore commands, and MCP tools for creating, listing, and updating PRs.
Share bugs, ideas, or general feedback.
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 output