
prepare-branch-context
Analyze the current branch's diff from main and related PR to build context for followup requests. Triggers on "prepare context", "branch context", "catch me up", "what's on this branch".
- Installs
- 105
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/jnsahaj/skills --skill prepare-branch-context- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads prepare-branch-context automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Prepare Branch Context
Build a comprehensive understanding of the current branch so you can handle followup requests with full context.
Steps
-
Identify the current branch and base branch:
git branch --show-current git merge-base HEAD main -
Gather the diff from main:
git diff main...HEAD --stat git diff main...HEADRead through the full diff carefully. Understand what files were changed, added, or removed, and what the changes do.
-
Review the commit history on this branch:
git log main..HEAD --onelineRead commit messages to understand the progression of changes.
-
Check for a related PR:
gh pr list --head "$(git branch --show-current)" --json number,title,body,url,state,comments --jq '.[0]'If a PR exists, read its title, description, and comments for additional context (acceptance criteria, discussion, review feedback).
-
Summarize your understanding to the user:
- What this branch does (high-level purpose)
- Key files and areas of the codebase affected
- Notable decisions or patterns visible in the changes
- Any open review comments or discussion from the PR
- Current state (clean, uncommitted changes, etc.)
-
Signal readiness: Tell the user you're ready for followup questions or tasks related to this branch.
Rules
- Do NOT make any changes to files. This skill is read-only.
- Read the actual diff content, not just the stat summary. You need to understand the code changes.
- If there's no PR, that's fine — just skip that step and note it.
- If the diff is very large, focus on understanding the overall structure first, then read key files in detail.
- Keep the summary concise but thorough enough that you could confidently make changes to this branch.
- If the branch is
mainor has no divergence from main, tell the user there's nothing to analyze.
FAQ
What does the prepare-branch-context skill do?
Analyze the current branch's diff from main and related PR to build context for followup requests. Triggers on "prepare context", "branch context", "catch me up", "what's on this branch".
How do I install prepare-branch-context?
Run npx skills add https://github.com/jnsahaj/skills --skill prepare-branch-context in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/prepare-branch-context/ (personal) or .claude/skills/prepare-branch-context/ (project).
Which AI agents can use prepare-branch-context?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is prepare-branch-context safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains prepare-branch-context?
It is published by jnsahaj in jnsahaj/skills. It has 105 recorded installs.
More from jnsahaj/skills
zero-tech-debt
jnsahaj/skills
Rework a change as if the intended UX and architecture existed from day one, deleting compatibility cruft and accidental complexity.
code-refactor-review
jnsahaj/skills
Open the skill to read its SKILL.md instructions.
ux-flow-plan
jnsahaj/skills
Open the skill to read its SKILL.md instructions.
create-draft-pr
jnsahaj/skills
Open the skill to read its SKILL.md instructions.
ga-pr
jnsahaj/skills
Open the skill to read its SKILL.md instructions.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.