/engineering:topr <PR number>from engineering
Rebase a stacked PR onto the latest origin/main, correctly dropping commits already merged via squash-and-merge. Use when user wants to refresh a stacked PR after an earlier PR in the stack merged, or says "rebase this PR on main".
Ships in engineering. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Checks out a PR branch, rebases it onto the latest origin/main (dropping already-merged commits from earlier PRs in the stack), and force-pushes.
This repo uses squash-and-merge. A naive git rebase origin/main will NOT drop already-merged commits because squash-merge creates different SHAs on main. Instead, we must identify the commits unique to this PR and cherry-pick only those onto origin/main.
When the user runs /topr <PR>, execute the following steps:
Get PR metadata:
gh pr view <PR> --json headRefName,title,state,commits --jq '.'
If the PR is not open, warn the user and stop. Note the number of commits reported by the PR — this is the count of commits unique to this PR.
Fetch latest main and the PR branch:
git fetch origin main <branch>
Check out the branch:
git checkout <branch>
Identify commits unique to this PR:
This is the critical step. Since we squash-merge, origin/main contains squashed versions of earlier PRs in the stack, but git doesn't know they're the same patches. We need to figure out which commits on the branch are actually new in this PR vs carried over from earlier (already-merged) PRs.
Strategy: Use git diff to find the unique commits.
a. First, show all commits above main:
git log --oneline origin/main..HEAD
b. Compare the tree diff against main to understand what this PR actually changes:
git diff --stat origin/main..HEAD
c. Look at the PR's commit count from step 1. The PR's own commits are the most recent N commits (where N = PR commit count). The older commits below them are from earlier PRs in the stack.
d. If the PR commit count is not available or ambiguous, identify unique commits by checking which files each commit touches vs what's already on main. Commits whose changes are already present on main (via squash-merge) are stale.
e. List the unique commits (most recent N):
git log --oneline -N HEAD # where N is the PR's commit count
Reset to origin/main and cherry-pick unique commits:
git reset --hard origin/main
git cherry-pick <commit1> <commit2> ... # in chronological order (oldest first)
git rebase origin/main — it replays all commits and won't drop squash-merged duplicates.Verify the result:
git log --oneline origin/main..HEAD
git diff --stat origin/main..HEAD
Confirm that:
Force-push:
git push --force-with-lease origin <branch>
Report the result:
git log --oneline origin/main..HEAD.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub goldenberry-so/pace --plugin engineering34 skills in this plugin
/architectureCreate or evaluate an architecture decision record (ADR). Use when choosing between technologies (e.g., Kafka vs SQS), documenting a design decision with trade-offs and consequences, reviewing a system design proposal, or designing a new component from requirements and constraints./careful-reviewRe-read the code you just wrote (and anything else you modified) with fresh eyes and look hard for bugs, errors, awkward design, dead code, or things that will confuse the next reader. Then fix what you find. Use after a batch of edits, when the user says "careful review", "look it over again", "give it another pass", or before opening a PR./code-reviewReview code changes for security, performance, and correctness. Trigger with a PR URL or diff, "review this before I merge", "is this code safe?", or when checking a change for N+1 queries, injection risks, missing edge cases, or error handling gaps./codex-reviewRun an OpenAI Codex code review on the current branch's changes against a base, extract findings, fix confirmed P0/P1 issues, and commit. Useful after a batch of work for a structured second opinion before shipping./debugStructured debugging session — reproduce, isolate, diagnose, and fix. Trigger with an error message or stack trace, "this works in staging but not prod", "something broke after the deploy", or when behavior diverges from expected and the cause isn't obvious./deploy-checklistPre-deployment verification checklist. Use when about to ship a release, deploying a change with database migrations or feature flags, verifying CI status and approvals before going to production, or documenting rollback triggers ahead of time.