Install any skill in seconds. Free to start, no credit card required.
Get Started Free →GitHub PR workflow orchestration for code review — list PRs, post comments, apply labels, and guarded auto-merge
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-07 | ✗→✓ | ▲ Improved | 117% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 78% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 1070% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 162% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 53% | 0% |
Orchestrates GitHub PR workflows for AI code review. Provides tools to list pull requests, post inline review comments, apply labels based on review findings, and (with explicit opt-in) auto-merge clean PRs.
All GitHub API interactions go through the gh CLI. Direct HTTP requests and web searches are denied to ensure all operations are auditable and respect GitHub's rate limiting.
bashexport GH_TOKEN="ghp_..."
The token needs read-write access since this skill posts comments, applies labels, and can merge PRs:
| Scope (classic PAT) | Fine-grained permission | Why | |----------------------|------------------------|-----| | repo | Pull requests: Read & Write | List PRs, post review comments, merge | | repo | Contents: Read | Read PR diff and file contents | | repo | Issues: Write | Apply and remove labels | | read:org (optional) | Organization: Read | Org-level label policies |
Minimum fine-grained token permissions: pull_requests: write, contents: read, issues: write on the target repository.
For read-only review without GitHub interaction, use the code-review skill instead — it only needs read access.
| Variable | Required | Description | |----------|----------|-------------| | GH_TOKEN | yes | GitHub personal access token or fine-grained token | | REVIEW_AUTO_MERGE | no | Set to true to enable guarded auto-merge. Default: disabled | | REVIEW_LABEL_PREFIX | no | Prefix for review labels (default: review/). Labels: review/approved, review/needs-changes, review/security-concern |
List open pull requests for a repository, optionally filtered by author or label.
Input:
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | repo | string | yes | Repository in owner/repo format | | author | string | no | Filter by PR author username | | label | string | no | Filter by label | | limit | integer | no | Maximum PRs to return (default: 10, max: 100) |
Output: JSON array of pull requests with number, title, author, url, labels, created_at, updated_at, mergeable_state.
The agent selects this tool when it detects:
Post inline review comments on a GitHub pull request based on code review findings.
Input:
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | repo | string | yes | Repository in owner/repo format | | pr_number | integer | yes | Pull request number | | findings | array | yes | Array of findings from code_review_diff output | | submit_review | boolean | no | Submit as a formal review (not just individual comments). Default: true | | review_event | string | no | Review event type: COMMENT, APPROVE, REQUEST_CHANGES. Default: COMMENT |
Each finding in the array should have: file, line, severity, title, description, suggestion.
Output: JSON object with comments_posted, review_url, and any errors for comments that failed.
The agent selects this tool when it detects:
code_review_diff, user asks to post findings to GitHubComments are posted as inline review comments with this format:
**[severity] category: title**
description
💡 **Suggestion:** suggestionApply review-status labels to a pull request based on review findings.
Input:
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | repo | string | yes | Repository in owner/repo format | | pr_number | integer | yes | Pull request number | | risk_level | string | yes | Overall risk level from review: low, medium, high, critical | | has_security_findings | boolean | no | Whether security issues were found. Default: false |
Output: JSON object with labels_applied and labels_removed.
| Risk Level | Label Applied | |------------|---------------| | low | review/approved | | medium | review/needs-changes | | high | review/needs-changes | | critical | review/security-concern |
If has_security_findings is true, review/security-concern is always applied regardless of risk level.
Previous review labels (with the configured prefix) are removed before applying new ones.
The agent selects this tool when it detects:
Merge a pull request after verifying safety conditions. Requires explicit opt-in via REVIEW_AUTO_MERGE=true.
Input:
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | repo | string | yes | Repository in owner/repo format | | pr_number | integer | yes | Pull request number | | merge_method | string | no | Merge method: merge, squash, rebase. Default: squash | | require_clean_review | boolean | no | Require no error-severity findings before merging. Default: true | | review_result | object | no | Review result from code_review_diff to verify cleanliness |
Output: JSON object with merged, sha, message, or blocked_reason if merge was prevented.
The agent selects this tool when it detects:
This tool enforces multiple safety layers:
REVIEW_AUTO_MERGE must be explicitly set to true. If unset or any other value, merge is blocked with a clear message.error-severity findings. Override with require_clean_review: false.A typical end-to-end review workflow using all three code-review skills:
review_github_list_prs to find PRs needing reviewcode_review_diff with the PR URL to generate findingsreview_github_post_comments to post findings as inline commentsreview_github_apply_labels to set status labelsreview_github_auto_merge if review is clean and opt-in is enabledThis skill MUST:
REVIEW_AUTO_MERGE=true explicitly setgh CLI — http_request and web_search tools are deniedThis skill is designed to work in automated pipelines:
error field and descriptive messagesOther measured skills in the registry, with their headline benchmark lift.