kata-stacked-pr-merge

Merge stacked pull requests bottom-to-top with CI and approval validation.

Updated Sep 3, 2025
One-click install
npx skills add https://github.com/guardiatechnology/design-system --skill kata-stacked-pr-merge
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kata-stacked-pr-merge
Source: https://github.com/guardiatechnology/design-system/tree/main/.claude/skills/kata-stacked-pr-merge
Command: npx skills add https://github.com/guardiatechnology/design-system --skill kata-stacked-pr-merge

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

You need to merge a chain of stacked Pull Requests (base → top) without breaking later layers, while ensuring each upper layer is rebased onto the updated main branch and that the umbrella issue closes.

Core Features & Use Cases

  • Order-safe stacked PR merging: merges layer 1 first, then processes layers 2..N in sequence to preserve correct bases.
  • Explicit base migration before rebasing: updates each upper PR’s GitHub base to main before performing a local rebase and force-push.
  • Operational guardrails and validation: checks CI status, approval presence, mergeability, and umbrella issue closure; stops when conflicts arise and delegates resolution to the rebase kata.
  • Two execution paths: supports a vanilla gh + git workflow and a git-spice variant for syncing/rebasing after merges.

Quick Start

Run the stacked merge procedure for a stack of N PR layers using gh pr merge in order, and for each upper layer first change the PR base to main, then rebase onto origin/main, force-push with lease, and merge via CLI.

Frequently Asked Questions about kata-stacked-pr-merge

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I merge stacked pull requests in order without breaking upper layers?

Merging stacked pull requests in order requires processing the bottom layer first, then sequentially updating each upper layer's GitHub base to main, rebasing onto origin/main, and force-push with lease before merging. This preserves correct branch bases throughout the stack.

What is the correct workflow for rebasing stacked PRs onto the main branch?

Rebasing stacked PRs onto main involves explicitly changing each upper PR's GitHub base to main before performing a local git rebase onto origin/main. A force-push with lease updates the remote branch safely without overwriting concurrent changes.

Does this stacked PR merge process check CI status and approvals before merging?

Yes, the stacked PR merge process validates CI status, approval presence, and mergeability for each layer before merging. It also checks umbrella issue closure to ensure full stack completion and stops when conflicts arise.

Can I use git-spice to sync and rebase stacked pull requests after a merge?

Yes, the stacked PR merge workflow supports a git-spice variant for syncing and rebasing layers after merges. It also provides a vanilla gh plus git workflow path for teams not using git-spice.

What happens when a rebase conflict occurs during a stacked PR merge?

When a rebase conflict occurs during a stacked PR merge, the process stops and delegates conflict resolution to the rebase kata. This prevents out-of-order merges, premature branch deletion, and broken upper layers.