code-fix-gh-stack

Repairs failing Graphite/GitHub PR stacks by fixing branches lowest-first until checks pass.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Stacked pull requests managed with Graphite often fail CI in cascading ways, and it is hard to know which branch to fix first, whether a failing check is stale, and when the stack is actually green. This Skill provides a disciplined repair loop that stabilizes the whole stack. ## Core Features & Use Cases - Stack inventory and triage: Reads structured stack topology and per-branch PR check status, classifying each PR as green, fresh-failing, pending, or needing a restack. - Lowest-first repair loop: Checks out the lowest actionable failing branch, reproduces the failure locally, fixes only that branch's blocker, amends with gt modify, and resubmits with gt submit. - Check-settling and done definition: Waits for checks to settle via wait-for-checks, distinguishes fresh from stale failures and trailing Graphite mergeability signals, and stops only when every PR has zero fresh failing checks. - Use Case: A developer has a five-PR Graphite stack where CI is red on three branches; the Skill identifies the lowest fresh failure, fixes it, restacks, and repeats until the entire stack is green. ## Quick Start Ask the agent to fix and green my current Graphite PR stack until all branch checks pass.

Frequently Asked Questions about code-fix-gh-stack

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

FAQPage Schema
How do I fix a failing Graphite PR stack?

Fix the stack lowest-first: inventory branch topology and PR checks, pick the lowest branch with a fresh failing check, reproduce and fix that failure locally, amend with gt modify, resubmit with gt submit, and wait for checks to settle before moving upstack.

How do I tell if a failing GitHub check is stale?

Compare the check's started_at or created_at timestamp against the branch head's latest push, typically your most recent gt submit. A failure from before that push is stale; wait for the current-head run instead of fixing from the old log.

Does this work with unresolved PR review threads?

No, review threads are outside this loop's scope. The Skill counts unresolved threads per PR for the final report and routes their handling to the pr-address processes; its done definition is checks-only.

What happens when a Graphite restack causes conflicts?

Conflicts are resolved toward the already-submitted downstack shape, skipping duplicate commits and re-expressing the branch's own delta on top. The mechanics run through code-gt-restack-resolve, followed by re-running local validation for the affected branch.

When should I stop an automated stack repair loop?

Stop when a semantic product or design decision is required, local validation cannot reproduce CI, Graphite state is unsafe beyond the current branch, another worktree owns the needed branch, or mutation beyond gt submit is required.