| name | stack-push |
| description | Pushes all branches in a stack and opens or updates one dependent PR per slice. Use after stack-create to publish the stack or after adding commits to a slice. |
| alwaysApply | false |
| category | workflow-automation |
| tags | ["git","stacked-diffs","pr","push","github"] |
| tools | [] |
| complexity | medium |
| model_hint | standard |
| estimated_tokens | 900 |
| dependencies | ["sanctum:stack-create","sanctum:pr-prep","sanctum:git-workspace-review"] |
Stack Push
Push all branches in a stack and open (or update) one PR
per slice, with each PR targeting its parent branch as base.
When To Use
Run stack-push after stack-create has initialized the
branch topology and at least one commit exists on each
slice branch.
Also run it after adding commits to any slice to update
open PRs.
When NOT To Use
- No stack exists yet (use
sanctum:stack-create)
- The base merged and the stack must catch up (use
sanctum:stack-rebase)
Prerequisites
stack-create completed: branches exist with commits
gh CLI authenticated (gh auth status)
- Each slice branch has at least one commit beyond its base
Required Progress Tracking
Create TodoWrite items before starting:
stack-push:branches-listed
stack-push:branches-pushed
stack-push:prs-opened
stack-push:stack-summary-posted
Step 1: List Stack Branches (branches-listed)
Identify all branches in the stack.
By convention they share a stack/<feature-name>/ prefix:
STACK=stack/my-feature
BASE=master
git branch --list "${STACK}/*" | sed 's/^[* ]*//'
Verify each branch has commits beyond the base:
for branch in $(git branch --list "${STACK}/*" \
| sed 's/^[* ]*//'); do
count=$(git rev-list --count \
"$(git merge-base ${BASE} ${branch})..${branch}")
echo "${branch}: ${count} commit(s)"
done
Any branch showing 0 commits must have work added before
pushing.