agentleFS
d-oitd-oit/rust-2026-template/.agents/skills/stacked-prs/SKILL.md

stacked-prs

Skill15 starsChanged 5 months agoMITView on GitHub

Optional workflow for large features using stacked PRs via gh-stack. Use ONLY when a feature has 3+ distinct concerns with clear dependencies. NOT for bug fixes, hotfixes, or small changes. Requires GitHub. Triggers: "stacked PRs", "gh stack", "split into layers", "stack this".

  • Deletes or force-pushes
  • Commits and pushes

14 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use show-me, blast-radius and 4 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • AnasX7Skill

    show-me

    Help the user understand the current topic visually with concise diagrams, code-shape sketches, and focused HTML artifacts.

    Also in 3 projects that use this

  • MicrosoftSkill

    blast-radius

    Assesses network dependency and shared-infrastructure exposure. Use when the user asks which services, customers, SLA policies, routes, or redundant links are affected by a network fault.

    Also in 3 projects that use this

  • Harut8Skill

    architect

    Also in 3 projects that use this

  • GoogleSkill

    improve-codebase-architecture

    Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

    Also in 3 projects that use this

  • GoogleSkill

    grilling

    Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.

    Also in 3 projects that use this

  • +1 more from google

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 6 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use stacks ONLY when ALL of these hold:

    line 23
  2. Distinctive:

    Do NOT use for: bug fixes, hotfixes, small/medium changes, or issue-triage batch work.

    line 30
  3. Very specific:

    Use stacked PRs when: GitHub repo, 3+ distinct layers, different reviewers per layer.

    line 44
  4. Very specific:

    Quality gates: run per-PR naturally — each layer gets its own CI via ./scripts/quality-gates.sh

    line 49
  5. Distinctive:

    Hotfixes: Never stack hotfixes — they must be atomic for DORA Change Failure Rate tracking

    line 53
  6. Distinctive:

    Always use flags to avoid TUI blocking:

    line 57
  7. Distinctive:

    Always merge bottom-up (closest to trunk first)

    line 97
  8. Distinctive:

    If a bottom PR is rejected, close upstack PRs and restack

    line 98
  9. Very specific:

    Use gh stack merge <pr-number> --yes to merge that PR and every unmerged PR below it

    line 99
  10. Very specific:

    After all layers merge, gh stack sync --prune cleans up local branches

    line 100
  11. Very specific:

    Partial submit: If gh stack submit fails mid-way (e.g., network error after 2 of 3 PRs created), re-run gh stack submit — it skips branches …

    line 104
  12. Very specific:

    Rebase conflict: Run gh stack rebase, resolve conflicts, git add, gh stack rebase --continue.

    line 105
  13. Very specific:

    Diverged stacks: Run gh stack sync to fetch and reconcile with GitHub.

    line 106

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Stacked PRs (Optional)

When to Use

Stacked PRs are OPTIONAL. Default to single-PR atomic commits (see atomic-commit skill). Use stacks ONLY when ALL of these hold:

  • Feature has 3+ distinct concerns with clear dependencies
  • Different layers need different reviewers
  • Bottom layers can merge independently while top layers are WIP
  • Repository is on GitHub (not GitLab)

Do NOT use for: bug fixes, hotfixes, small/medium changes, or issue-triage batch work.

Setup

gh extension install github/gh-stack
git config rerere.enabled true      # remember conflict resolutions

See https://github.com/github/gh-stack for the full agent skill (SKILL.md + references/). This file provides template-specific integration guidance only.

Decision Flow

Use stacked PRs when: GitHub repo, 3+ distinct layers, different reviewers per layer. Otherwise: use atomic-commit (single PR).

Template Integration

  • Quality gates run per-PR naturally — each layer gets its own CI via ./scripts/quality-gates.sh
  • Conventional commits per layer: feat(scope): description
  • Branch naming: <topic>/<concern> (e.g., billing/schema, billing/api)
  • Metrics: Report one event per layer completion to .agents/events/YYYY/MM/DD/
  • Hotfixes: Never stack hotfixes — they must be atomic for DORA Change Failure Rate tracking

Non-Interactive Agent Usage

Always use flags to avoid TUI blocking:

CommandUseNever run bare
Viewgh stack view --jsongh stack view (opens TUI)
Submitgh stack submit --autogh stack submit (prompts per PR)
Submit (ready)gh stack submit --auto --opencreates non-draft PRs
Initgh stack init <branches...>gh stack init (prompts for names)
Mergegh stack merge <pr-number> --yesgh stack merge (interactive picker)
Addgh stack add <branch>gh stack add (prompts for name)
Checkoutgh stack checkout <target>gh stack checkout (opens menu)
ModifyNot available non-interactivelygh stack modify (TUI-only)

Typical Agent Workflow

# 1. Create stack with named branches
gh stack init feat/billing/schema feat/billing/api feat/billing/ui

# 2. Implement bottom layer
git add ... && git commit -m "feat(billing): add schema and models"
./scripts/quality-gates.sh

# 3. Move up and implement next layer
gh stack up
git add ... && git commit -m "feat(billing): add API routes"
./scripts/quality-gates.sh

# 4. Push and create draft PRs
gh stack submit --auto

# 5. After review changes on a layer
gh stack bottom
git add ... && git commit -m "fix(billing): address schema review"
gh stack rebase --upstack
gh stack push

Merge Strategy

  • Always merge bottom-up (closest to trunk first)
  • If a bottom PR is rejected, close upstack PRs and restack
  • Use gh stack merge <pr-number> --yes to merge that PR and every unmerged PR below it
  • After all layers merge, gh stack sync --prune cleans up local branches

Failure Recovery

  • Partial submit: If gh stack submit fails mid-way (e.g., network error after 2 of 3 PRs created), re-run gh stack submit — it skips branches that already have PRs
  • Rebase conflict: Run gh stack rebase, resolve conflicts, git add, gh stack rebase --continue. Use --abort to restore all branches
  • Diverged stacks: Run gh stack sync to fetch and reconcile with GitHub. If that fails, gh stack unstack then gh stack submit --auto to recreate.

Rationalizations

RationalizationReality
"I'll put everything in one PR, it's simpler"Large PRs get superficial reviews. Stacked PRs get focused, thorough reviews per layer.
"Stacking is too much overhead for this feature"If you're already splitting concerns across files, stacking formalizes what you're doing anyway.
"I'll split the PR after I finish coding"Splitting after the fact is expensive and error-prone. Plan layers before writing code.

Red Flags

  • Stacking a bug fix or hotfix (use atomic-commit instead)
  • Using git push --force on stacked branches (use gh stack push)
  • Stacking on GitLab (gh-stack is GitHub-only)
  • Amending commits on a stacked branch (breaks upstack branches)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.