ns-flow-gt-branch-latest-commit

Moves the latest eligible commit to a new Graphite child branch via the ns flow CLI.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When a commit lands on the wrong branch in a Graphite stack, manually extracting it requires careful resets and branch surgery that risks losing work. This Skill delegates that operation to the ns flow gt branch-latest-commit CLI, which safely moves the latest eligible commit onto its own Graphite child branch with built-in recovery handling. ## Core Features & Use Cases - Commit Extraction: Moves the latest commit from a clean worktree to a new Graphite child branch, optionally with an explicit branch slug. - Eligibility Enforcement: Refuses remote-ahead or diverged branches, synchronized trunk, branches with existing children, root commits, and merge commits. - Safe Transaction: Creates a recovery branch, resets the source branch, moves the commit, verifies the result, and cleans up recovery evidence. - Use Case: You committed a feature change directly on your main development branch and want it split into its own stacked branch before submitting PRs with Graphite. ## Quick Start Ask the agent to move the latest commit on the current branch to its own Graphite branch using the ns flow gt branch-latest-commit command.

Frequently Asked Questions about ns-flow-gt-branch-latest-commit

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

FAQPage Schema
How do I move the latest commit to a new Graphite branch?

Run ns flow gt branch-latest-commit from a clean worktree, optionally passing --slug to name the new branch. The command creates a recovery branch, resets the source branch to the parent, creates the Graphite branch, and moves the commit there.

How to split a commit off a branch in a Graphite stack?

Use ns flow gt branch-latest-commit when the worktree is clean and the commit is the latest on its branch. For pending dirty worktree changes, use ns flow gt autobranch instead, which handles uncommitted work.

When does branch-latest-commit refuse to move a commit?

It refuses remote-ahead and diverged branches, a synchronized Graphite trunk, branches that already have children, root commits, and merge commits. Eligibility checks use local Git tracking refs only and do not fetch.

Does moving a commit to a new branch push or submit PRs?

No, the operation is entirely local and never pushes, publishes, submits, or updates PRs. After a synchronized non-trunk split, you must explicitly run ns flow gt submit from the new child branch to publish the reshaped stack.

What happens if the branch-latest-commit command fails?

The skill surfaces the command output and stops without attempting automatic recovery. Recovery only proceeds on an explicit user choice after reviewing the failure, and a recovery branch is created during the transaction to protect state.