Agent Skillstrycompai/crm › prepare-branch-context

prepare-branch-context

GitHub

分析当前分支相对于main的变更及PR信息,构建上下文以便后续任务。通过git和gh命令获取diff、日志和PR详情,总结代码改动、影响范围及评审意见,为开发者提供全面背景。

.agents/skills/prepare-branch-context/SKILL.md trycompai/crm

Trigger Scenarios

prepare context branch context catch me up what's on this branch

Install

npx skills add trycompai/crm --skill prepare-branch-context -g -y
More Options

Non-standard path

npx skills add https://github.com/trycompai/crm/tree/release/.agents/skills/prepare-branch-context -g -y

Use without installing

npx skills use trycompai/crm@prepare-branch-context

指定 Agent (Claude Code)

npx skills add trycompai/crm --skill prepare-branch-context -a claude-code -g -y

安装 repo 全部 skill

npx skills add trycompai/crm --all -g -y

预览 repo 内 skill

npx skills add trycompai/crm --list

SKILL.md

Frontmatter
{
    "name": "prepare-branch-context",
    "description": "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\".",
    "user-invocable": true
}

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.

Version History

  • c26a08d Current 2026-08-08 08:04

Same Skill Collection

.agents/skills/ai-elements/SKILL.md
.agents/skills/better-auth-best-practices/SKILL.md
.agents/skills/better-colors/SKILL.md
.agents/skills/better-interface/SKILL.md
.agents/skills/better-ui/SKILL.md
.agents/skills/better-writing/SKILL.md
.agents/skills/code-refactor-review/SKILL.md
.agents/skills/create-draft-pr/SKILL.md
.agents/skills/eve/SKILL.md
.agents/skills/ga-pr/SKILL.md
.agents/skills/ga/SKILL.md
.agents/skills/nestjs-best-practices/SKILL.md
.agents/skills/no-use-effect/SKILL.md
.agents/skills/nuqs/SKILL.md
.agents/skills/pit-of-success/SKILL.md
.agents/skills/posthog-instrumentation/SKILL.md
.agents/skills/prisma-database-setup/SKILL.md
.agents/skills/shadcn/SKILL.md
.agents/skills/skill-creator/SKILL.md
.agents/skills/turborepo/SKILL.md
.agents/skills/typescript-advanced-types/SKILL.md
.agents/skills/ux-flow-plan/SKILL.md
.agents/skills/vercel-composition-patterns/SKILL.md
.agents/skills/vercel-react-best-practices/SKILL.md
.agents/skills/web-design-guidelines/SKILL.md
.agents/skills/zero-tech-debt/SKILL.md
.agents/skills/ai-sdk/SKILL.md
.agents/skills/better-accessibility/SKILL.md
.agents/skills/better-layout/SKILL.md
.agents/skills/better-typography/SKILL.md
.agents/skills/nestjs-trpc/SKILL.md
.agents/skills/seo-audit/SKILL.md

Metadata

Files
0
Version
c26a08d
Hash
4284631f
Indexed
2026-08-08 08:04

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-08 23:42
浙ICP备14020137号-1 $Гость$