跳到正文
Skillpedia
通用编程12k · #11525

prepare-branch-context

它能做什么

这个技能让你的 AI 阅读当前代码分支上的更改,以及相关的拉取请求和评论。适合希望 AI 在开始任务前先了解情况的开发者。

适用场景

  • ✓你回到某个代码分支,希望 AI 了解其中的更改的时候。
  • ✓你在审查前让 AI 解释某个分支上有什么的时候。
  • ✓你希望 AI 在继续工作前先阅读拉取请求评论的时候。

技能链接

https://github.com/trycompai/crm/blob/release/.agents/skills/prepare-branch-context/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/trycompai/crm/blob/release/.agents/skills/prepare-branch-context/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“在我们做任何更改之前,请先告诉我这个分支上有什么内容。”

每周 5 个新技能,1 分钟读完。

工作原理

这个技能运行 git 命令,将你的分支与 main 进行比较,阅读提交历史和拉取请求,然后给你一份简短的总结。

技术内容(原始 SKILL.md)

作者在 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.
常见问题

这个技能需要 GitHub 命令行工具吗?

需要。它使用 gh 命令查找相关的拉取请求,因此必须安装该工具。

AI 会报告哪些内容?

它总结分支的目的、主要涉及的文件、重要决定、未解决的审查评论以及工作的当前状态。

它会更改代码吗?

列出的步骤只读取分支信息,例如差异、历史记录和拉取请求。

详情

作者的原始描述

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

热度

GitHub 星标
12k
排名
#11525
许可证
MIT
更新时间
2026/11/1

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能