Skip to content
Skillpedia
General coding12k · #11525

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.md

Copy 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

Use this skill to help me: https://github.com/trycompai/crm/blob/release/.agents/skills/prepare-branch-context/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

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

  1. Identify the current branch and base branch:

    git branch --show-current
    git merge-base HEAD main
    
  2. Gather the diff from main:

    git diff main...HEAD --stat
    git diff main...HEAD
    

    Read through the full diff carefully. Understand what files were changed, added, or removed, and what the changes do.

  3. Review the commit history on this branch:

    git log main..HEAD --oneline
    

    Read commit messages to understand the progression of changes.

  4. 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).

  5. 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.)
  6. 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 main or 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

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills