code-just-the-stack

Validates each branch in a Graphite stack with just, fixes failures, restacks, and submits.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manually running checks across every branch of a stacked-diff workflow is tedious and error-prone: you must check out each branch, run tests, commit fixes separately, restack descendants, and only then submit. This Skill automates that entire loop for a Graphite stack while enforcing safe boundaries like clean worktrees and no weakened checks. ## Core Features & Use Cases - Bottom-to-top stack validation: Runs just on every branch from the Graphite bottom to the top, fixing failures where they occur. - Checkpoint fix commits: Creates separate fix commits via ns flow cp and restacks descendants with gt restack after each fix. - Guarded submission: Submits the stack with gt submit --no-interactive only after every branch is green, and stops on conflicts, dirty worktrees, or ambiguous branches instead of guessing. - Use Case: You have a five-branch Graphite stack and want CI-equivalent confidence before submitting; invoke the skill and it walks the stack, fixes a failing lint on branch two, commits it, restacks, and submits once all branches pass. ## Quick Start Ask the agent to run just-the-stack on my current Graphite stack and submit it once every branch passes.

Frequently Asked Questions about code-just-the-stack

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

FAQPage Schema
How do I run tests on every branch in a Graphite stack?

Use this skill to run just on each branch from the Graphite bottom to the top of the current stack path. It records pass/fail per branch, fixes failures in place, and reports a branch-by-branch status table at the end.

How to fix a failing branch in the middle of a stacked diff?

The skill edits the root cause on the failing branch, reruns just until green, then creates a separate checkpoint commit with ns flow cp. Afterward it runs gt restack so descendant branches incorporate the fix.

Does this work with a dirty git worktree?

No. The preflight step runs git status --short and stops if the worktree is dirty, asking you to clean, stash, or checkpoint first. This prevents mixing unrelated changes into fix commits.

What happens when gt restack hits a merge conflict?

The skill delegates conflict-heavy restacks to the code-gt-restack-resolve or code-resolve-merge-conflicts skills rather than inventing conflict policy. It verifies the worktree is clean after restack before continuing upward.

When should I not use automated stack submission?

Avoid it when a failure requires a product or design decision, when Graphite reports ambiguous child branches, or when submit fails due to branch protection or remote divergence. The skill stops and asks rather than force-pushing or bypassing checks.