| name | graphite-workflow |
| description | Use this skill when working with Graphite (gt) for stacked PRs, when the user mentions pull requests, Graphite, stacking, or gt commands. Ensures proper use of gt commands instead of raw git for stack-aware operations. |
Graphite Workflow Skill
This skill ensures correct usage of Graphite CLI (gt) for managing stacked PRs. When working in a Graphite-enabled workflow, always use gt commands instead of raw git commands for stack-aware operations.
When to Use
Apply this skill when:
- User mentions Graphite, pull requests, stacking, or
gt
- Working on a feature that uses stacked PRs
- Managing branches in a stack
Critical Rule: gt vs git
| Instead of... | Use... | Why |
|---|
git commit | gt create -a -m "message" | Creates branch + commit + tracks in stack |
git commit --amend | gt modify -a | Amends AND auto-restacks descendants |
git push | gt submit --no-interactive | Pushes AND creates/updates PRs |
git checkout <branch> | gt checkout <branch> | Stack-aware checkout |
git pull / git rebase | gt sync | Syncs trunk AND rebases entire stack |
Core Commands Quick Reference
gt create -a -m "feat: description"
gt modify -a
gt submit --no-interactive
gt submit --stack --no-interactive
gt up / gt down
gt top / gt bottom
gt checkout
gt sync
gt log
gt ls
The Stack Building Workflow
- Write code FIRST - Never create empty branches
- Stage changes -
git add .
- Create branch -
gt create -a -m "message"
- Repeat for each slice
- Submit stack -
gt submit --stack --no-interactive
When to Use Raw Git
These operations are fine with raw git:
git add - Staging files
git status - Checking status
git diff - Viewing changes
git log (for viewing history, not stack structure)
Handling Modifications
When changes are needed to an earlier PR in the stack:
gt checkout <branch-needing-changes>
git add .
gt modify -a
gt submit --stack --no-interactive
Conflict Resolution
git add .
gt continue
gt abort