User guide for the local squash-safe stack CLI for stacked PR repair.

MITAuto-check passedDevelopment

Install Stack

skills CLI
$ npx skills add UsefulSoftwareCo/executor --skill stack -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install UsefulSoftwareCo/executor stack --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/UsefulSoftwareCo/executor.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/stack .claude/skills/stack && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
stack
GitHub stars
4.1k
Token cost
~2.3k tokens
SKILL.md length
1,222 words
Files
1
Skills in repo
21
Repo updated
First seen
Licence
MIT

At a glance

User guide for the local squash-safe stack CLI for stacked PR repair.

  • Someone asks how to inspect
  • SKILL.md covers Mental Model, Common Commands, Happy Path: PR Bases Encode… and Inspect A Stack, plus 7 more sections
  • Calls gh
  • Undo stacked pull requests in squash-merge repositories

What it does

Stack is an agent skill from UsefulSoftwareCo/executor. User guide for the local squash-safe stack CLI for stacked PR repair. Use when someone asks how to inspect, track, sync, merge, document, or undo stacked pull requests in squash-merge repositories. Prefer this tool over GitHub's gh stack command for this workflow.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Pull requests and Technical writing. It works with GitHub and Git. The repository describes itself as: The missing integration layer for AI agents. Let them call any OpenAPI / MCP / GraphQL / custom js functions in secure environment. The licence is MIT.

When your agent uses it

  • Someone asks how to inspect
  • Undo stacked pull requests in squash-merge repositories

Example prompts

  • “/stack”

What it can do on your machine

Read from SKILL.md and the folder at commit 27dccb8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Stack loads about 2.3k tokens when it runs. Until then it costs about 69 tokens; SKILL.md has 1,222 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~69
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from UsefulSoftwareCo/executor at commit 27dccb8, republished under its MIT licence (© UsefulSoftwareCo). 1,222 words, ~2,257 tokens.

