code-gt-restack-resolve

Restack Graphite stacks with automated merge conflict resolution and escalation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Restacking a Graphite stack often stops repeatedly on merge conflicts, forcing tedious manual resolution at every branch. This Skill drives the restack semi-autonomously: it resolves mechanically-safe conflicts through delegated subagents and escalates only genuinely ambiguous ones to the user. ## Core Features & Use Cases - Scoped restacking: Defaults to downstack (ancestors + current branch) and only runs a full-stack restack on explicit request, protecting upstack branches from unexpected rewrites. - Delegated conflict resolution: Each conflict stop is handled by a fresh subagent following a merge-conflict engine, with verified project checks before running gt continue. - Structured escalation: Ambiguous conflicts return a structured payload (both sides, intent diff, proposed resolution) so the user decides, then a follow-up subagent applies the decision. - Use Case: After rebasing trunk, run an intelligent restack of your current Graphite stack; safe formatting or mechanical conflicts resolve automatically while a genuine logic conflict pauses for your decision. ## Quick Start Ask the agent to restack my current Graphite stack and resolve any conflicts that come up.

Frequently Asked Questions about code-gt-restack-resolve

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

FAQPage Schema
How do I restack a Graphite stack and resolve conflicts automatically?

Invoke the skill with a restack request; it runs preflight checks, starts gt restack, and delegates each conflict stop to a subagent that resolves mechanically-safe conflicts and runs gt continue. Ambiguous conflicts are escalated to you with a structured summary.

What is the difference between downstack and full restack scope?

Downstack scope restacks only ancestors plus the current branch and is the default for generic requests. Full scope restacks the entire stack including upstack descendants, which may rewrite them, so it requires an explicit whole-stack request.

Can this skill push or submit branches after restacking?

No. The skill never runs gt submit, push, or land, and never aborts a rebase without explicit confirmation. It only restacks and resolves conflicts locally, leaving submission decisions to the user.

What happens when a conflict cannot be resolved automatically?

The conflict subagent leaves the rebase stopped and returns a structured escalation payload with both sides of the conflict, the incoming intent, and a proposed resolution. You decide in the parent session, and a follow-up subagent applies your decision.

Why does a Graphite restack fail when branches are in other worktrees?

Branches checked out in other worktree slots are locked against rebasing, causing restack failures. The skill detects these slot conflicts in preflight and can free them with ns slot gt free-stack after your authorization.