Skip to content
Back to skills

Stack Setup

ASecurity

Use when the GitHub CLI or its gh-stack extension is missing or unauthenticated, when `gh stack` commands fail with an auth error, or when the user asks to install gh-stack, set up stacked PRs, or log in to GitHub. Triggered by check-status.sh reporting "gh=NOT installed", "ext=NOT installed", or "auth=NOT authenticated".

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 15, 2026
ai-agentsbashgit

Works with

  • terminal
  • cli

Security analysis

A100/100

Scanned November 15, 2026

npx -y skills add XingLiu0923/pr-stack-skill --skill stack-setup --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Stack Setup?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Stack Setup
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/xingliu0923-stack-setup/badge)](https://www.skillsdirectory.com/skills/xingliu0923-stack-setup)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: stack-setup
description: Use when the GitHub CLI or its gh-stack extension is missing or unauthenticated, when `gh stack` commands fail with an auth error, or when the user asks to install gh-stack, set up stacked PRs, or log in to GitHub. Triggered by check-status.sh reporting "gh=NOT installed", "ext=NOT installed", or "auth=NOT authenticated".
---

# Setting up `gh stack`

Work through only the steps the probe says are missing. Re-run the probe after
each one.

## 1. Confirm what is actually missing

```bash
bash "${CLAUDE_PLUGIN_ROOT}/scripts/check-status.sh"
```

## 2. `gh=NOT installed` — install the GitHub CLI

Ask the user which they prefer; do not pick silently.

```bash
brew install gh                  # macOS / Linuxbrew
winget install --id GitHub.cli   # Windows
```

Anything else: point them at <https://github.com/cli/cli#installation>.

## 3. `auth=NOT authenticated` — log in

**The user runs this in their own terminal, not you.**

```bash
gh auth login
```

It is interactive: it opens a browser and prompts for a one-time code. Running
it from an agent session blocks forever.

### Token handling rules — no exceptions

* Never ask the user to paste a token into the chat.
* Never run `gh auth login --with-token` yourself.
* Never echo, log, store, or copy a token.
* Never read `~/.config/gh/hosts.yml` or `$GH_CONFIG_DIR`.
* `gh auth status` is the only supported check. It prints no secret.

If the user is on GitHub Enterprise, `gh auth login --hostname <host>`, and
`GH_HOST` selects it for later commands.

## 4. `ext=NOT installed` — install the extension

```bash
gh extension install github/gh-stack
```

This compiles from source and can take a minute or two. Later upgrades:

```bash
gh extension upgrade gh-stack
```

## 5. Configure git for stack work

Both of these prevent real failures, so set them unless the user objects:

```bash
git config --global rerere.enabled true    # remember conflict resolutions;
                                           # a restack replays the same conflict
                                           # once per layer without it
git config remote.pushDefault origin       # REQUIRED if the repo has more than
                                           # one remote, or push/submit/sync/
                                           # rebase/link need --remote every time
```

`gh stack checkout` and `gh stack trunk` have **no** `--remote` flag at all, so
in a multi-remote repository `remote.pushDefault` is not optional.

## 6. Verify

```bash
bash "${CLAUDE_PLUGIN_ROOT}/scripts/check-status.sh"
```

All of `gh=installed`, `ext=installed`, `auth=authenticated` should now hold.

`stacks=NOT available` is **not** a setup failure — it means stacked PRs are not
enabled on that particular repository. Nothing in this skill fixes that; tell
the user and use the ordinary single-PR workflow there.

## Related skills

* **pr-stack:stack** — the workflow itself, and the blocked-command contract.
* **pr-stack:split-pr** — split an existing oversized branch into a stack.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.