Claude-skill-registry graphite-workflow
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.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/graphite-workflow" ~/.claude/skills/majiayu000-claude-skill-registry-graphite-workflow && rm -rf "$T"
manifest:
skills/data/graphite-workflow/SKILL.mdsource content
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 |
|---|---|---|
| | Creates branch + commit + tracks in stack |
| | Amends AND auto-restacks descendants |
| | Pushes AND creates/updates PRs |
| | Stack-aware checkout |
/ | | Syncs trunk AND rebases entire stack |
Core Commands Quick Reference
# Creating PRs in a stack gt create -a -m "feat: description" # Stage all, create branch, commit # Modifying existing PR gt modify -a # Amend commit, auto-restack upstack # Submitting to GitHub gt submit --no-interactive # Current branch + downstack gt submit --stack --no-interactive # Entire stack # Navigation gt up / gt down # Move within stack gt top / gt bottom # Jump to ends of stack gt checkout # Interactive picker # Syncing gt sync # Fetch trunk, rebase stack, cleanup merged # Viewing gt log # Visual stack graph gt ls # Short list
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:
- Staging filesgit add
- Checking statusgit status
- Viewing changesgit diff
(for viewing history, not stack structure)git log
Handling Modifications
When changes are needed to an earlier PR in the stack:
gt checkout <branch-needing-changes> # Make code changes git add . gt modify -a # Amend + auto-restack gt submit --stack --no-interactive # Push updates
Conflict Resolution
# If conflict occurs during sync/restack: # 1. Fix conflicts in editor git add . gt continue # To abort: gt abort