From scm-utils
This skill should be used when the user asks to "update the PR", "update PR
npx claudepluginhub nsheaps/ai-mktpl --plugin scm-utilsThis skill is limited to using the following tools:
Synchronize a local branch with its remote counterpart and ensure the remote branch is up-to-date with its base branch.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Synchronize a local branch with its remote counterpart and ensure the remote branch is up-to-date with its base branch.
Current branch: !git branch --show-current 2>/dev/null || echo "(not in a git repo)"
PR info for current branch:
!gh pr view --json baseRefName,headRefName,number,title,state 2>/dev/null || echo "(no PR found or gh not authenticated)"
This skill handles the common workflow of keeping a feature branch synchronized:
The goal: ensure the remote feature branch contains all local changes AND is current with its base branch.
Default behavior (no arguments): Use the current directory, get the current branch via git branch --show-current, find the associated PR via gh pr list --head <branch>, and update from the PR's base branch.
Determine the target branch from the provided input. Accept any of:
| Input Type | Example | Resolution |
|---|---|---|
| No input | (empty) | Current directory → current branch → find PR → update |
| PR number | 123, #123 | gh pr view 123 --json headRefName,baseRefName |
| PR URL | https://github.com/org/repo/pull/123 | Parse number, use gh pr view |
| Branch name | feature/my-branch | Use directly, find PR with gh pr list --head <branch> |
| Directory | /path/to/repo | cd there, get current branch, find PR |
Critical: Always query the PR to determine the base branch. Never assume main or master.
# Get branch info from PR
gh pr view <number> --json headRefName,baseRefName,number,url
# Find PR for a branch
gh pr list --head <branch-name> --json number,baseRefName --limit 1
Execute these steps in order:
git fetch --all --prune
# Extract base branch name
BASE_BRANCH=$(gh pr view <number> --json baseRefName --jq '.baseRefName')
If no PR exists for the branch, ask the user what the base branch should be.
git checkout <feature-branch>
git merge origin/$BASE_BRANCH --no-edit
If conflicts occur, see Conflict Resolution.
git pull origin <feature-branch> --no-edit
If conflicts occur, handle them before proceeding.
git push origin <feature-branch>
Confirm the remote branch is updated:
gh pr view <number> --json commits,mergeable,mergeStateStatus
When merge conflicts occur:
Resolve directly when the conflict is clearly one of:
For conflicts requiring analysis, delegate to specialized agents:
Use Explore agent with haiku model to understand:
Use Plan agent to determine:
Execute the resolution - The executing agent owns the final resolution. Agent delegations are helpers, not decision-makers.
Verify the resolution - Run tests or builds to confirm the merge didn't break anything.
For detailed conflict resolution patterns, see references/conflict-resolution.md.
Only modify the requested branch:
Never rewrite history:
git push --force--force-with-lease or --force-if-includesPreserve all changes:
This skill works identically in CI and local environments:
git directly for all operationsuser.name and user.email appropriately| Error | Resolution |
|---|---|
| No PR found for branch | Ask user for base branch, or create PR first |
| Merge conflicts | Follow conflict resolution workflow |
| Push rejected (non-fast-forward) | Pull first, then push again |
| Authentication failure | Ensure gh and git are authenticated |
When reporting completion, use clear language that doesn't imply the PR was merged:
Don't say: "PR #123 is now merged with main" (implies PR merged INTO main)
Do say: "Branch updated: merged base branch (main) into feature branch, synced local and remote"
For detailed conflict resolution guidance, consult:
references/conflict-resolution.md - Patterns for analyzing and resolving merge conflicts