How to build stacked PRs with the gh-stack skill
GitHub shows how to use GitHub Copilot with the gh-stack skill to split large, agent-generated changes into smaller stacked pull requests, making review and merging easier. The video covers installing the gh-stack CLI extension, verifying the skill setup, prompting Copilot to generate a PR stack, and reviewing and merging the stack on GitHub.
Overview
AI coding agents can produce very large changesets that end up as huge pull requests (PRs) that are hard to review. This video demonstrates using the gh-stack skill together with GitHub Copilot to automatically break a large update into a set of stacked PRs.
Why stacked PRs
- Large PRs are difficult to review and reason about.
- Stacked PRs split a big change into smaller, layered PRs that can be reviewed independently.
Install the gh-stack extension and skill
- Install the gh-stack CLI extension.
- Configure the gh-stack skill in the local environment so Copilot can use it.
Verify the skill is available in Copilot
- Check that the skill installation is recognized and available for use from GitHub Copilot.
Create a stacked PR with a single prompt
- Write one prompt instructing Copilot to generate a stacked PR.
- The example shown creates a three-layer PR stack.
Review and merge the PR stack
- Review each PR in the stack individually on GitHub.
- Merge the stack once the layered PRs are approved.