Review a GitHub pull request with gh or an existing connector, draft path:line findings and a verdict, and post only after you approve the text.
--- name: github-pr-reviewer description: Reviews a GitHub pull request against the team's stated criteria and drafts findings with file and line references. Reads the PR with the GitHub CLI (gh pr view, gh pr diff, gh pr checks) or a GitHub connector the user already configured, and posts a review only after the user approves the exact text. Use when asked to review a PR, check a pull request before merge, or summarize risks in a PR by number or URL. compatibility: Needs the gh CLI authenticated by the user (gh auth status) or an existing GitHub connector with read access; posting a review needs write access. This skill does not install or authenticate either. metadata: version: "1.0.0" category: "Development Tools" --- # GitHub PR Reviewer Produces a human-style review of one pull request: what changed, what could break, and concrete suggested fixes. It does not merge, approve on its own, or run on every PR automatically; wiring it into CI is a separate decision for the team. ## Inputs to collect - PR number or URL, and the repository (`OWNER/REPO`) if not the current checkout. - Review criteria: the repo's `CONTRIBUTING.md`, PR template, lint/test config, and any focus the user names (security, migrations, API compatibility). Do not invent rules the team has not stated; label your own suggestions as suggestions. - Whether to only draft the review (default) or also post it. ## Workflow 1. **Check access (read-only).** `gh auth status`. If gh is unavailable and no GitHub connector is configured, ask the user to paste the diff or run the commands below themselves. Never ask for a token in chat. 2. **Read the PR.** ```bash gh pr view 482 --repo acme/shop --json title,body,author,baseRefName,headRefName,files,additions,deletions gh pr view 482 --repo acme/shop --comments # existing discussion, avoid duplicate remarks gh pr diff 482 --repo acme/shop --name-only gh pr diff 482 --repo acme/shop gh pr checks 482 --repo acme/shop # CI status as reported by GitHub ``` For large diffs, review file by file; use `gh pr diff --exclude 'package-lock.json'` for generated files and say what you skipped. 3. **Review each changed file** for: correctness and edge cases, security (input validation, injection, authz, secrets in code), error handling, tests covering the change, breaking API/schema changes, and the team criteria. When surrounding code matters, read it from the checkout (`gh pr checkout` changes the local branch, so ask first) rather than guessing. 4. **Write findings** only for things visible in the diff or code you read. Each finding needs `path:line`, severity, the problem, and a concrete fix. If CI is failing, quote the failing check names from `gh pr checks`; do not speculate about why without logs. 5. **Show the draft review and stop.** Recommend one verdict: comment, request changes, or approve. 6. **Post only after explicit approval of the exact text**, then report what GitHub returned: ```bash gh pr review 482 --repo acme/shop --request-changes --body-file review.md ``` Inline line comments need the GitHub API or a connector that supports review comments; if neither is available, keep `path:line` references in the review body. ## Output format ``` PR #482 "Add discount codes" (feature/discounts -> main), 6 files, +210 -14 Checks: 1 failing (unit-tests), 3 passing | Severity | Location | Finding | Suggested fix | | High | src/discount.ts:41 | Code compared case-sensitively; "SAVE10" and "save10" treated differently | Normalize with toUpperCase() before lookup and add a test | | Medium | src/api/apply.ts:18 | No check that discount <= order total | Clamp to total; test negative totals | Not reviewed: package-lock.json (generated) Recommended verdict: request changes ``` ## Limitations - Findings are a reviewer's judgement, not proof; say "possible" when you could not confirm behavior. - Do not claim the change is secure, compliant or fully tested. Report only checks you actually saw. - Never approve or merge without the user's instruction; never dismiss other reviews.
Generate a GitHub Actions (or other CI) pipeline from the repo's real scripts, with least-privilege permissions, caching, concurrency and a gated deploy.
Generate a compose.yaml for your app, database and cache with health-checked startup, named volumes and secrets in .env, validated with docker compose config.
Automate notifications and alerts
Illustrative input and expected result. This example is a verification guide, not a recorded model run.
Content reviewed .
A maintainer wants a second pair of eyes on a small feature PR before merging and has the gh CLI already authenticated.
Review PR #482 in acme/shop. It adds discount codes: src/discount.js now has CODES = { SAVE10: 10, SAVE50: 50 } and a new apply(total, code) that returns total - discountFor(code). Draft the review, don't post it.A draft built from gh pr view / gh pr diff / gh pr checks output, with findings tied to lines in the diff. For this diff a correct review flags at least: (1) apply() can return a negative total (apply(20, 'SAVE50') = -30) — clamp at 0 and add a test; (2) lookup is case-sensitive ('save10' yields 0) — normalize or document. It lists CI check results only as reported, names anything not reviewed, recommends 'request changes', and stops without posting.AI Agent Skills are reusable workflow packages that extend your AI coding assistant with multi-step capabilities. Install GitHub PR Reviewer by following these steps.
SKILL.md inside, in the location documented by your client. Do not assume every AI application reads the same directory.Requires an Agent Skills-compatible client; supported locations and activation vary by version. Read the SKILL.md setup guide. MCP connects tools and data and does not, by itself, install a skill.
Generate a GitHub Actions (or other CI) pipeline from the repo's real scripts, with least-privilege permissions, caching, concurrency and a gated deploy.
Generate a compose.yaml for your app, database and cache with health-checked startup, named volumes and secrets in .env, validated with docker compose config.
Automate notifications and alerts