What problem does it solve?
Splitting a large change into reviewable pieces is painful when each PR depends on the previous one: rebases cascade, CI costs multiply, and merges can bypass required review paths. This Skill provides the operational workflow for creating, syncing, and landing GitHub native stacked PRs in the PostHog repo without breaking branch protections or the Trunk merge queue.
Core Features & Use Cases
- Stack creation and publishing: Initialize stacks with
gh stack init, add layers with gh stack add, adopt existing branches or link existing PRs, and publish everything as draft PRs with gh stack submit --auto.
- Iteration and sync: Cascade-rebase layers with
gh stack sync, resolve rebase conflicts safely, handle force-with-lease refusals when bots push commits, and prune merged branches.
- Queue-safe merging: Land stacks through the Trunk merge queue via
/trunk merge on the top PR or bottom-first through /merging-prs, never with gh stack merge.
- Cloud sandbox workflow: In cloud task environments where
git push is blocked, build stacks with git_signed_commit and link them through the gh_stack MCP tool.
- Use Case: You have a large feature touching database, backend, and frontend. Use this Skill to split it into three stacked PRs, publish them as drafts, keep them rebased on master, and land the whole stack atomically through the merge queue.
Quick Start
Ask the agent to split your current branch into a stacked PR chain using gh stack and submit the layers as draft PRs.