From version-control
Graphite CLI for commits, branches, pushes, PRs, and stacked diffs. This skill should be used when the user mentions Graphite, gt commands (gt create, gt modify, gt submit, gt sync, gt split, gt ss), stacked PRs, stacked diffs, or stacked branches. It should also be used when about to commit, push, or create a PR, or when evaluating whether the current changeset should be committed as-is or split into smaller pieces first. Relevant when deciding whether to continue adding changes to the current branch or start a new one, when working on top of un-merged branches, managing dependent PRs, or restacking branches.
npx claudepluginhub dergut/ai --plugin version-controlThis skill uses the workspace's default tool permissions.
Graphite CLI (`gt`) manages stacked branches and PRs from the command line.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Guides TDD-style skill creation: pressure scenarios as tests, baseline agent failures, write docs to enforce compliance, verify with RED-GREEN-REFACTOR.
Guides idea refinement into designs: explores context, asks questions one-by-one, proposes approaches, presents sections for approval, writes/review specs before coding.
Graphite CLI (gt) manages stacked branches and PRs from the command line.
Instead of one massive PR, break work into a chain of small, reviewable PRs
where each builds on the previous.
Docs: https://graphite.com/docs/graphite-cli Stacking overview: https://www.stacking.dev/
When implementing a feature that depends on code from a branch not yet merged to trunk, use Graphite to formalize the dependency as a stack. This ensures:
Consider splitting into a stack when any of these apply:
Splitting strategy - group by concern:
When Graphite is available, always use gt commands instead of raw git:
git push — use gt submit or gt ss to push and create/update PRsgit checkout -b — use gt create to maintain stack metadatagt modify and let Graphite restack automaticallygit commit — use gt create (new branch) or gt modify (amend current branch)Breaking these rules corrupts Graphite's stack metadata and requires manual recovery.
# Ensure trunk is up to date
gt sync
# Create the first branch in the stack
gt create -am "add user schema migration"
# Continue working, create the next branch on top
gt create -am "implement user service logic"
# And the next
gt create -am "add user API handlers"
Each gt create stacks the new branch on top of the current one.
# Amend staged changes to current branch
gt modify -a
# Or add a new commit instead of amending
gt modify -cam "fix edge case in validation"
# Navigate to the branch
gt checkout <branch-name>
# Or use relative navigation
gt down 2
# Make changes, then amend
gt modify -a
# Graphite automatically restacks all upstack branches
If conflicts arise during restacking:
git add .gt continuegt abort# Submit entire stack (create/update PRs for all branches)
gt submit --stack
# Shorthand:
gt ss
# Submit only current branch and its downstack
gt submit
# Update only branches that already have PRs
gt ss -u
# Pull trunk, clean merged branches, restack
gt sync
| Command | Shorthand | Action |
|---|---|---|
gt log | Full stack view with PR status | |
gt log short | gt ls | Compact branch list |
gt checkout <branch> | gt co | Switch to branch |
gt up [n] | gt u | Move up n branches (default 1) |
gt down [n] | gt d | Move down n branches (default 1) |
gt top | gt t | Go to top of stack |
gt bottom | gt b | Go to bottom of stack |
| Command | Shorthand | Action |
|---|---|---|
gt split | gt sp | Split current branch into multiple |
gt fold | Fold branch into its parent | |
gt move | Move branch to a new parent | |
gt reorder | Reorder branches in the stack | |
gt squash | gt sq | Squash all commits in branch into one |
gt absorb | gt ab | Distribute staged changes to downstack branches |
gt pop | Delete branch, keep changes in working tree |
gt split interactively splits the current branch's changes into multiple
new branches. Use when a single branch has grown to cover multiple concerns.
Alternatively, split manually:
gt checkout <big-branch>gt pop (removes branch, keeps changes unstaged)gt create -am "first concern"gt create -am "second concern"# Undo the most recent Graphite mutation
gt undo
# Fetch a teammate's stack locally
gt get <branch-name>
# Freeze a branch to prevent edits
gt freeze <branch>
gt unfreeze <branch>
references/cli-reference.md - Full CLI command reference