branch-context

Manages saved implementation plans attached to git branches via Branch Memory.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Implementation plans written before a branch exists often get lost or disconnected from the branch they belong to. This Skill provides the shared lifecycle, storage contracts, diagnostics, and administration for attaching saved plans to branches as durable branch context, so the plan travels with the branch through implementation. ## Core Features & Use Cases - Plan lifecycle management: Defines the Saved plan vs Attached plan distinction, the local plan store layout, and the Branch Memory branch-context namespace contract. - Diagnostics and repair: Inspect saved-plan stores and attached-plan entries with deterministic CLI helpers, recover from stale or orphaned plan state, and resolve ambiguous keys. - Plan administration: Retarget a saved plan to a different source branch, move or copy plans between branches, and handle collisions with explicit destructive-intent safeguards. - Use Case: You saved an implementation plan while on main, then created a feature branch. Use this skill family to attach the plan as branch context, later load it in a fresh session, and implement directly from the attached plan. ## Quick Start Ask the agent to inspect the branch-context entries attached to the current branch and load the attached implementation plan.

Frequently Asked Questions about branch-context

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

FAQPage Schema
How do I attach a saved plan to a git branch?

Use the branch-context-from-plan step skill or `ns branch-context exec from-plan`, which creates the branch and attaches the saved plan as a Branch Memory entry keyed `<branch-context-slug>.md`. The plan is resolved from the local plan store before attachment.

What is the difference between a saved plan and an attached plan?

A saved plan is a Markdown file in the machine-local plan store written before a branch exists. An attached plan is the canonical plan stored in the Branch Memory `branch-context` namespace on the target branch, used for implementation.

Where are saved plans stored on disk?

Saved plans live under `$XDG_STATE_HOME/ns/enriched-plan/<repo>/<encoded-source-branch>/<slug>.md`, defaulting to `$HOME/.local/state/ns/enriched-plan/`. Branch slashes are encoded as `---` in the path segment.

Can I move a saved plan to a different source branch?

Yes, retargeting moves the saved plan to the target source-branch directory after checking for path collisions. The skill stops unless replacement intent is explicit, updates only obvious metadata lines, and reports old and new paths.

Why does branch-context refuse to overwrite an existing entry?

The default safety posture refuses collisions with existing files, branches, and Branch Memory entries unless the user gives explicit destructive intent. This prevents accidental loss of attached plans or branch state.

When should I not use the branch-context skill?

Do not use it for generic planning, branch creation, or implementation without explicit branch-context intent, nor as a substitute for the step skills that own specific create or implement commands. It is the shared reference and diagnostics layer.