Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Cascades a rebase through an entire PR stack after a base PR merges or upstream changes. Use when a stack needs to incorporate new base branch commits.
.claude/skills/athola-stack-rebase/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-09 | ✗→✓ | ▲ Improved | 27% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 275% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 16% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 29% | 0% |
| case-22 | ✗→✓ | ▲ Improved | 26% | 0% |
Cascade a rebase through an entire PR stack after a base PR merges or the upstream base branch changes.
Run stack-rebase in any of these situations:
master; thesecond PR now needs to target master directly
master has moved forward and stack branches need toincorporate the new commits
pick up the change
sanctum:stack-push)sanctum:stack-create)git branch --list)git fetch origin)git status)--update-refsCreate TodoWrite items before starting:
stack-rebase:fetch-completestack-rebase:trigger-identifiedstack-rebase:rebase-completestack-rebase:conflicts-resolvedstack-rebase:force-pushedstack-rebase:prs-updatedfetch-complete)bashgit fetch origin
If the merged PR's branch still exists on remote, note that GitHub retains the branch after merge. The merged branch itself is no longer a valid stack base.
trigger-identified)Determine what changed:
Case A, Base PR merged into master: The slice that was the old "root" is now in master. All remaining slices need to rebase onto master.
bash# Confirm the merged branch is now in master git branch -r --merged origin/master | grep "${MERGED_BRANCH}"
Case B, Master moved forward: Slices are behind master but the stack topology is unchanged. Rebase the root slice onto master; --update-refs carries all descendants.
Case C, Mid-stack revision: A slice was amended. All descendant slices need to rebase onto it.
rebase-complete)bashSTACK=stack/my-feature BASE=master # Check out the root slice ROOT_SLICE=$(git branch --list "${STACK}/*" \ | sed 's/^[* ]*//' | sort | head -1) git checkout "${ROOT_SLICE}" # Rebase with --update-refs rewrites all stack branches git rebase --update-refs origin/${BASE}
--update-refs scans the reflog and updates every local branch ref that points to a commit being rebased. All slice branches in the stack are rewritten in one pass.
bash# Check out the first slice BELOW the amended one CHILD_SLICE=stack/my-feature/add-api # example git checkout "${CHILD_SLICE}" git rebase --update-refs stack/my-feature/add-schema
bash# jj rebases all descendants automatically on any change # To rebase the whole stack onto master: jj rebase -d master \ -r "ancestors(${STACK}/add-ui) & !ancestors(master)"
conflicts-resolved)If the rebase pauses with conflicts:
bash# See which file conflicts git status # After resolving each file: git add <resolved-file> git rebase --continue
Repeat until the rebase completes. If a conflict is too complex, abort and investigate:
bashgit rebase --abort
Then examine the diff between the conflicting commits before retrying.
force-pushed)After a successful rebase, push all slice branches. Use --force-with-lease to guard against remote changes made since the last fetch:
bashfor branch in $(git branch --list "${STACK}/*" \ | sed 's/^[* ]*//' | sort); do git push --force-with-lease origin "${branch}" echo "force-pushed: ${branch}" done
Never use --force (drops the remote-change guard).
bashjj git push --all --allow-new
prs-updated)Case A only: After the root slice merged and you rebased remaining slices onto master, the next PR in the stack now targets the wrong base. Update its base via the GitHub CLI:
bashNEXT_PR=456 # PR number of the new stack root gh pr edit "${NEXT_PR}" --base master
For PRs further down the stack, their bases remain the previous slice branch, which --update-refs already rewrote; no base edit is needed for them.
Verify the full stack is consistent:
bashfor branch in $(git branch --list "${STACK}/*" \ | sed 's/^[* ]*//' | sort); do pr_num=$(gh pr list --head "${branch}" \ --json number,baseRefName \ --jq '.[0] | "#\(.number) base=\(.baseRefName)"') echo "${branch}: ${pr_num}" done
area for conflicts during rebase
once a day is cheaper than resolving a week of drift
prefer a fixup commit and squash at merge time
git rebase --update-refs requires Git 2.38+; confirmwith git version before running
--update-refs is unavailable, manually check outand rebase each slice branch in order from root to tip
reviews as stale; remind reviewers to re-approve
stack-push skill documents how to re-post thestack summary comment after a rebase changes PR SHAs
stack-rebase:fetch-complete throughstack-rebase:prs-updated) are created before the rebase starts and marked complete in order
git fetch origin completes before the rebase trigger isidentified and classified as Case A, B, or C
git rebase --update-refs completes without abort for Cases Aand B; if conflicts occur, each is resolved before continuing
--force-with-lease; plain--force is never used
gh pr edit <next-pr> --base master updatesthe new stack root's base target and the full stack topology verified with gh pr list output
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-05 | pass→pass | 3,975 | 3,771 | -5% | 1 | 1 | 0% | 677 | 2,327 | +244% | 0 | 0 | — |
case-01 | fail→fail | 14,817 | 9,832 | -34% | 1 | 1 | 0% | 387 | 2,370 | +512% | 0 | 0 | — |
case-02 | fail→fail | 10,107 | 9,579 | -5% | 1 | 1 | 0% | 1,822 | 2,329 | +28% | 0 | 0 | — |
case-03 | fail→fail | 3,361 | 8,710 | +159% | 1 | 1 | 0% | 337 | 2,172 | +545% | 0 | 0 | — |
case-04 | pass→pass | 12,223 | 9,788 | -20% | 1 | 1 | 0% | 2,214 | 3,650 | +65% | 0 | 0 | — |
case-06 | pass→pass | 4,834 | 3,388 | -30% | 1 | 1 | 0% | 761 | 2,162 | +184% | 0 | 0 | — |
case-07 | pass→pass | 4,529 | 2,784 | -39% | 1 | 1 | 0% | 700 | 2,021 | +189% | 0 | 0 | — |
case-08 | pass→pass | 10,767 | 10,688 | -1% | 1 | 1 | 0% | 1,746 | 3,720 | +113% | 0 | 0 | — |
case-09 | fail→pass | 14,570 | 6,883 | -53% | 1 | 1 | 0% | 2,352 | 2,986 | +27% | 0 | 0 | — |
case-10 | pass→pass | 11,742 | 2,376 | -80% | 1 | 1 | 0% | 2,161 | 2,145 | -1% | 0 | 0 | — |
case-11 | fail→pass | 4,811 | 3,045 | -37% | 1 | 1 | 0% | 596 | 2,236 | +275% | 0 | 0 | — |
case-12 | pass→pass | 9,826 | 3,848 | -61% | 1 | 1 | 0% | 1,853 | 2,508 | +35% | 0 | 0 | — |
case-13 | pass→pass | 12,631 | 4,877 | -61% | 1 | 1 | 0% | 2,558 | 2,453 | -4% | 0 | 0 | — |
case-14 | pass→pass | 3,429 | 1,501 | -56% | 1 | 1 | 0% | 418 | 1,873 | +348% | 0 | 0 | — |
case-15 | pass→pass | 6,654 | 4,266 | -36% | 1 | 1 | 0% | 1,056 | 2,351 | +123% | 0 | 0 | — |
case-16 | fail→pass | 13,306 | 5,322 | -60% | 1 | 1 | 0% | 2,228 | 2,579 | +16% | 0 | 0 | — |
case-17 | pass→pass | 8,159 | 5,124 | -37% | 1 | 1 | 0% | 1,239 | 2,576 | +108% | 0 | 0 | — |
case-18 | fail→pass | 12,220 | 5,638 | -54% | 1 | 1 | 0% | 1,979 | 2,558 | +29% | 0 | 0 | — |
case-19 | pass→pass | 9,557 | 4,100 | -57% | 1 | 1 | 0% | 1,502 | 2,307 | +54% | 0 | 0 | — |
case-20 | pass→pass | 7,376 | 2,415 | -67% | 1 | 1 | 0% | 1,037 | 2,049 | +98% | 0 | 0 | — |
case-21 | pass→pass | 15,822 | 5,831 | -63% | 1 | 1 | 0% | 2,385 | 2,450 | +3% | 0 | 0 | — |
case-22 | fail→pass | 9,508 | 2,735 | -71% | 1 | 1 | 0% | 1,697 | 2,130 | +26% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 20 counted toward the lift figure. The other 2 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +23 percentage points is the difference between those two pass rates over the 20 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.