# prepare-branch-context

prepare-branch-context inspects git diffs, commits, and pull request metadata on the active branch so the agent grasps full context before editing.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 107 installs · ★ 107 repo stars
- Author: jnsahaj
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/jnsahaj/skills/tree/HEAD/skills/prepare-branch-context/SKILL.md
- Updated: 2026-10-05
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/prepare-branch-context

## What it does

This workflow inspects branch history in read-only mode. It pinpoints the current branch, checks the divergence point from `main`, and reviews the full diff along with the oneline commit history.

When a matching pull request exists, it queries the GitHub CLI (`gh`) to read the PR description, review discussions, and thread comments. The agent then delivers a concise recap of affected code areas, architectural shifts, and working tree cleanliness.

Without an authenticated `gh` binary, the pull request step fails quietly and gets skipped.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add jnsahaj/skills --skill prepare-branch-context -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/prepare-branch-context/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/prepare-branch-context/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add jnsahaj/skills --skill prepare-branch-context -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/prepare-branch-context/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add jnsahaj/skills --skill prepare-branch-context -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/prepare-branch-context/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install jnsahaj/skills skills/prepare-branch-context
```

2. **Manually: put the files in place**
- File: `.github/skills/prepare-branch-context/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add jnsahaj/skills --skill prepare-branch-context -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/jnsahaj/skills --path skills/prepare-branch-context
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/prepare-branch-context/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add jnsahaj/skills --skill prepare-branch-context -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/jnsahaj/skills/tree/HEAD/skills/prepare-branch-context/SKILL.md

## When to use it
- bring the coding agent up to speed on active branch diffs
- inspect code modifications against `main` without manual pasting
- pull PR feedback directly into agent working memory
- verify touched project modules before generating further patches

## Example prompts
- Prepare branch context and summarize what has changed so far
- Catch me up on this branch and check open PR review threads
- Inspect branch diff from main before we start next edits

## Similar
- [new-branch-and-pr](https://affpapa.org/en/nevibecode/skills/new-branch-and-pr.md) — skill · 2300 installs
- [workspace-branch](https://affpapa.org/en/nevibecode/skills/workspace-branch.md) — skill · ★ 44 repo stars
- [branch-review-before-pr](https://affpapa.org/en/nevibecode/skills/branch-review-before-pr.md) — skill · 167 installs
- [git-workflow](https://affpapa.org/en/nevibecode/skills/ruvnet-git-workflow.md) — skill · 743 installs
- [diff-context](https://affpapa.org/en/nevibecode/skills/diff-context.md) — skill · ★ 34 repo stars
- [branch-finalization](https://affpapa.org/en/nevibecode/skills/branch-finalization.md) — skill · 131 installs

From the same set: [jnsahaj/skills](https://affpapa.org/en/nevibecode/by/jnsahaj/skills.md) — 6 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
