Agent skill

Stacked PRs

by FoundationDB in FoundationDB/fdb-record-layer

Create and manage stacked pull requests on FoundationDB/fdb-record-layer using the gh stack CLI extension.

Apache-2.0Auto-check passedDevelopment

Install Stacked PRs

skills CLI
$ npx skills add FoundationDB/fdb-record-layer --skill stacked-prs -a claude-code

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

GitHub CLI
$ gh skill install FoundationDB/fdb-record-layer stacked-prs --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/FoundationDB/fdb-record-layer.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/stacked-prs .claude/skills/stacked-prs && 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
stacked-prs
GitHub stars
675
Token cost
~1.9k tokens
SKILL.md length
1,136 words
Files
1
Skills in repo
10
Repo updated
First seen
Licence
Apache-2.0

At a glance

Create and manage stacked pull requests on FoundationDB/fdb-record-layer using the gh stack CLI extension.

  • Works in 4 steps: gh stack down (or gh stack checkout… → Commit the change normally (using git… → gh stack rebase --upstack to cascade the… → …
  • Tasks that involve Pull requests
  • SKILL.md covers Who this applies to, Branch location and naming…, Why upstream branches instead… and Setup (once per clone), plus 5 more sections
  • Calls gh and git

What it does

Stacked PRs is an agent skill from FoundationDB/fdb-record-layer. Create and manage stacked pull requests on FoundationDB/fdb-record-layer using the gh stack CLI extension. Applies to Record Layer team members with write access to the upstream repository. Some example usages: "split this change into a stack of PRs" "create a stacked PR for this" "add a branch on top of my stack" "rebase my stack onto main" "why is my PR not showing up in the stack view"

Its SKILL.md is about 1.9k 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. It works with GitHub. The repository describes itself as: A relational database with SQL support built on FoundationDB. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Pull requests

Example prompts

  • “split this change into a stack of PRs”
  • “create a stacked PR for this”
  • “add a branch on top of my stack”
  • “/stacked-prs”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. gh stack down (or gh stack checkout «branch-name») to the branch that needs the change.
  2. Commit the change normally (using git add and git commit).
  3. gh stack rebase --upstack to cascade the change through every branch above it (plain gh stack rebase also pulls in trunk updates). Each…
  4. gh stack push to update the remote branches (uses --force-with-lease, safe for already-open PRs). Pushes are per-branch, not atomic. If…

What it can do on your machine

Read from SKILL.md and the folder at commit f266052. 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
    • git

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

  • Network

    No URLs in SKILL.md. Its commands use gh and git, 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

Stacked PRs loads about 1.9k tokens when it runs. Until then it costs about 102 tokens; SKILL.md has 1,136 words of instructions outside code blocks.

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

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 FoundationDB/fdb-record-layer at commit f266052, republished under its Apache-2.0 licence (© FoundationDB). 1,136 words, ~1,937 tokens.

Download SKILL.mdSave it as .claude/skills/stacked-prs/SKILL.md (or your agent's skills folder).
name
stacked-prs
description
Create and manage stacked pull requests on `FoundationDB/fdb-record-layer` using the `gh stack` CLI extension. Applies to Record Layer team members with write access to the upstream repository. Some example usages: "split this change into a stack of PRs" "create a stacked PR for this" "add a branch on top of my stack" "rebase my stack onto main" "why is my PR not showing up in the stack view"

Who this applies to

Team members with write access to FoundationDB/fdb-record-layer (check your own access with gh api repos/FoundationDB/fdb-record-layer --jq .permissions.push). External contributors without upstream write access must use a fork and cannot use stacked PRs.

Branch location and naming convention

In order for stacked pull requests to work, branches must live directly on FoundationDB/fdb-record-layer, never on a personal fork.

As a team-wide convention, branch names must be namespaced as follows:

apple/«github-username»/**

For example, apple/arnaud-lacurie/topic1/step2. This naming scheme avoids collisions with other contributors’ branches on the shared upstream repository and keeps personal work clearly attributed.

Why upstream branches instead of a fork

A pull request’s base branch must exist in the same repository as the PR itself. A PR opened from a fork can only ever target a branch that exists upstream (typically main); it cannot chain onto another of your own branches, because that branch lives only on the fork. Working directly on upstream branches is what makes GitHub’s native support for stacked-PR chaining and coordinated stack merges possible.

Setup (once per clone)

gh extension install github/gh-stack
gh repo set-default FoundationDB/fdb-record-layer

The default-repo setting matters even when a remote named upstream already exists. Without it, gh stack and gh pr commands may resolve PR numbers against a fork remote (for example, origin) instead of upstream. If you would rather not change the default, pass --repo FoundationDB/fdb-record-layer on each gh pr and gh api invocation instead.

Common workflows

  • To start a new stack, use gh stack init apple/«github-username»/«topic»/step1 apple/«github-username»/«topic»/step2 …, which adopts existing branches or creates new ones.
  • To add a layer on top of the current stack, use gh stack add apple/«github-username»/«topic»/stepN.
  • To push the whole stack and open or update its PRs, use gh stack submit. (Also follow the “Project conventions when submitting” below.)
  • To link branches or PRs that already exist into a stack, without adopting local tracking, use gh stack link «branch-or-pr» «branch-or-pr» …, which accepts branch names, PR numbers, or PR URLs, in bottom-to-top order.
  • To keep local branches in sync with remote state, use gh stack sync.
  • To rebase the whole stack (for example, onto an updated main), cascading through every layer, use gh stack rebase.
  • To restructure an existing stack, use gh stack modify, which opens an interactive TUI that can drop, fold, insert, reorder, and rename branches. Changes are staged and applied together; run gh stack submit afterward to update the PRs and the stack on GitHub.
  • To merge the stack, use gh stack merge. (See “Merging a stack” below.)
  • To navigate a stack locally, use gh stack top / bottom / up / down / switch / checkout.
  • To inspect stack state, use gh stack view, which is interactive; --short gives one line per branch and --json machine-readable output. Prefer --json when a script or agent needs to reason about the stack.
  • To tear a stack down, use gh stack unstack, which removes local tracking and unstacks it on GitHub while leaving the branches and their PRs intact. --local drops only the local tracking, leaving GitHub alone.

Project conventions when submitting

  • New PRs must be drafts (see AGENTS.md). The interactive editor for gh stack submit defaults new PRs to ready for review, so either switch each one with the “CREATE AS” toggle, or run gh stack submit --auto, which skips the editor and creates drafts. Never pass --open unless the human explicitly asks for PRs to be marked ready.
  • PR titles feed the release notes, so the auto-generated titles from --auto usually need fixing up afterwards (gh pr edit «n» --title '…').
  • gh stack submit cannot apply labels, so a freshly submitted stack will land without labels. Every PR still needs one of the required labels. To add a bug fix label, for example, use gh pr edit «n» --add-label 'bug fix'.
  • gh stack submit, gh stack push, and gh stack merge all change state on GitHub. Treat them as human-initiated. Don’t run them on your own initiative, and never merge without explicit consent.
Show full SKILL.md (490 more words)Show less

Merging a stack

The whole stack does not need to be merged at once.

  • You can merge any contiguous group starting from the lowest unmerged PR — including just the bottom PR alone. You cannot merge a mid-stack PR in isolation; everything below it merges with it in the same operation.
  • When the bottom PR merges, GitHub automatically retargets the next unmerged PR’s base to point directly at the trunk branch. No manual rebase/retarget step is needed for that.
  • Once the human has asked you to merge, prefer gh stack merge over merging PRs one-by-one through the UI. With no argument it merges the current stack (with an interactive picker for how far up to go); pass a stack or PR number to control how far. It performs the chosen range as a single all-or-nothing operation.
  • If the stack’s history isn’t linear when you try to merge, a “Rebase stack” button appears in the PR merge box on GitHub, or run gh stack rebase from the CLI. A stack must have a linear history between its branches before it can merge.
  • In a merge queue, ejecting a PR also ejects everything above it in the stack.

Modifying a lower branch after the stack exists

Make the change in the branch it actually belongs to — don’t work around it by patching the change into a higher layer. Then propagate it upward:

  1. gh stack down (or gh stack checkout «branch-name») to the branch that needs the change.
  2. Commit the change normally (using git add and git commit).
  3. gh stack rebase --upstack to cascade the change through every branch above it (plain gh stack rebase also pulls in trunk updates). Each branch is rebased onto the branch below it, in order — this is required because a stack needs linear history to merge.
  4. gh stack push to update the remote branches (uses --force-with-lease, safe for already-open PRs). Pushes are per-branch, not atomic. If one branch is rejected, the others may still have updated; fix that branch and re-run, the rest stay as they are.

On a conflict partway up the stack, gh stack rebase stops and lists the conflicted files — resolve them, git add, then gh stack rebase --continue. gh stack rebase --abort restores every branch to its pre-rebase state.

Gotchas

  • gh stack view operates on the stack of the locally checked-out branch. It needs a local branch that’s part of a tracked stack, and does not take a stack number as an argument. gh stack checkout «stack-number» does, and switches you into that stack first.
  • gh stack link does not require local tracking state. Use it to retroactively register a stack from PRs that were created another way (for example, manually chained base branches).
  • Branch from upstream/main, not a fork’s main. A fork’s main can silently fall behind upstream; branches based on the stale copy will show mergeable: CONFLICTING even though the git ancestry within the stack itself looks fine.

© FoundationDB, Apache-2.0. 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 .claude/skills/stacked-prs of FoundationDB/fdb-record-layer.

Open the folder on GitHubat commit f266052

Compare with similar skills

Stacked PRs 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.

Stacked PRs compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Stacked PRs this skillFoundationDB/fdb-record-layer675—~1.9kAutomated safety check: PassApache-2.0
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Check PRonyx-dot-app/onyx32k2 repos~2.3kAutomated safety check: PassMIT
Contributor-First PR MergeHKUDS/OpenHarness16k1 repos~847Automated safety check: PassMIT
Create Pull Requestcline/cline70k1 repos~1.6kAutomated safety check: PassApache-2.0
Pull Request Title and Body Writeropeninterpreter/openinterpreter69k2 repos~1.1kAutomated safety check: PassApache-2.0

Similar skills

  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Check PR

    onyx-dot-app/onyx

    Checks a GitHub, GitLab, or Perforce (p4) pull request (or merge request, or shelved changelist) for unresolved review comments, failing status checks, and incomplete PR descriptions.

    32k GitHub starsUsed in 2 repos~2.3k 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
  • 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
  • Official

    Runs a loop on a GitHub pull request: fetch review state, triage comments into actions, implement them and resolve threads, repeating until nothing actionable is left.

    48k GitHub stars~2.2k tokensUpdated today
    DevelopmentAuto-check passed

More from FoundationDB/fdb-record-layer

All 10 skills in this repo
  • Relational Query Processor

    FoundationDB/fdb-record-layer

    Specialized skill for working in the fdb-relational-core SQL processing layer — parser, plan generator, and Cascades planner.

    675 GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Using Gradle

    FoundationDB/fdb-record-layer

    A skill your agent uses when you need to build the project, compile code, or run tests.

    675 GitHub stars~705 tokensUpdated today
    Auto-check passed
  • Context Resumption

    FoundationDB/fdb-record-layer

    Rebuild working context after a session restart. An agent skill from FoundationDB/fdb-record-layer.

    675 GitHub stars~467 tokensUpdated today
    Auto-check passed
  • Docs Writer

    FoundationDB/fdb-record-layer

    Write or update documentation in docs/sphinx/source/. An agent skill from FoundationDB/fdb-record-layer.

    675 GitHub stars~925 tokensUpdated today
    Auto-check passed
  • Frl Coding Standard

    FoundationDB/fdb-record-layer

    Coding standards for all Java code in fdb-record-layer. An agent skill from FoundationDB/fdb-record-layer.

    675 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Frl Test Coding Standard

    FoundationDB/fdb-record-layer

    Standards for writing tests in fdb-record-layer. An agent skill from FoundationDB/fdb-record-layer.

    675 GitHub stars~792 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Stacked PRs

What does Stacked PRs do?

Create and manage stacked pull requests on FoundationDB/fdb-record-layer using the gh stack CLI extension. Stacked PRs is an agent skill from FoundationDB/fdb-record-layer. Create and manage stacked pull requests on FoundationDB/fdb-record-layer using the gh stack CLI extension.

When should I use Stacked PRs?

Stacked PRs fits situations like: tasks that involve Pull requests.

How do I install Stacked PRs in Claude Code?

Run `npx skills add FoundationDB/fdb-record-layer --skill stacked-prs -a claude-code`. Or copy the skill folder (.claude/skills/stacked-prs in FoundationDB/fdb-record-layer) into .claude/skills/stacked-prs in your project. Claude Code loads it when a task matches its description.

How do I install Stacked PRs in Codex?

Run `npx skills add FoundationDB/fdb-record-layer --skill stacked-prs -a codex`. Or copy the skill folder (.claude/skills/stacked-prs in FoundationDB/fdb-record-layer) into .agents/skills/stacked-prs in your project. Codex loads it when a task matches its description.

Can I use Stacked PRs 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 FoundationDB/fdb-record-layer --skill stacked-prs -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/stacked-prs, .gemini/skills/stacked-prs, .github/skills/stacked-prs and .opencode/skills/stacked-prs in your project.

What does Stacked PRs need to run?

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

Does Stacked PRs access the network?

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

Is Stacked PRs 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 Stacked PRs use?

Stacked PRs is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Stacked PRs use?

About 1.9k tokens (SKILL.md is roughly 7.7k 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 Stacked PRs?

Skills that share tags, products or a category with Stacked PRs: PR Babysitter (openinterpreter/openinterpreter, 69k stars), Check PR (onyx-dot-app/onyx, 32k stars), Contributor-First PR Merge (HKUDS/OpenHarness, 16k stars) and Create Pull Request (cline/cline, 70k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Stacked PRs?

FoundationDB (a GitHub organization) maintains it in FoundationDB/fdb-record-layer, which has 675 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 7, 2026.

Source: FoundationDB/fdb-record-layer on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.