Skip to content

Commit 309e12a

Browse files
committed
skills file for agents
1 parent 1304670 commit 309e12a

3 files changed

Lines changed: 614 additions & 5 deletions

File tree

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ gh extension install github/gh-stack
1212

1313
Requires the [GitHub CLI](https://cli.github.com/) (`gh`) v2.0+.
1414

15+
## AI agent integration
16+
17+
Install the gh-stack skill so your AI coding agent knows how to work with stacked PRs and the `gh stack` CLI:
18+
19+
```sh
20+
npx skills add github/gh-stack
21+
```
22+
1523
## Quick start
1624

1725
```sh
@@ -35,15 +43,19 @@ gh stack view
3543

3644
## How it works
3745

38-
A **stack** is an ordered list of branches where each branch builds on the one below it. The bottom of the stack is based on a **trunk** branch (typically `main`).
46+
A **stack** is an ordered list of branches where each branch builds on the one below it. The **bottom** of the stack is based on a **trunk** branch (typically `main`).
3947

4048
```
49+
frontend → PR #3 (base: api-endpoints) ← top
50+
api-endpoints → PR #2 (base: auth-layer)
51+
auth-layer → PR #1 (base: main) ← bottom
52+
─────────────
4153
main (trunk)
42-
└── auth-layer → PR #1 (base: main)
43-
└── api-endpoints → PR #2 (base: auth-layer)
4454
```
4555

46-
When you push, `gh stack` creates one PR per branch. Each PR's base is set to the branch below it in the stack (**branch-chaining**), so reviewers see only the diff for that layer.
56+
The **bottom** of the stack is the branch closest to the trunk, and the **top** is the branch furthest from it. Each branch inherits from the one below it. Navigation commands (`up`, `down`, `top`, `bottom`) follow this model: `up` moves away from trunk, `down` moves toward it.
57+
58+
When you push, `gh stack` creates one PR per branch. Each PR's base is set to the branch below it in the stack, so reviewers see only the diff for that layer.
4759

4860
### Local tracking
4961

cmd/init.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ func InitCmd(cfg *config.Config) *cobra.Command {
2828
Short: "Initialize a new stack",
2929
Long: `Initialize a stack object in the local repo.
3030
31-
Creates an entry in .git/gh-stack to track stack state.
3231
Unless specified, prompts user to create/select branch for first layer of the stack.
3332
Trunk defaults to default branch, unless specified otherwise.`,
3433
Example: ` $ gh stack init

0 commit comments

Comments
 (0)