بنقرة واحدة
github-review
Perform code review on a GitHub pull request using the gh CLI.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Perform code review on a GitHub pull request using the gh CLI.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Make code modifications in a GitHub repository using the gh CLI.
Answer questions from GitHub issue or PR comments using the gh CLI.
Guide for authoring and implementing ExecPlans — self-contained execution plans that enable any agent or novice to deliver a working feature. Use when planning complex work, writing design docs, or creating step-by-step implementation guides.
| name | github-review |
| description | Perform code review on a GitHub pull request using the gh CLI. |
| user-invocable | false |
You received a request to review a GitHub pull request. Your job is to provide a thorough, constructive review.
What you CAN do:
gh CLIWhat you CANNOT do:
--comment only, not --approve or --request-changes)Before executing, verify gh is installed and authenticated:
gh --version
If not installed, tell the user:
ghCLI is required. Install it: https://cli.github.com/
If the message includes a <gh_account> tag, switch to that account first:
gh auth switch --user <account>
The message contains XML-tagged sections:
| Tag | Content |
|---|---|
<event_type> | Event type: pr_opened, pr_comment, pr_review, etc. |
<trigger_context> | Human-readable description of what triggered this |
<trigger_username> | Who requested the review |
<is_pr> | Always true for code reviews |
<repo> | Repository name (owner/repo) |
<gh_account> | GitHub account for gh auth switch (optional) |
<comment_id> | ID of the triggering comment (optional) |
<pr_metadata> | PR summary: number, title, state, +additions/-deletions, files, commits, branch, URL |
<pr_body> | Full PR description (pre-fetched from webhook) |
<trigger_comment> | Specific review instructions (optional, for comment-triggered reviews) |
<instructions> | gh command hints for fetching diff and posting review |
If <comment_id> is present, run:
gh api repos/<owner>/<repo>/issues/comments/<comment_id>/reactions \
--method POST --field content=eyes
If the reaction fails, continue the task.
Post the final PR review/comment with --body-file. Keep it short and include: summary, key findings or status, and any blocker or next step.
If <comment_id> is present, run after the final PR review/comment is posted:
gh api repos/<owner>/<repo>/issues/comments/<comment_id>/reactions \
--method POST --field content=rocket
If the reaction fails, do not block completion.
You MUST fully understand the PR before reviewing. The message includes pre-fetched data — use it, then fill gaps.
<pr_body> — full PR description, no need to re-fetch<pr_metadata> — PR stats (additions, deletions, files, commits, branch info)gh pr view <number> --repo <owner/repo> --comments
gh pr view <number> --repo <owner/repo> --json commits --jq '.commits[] | "\(.oid[:8]) \(.messageHeadline)"'
# For individual commit details:
gh api repos/<owner>/<repo>/commits/<sha> --jq '{message: .commit.message, files: [.files[] | {filename, status, additions, deletions}]}'
gh pr view <number> --repo <owner/repo> --json files --jq '.files[] | "\(.path) (\(.status)) +\(.additions) -\(.deletions)"'
gh api repos/<owner>/<repo>/pulls/<number>/reviews --jq '.[] | "\(.user.login) (\(.state)): \(.body)"'
gh api repos/<owner>/<repo>/pulls/<number>/comments --jq '.[] | "\(.user.login) on \(.path):\(.line): \(.body)"'
gh issue view <issue-number> --repo <owner/repo> --comments
If the repository is not already present locally, you MAY and SHOULD fetch it with gh before reviewing code outside the diff:
gh repo clone <owner/repo>
cd <repo>
If you already have a local checkout, reuse it instead of cloning again.
If the target directory already exists, clone into a fresh directory name:
gh repo clone <owner/repo> <repo>-tmp
cd <repo>-tmp
Read in order of priority:
README.md — project overview, tech stackCLAUDE.md / AGENTS.md — AI agent conventions, golden rules, coding standardsdocs/ directory — architecture docs, design docsRead complete files being modified to understand:
# Via API (without cloning)
gh api repos/<owner>/<repo>/contents/<file-path> --jq '.content' | base64 -d
Run Immediate Feedback if <comment_id> exists
Use pre-fetched <pr_body> and <pr_metadata> — skip re-fetching these
Follow Context Gathering (CRITICAL — Do NOT Skip) and fetch the remaining context you need (comments, commits, diff, reviews, source)
Fetch the full PR diff:
gh pr diff <number> --repo <owner/repo>
Review the changes against these criteria:
Correctness
Security
Architecture & Design
Code Quality
Tests
Draft exactly one final review message in Markdown
If you completed the review, post it with gh pr review <number> --repo <owner/repo> --comment --body-file <file>
If you were blocked or could not finish the review, post the status with gh pr comment <number> --repo <owner/repo> --body-file <file>
Run Completion Reaction if <comment_id> exists
You MUST always leave one final GitHub comment before finishing. Even if anything fails or is blocked, you still must post the final comment.
Structure your review for clarity and actionability:
## Summary
[1-2 sentence overall assessment]
## Issues
### [Critical/Major/Minor]: [Short title]
**File:** `path/to/file.ts:42`
**Description:** [What's wrong and why it matters]
**Suggestion:**
\`\`\`ts
// suggested fix
\`\`\`
[Repeat for each issue]
## Positive Notes
- [Things done well — reinforce good practices]
https://github.com/<owner>/<repo>/blob/<branch>/<path>#L<line>