pr-workflow-manager
Best practices and automation helpers for creating and maintaining high-quality pull requests
What this skill does
# PR Workflow Manager ## Purpose 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. ## Activation cues - Requests to create a PR, pull request, or merge request - Questions about git upstream tracking or remote branch configuration - Follow-up after pushing branches or creating PRs - Troubleshooting PR-related git issues - Team workflow standardization requests ## Primary commands | 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` | ## Automation helper Use the bundled script for complete PR creation with all best practices: ```bash skills/pr_workflow_manager/scripts/create_pr_with_upstream.sh [--title "PR Title"] [--body "PR Description"] ``` The script: 1. Validates current branch is not main/master 2. Pushes branch with upstream tracking (`-u` flag) 3. Creates PR using `gh pr create` 4. Verifies upstream tracking is set 5. Displays PR URL and branch status ## Decision guide 1. **Creating new PR** → Use automation script OR `git push -u origin HEAD && gh pr create` 2. **PR already created but no upstream** → `git branch --set-upstream-to=origin/$(git branch --show-current)` 3. **Fixing PR after comments** → Commit changes, `git push` (upstream already set) 4. **Checking PR status** → `gh pr view` or `gh pr checks` 5. **Creating PR from issue** → `gh issue develop <number> --checkout && git push -u origin HEAD && gh pr create` ## Critical Rules - **🚨 ALWAYS set upstream tracking**: Use `git push -u origin HEAD` OR manually set with `git branch --set-upstream-to=origin/BRANCH_NAME` - **🚨 NEVER push without `-u` on first push**: Prevents "no tracking information" errors - **🚨 CHECK upstream after PR creation**: Run `git branch -vv` to verify tracking is configured - **🚨 USE automation script for consistency**: Ensures all steps are followed ## Upstream Tracking Benefits - ✅ `git push` and `git pull` work without arguments - ✅ Git status shows "ahead/behind" information - ✅ `gh pr` commands work correctly - ✅ Prevents accidental pushes to wrong branch - ✅ Enables `git push --force-with-lease` safety ## Common Issues & Solutions ### Issue: "fatal: The current branch has no upstream branch" **Solution**: `git branch --set-upstream-to=origin/$(git branch --show-current)` ### Issue: PR created but git status doesn't show tracking **Solution**: Run upstream setup command above, then `git branch -vv` to verify ### Issue: Want to change PR base branch **Solution**: `gh pr edit --base new-base-branch` ### Issue: Multiple commits, want to squash **Solution**: `git rebase -i HEAD~N` (where N is number of commits), then `git push --force-with-lease` ## PR Description Best Practices Include in every PR description: 1. **Summary**: What does this PR do? 2. **Changes**: Bullet list of specific changes 3. **Benefits**: Why is this valuable? 4. **Test Plan**: How was this tested? 5. **Related Issues**: Link to issues/tickets ## Workflow Integration This skill integrates with: - `/pr` command - Complete PR workflow automation - `/push` command - Branch pushing with PR creation - `/pushl` command - Push with automatic labeling - Build/test/lint autopilot - Pre-PR validation ## PR Branch Verification (MANDATORY) **CRITICAL: Always verify the correct PR remote branch before working on merge conflicts or PR operations.** ### Forbidden Actions - Guessing or assuming PR branch names - Using branch names that "look like" they match the PR number - Working on branches without verifying they're the actual PR branch ### Required Steps 1. **Verify PR branch name**: - `gh pr view <number> --json headRefName` - Or: `git log --oneline --all --grep="<PR-number>"` 2. **Fetch the correct remote branch**: `git fetch origin <actual-branch-name>` 3. **Reset to the correct branch**: `git reset --hard origin/<actual-branch-name>` 4. **Verify before proceeding**: `git log --oneline -5` ### Example ```bash # 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. ## Reporting expectations - Confirm upstream tracking is set: `git branch -vv` output - Display PR URL after creation - Show current branch status and tracking information - Highlight any issues with upstream configuration - Provide next steps if PR creation partially fails
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.