Skip to content
Back to skills

Graphite Workflow

ASecurity

Graphite CLI (gt) for stacked PRs. Use when the user mentions Graphite, `gt`, or stacked PRs, or the current branch is already tracked by Graphite. Not for ordinary PRs; those go through `gh`.

  • 6 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 23, 2026
developmentgobashgit

Works with

  • cli

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 23, 2026

npx -y skills add narrowstacks/dorkroom --skill graphite-workflow --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Graphite Workflow?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Graphite Workflow
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/narrowstacks-graphite-workflow/badge)](https://www.skillsdirectory.com/skills/narrowstacks-graphite-workflow)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: graphite-workflow
description: Graphite CLI (gt) for stacked PRs. Use when the user mentions Graphite, `gt`, or stacked PRs, or the current branch is already tracked by Graphite. Not for ordinary PRs; those go through `gh`.
---

# Graphite Workflow Skill

Graphite CLI (`gt`) for managing stacked PRs. First check that `gt` is installed
(`command -v gt`); if it isn't, say so and use plain `git`/`gh`. In a stack, use
`gt` for stack-aware operations, because raw `git` commits and rebases leave
descendant branches un-restacked.

The repo's git rules still apply: confirm before committing, and don't run
`gt submit` (which pushes) without an explicit request.

## 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

```bash
# 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

1. **Write code FIRST** - Never create empty branches
2. **Stage changes** - `git add .`
3. **Create branch** - `gt create -a -m "message"`
4. **Repeat** for each slice
5. **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:

```bash
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

```bash
# If conflict occurs during sync/restack:
# 1. Fix conflicts in editor
git add .
gt continue

# To abort:
gt abort
```

Files in this skill

  • SKILL.md2.8 KB
  • examples.md2.9 KB
  • references.md2.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…