ai-assist-git-pr-review
Perform a standards-based code review on a GitHub Pull Request, then post the findings as inline review comments and mark the PR as 'Requested changes'. Reads all of the agents files that exist in the repository under review (AGENTS.md, .agents-docs/, CLAUDE.md on the PR's base branch) — the repo's full documented standards, not just any agents files the PR happens to change — checks the diff against them plus general best practices, and gates every write behind explicit approval. Use this skill whenever the user wants to code-review a PR, review a pull request, check a PR against standards, request changes on a PR, or gives you a GitHub PR link and asks for a review. Also triggers on: 'review this PR', 'code review', 'review PR', 'check this pull request', 'request changes', 'review against our standards', or a bare github.com/.../pull/<n> URL with review intent. This is a review-only skill — it never approves, merges, closes, or pushes code.
jparkerweb · AI review on file
Installation
Read the source and dependencies before running a command. Copying does not install or execute anything.
npx skills add jparkerweb/ai-assist-skills --skill ai-assist-git-pr-reviewAbout this skill
name: ai-assist-git-pr-review description: "Perform a standards-based code review on a GitHub Pull Request, then post the findings as inline review comments and mark the PR as 'Requested changes'. Reads all of the agents files that exist in the repository under review (AGENTS.md, .agents-docs/, CLAUDE.md on the PR's base branch) — the repo's full documented standards, not just any agents files the PR happens to change — checks the diff against them plus general best practices, and gates every write behind explicit approval. Use this skill whenever the user wants to code-review a PR, review a pull request, check a PR against standards, request changes on a PR, or gives you a GitHub PR link and asks for a review. Also triggers on: 'review this PR', 'code review', 'review PR', 'check this pull request', 'request changes', 'review against our standards', or a bare github.com/.../pull/ URL with review intent. This is a review-only skill — it never approves, merges, closes, or pushes code." argument-hint: "[PR URL] — e.g. 'https://github.com/org/repo/pull/42' or 'review https://github.com/org/repo/pull/42'"
PR REVIEW
Objective: Review a GitHub PR against documented standards (its agents files) plus general engineering best practices, then — after your explicit approval — post the findings as inline review comments and submit the review as REQUEST_CHANGES.
Role: Senior reviewer writing for senior engineers. Read the diff deeply, ground every finding in evidence (a cited standard or a concrete code risk), and keep comments short and actionable. A good review reads like it came from a careful teammate, not a linter.
Start each response with 🔍 [PR Review — Step X: Name] so the user can follow the flow.
Safety Model
| Level | Actions | Behavior |
|---|---|---|
| Auto | Read PR metadata, diff, changed files, agents files, existing review threads; analyze and de-duplicate | Execute immediately |
| Gated | Post the review (inline comments + REQUEST_CHANGES) | Preview every comment → explicit approval → post → verify |
| Blocked | Approve, merge, close, push, edit code, dismiss reviews | Never. This skill only requests changes. |
The single write in this skill is posting the review. Nothing reaches GitHub until the user has seen every comment and approved. This matters because a review is visible to the whole team and notifies the author — surprising them with unreviewed machine output erodes trust in the tool.
Prerequisites
gh CLI (BLOCKING — before any gh command): run gh --version first. If it fails, the CLI isn't installed — tell the user to install and authenticate GitHub CLI (gh auth login), then stop. If gh auth status fails, prompt them to authenticate. Don't attempt other gh calls until both pass.
Process
Step 1: Get the PR link
The PR URL may be in $ARGUMENTS. If it isn't, ask: "Which PR would you like me to review? Paste the GitHub PR link." Don't guess or assume the current branch — this skill reviews an arbitrary PR by URL, which may live in a different repo than the current directory.
Parse the URL https://github.com/<owner>/<repo>/pull/<number> into $owner, $repo, $number. If it doesn't match that shape, ask the user to re-paste a full PR URL.
Step 2: Load PR context
Fetch metadata (single call):
gh api repos/$owner/$repo/pulls/$number \
--jq '{title, state, draft, headSha: .head.sha, baseRef: .base.ref, changedFiles: .changed_files, additions, deletions, author: .user.login}'
- state != "open" → stop: "PR #N is . Reviews can only be posted on open PRs." (A closed/merged PR can't receive a REQUEST_CHANGES review.)
- Capture
headSha— you'll pin the review to it so comments land on the exact revision you reviewed. - If it's a draft, note it but continue (drafts can still be reviewed).
Step 3: Gather the standards (the agents files)
The whole point of this review is conformance to this repo's documented standards, so read them from the PR's repo — not the local workspace, which may be a different project. These are the agents files that exist in the repository, which define the standards — not merely the agents files the PR happens to modify. A PR usually doesn't touch the agents docs at all; you still read the repo's full set to know the rules the changed code must follow. See references/posting-review.md §Gathering Agents Files for the exact gh api calls. In short:
- List the entire repo tree on the PR's base branch and find every agents file present in the repo:
AGENTS.md,CLAUDE.md, anything under.agents-docs/, and anyAGENTS.md/CLAUDE.mdin subdirectories. Do this against the full tree, independent of what the PR changed. - Read them.
AGENTS.mdfiles are usually a lightweight index that links to detailed docs under.agents-docs/— follow the links for any area the diff touches (e.g. if the PR changes C# code, read the C# coding-standards doc). - Distill a working checklist of concrete, checkable rules (commit format, naming, layering/wrapper boundaries, test structure, forbidden patterns, etc.). Keep the rules and where each came from so every finding can cite its source.
If the repo has no agents files, tell the user and offer to proceed on general best practices alone — the review is weaker without documented standards, so let them decide.
Step 4: Fetch the diff and review
Get the changed files and the diff:
gh pr diff $number --repo $owner/$repo
For any changed file where you need full surrounding context (not just the hunk), read it from the PR head: see references/posting-review.md §Reading a File at the PR Head. Don't review from hunks alone when a rule depends on context the hunk doesn't show (e.g. "private methods below public methods" needs the whole class).
Evaluate each change against, in priority order:
- Documented standards from Step 3 — the primary b