semantic-stacked-pr

Split one change into a stack of PRs by meaning using gh stack.

Updated Jun 28, 2026
One-click install
npx skills add https://github.com/Cohey0727/CodingAgentTools --skill semantic-stacked-pr-cohey0727
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: semantic-stacked-pr
Source: https://github.com/Cohey0727/CodingAgentTools/tree/main/skills/semantic-stacked-pr
Command: npx skills add https://github.com/Cohey0727/CodingAgentTools --skill semantic-stacked-pr-cohey0727

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Large pull requests that mix hand-written contracts, generated code, behavior fixes, and tests force reviewers to dig through hundreds of irrelevant lines to find the changes that matter. This Skill splits one change into a stack of PRs by meaning, so each reviewer sees only the layer that needs their scrutiny. ## Core Features & Use Cases - Semantic Layer Classification: Assigns every changed file to exactly one of four layers — Base (codegen input), Generated (generator output), Fix (behavior change), and Tests — using evidence like generated-file headers and lockfile patterns. - Automated Stack Building: Creates branches, commits, and draft PRs bottom-up with gh stack, then rewrites each PR with a proper title, body, and label (generated, test). - Drift-Check Awareness: Detects CI codegen drift checks that would make a Base-only PR fail, and offers to fold Base and Generated into one PR with two commits. - Use Case: You changed an OpenAPI spec, regenerated the client (800 lines), fixed retry logic (20 lines), and added tests. The Skill produces four stacked PRs so reviewers read the contract and the fix while skipping the generated diff entirely. ## Quick Start Split my current uncommitted changes into a stacked PR by meaning using the semantic-stacked-pr skill.

Frequently Asked Questions about semantic-stacked-pr

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

FAQPage Schema
How do I split a large pull request into stacked PRs on GitHub?▼

Use the gh stack extension to build a stack of branches bottom-up, committing each layer's files separately and submitting with gh stack submit. This Skill automates the split by classifying files into Base, Generated, Fix, and Tests layers before creating the PRs.

How to separate generated code from real changes in a PR?▼

Detect generated files by headers like '@generated' or 'DO NOT EDIT', plus lockfiles and codegen output patterns, then commit them to their own PR labeled 'generated'. Reviewers verify the generator command instead of reading the diff.

Does gh stack work with branch protection and required CI checks?▼

Yes, but a Base PR containing a contract change without regenerated output can fail CI drift checks like 'git diff --exit-code'. The Skill detects such workflows and offers to fold Base and Generated into one bottom PR with two commits.

What happens if my change has no generated code or tests?▼

The Skill only creates PRs for non-empty layers. A change with no codegen becomes a two-layer stack of Fix and Tests, and a single-layer change is delegated to a normal single-PR workflow instead of creating a stack.

Can I split a branch that already has an open PR?▼

No. Splitting a branch with an open PR would require a force push over a branch under review, so the Skill stops and reports instead. It only rewrites local history on branches without an open PR, and asks before doing so.