git-workflow-stack

Manages stacked pull requests with chained branches, ordered merges, and conflict detection.

1|Updated Jan 14, 2024
One-click install
npx skills add https://github.com/Eyhenij/rt-tools --skill git-workflow-stack-eyhenij
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-workflow-stack
Source: https://github.com/Eyhenij/rt-tools/tree/main/.claude/skills/git-workflow-stack
Command: npx skills add https://github.com/Eyhenij/rt-tools --skill git-workflow-stack-eyhenij

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When several pieces of work depend on each other, opening all PRs against the main branch creates quadratic merge conflicts, stale branches, and silently lost work. This Skill defines a disciplined pattern for stacking PRs so dependent changes merge cleanly in order. ## Core Features & Use Cases - Chained branching: Branch each dependent work item from the previous branch instead of the epic branch, and set each PR's base to its predecessor. - Ordered bottom-up merging: Retarget the heir PR's base after each merge, close linked issues manually since the host only auto-closes on merges to the default branch, and record merge order in PR bodies. - Conflict and lag detection: Query mergeable status across all open PRs with the GitHub CLI, merge main only on actual conflicts, and detect silently lagging local branch stacks. - Use Case: You finished five sequential tasks in one session on one epic. Use this pattern to chain the branches, open stacked PRs with declared merge order, run a trial merge to find collisions, and hand the owner a clean bottom-up merge list. ## Quick Start Ask the AI to organize my pending feature branches into a stacked PR chain with the correct base branches and merge order using the git-workflow-stack pattern.

Frequently Asked Questions about git-workflow-stack

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

FAQPage Schema
How do I create stacked pull requests on GitHub?

Branch each dependent work item from the previous branch rather than the main or epic branch, then open each PR with its predecessor as the base using gh pr create --base. Merge bottom-up and retarget each heir's base after its predecessor merges.

How do I check which open PRs have merge conflicts?

Run gh pr list --state open --json number,headRefName,mergeable and filter for entries where mergeable equals CONFLICTING. An UNKNOWN result means the host is still computing, so repeat the call after a few seconds rather than merging main preemptively.

Why does GitHub not auto-close issues for stacked PRs?

GitHub only closes linked issues when a PR merges into the default branch, and a stacked PR merges into its predecessor branch instead. Close the issue manually with a comment naming the PR that merged the work.

What happens if I rebase the lower branch in a PR stack?

Rebasing or force-pushing the lower branch makes the upper branch's tip reachable from its base, so the host closes the upper PR as merged even though main has none of its edits. Fix a lagging lower branch by merging main into it instead.

When should I avoid opening all stacked PRs at once?

Avoid opening all PRs at once when many branches touch the same files, since each merge makes the rest stale and the maintenance cost grows quadratically. Hand over only as much as the owner can merge, and declare the merge order in each PR body.