From dev-toolkit
Use when the user wants to sync their PR branch with its base branch — "update my PR", "merge main into my branch", "my PR is behind", "pull in base branch changes", "sync with main", "rebase on main", "resolve conflicts with base". Fetches the base, rebases or merges it in, resolves conflicts if needed, and pushes.
How this skill is triggered — by the user, by Claude, or both
Slash command
/dev-toolkit:update-prThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Sync the current branch with its base branch: fetch → rebase (or merge) → resolve conflicts → push.
Sync the current branch with its base branch: fetch → rebase (or merge) → resolve conflicts → push.
BASE=$(gh pr view --json baseRefName --jq '.baseRefName' 2>/dev/null)
if [ -z "$BASE" ]; then
BASE=$(git rev-parse --abbrev-ref origin/HEAD | sed 's|origin/||')
fi
Method: Use rebase by default. Switch to merge only if the user explicitly says "merge" or passes --merge.
Tell the user: "Updating $(git branch --show-current) from $BASE (rebase)." — or "(merge)" if merge was requested.
git fetch origin "$BASE"
Check if already up to date:
BEHIND=$(git rev-list HEAD..origin/"$BASE" --count)
If BEHIND is 0, tell the user "Already up to date with $BASE." and stop.
git rebase origin/"$BASE"
If rebase succeeds: proceed to Step 5.
If rebase hits conflicts: proceed to Step 4.
git merge origin/"$BASE"
If merge succeeds: proceed to Step 5.
If merge hits conflicts: proceed to Step 4 (merge variant).
List conflicted files:
git diff --name-only --diff-filter=U
For each conflicted file, resolve the conflict markers (<<<<<<<, =======, >>>>>>>). Favor the PR branch's intent unless the base branch changes must win (e.g., schema migrations, config values).
After resolving each file:
git add <file>
Continue rebase:
GIT_EDITOR=true git rebase --continue
Repeat for each commit if there are multiple conflicts. To abort: git rebase --abort.
Continue merge:
GIT_EDITOR=true git merge --continue
To abort: git merge --abort.
Tell the user "Aborted. Branch is unchanged." on abort.
Rebase rewrites history — a force-push is required and expected:
git push --force-with-lease
After a merge, a regular push suffices:
git push
Never use bare --force.
Branch updated from
$BASEvia rebase. Replayed N commit(s). [PR link if available]
Or for merge:
Branch updated from
$BASEvia merge. [PR link if available]
List any files where conflicts were resolved.
git stash first, complete the operation, then git stash pop. Tell the user what was stashed.gh not available — Use the repo default branch as the base. Warn: "No PR found; using default branch $BASE."npx claudepluginhub siroc-labs/cortex --plugin dev-toolkitProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.