split-commit-into-stack

Split oversized commits into stacks of independently reviewable Graphite PRs.

7.7k|1.1k|Updated Mar 19, 2025
One-click install
npx skills add https://github.com/maximhq/bifrost --skill split-commit-into-stack
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: split-commit-into-stack
Source: https://github.com/maximhq/bifrost/tree/main/.claude/skills/split-commit-into-stack
Command: npx skills add https://github.com/maximhq/bifrost --skill split-commit-into-stack

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Large commits and branches are hard to review because reviewers cannot tell which changes belong to which decision. This Skill analyzes an oversized commit or branch and splits it into a stack of Graphite (gt) PRs where each lower PR builds and passes tests on its own.

Core Features & Use Cases

  • Concern-Based Analysis: Measures the full diff against the merge base, groups changes by decision rather than directory, and reports production versus test line counts before proposing any split.
  • Dependency Verification: Statically checks which symbols cross the proposed cut, then proves the lower PR compiles and passes tests with the upper half genuinely absent using a patch-based reset workflow.
  • Atomicity Judgment: Refuses to split refactors that have no compiling intermediate state, and relocates small seams (interfaces, mocks) down-stack instead of splitting files hunk by hunk.
  • Use Case: You have a 3,500-line branch mixing a storage-layer refactor with a new API endpoint. The Skill identifies the two concerns, commits the storage change as the lower PR, proves it builds alone, and creates the endpoint as the upper PR ready for gt submit --stack.

Quick Start

Ask the AI to split this oversized branch into a stack of reviewable Graphite PRs where each lower PR builds and passes tests independently.

Frequently Asked Questions about split-commit-into-stack

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

FAQPage Schema
How do I split a large commit into multiple PRs?

Measure the full diff against the merge base, group files by concern rather than directory, then commit the lower concern explicitly with git add and create the upper PR with gt create. Verify the lower PR builds and passes tests with the upper half removed before submitting.

How to split a branch into a Graphite stacked PR workflow?

Use gt split --by-commit when the branch already has commits matching each concern, or rewrite the tip with plain git reset and gt create for many-file splits. Run gt restack afterward if the branch has children, and confirm order with gt log long before gt submit --stack.

When should you not split a commit into smaller PRs?

Do not split when the change is atomic, meaning removing a field or method requires simultaneously adding its replacement and flipping every reader and writer. Any intermediate state would fail to compile or hold the same fact in two places, making it harder to review than the whole change.

How do I verify a lower PR in a stack builds independently?

Stage the upper half as a patch, run git reset --hard to the lower commit, then run go build, go vet, and go test -count=1 in every touched module. The -count=1 flag bypasses Go's test cache, which can report stale passing results for a broken split.

What happens if one file contains changes for two concerns?

Avoid hunk-level splitting by moving a small seam, such as an interface entry plus its implementation and mocks, into the lower PR where it may sit unused. This keeps files whole and prevents manual conflict resolution on every later rebase.