# graphite

Teaches the agent to build and manage Graphite PR stacks: create branches, walk the stack, restack on main.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 10000 installs · ★ 7
- Author: withgraphite
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/withgraphite/agent-skills/tree/HEAD/skills/graphite/SKILL.md
- Updated: 2026-02-18
- HTML: https://affpapa.org/en/nevibecode/skills/graphite

## What it does

The skill covers the Graphite CLI (`gt`) and whitelists the commands the agent may run: `gt *`, `git add`, `git reset`, `git diff`, `git status`, `git stash`, `git checkout`, `git rebase`, `git branch` and `gh pr`. Inside there is a quick-reference table, the basic stack workflow, navigation (`gt up`, `gt down`, `gt top`, `gt bottom`, `gt ls`), amending a branch with `gt modify` and submitting with `gt submit --no-interactive`.

A separate section handles branches Graphite does not track. When `gt branch info` returns the untracked-branch error, the skill gives two routes: track the branch temporarily with `gt track -p main`, build the stack, then re-parent the first branch onto main and run `gt restack`; or stash the work and start from main. There is also a recipe for resetting commits back to unstaged changes and advice to reorder branches with `gt move` rather than `gt create --insert`.

Before submitting, the skill tells the agent to confirm with `gt ls` that the first branch sits on main, then run lint, build and tests using the commands from the project's `CLAUDE.md`. PR descriptions should be written to `/tmp/pr-body.md` and applied with `gh pr edit --body-file` instead of a heredoc, because shell escaping breaks markdown. In deep stacks `gt restack` can touch branches outside your work and hit unrelated conflicts; the skill points to a targeted `git rebase <target>` for that case.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add withgraphite/agent-skills --skill graphite -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/graphite/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/graphite/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add withgraphite/agent-skills --skill graphite -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/graphite/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add withgraphite/agent-skills --skill graphite -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/graphite/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install withgraphite/agent-skills graphite
```

2. **Manually: put the files in place**
- File: `.github/skills/graphite/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add withgraphite/agent-skills --skill graphite -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/withgraphite/agent-skills --path skills/graphite
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/graphite/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add withgraphite/agent-skills --skill graphite -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/withgraphite/agent-skills/tree/HEAD/skills/graphite/SKILL.md

## When to use it
- build a stack of dependent pull requests
- jump to a specific branch in the stack
- re-parent a stack from a feature branch onto main
- split one large commit into separate PRs
- fix a branch Graphite is not tracking

## Example prompts
- create a three-PR stack for this feature with gt
- show me the stack and move me up one branch
- re-parent the stack onto main and restack it

## Similar
- [om-approve-merge-pr](https://affpapa.org/en/nevibecode/skills/om-approve-merge-pr.md) — skill · 3500 installs
- [visual-pr](https://affpapa.org/en/nevibecode/skills/visual-pr.md) — skill · 3000 installs
- [review-pr](https://affpapa.org/en/nevibecode/skills/tirth8205-review-pr.md) — skill · 1200 installs
- [work-with-pr](https://affpapa.org/en/nevibecode/skills/work-with-pr.md) — skill · 763 installs
- [review](https://affpapa.org/en/nevibecode/skills/owainlewis-review.md) — skill · 748 installs
- [finish-pr](https://affpapa.org/en/nevibecode/skills/finish-pr.md) — skill · 540 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
