AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Stacked Pr

skill-nir-mo-gh-stack-pr-skill-gh-stack-pr-skill · by nir-mo

Use when the user asks to "stack a PR", "stacked PR", "branch on top of this PR", "next layer", "restack", "rebase the stack", "split this into a stack", or wants to start follow-up work while the previous PR is still in review.

No reviews yet
0 installs
11 views
0.0% view→install

Install

$ agentstack add skill-nir-mo-gh-stack-pr-skill-gh-stack-pr-skill

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-nir-mo-gh-stack-pr-skill-gh-stack-pr-skill)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
23d ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Stacked Pr? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Stacked PRs

Use GitHub's gh stack extension. It already does parent tracking, cascading rebase, PR base retargeting, and bottom-up merging. Do not hand-roll this with git rebase --update-refs, git config branch.*.parent, or manual gh pr create --base — that reimplements the extension badly and drifts from what GitHub's UI shows.

Public preview — flags may change. gh stack --help is authoritative over this file.

First: does this actually need to be a stack?

Stacking couples the PRs. They merge bottom-up only, so a review stall or a revert on a lower layer blocks everything above it.

Before running any command here, check whether the changes actually depend on each other — later layers building on earlier layers' code, or a split of one logical change too big to review at once. If they're independent (unrelated files, either could merge first, no shared new symbols), stop and ask the user whether they really want a stack, and say why you're asking: independent PRs opened straight against the trunk merge in any order and don't block each other. Only proceed once they confirm.

Setup (once)

gh extension install github/gh-stack
gh stack alias        # optional: shorter command

If the repo's trunk is not the default branch, every init must say so, or the bottom PR targets the wrong branch:

gh stack init --base develop 

Create a stack

gh stack init feat-auth          # add --base  if trunk isn't the default branch
gh stack add -Am "api routes"    # -A stages all, -m commits, then branches
gh stack add -Am "ui"
gh stack submit                  # push + create/update PRs, interactive editor

gh stack submit opens an editor for titles/bodies; --auto skips it and generates titles from commits, --open marks PRs ready for review (without it, --auto creates drafts). Commit messages become the PR titles, so write them the way you want the PR titled.

Already have branches? Adopt them bottom-to-top instead of recreating:

gh stack init feat/auth feat/api feat/ui

Already have open PRs you don't want tracked locally? gh stack link --base .

Adapt to your repo

gh stack submit creates the PRs, which means any repo-specific PR skill or convention you normally rely on is bypassed. Retrofit those rules after submit rather than before:

  • Apply required labels per PR: gh pr edit --add-label .
  • Run any mandatory post-PR step once for the whole stack, not once per layer.
  • Verify the bottom PR targets the intended trunk: gh stack view.
  • If your repo enforces a title format (ticket prefixes and the like), put it in the commit

message — that is what becomes the PR title.

Day to day

gh stack view            # -s for short, --json for scripting
gh stack sync            # fetch, rebase, push, sync PR state — the one you want most days
gh stack rebase          # cascading rebase only; --downstack / --upstack to limit scope
gh stack push            # push branches without touching PRs
gh stack modify          # interactively reorder/restructure; --continue / --abort
gh stack up | down | top | bottom | trunk | switch | checkout

Reach for gh stack sync before assuming a stack is broken — most "my diff looks wrong" reports are just a stale local stack after trunk moved.

Merge

gh stack merge --squash      # bottom-up; can merge several layers at once

GitHub retargets the remaining PRs onto the trunk automatically as lower layers merge. Never merge a middle PR first, and never merge a stacked PR from the web UI's plain merge button unless you've confirmed everything below it is already in.

Bail out

gh stack unstack --local     # drop local tracking, leave the PRs alone
gh stack unstack             # also unstack them on GitHub

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.