code-graphite

Executes Graphite gt commands to create, reshape, and submit stacked branches and PRs.

2|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/nseng-ai/ns --skill code-graphite-nseng-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-graphite
Source: https://github.com/nseng-ai/ns/tree/main/skills/internal/code/code-graphite
Command: npx skills add https://github.com/nseng-ai/ns --skill code-graphite-nseng-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing stacked pull requests with Graphite involves many commands with subtle semantics — insertion vs. creation, restacking, re-parenting, untracking cascades — and mistakes can corrupt stack topology or leave metadata inconsistent. This Skill provides the exact command mechanics for each operation so an agent performs them correctly without guessing. ## Core Features & Use Cases - Stack construction and editing: Create branches with gt create, amend with gt modify, insert branches mid-stack with gt create -i to split a PR in place, and navigate with gt up/gt down/gt top/gt bottom. - Topology reshaping and recovery: Re-parent branches with gt track --parent, restack after changes, perform surgical rebases in complex stacks, and recover from interrupted rebases after a context reset. - Branch lifecycle management: Delete branches non-interactively, untrack branches while understanding cascade behavior, and reconcile dangling Graphite metadata. - Use Case: You need to split a large PR into three reviewable chunks within an existing stack. The Skill guides resetting commits, selectively staging each portion, and inserting new branches before the existing child so the split lands in the right position. ## Quick Start Ask the agent to split the current PR into two stacked branches using Graphite, keeping the first half on the existing branch and inserting the second before its child.

Frequently Asked Questions about code-graphite

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I split a PR into multiple stacked branches with Graphite?

Reset the branch's commits to unstaged changes with git reset, stage the first portion and amend with gt modify, then selectively stage each remaining portion and run gt create -i to insert new branches before the existing child. Plain gt create would place the split at the stack tip instead.

How do I fix a Graphite branch parented on the wrong branch?

Check out the branch, run gt track --parent <correct-parent> to set the intended parentage, then run gt restack to rebase the branch and its descendants onto the new parent. Establishing parentage before restacking ensures the rebase lands where the stack should live.

Why does Graphite say cannot perform this operation on untracked branch?

The branch exists in git but Graphite has no tracking metadata for it, which is common in worktrees. Adopt it by running gt track --parent <intended-parent> followed by gt restack, or create a fresh tracked branch with gt create and move your changes onto it.

What is the difference between gt delete and gt untrack?

gt delete removes the branch itself from git, while gt untrack only removes Graphite's metadata and leaves the branch and commits intact. Untracking cascades to all children, so untracking mid-stack drops tracking for the entire subtree.

How do I recover from an interrupted git rebase in a Graphite stack?

Run git status to confirm the rebase is in progress and check unmerged paths. If files are already resolved, stage them and run git rebase --continue; if conflict markers remain, resolve them first, then stage and continue.