Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
athola avatar

Stack Push

  • 71 installs
  • 325 repo stars
  • Updated August 2, 2026
  • athola/claude-night-market

Stack Push is an agent skill that pushes every branch in a stacked-diff stack and opens or updates one GitHub PR per slice with parent branches as merge bases.

About

Stack Push is a Sanctum workflow skill for solo builders who ship large changes as stacked diffs instead of one monolithic PR. After stack-create has carved branch topology and each slice has at least one commit beyond its base, you invoke stack-push to publish the whole stack: list prefixed branches, verify commits exist, push with GitHub CLI, and open or refresh dependent pull requests so reviewers can merge from the bottom up. The skill encodes naming conventions, branch verification loops, and explicit progress tracking so agents do not half-publish a stack or target the wrong base branch. It fits indie teams using gh on GitHub who already follow pr-prep and workspace review habits. Re-run it whenever any slice moves forward so open PRs stay aligned with the latest commits and the stack summary reflects current state.

  • Pushes every branch under a shared stack/<feature>/ prefix in dependency order
  • Opens or updates one PR per slice with each PR’s base set to its parent branch
  • Runs after stack-create and again whenever any slice gains new commits
  • Uses gh CLI with a four-item TodoWrite gate: listed, pushed, PRs opened, summary posted
  • Depends on stack-create, pr-prep, and git-workspace-review from the same Sanctum workflow

Stack Push by the numbers

  • 71 all-time installs (skills.sh)
  • Ranked #261 of 733 Git & Pull Requests skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/athola/claude-night-market --skill stack-push

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs71
repo stars325
Last updatedAugust 2, 2026
Repositoryathola/claude-night-market

What it does

Publish an entire stacked-branch feature to GitHub with one dependent PR per slice after stack-create has commits on every branch.

Who is it for?

Best when you're on GitHub using gh and Sanctum-style stack-create and need repeatable bulk push and PR creation without manual branch bookkeeping.

Skip if: Repos without stacked branches, teams not using GitHub/gh, or changes where stack-create has not finished or slices lack commits beyond their bases.

When should I use this skill?

After stack-create has initialized branch topology and each slice has at least one commit beyond its base; also after adding commits to any slice to update open PRs.

What you get

All stack branches are on the remote with one PR per slice wired to the correct parent base, plus a posted stack summary so reviewers can merge the stack safely.

  • All stack branches pushed to remote
  • One open or updated PR per slice with parent as base
  • Stack summary posted to the workflow tracker

By the numbers

  • 4 TodoWrite progress items before starting stack-push

Files

SKILL.mdMarkdownGitHub ↗

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.

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:

1. stack-push:branches-listed 2. stack-push:branches-pushed 3. stack-push:prs-opened 4. 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.

Step 2: Push Branches (branches-pushed)

Push every slice branch to the remote in stack order (base slice first):

for branch in $(git branch --list "${STACK}/*" \
    | sed 's/^[* ]*//' | sort); do
  git push --set-upstream origin "${branch}"
  echo "pushed: ${branch}"
done

jj Accelerator (if available)

jj git push --all

Step 3: Open or Update PRs (prs-opened)

Create one PR per slice, targeting its parent branch. For the first slice the parent is master; for subsequent slices the parent is the previous slice's branch.

PREV_BASE=master

for branch in $(git branch --list "${STACK}/*" \
    | sed 's/^[* ]*//' | sort); do

  # Check if a PR already exists for this branch
  existing=$(gh pr list \
    --head "${branch}" \
    --json number \
    --jq '.[0].number' 2>/dev/null)

  if [ -n "${existing}" ]; then
    echo "PR #${existing} already open for ${branch} -- skipping"
  else
    gh pr create \
      --base "${PREV_BASE}" \
      --head "${branch}" \
      --title "[$(echo ${branch} | sed 's|.*/||')] <title>" \
      --body "Part of stack \`${STACK}\`." \
      --draft
    echo "opened PR for ${branch} (base: ${PREV_BASE})"
  fi

  PREV_BASE="${branch}"
done

Fill in the actual PR titles and bodies before removing the --draft flag. Run Skill(sanctum:pr-prep) on each slice to generate quality-gated descriptions.

Step 4: Post Stack Summary (stack-summary-posted)

After all PRs are open, post a summary comment on the first PR (the root of the stack) listing the full chain:

ROOT_PR=$(gh pr list \
  --head "${STACK}/$(git branch --list \
    "${STACK}/*" | sed 's/^[* ]*//' | sort | head -1 \
    | sed 's|.*/||')" \
  --json number --jq '.[0].number')

# Build the stack table
BODY="## Stack\n\n| # | Branch | PR |\n|---|--------|----|\n"
N=1
for branch in $(git branch --list "${STACK}/*" \
    | sed 's/^[* ]*//' | sort); do
  pr_num=$(gh pr list --head "${branch}" \
    --json number --jq '.[0].number')
  BODY="${BODY}| ${N} | \`${branch}\` | #${pr_num} |\n"
  N=$((N+1))
done

gh pr comment "${ROOT_PR}" --body "$(printf "${BODY}")"

Notes

  • Always push in stack order so GitHub sees the parent

branch before the child PR is opened

  • Use --draft by default; promote slices to ready

individually as they pass review

  • After any git rebase --update-refs run, re-push with

git push --force-with-lease (never --force)

  • When a base PR merges, run Skill(sanctum:stack-rebase)

to cascade the rebase before updating the next PR's base

Exit Criteria

  • [ ] All 4 TodoWrite items (stack-push:branches-listed through

stack-push:stack-summary-posted) are created before pushing starts and marked complete in order

  • [ ] Each slice branch confirmed to have ≥ 1 commit beyond its base

before git push is called; branches with 0 commits are blocked

  • [ ] One draft PR opened per slice, each targeting its parent branch

as base (root slice targets master/main)

  • [ ] Root PR receives a ## Stack comment containing a table with

columns #, Branch, and PR listing all slices

  • [ ] gh pr list --head <branch> returns a PR number for each

pushed branch after the step completes

Related skills

How it compares

Use instead of hand-rolling git push and gh pr create per branch when you already standardized on stacked diffs and parent-based PR chains.

FAQ

Who is stack-push for?

Stack Push is for developers who work in stacked-diff workflows on GitHub and want their coding agent to publish the full branch stack and dependent PRs in one governed procedure.

When should I use stack-push?

Run it in Ship after stack-create when every slice has commits; run again in Build/Ship whenever you add commits to any slice so open PRs update; use Launch-style publishing when you are ready for review on GitHub.

Is stack-push safe to install?

It drives real git push and gh PR operations against your authenticated account—review the Security Audits panel on this page and confirm gh auth and branch targets before running in production repos.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.