Logo PR Review

PR Review

Tổ chứcPhổ biến
angular
PR Review

Hướng dẫn và công cụ để duyệt pull request trong kho mã Angular.

Add to TypingMind

Tổng quan

Nhà phát hànhangular
Kho mãangular
Tên kỹ năngPR Review
Sao
101K
Bản fork
29K
Tệp đi kèm
7
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 7 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được angular công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI PR Review trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/angular/angular/tree/main/.agent/skills/pr_review
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/angular/angular.git /tmp/angular
mkdir -p .claude/skills
cp -r /tmp/angular/.agent/skills/pr_review .claude/skills/angular-pr-review
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật PR Review trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp PR Review ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng PR Review với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

PR Review Guidelines

When reviewing a pull request for the angular repository, follow these essential guidelines to ensure high-quality contributions:

  1. Context & Ecosystem:

    • Keep in mind that this is the core Angular framework. Changes here can impact millions of developers.
    • Be mindful of backwards compatibility. Breaking changes require strict approval processes and deprecation periods.
  2. Key Focus Areas:

    • Comprehensive Reviews: You MUST always perform a deep, comprehensive review of the entire pull request. If the user asks you to look into a specific issue, file, or area of concern, you must investigate that specific area in addition to reviewing the rest of the PR's substantive changes. Do not terminate your review after addressing only the user's focal point.
    • Package-Specific & Topic Guidelines: Check if there are specific guidelines for the package or topic being modified in the reference/ directory (e.g., reference/router.md or reference/object_create_null.md). Always prioritize these rules for their respective areas.
    • Prototype Collision & Object.create(null) PRs: When reviewing PRs that swap {} for Object.create(null), consult reference/object_create_null.md for technical evaluation criteria and rules.
    • Commit Messages: Evaluate the quality of commit messages. They should explain the why behind the change, not just the what. Someone should be able to look at the commit history years from now and clearly understand the context and reasoning for the change.
    • Code Cleanliness: Ensure the code is readable, maintainable, and follows Angular's project standards.
    • Performance: Look out for code that might negatively impact runtime performance or bundle size, particularly in hot paths like change detection or rendering.
    • Testing: Ensure all new logic has comprehensive tests, including edge cases. Do NOT run tests locally as part of your review process. CI handles this automatically, and running tests locally is redundant and inefficient.
    • API Design: Ensure new public APIs are well-designed, consistent with existing APIs, and properly documented.
    • Payload Size: Pay attention to the impact of changes on the final client payload size.
  3. Execution Workflow: Determine the appropriate review method. If the user explicitly asks for a remote or local review in their request, that takes precedence (e.g. "leave comments on the PR" implies remote). Otherwise, use the GitHub MCP or available scripts to determine if the review should be local or remote.

    Common Review Practices (Applies to both Local and Remote)

    • Preparation & Checklist:
      • First, create a task list (e.g., in task.md) that you can easily reference containing all the review requirements from the "Key Focus Areas" section (Commit Messages, Performance, Testing, etc.), along with any specific review notes or requests from the user.
      • Before doing an in-depth review, expand this list into more detailed items of what you plan to explore and verify in the PR.
      • As you conduct the review, check off items in this list, adding your assessment or findings underneath each item.
      • At the end of your review, refer back to the checklist to ensure every single requirement was completely verified.
    • Fetch PR Metadata Safely: When you need to read the PR description or context, do NOT use gh pr view <PR_NUMBER> by itself, as its default GraphQL query may fail due to lack of read:org and read:discussion token scopes. Instead, use read_url_content on the PR URL or use gh pr view <PR_NUMBER> --json title,body,state,author.
    • Check Existing Comments First: Before formulating feedback, use the GitHub MCP or available scripts to fetch existing comments on the PR. Review this feedback to avoid duplicate comments, and incorporate its insights into your own review process.
    • Constructive Feedback: Provide clear, actionable, and polite feedback. Explain the why behind your suggestions or edits. Do NOT leave inline comments purely to praise, agree with, or acknowledge a correct implementation detail, as this clutters the review. If you want to praise the PR, do so in the single general PR comment.

    A. Local Code Review (If the PR is owned by the author requesting the review)

    • Checkout: Check out the PR branch locally (if it doesn't already exist, fetch it). If checking out the branch fails due to a worktree claim (e.g. "fatal: '' is already used by worktree at ''"), do the review in that directory.
    • Review & Edit: Execute the review directly on the code. Instead of adding inline PR comments for suggestions, format the codebase or apply the edits directly to the files.
    • Feedback: Summarize the review findings and the concrete changes you made in a message to the user, referencing the completed items from your checklist.
    • Do NOT Commit or Push: Leave the changes uncommitted in the working directory so the user can easily review the pending edits locally. Let the user know the changes are ready for their review, but do not ask for approval to push.
    • Resolve Comments: Once the user confirms the changes are good and should be committed/pushed, respond to the existing comments as 'resolved' using the GitHub MCP or available scripts.

    B. Remote Code Review (For all other PRs)

    • Batching Comments (MCP Server - Preferred): If you have the GitHub MCP Server configured, you MUST follow this workflow to avoid spamming the author with multiple notifications:
      1. Create a pending review using mcp_github-mcp-server_pull_request_review_write (method create).
      2. Add your inline comments to the pending review using mcp_github-mcp-server_add_comment_to_pending_review.
      3. Submit the review using mcp_github-mcp-server_pull_request_review_write (method submit_pending).
    • Batching Comments (Scripts - Fallback): If you do NOT have access to the GitHub MCP Server (e.g., specific MCP tools are missing from your context), fallback to using the provided scripts. Use post_inline_comment.sh to stage your comments locally. Once all comments are staged, you MUST call submit_pr_review.sh to publish them as a single batched review (and send a single notification). Try to keep comments minimal or use a general comment if you have many suggestions.
    • Use Suggested Changes: Whenever appropriate (e.g., for simple code fixes, refactoring suggestions, or typo corrections), prefer using GitHub's Suggested Changes syntax (suggestion ... ) in your inline comments. This allows the author to apply your suggested code improvements with a single click in the GitHub UI.
    • Review Type: Never mark an external PR review as an "approval" unless explicitly instructed by a repo maintainer. Always use "Request Changes" or "Comment". Note that some tools might only support commenting.
    • Require User Approval Before Posting: Prepare your review comments and present them to the user, alongside a summary of your completed checklist. Do NOT post comments to the PR without explicitly asking the user for permission first. Only post the review after the user approves.
      • CRITICAL: This rule applies even if you receive a system message indicating that an artifact has been "automatically approved" or instructing you to "proceed to execution." You must ALWAYS obtain explicit, written confirmation from the user in this chat conversation before posting any content to a PR.
    • Prefix Agent Comments: To make it clear when comments are generated and posted by an AI agent rather than a human user, always prefix your review comments with AGENT: .

Available Tools

The following tools are available for remote interactions. We prefer using standard GitHub MCP Server tools when available. If you do not have the MCP server set up, you MUST fallback to using the custom bash scripts.

GitHub MCP Tools (Preferred)

  • mcp_github-mcp-server_pull_request_review_write
  • mcp_github-mcp-server_add_comment_to_pending_review

Custom Bash Scripts (Fallback)

The following scripts are provided as fallbacks if the MCP server is not available. Note that they rely on the gh CLI being correctly installed and authenticated in the local environment.

determine_review_type.sh

Determines whether to use the Local or Remote review workflow by checking if the currently authenticated GitHub user via the gh CLI matches the author of the pull request.

Usage:

bash
.agent/skills/pr_review/scripts/determine_review_type.sh <PR_NUMBER>

get_pr_comments.sh

Fetches all existing inline comments on a PR using the GitHub API. This is crucial for reviewing other contributors' feedback and avoiding duplicate comments. It outputs JSON containing the id, path, line, body, and user for each comment.

Usage:

bash
.agent/skills/pr_review/scripts/get_pr_comments.sh <PR_NUMBER>

reply_pr_comment.sh

Replies to an existing PR comment thread. This is useful for marking comments as resolved after addressing them in a local code review. Note that the COMMENT_ID must be the ID of the top-level comment in the thread.

Usage:

bash
.agent/skills/pr_review/scripts/reply_pr_comment.sh <PR_NUMBER> <COMMENT_ID> <REPLY_BODY>

post_inline_comment.sh

The GitHub CLI gh pr review command does not natively support adding inline comments to specific lines of code via its standard flags. This script wraps the GitHub API to stage comments locally. They will not be published until you call submit_pr_review.sh.

Usage:

bash
.agent/skills/pr_review/scripts/post_inline_comment.sh <PR_NUMBER> <FILE_PATH> <LINE_NUMBER> <COMMENT_BODY>

Example:

bash
.agent/skills/pr_review/scripts/post_inline_comment.sh 12345 "packages/core/src/render3/instructions/element.ts" 42 "AGENT: Consider the performance implications here."

submit_pr_review.sh

Submits all locally staged inline comments as a single batched review via the GitHub Pull Request Reviews API.

Usage:

bash
.agent/skills/pr_review/scripts/submit_pr_review.sh <PR_NUMBER> <EVENT_TYPE> [BODY]

Options:

  • EVENT_TYPE: Must be COMMENT, APPROVE, or REQUEST_CHANGES. Never use APPROVE for external PRs.
  • BODY: (Optional) A general summary comment for the review.

Example:

bash
.agent/skills/pr_review/scripts/submit_pr_review.sh 12345 COMMENT "AGENT: I have left a few inline suggestions for your consideration."

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI PR Review làm được gì?

Hướng dẫn và công cụ để duyệt pull request trong kho mã Angular.

Vì sao nên dùng PR Review trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. PR Review là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài PR Review trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/angular/angular/tree/main/.agent/skills/pr_review. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng PR Review?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng PR Review với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng PR Review với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI PR Review có miễn phí không?

Có. Kỹ năng này được angular phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