prepare-branch-context
What it does
This skill has your AI read the changes made on your current code branch, plus the related pull request and its comments. It is for developers who want the AI to get up to speed before working on a task.
When to use it
- ✓When you return to a code branch and want the AI to catch up on what it changes.
- ✓When you ask your AI to explain what is on a branch before a review.
- ✓When you want the AI to read the pull request comments before continuing the work.
Skill link
https://github.com/trycompai/crm/blob/release/.agents/skills/prepare-branch-context/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Catch me up on what's on this branch before we make any changes.”
5 new skills a week. 1 minute to read.
How it works
The skill runs git commands to compare your branch with main, reads the commit history and the pull request, and then gives you a short summary.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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 mainGather 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
Does this skill need the GitHub command line tool?
Yes. It uses the gh command to find the related pull request, so that tool must be installed.
What does the AI report back?
It sums up the branch purpose, the main files affected, notable decisions, open review comments and the current state of the work.
Does it change any code?
The listed steps only read information about the branch, such as the diff, the history and the pull request.
Details
Original description by the author
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".
repo: trycompai/crm
Popularity
- GitHub stars
- 12k
- Ranking position
- #11525
- License
- MIT
- Updated
- 11/1/2026
Comments
- …
More skills from this repository
ai-elements
12kHelps your agent build AI chat interfaces with ready-made components for conversations, messages, tool displays and prompt inputs.
ai-sdk
12kHelps your agent build AI features with the Vercel AI SDK, including text generation, streaming, tool calling and agents.
better-accessibility
12kHelps your agent make interfaces usable with a keyboard and screen readers, covering focus, labels, ARIA and forms.
better-auth-best-practices
12kHelps your agent set up Better Auth for login, sessions, OAuth and plugins in a TypeScript app, following its documented steps.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.