Download SKILL.mdSave it as .claude/skills/stack/SKILL.md (or your agent's skills folder).
name
stack
description
User guide for the local squash-safe `stack` CLI for stacked PR repair. Use when someone asks how to inspect, track, sync, merge, document, or undo stacked pull requests in squash-merge repositories. Prefer this tool over GitHub's `gh stack` command for this workflow.

Stack

Use the local stack CLI for squash-safe stacked PR repair. It is designed for repos where PRs are squash-merged and merged branches are deleted, so Git ancestry alone cannot preserve stack intent.

Keep ordinary editing and commits on plain git. Use stack only for stack intent, stack inspection, sync, merge, and undo workflows.

Mental Model

text
dev
└─ stack-a  #101
   └─ stack-b  #102
      └─ stack-c  #103

Stack intent is persisted in .git/stack/state.json as stack links:

  • branch
  • parent branch
  • merge-base anchor
  • PR number

Mutating sync and merge workflows write .git/stack/undo.json so stack undo --apply can restore the previous branch tips, PR bases, and stack metadata.

Common Commands

  • stack status: show the relevant tracked stack graph and include open PR details when GitHub is available.
  • stack guide: print the opinionated happy path for agents and humans.
  • stack track <branch> --onto <parent>: record stack intent for an existing branch.
  • stack sync --dry-run [branch]: preview inferred PR-base stack links and repairs without changing branches or PRs.
  • stack sync [branch]: infer clear PR-base stack links, repair descendants, retarget PRs, and refresh stack blocks. With a branch argument, sync only the stack containing that branch.
  • stack sync --continue-on-failure / stack sync --keep-going: process independent stacks, summarize successes and failures, and exit nonzero if any stack failed.
  • stack doctor: inspect local Git, GitHub, stack metadata, trunk branches, and undo journal health without changing anything.
  • stack merge [branch]: dry-run root PR merge plus descendant repair.
  • stack merge [branch] --apply: retarget immediate child PRs, squash-merge the root PR, then repair descendants.
  • stack merge [branch] --auto: retarget immediate child PRs, enable GitHub auto-merge, wait, then repair descendants.
  • stack merge --auto --through <branch-or-pr>: repeat auto-merge one root at a time until the target branch or PR lands.
  • stack history: show the most recent applied repair journal.
  • stack undo: dry-run restore of the most recent applied repair.
  • stack undo --apply: restore branches, PR bases, and stack metadata from the journal.

Happy Path: PR Bases Encode The Stack

bash
gh pr create --base dev --head stack-a
gh pr create --base stack-a --head stack-b
stack sync --dry-run
stack sync
stack sync cleanup/schema-source
stack sync --keep-going

Prefer this workflow. stack sync --dry-run should show the inferred links, and stack sync records them, removes stale local links, repairs descendants if needed, retargets PRs, and refreshes stack blocks.

Use stack guide when you need the CLI itself to print this guidance.

Inspect A Stack

bash
stack status

Use this to understand local stack metadata, current branch position, missing parents, tracked PR numbers, and PR titles when GitHub is available. It is opinionated: backup branches are hidden, and when the current branch is stack-relevant it focuses on that stack instead of listing every local branch. When relaying a stack view to the user, always include the full PR URLs for every branch that has a PR, not just PR numbers or titles. If stack status does not print a URL for a branch, query GitHub with gh pr view/gh pr list and include the URL in the shown stack view. Use Markdown links or plain URL lines for user-facing stack views so the PR links are clickable; do not hide the only copy of the PR URLs inside a fenced code block.

Use stack sync --dry-run, not stack status, when you need GitHub PR-base inference before mutation.

Track Existing Branches

bash
stack track stack-b --onto stack-a
stack track stack-c --onto stack-b

This records stack intent without changing commits or PRs. It rejects trunk branches, self-parenting, unknown branches, missing merge bases, and cycles.

Sync The Common Safe Workflow

bash
stack sync --dry-run
stack sync

Use sync when open PR bases already describe the stack, a parent PR branch has changed, or the repo needs the safe common maintenance flow. It:

  • infers clear PR-base stack links
  • removes stale local stack links when no open PR depends on them
  • updates stale explicit links when open PR bases clearly show the current stack
  • skips standalone trunk-root PRs unless another open PR is based on them
  • repairs descendants after squash merges or parent drift
  • retargets PR bases
  • refreshes stack blocks in PR bodies
  • prints a concise tree summary of changed, planned, or failed branches

Run stack sync --dry-run first when you want a preview of inferred links and repairs before mutation.

stack sync <branch> scopes sync to the stack containing that branch. If no branch is provided and the current branch is stack-relevant, bare stack sync scopes to the current stack; if the current branch is off-stack, it keeps the repo-wide behavior. --dry-run follows the same scoping rules.

Use stack sync --continue-on-failure or stack sync --keep-going when one independent stack should not block the rest. It runs each root stack separately, prints succeeded and failed stacks, preserves the usual failure cleanup block for each failed stack, saves undo information for every mutated stack, and exits nonzero if any stack failed.

Sync output is intentionally outcome-oriented. It should show the stack tree with icons like ●, ✓, ◌, and ✕, plus changed PRs/backups/undo instructions. It should not default to internal phase logs like fetch, inspect, or reconcile. When you show a stack tree to the user, include full PR URLs alongside each PR entry so the stack view is directly actionable. Prefer Markdown list/tree output with clickable links over fenced code blocks when relaying PR URLs to a user.

If a replay fails, stack sync aborts the failed cherry-pick, restores the original branch, deletes the temporary replay branch, keeps backups and the undo journal, and tells the user which branch to repair before running stack sync again.

Do not edit .git/stack/state.json by hand. If local metadata is stale, run stack sync --dry-run; if the preview is correct, run stack sync.

Show full SKILL.md (337 more words)Show less

Merge The Stack Root

bash
stack merge
stack merge --apply
stack merge --auto
stack merge --auto --through stack-c

Prefer omitting the branch. stack merge infers the root from the current stack branch. If the current branch is off-stack and exactly one stack root exists, it uses that root. If multiple roots exist, it asks for stack merge <branch>.

Use bare stack merge as a dry-run. Add --apply only when the plan is correct. Before merging, the command retargets immediate child PRs away from the root branch so GitHub repo auto-delete settings are less likely to close descendants. Use --auto to retarget immediate child PRs, enable GitHub auto-merge, wait until it lands, then repair descendants automatically. Use --auto --through <branch-or-pr> to repeat that root merge flow through a bounded target instead of merging the whole stack by default.

Mutating merge workflows stream progress while they run. Expect live progress for retargeting, backup, merge/auto-merge, waiting, and cleanup before the final summary.

Understand Or Undo The Last Mutation

bash
stack history
stack undo
stack undo --apply

Use history to inspect the saved undo journal. Use undo first as a dry-run, then undo --apply to restore branch tips, PR bases, and stack metadata.

PR Body Stack Blocks

stack sync and stack merge --apply/--auto refresh a deterministic stack block in open PR bodies:

md
<!-- stack:links:start -->

### Stack

- [x] #101
- [ ] #102
- [ ] **#103** 👈 current
<!-- stack:links:end -->

Checked entries are landed history preserved from the previous block. Open PRs stay unchecked until they are actually merged. The current PR is bold and marked with 👈 current. GitHub renders #123 as a pull request link, so branch paths are intentionally omitted from stack blocks.

Safety Rules

  • stack merge is dry-run by default.
  • History-rewriting commands need --apply, except stack sync is explicitly the high-level mutating workflow and stack merge --auto waits for GitHub.
  • Never mutate trunk branches such as dev, main, or master.
  • Before rebasing a branch, the tool creates a local backup branch.
  • If output is unclear, inspect with stack status, stack history, or command help before applying.

Do Not Use

Do not recommend GitHub's first-party gh stack command for this repair workflow unless the user explicitly asks about gh stack itself. This skill is for the local stack CLI.

© UsefulSoftwareCo, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/stack of UsefulSoftwareCo/executor.

Open the folder on GitHubat commit 27dccb8

Compare with similar skills

Stack next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Stack compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Stack this skillUsefulSoftwareCo/executor4.1k—~2.3kAutomated safety check: PassMIT
Pull Request Title and Body Writeropeninterpreter/openinterpreter69k2 repos~1.1kAutomated safety check: PassApache-2.0
Contributor-First PR MergeHKUDS/OpenHarness16k1 repos~847Automated safety check: PassMIT
Create Pull Requestcline/cline70k1 repos~1.6kAutomated safety check: PassApache-2.0
PR Review State Fetchprisma/orm48k—~767Automated safety check: PassApache-2.0
Creating Description For Gh PRredis/jedis12k—~838Automated safety check: PassMIT

Similar skills

  • Pull Request Title and Body Writer

    openinterpreter/openinterpreter

    Rewrites the title and body of one or more pull requests with gh, leading with why the change was made, then what changed, and describing only the net result.

    69k GitHub starsUsed in 2 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Merges external GitHub pull requests while keeping the original author credited, and fixes conflicts after the merge instead of rewriting the contribution.

    16k GitHub starsUsed in 1 repo~847 tokens
    DevelopmentAuto-check passed
  • Opens a GitHub pull request from your current branch with the gh CLI, after reviewing the commits and diff and gathering the details the PR needs.

    70k GitHub starsUsed in 1 repo~1.6k tokens
    DevelopmentAuto-check passed
  • Official

    Fetches a pull request's canonical review state as JSON, validates it, and renders markdown, a text summary and triage target files from it using bundled scripts.

    48k GitHub stars~767 tokensUpdated today
    DevelopmentAuto-check passed
  • Official

    Generate a clear, concise GitHub PR title and description from the diff between two local git branches, and save it to prDescription.md in the repo root.

    12k GitHub stars~838 tokensUpdated today
    DevelopmentAuto-check passed
  • Opens a pull request for the current branch using the repo's template, a work item ID in the title and a description filled in from the actual diff.

    60k GitHub stars~824 tokensUpdated yesterday
    DevelopmentAuto-check passed

More from UsefulSoftwareCo/executor

All 21 skills in this repo
  • Effect Client Wrapper

    UsefulSoftwareCo/executor

    Pattern for wrapping third-party SDK clients (Stripe, Resend, AWS, etc.) with Effect.

    4.1k GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check passed
  • CLI Release

    UsefulSoftwareCo/executor

    Runbook for releasing the executor CLI package (stable and beta).

    4.1k GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Effect Atom Optimistic Updates

    UsefulSoftwareCo/executor

    Pattern for implementing optimistic UI updates with effect-atom in this codebase.

    4.1k GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • Effect HTTP Testing

    UsefulSoftwareCo/executor

    Testing Effect HttpApi services end-to-end. An agent skill from UsefulSoftwareCo/executor.

    4.1k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Emulate

    UsefulSoftwareCo/executor

    Use the @executor-js/emulate service emulators (GitHub, Google, Stripe, Resend, WorkOS, …) to test integrations for real — full OpenAPI specs, working OAuth flows, mintable credentials, and a…

    4.1k GitHub stars~2.2k tokensUpdated today
    Auto-check: notes
  • Prod Telemetry

    UsefulSoftwareCo/executor

    Query Executor's production telemetry — Axiom traces (executor-cloud dataset), prod Postgres via PlanetScale, PostHog product analytics — through the Executor MCP.

    4.1k GitHub stars~1.9k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Stack

What does Stack do?

User guide for the local squash-safe stack CLI for stacked PR repair. Stack is an agent skill from UsefulSoftwareCo/executor. User guide for the local squash-safe stack CLI for stacked PR repair.

When should I use Stack?

Stack fits situations like: someone asks how to inspect; undo stacked pull requests in squash-merge repositories.

How do I install Stack in Claude Code?

Run `npx skills add UsefulSoftwareCo/executor --skill stack -a claude-code`. Or copy the skill folder (.agents/skills/stack in UsefulSoftwareCo/executor) into .claude/skills/stack in your project. Claude Code loads it when a task matches its description.

How do I install Stack in Codex?

Run `npx skills add UsefulSoftwareCo/executor --skill stack -a codex`. Or copy the skill folder (.agents/skills/stack in UsefulSoftwareCo/executor) into .agents/skills/stack in your project. Codex loads it when a task matches its description.

Can I use Stack in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add UsefulSoftwareCo/executor --skill stack -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/stack, .gemini/skills/stack, .github/skills/stack and .opencode/skills/stack in your project.

What does Stack need to run?

Going by SKILL.md and its folder, Stack needs the command-line tools its instructions call (gh).

Does Stack access the network?

SKILL.md contains no URLs. Its commands use gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Stack safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Stack use?

Stack is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Stack use?

About 2.3k tokens (SKILL.md is roughly 9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Stack?

Skills that share tags, products or a category with Stack: Pull Request Title and Body Writer (openinterpreter/openinterpreter, 69k stars), Contributor-First PR Merge (HKUDS/OpenHarness, 16k stars), Create Pull Request (cline/cline, 70k stars) and PR Review State Fetch (prisma/orm, 48k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Stack?

UsefulSoftwareCo (a GitHub organization) maintains it in UsefulSoftwareCo/executor, which has 4,085 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on October 7, 2026.

Source: UsefulSoftwareCo/executor on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.