Chuyển đến nội dung
Skillpedia
Lập trình chung12k · #11525

prepare-branch-context

Skill này làm gì

Skill này để AI đọc các thay đổi trên nhánh code hiện tại, cùng pull request liên quan và các bình luận của nó. Skill dành cho developer muốn AI nắm rõ tình hình trước khi làm một công việc.

Khi nào nên dùng

  • ✓Khi bạn quay lại một nhánh code và muốn AI nắm được những thay đổi trên đó.
  • ✓Khi bạn yêu cầu AI giải thích những gì có trên nhánh trước một lần review.
  • ✓Khi bạn muốn AI đọc các bình luận pull request trước khi tiếp tục công việc.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/trycompai/crm/blob/release/.agents/skills/prepare-branch-context/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Cập nhật cho tôi về những gì có trên nhánh này trước khi chúng ta thay đổi bất cứ thứ gì.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill chạy các lệnh git để so sánh nhánh với main, đọc lịch sử commit và pull request, rồi đưa cho bạn một bản tóm tắt ngắn.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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.
Câu hỏi thường gặp

Skill này có cần công cụ dòng lệnh GitHub không?

Có. Skill dùng lệnh gh để tìm pull request liên quan, nên công cụ này phải được cài đặt.

AI báo cáo lại những gì?

Nó tóm tắt mục đích của nhánh, các file chính bị ảnh hưởng, quyết định đáng chú ý, bình luận review chưa giải quyết và trạng thái hiện tại của công việc.

Skill có thay đổi code không?

Các bước được liệt kê chỉ đọc thông tin về nhánh, như diff, lịch sử và pull request.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
12k
Vị trí xếp hạng
#11525
Giấy phép
MIT
Cập nhật
1/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự