.agent/skills/pr_review/SKILL.md
When reviewing a pull request for the angular repository, follow these essential guidelines to ensure high-quality contributions:
Context & Ecosystem:
Key Focus Areas:
reference/ directory (e.g., reference/router.md). Always prioritize these rules for their respective packages.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)
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.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.A. Local Code Review (If the PR is owned by the author requesting the review)
B. Remote Code Review (For all other PRs)
mcp_github-mcp-server_pull_request_review_write (method create).mcp_github-mcp-server_add_comment_to_pending_review.mcp_github-mcp-server_pull_request_review_write (method submit_pending).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.suggestion ... ) in your inline comments. This allows the author to apply your suggested code improvements with a single click in the GitHub UI.AGENT: .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.
mcp_github-mcp-server_pull_request_review_writemcp_github-mcp-server_add_comment_to_pending_reviewThe 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.shDetermines 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:
.agent/skills/pr_review/scripts/determine_review_type.sh <PR_NUMBER>
get_pr_comments.shFetches 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:
.agent/skills/pr_review/scripts/get_pr_comments.sh <PR_NUMBER>
reply_pr_comment.shReplies 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:
.agent/skills/pr_review/scripts/reply_pr_comment.sh <PR_NUMBER> <COMMENT_ID> <REPLY_BODY>
post_inline_comment.shThe 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:
.agent/skills/pr_review/scripts/post_inline_comment.sh <PR_NUMBER> <FILE_PATH> <LINE_NUMBER> <COMMENT_BODY>
Example:
.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.shSubmits all locally staged inline comments as a single batched review via the GitHub Pull Request Reviews API.
Usage:
.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:
.agent/skills/pr_review/scripts/submit_pr_review.sh 12345 COMMENT "AGENT: I have left a few inline suggestions for your consideration."