From graphite-skill
Manage Graphite stacked PRs. USE THIS SKILL when the user invokes "/graphite", "/gt", "/stack", says "debug my stack", "get stack comments", "resolve restack conflicts", "create a stack", "submit stack", "sync graphite", "restack", "debug PR", "PR comments", or "stack status". Provides four workflows for stack debugging, comment aggregation, conflict resolution, and general Graphite operations.
npx claudepluginhub jpdesigntech/graphite-skillThis skill uses the workspace's default tool permissions.
Manage stacked PRs using Graphite CLI.
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Manage stacked PRs using Graphite CLI.
This skill only applies to Graphite-managed repositories. Verify by checking for .git/.graphite_repo_config.
gt commands (this skill applies)git commands (this skill does NOT apply)mcp__graphite__run_gt_cmd for all gt commands (if Graphite MCP is connected)Bash(gt ...) if MCP tool is unavailable or errorsgh CLI for PR comments, CI status, reviews (not covered by Graphite MCP)mcp__graphite__learn_gt when unsure about a command's syntax or flags--no-interactive to gt submit and other interactive commandsAt the start of any workflow, detect the repo context:
# Get trunk branch name
gt trunk 2>/dev/null || echo "main"
# Get GitHub repo (owner/name)
gh repo view --json nameWithOwner --jq '.nameWithOwner' 2>/dev/null
Store these as TRUNK and REPO for use in all subsequent commands.
When the skill triggers, identify which workflow the user needs from context. If ambiguous, ask with AskUserQuestion:
| Workflow | When to use |
|---|---|
| 1. Debug Stack | User mentions CI failures, PR issues, review blockers, stack status |
| 2. Stack Comments | User wants PR review comments, feedback, or unresolved threads |
| 3. Resolve Conflicts | User mentions restack conflicts, merge conflicts, sync issues |
| 4. General Workflow | Creating stacks, submitting, syncing, navigating, reorganizing |
Diagnose CI failures, review blockers, and PR status across the entire stack.
Run gt log short to get the ordered list of branches in the current stack.
For each branch in the stack, run in parallel where possible:
gh pr list --repo $REPO --head <branch> --json number,title,state,statusCheckRollup,reviewDecision,mergeable,isDraft
For PRs with failing checks:
gh pr checks <number> --repo $REPO
For specific failed runs, get the failure log:
gh run view <run_id> --repo $REPO --log-failed
Format a structured table:
| # | Branch | PR | CI | Reviews | Blockers |
|---|--------|----|----|---------|----------|
| 1 | branch-name | #123 | passing/failing | approved/changes_requested/pending | list blockers |
Always fix from the bottom of the stack up -- fixes in lower branches cascade to upper branches after restack. Explain which PRs are blocked by which failures.
Aggregate all PR review comments across the entire stack into one view.
Run gt log short to get the ordered branch list.
For each branch:
gh pr list --repo $REPO --head <branch> --json number,title
For each PR, fetch both types of comments:
Inline code review comments (file-specific):
gh api repos/$REPO/pulls/<number>/comments --jq '.[] | {path: .path, line: .line, body: .body, user: .user.login, created_at: .created_at, in_reply_to_id: .in_reply_to_id}'
General review comments (PR-level):
gh api repos/$REPO/pulls/<number>/reviews --jq '.[] | {state: .state, body: .body, user: .user.login, submitted_at: .submitted_at}'
Issue comments (conversation):
gh pr view <number> --repo $REPO --json comments --jq '.comments[] | {body: .body, author: .author.login, createdAt: .createdAt}'
Present comments in bottom-up stack order (matches fix priority):
## PR #123: feat: add fog layer (branch: feat_fog_layer)
### Inline Comments
- **file.tsx:42** (@reviewer): "Consider using useCallback here"
- **store.ts:15** (@reviewer): "This should be derived state"
### Review Comments
- @reviewer (CHANGES_REQUESTED): "Needs error handling for the disconnect case"
### Conversation
- @reviewer: "Can we add a loading state?"
After presenting, ask if the user wants to filter:
Guide the user through resolving conflicts during gt restack or gt sync.
Run the command the user requested:
gt restack -- rebase current stack onto parentsgt sync -- pull trunk, rebase all stacks, clean mergedIf the output contains "CONFLICT" or the command exits with an error:
git diff --name-only --diff-filter=U to get the full list of unmerged filesFor each conflicted file:
references/conflict-resolution.md:
git add <file>After all files in the current step are resolved:
gt continue
If more conflicts appear (next branch in the stack), repeat from Step 3.
After the full restack completes, suggest running the project's type checker and linter to catch incomplete resolutions.
Suggest pushing the restacked branches:
gt submit --no-interactive
If conflicts are too complex or the user wants to stop:
gt abort
This returns to the state before the restack started. No work is lost.
Always plan the stack structure before writing code.
Break the feature into logical, sequential PRs. Each PR should represent one logical concern.
Present the planned stack to the user:
Stack Plan for [Feature]:
1. PR 1: [branch-name] - [description] (~X lines)
2. PR 2: [branch-name] - [description] (~X lines)
3. PR 3: [branch-name] - [description] (~X lines)
Each PR must:
Ask for confirmation before creating any branches.
Stage the relevant files, then create:
gt create <branch-name> -m "<conventional-commit-message>"
Or stage all and create in one step:
gt create <branch-name> -am "<conventional-commit-message>"
Commit message format: conventional commits, casual and concise
feat: add fog layer state managementfix: resolve token position reset on map changerefactor: extract service from routerchore: update schema for new tableTo amend the current branch (e.g., addressing review feedback):
gt modify -a
This stages all changes, amends the commit, and auto-restacks all descendant branches.
For adding a separate commit (not amending):
gt modify -c
Current branch + all downstack (recommended default):
gt submit --no-interactive
Entire stack including descendants:
gt submit --stack --no-interactive
PR descriptions should explain:
Keep it casual and concise. No LLM fluff, no em dashes.
After submitting, return the Graphite PR URL (e.g., https://app.graphite.dev/github/pr/...) when available.
Pull latest trunk, rebase all stacks, clean merged branches:
gt sync
Run this:
If conflicts arise during sync, switch to Workflow 3 (Resolve Conflicts).
gt log # Full stack visualization with PR status
gt log short # Compact view
gt up # Move up one branch
gt down # Move down one branch
gt top # Jump to top of stack
gt bottom # Jump to bottom of stack
gt checkout X # Switch to specific branch
gt move --onto <branch> # Reparent current branch
gt fold # Merge current branch into parent
gt split # Split current branch into multiple
gt reorder # Reorder branches in stack
gt absorb # Distribute staged changes to correct downstack branch
gt delete <branch> # Delete a branch
gt rename <new-name> # Rename current branch
mcp__graphite__run_gt_cmd > Bash(gt ...) > ask user to run manuallymcp__graphite__learn_gt when unsure about command syntaxgt submit handle all pushes--no-interactive for automated commandsfeat:, fix:, etc.), casual and concise, no LLM fluffSee references/cheatsheet.md for the full gt command reference.
See references/conflict-resolution.md for detailed conflict resolution patterns.