Automated code review for pull requests

VerifiedSafe

Automates pull request code review with multiple AI agents that check PR status, gather CLAUDE.md guidelines, analyze diffs for bugs and rule compliance, and validate each issue to ensure high signal. Designed to reduce false positives while catching significant problems in code changes.

Sby Skills Guide Bot
DevelopmentIntermediate
3/2/2026
Claude Code
#code-review#pull-request#multi-agent#github-cli#quality-assurance

Recommended for

Automated summary

This skill performs an automated code review of a GitHub pull request by orchestrating several specialized subagents (CLAUDE.md compliance, bug detection, issue validation).

Strengths

  • Divides work across multiple agents (CLAUDE.md compliance, bug hunting, validation) run in parallel, giving a diff several independent passes
  • Deliberately keeps only high-signal findings (compile or parse failures, clear logic errors, quotable CLAUDE.md violations) to reduce false positives
  • Pre-checks that the PR is open, not a draft, and not already reviewed by Claude before starting
  • Includes a dedicated validation step where each flagged issue is re-confirmed by a subagent before posting

Limitations

  • Fully dependent on an authenticated GitHub CLI (gh) and read/comment permissions on the repository
  • Covers only GitHub pull requests, not other forges (GitLab, Bitbucket) or local diffs
  • Intentionally skips style, subjective suggestions and input-dependent concerns, so it is weak as a general quality review
When to use it

When you want a fast review of a GitHub pull request focused on real bugs and adherence to the repo's CLAUDE.md files.

When not to use it

When you need feedback on style, architecture or improvement ideas, or when your repository is not hosted on GitHub.

Security analysis

Safe
Quality score78/100

All executed commands are read-oriented GitHub CLI operations plus PR commenting; there is no network exfiltration, no shell download-and-execute, no destructive filesystem action, and no attempt to disable safety controls. The only write action is posting review comments to the PR under review, which is the skill's explicit purpose and is scoped by the allowlist. Minor inconsistency between the allowlist and the `gh pr review` instruction is a permissions/UX issue rather than a security risk.

Findings
  • •Declared allowed-tools omit `gh pr review`, yet step 9 instructs posting inline comments via `gh pr review`; this mismatch may cause repeated permission prompts or an agent attempting commands outside its allowlist (availability concern, not exfiltration).
  • •The skill spawns multiple subagents and instructs them to assume 'all tools are functional and will work without error' and not to test tools — harmless, but reduces the agents' ability to verify state before acting.
How this analysis is made

Examples

Review a specific PR
Review pull request #248 in this repository and post your findings as a PR comment.
Review the current branch's PR
Find the open pull request for my current branch and give it a code review, flagging only high-confidence bugs and CLAUDE.md violations.
Review a PR by URL
Run a code review on https://github.com/acme/api/pull/512, skipping it if it's a draft or already reviewed.

name: code-review description: Automated code review for pull requests using multiple specialized agents disable-model-invocation: true allowed-tools: Bash(gh issue view:), Bash(gh search:), Bash(gh issue list:), Bash(gh pr comment:), Bash(gh pr diff:), Bash(gh pr view:), Bash(gh pr list:*)

Provide a code review for the given pull request.

Agent assumptions (applies to all agents and subagents):

  • All tools are functional and will work without error. Do not test tools or make exploratory calls. Make sure this is clear to every subagent that is launched.
  • Only call a tool if it is required to complete the task. Every tool call should have a clear purpose.

To do this, follow these steps precisely:

  1. Launch a haiku agent to check if any of the following are true:

    • The pull request is closed
    • The pull request is a draft
    • The pull request does not need code review (e.g. automated PR, trivial change that is obviously correct)
    • Claude has already commented on this PR (check gh pr view <PR> --comments for comments left by claude)

    If any condition is true, stop and do not proceed.

Note: Still review Claude generated PR's.

  1. Launch a haiku agent to return a list of file paths (not their contents) for all relevant CLAUDE.md files including:

    • The root CLAUDE.md file, if it exists
    • Any CLAUDE.md files in directories containing files modified by the pull request
  2. Launch a sonnet agent to view the pull request and return a summary of the changes

  3. Launch 4 agents in parallel to independently review the changes. Each agent should return the list of issues, where each issue includes a description and the reason it was flagged (e.g. "CLAUDE.md adherence", "bug"). The agents should do the following:

    Agents 1 + 2: CLAUDE.md compliance sonnet agents Audit changes for CLAUDE.md compliance in parallel. Note: When evaluating CLAUDE.md compliance for a file, you should only consider CLAUDE.md files that share a file path with the file or parents.

    Agent 3: Opus bug agent (parallel subagent with agent 4) Scan for obvious bugs. Focus only on the diff itself without reading extra context. Flag only significant bugs; ignore nitpicks and likely false positives. Do not flag issues that you cannot validate without looking at context outside of the git diff.

    Agent 4: Opus bug agent (parallel subagent with agent 3) Look for problems that exist in the introduced code. This could be security issues, incorrect logic, etc. Only look for issues that fall within the changed code.

    CRITICAL: We only want HIGH SIGNAL issues. Flag issues where:

    • The code will fail to compile or parse (syntax errors, type errors, missing imports, unresolved references)
    • The code will definitely produce wrong results regardless of inputs (clear logic errors)
    • Clear, unambiguous CLAUDE.md violations where you can quote the exact rule being broken

    Do NOT flag:

    • Code style or quality concerns
    • Potential issues that depend on specific inputs or state
    • Subjective suggestions or improvements

    If you are not certain an issue is real, do not flag it. False positives erode trust and waste reviewer time.

    In addition to the above, each subagent should be told the PR title and description. This will help provide context regarding the author's intent.

  4. For each issue found in the previous step by agents 3 and 4, launch parallel subagents to validate the issue. These subagents should get the PR title and description along with a description of the issue. The agent's job is to review the issue to validate that the stated issue is truly an issue with high confidence. For example, if an issue such as "variable is not defined" was flagged, the subagent's job would be to validate that is actually true in the code. Another example would be CLAUDE.md issues. The agent should validate that the CLAUDE.md rule that was violated is scoped for this file and is actually violated. Use Opus subagents for bugs and logic issues, and sonnet agents for CLAUDE.md violations.

  5. Filter out any issues that were not validated in step 5. This step will give us our list of high signal issues for our review.

  6. If issues were found, skip to step 8 to post comments.

    If NO issues were found, post a summary comment using gh pr comment (if --comment argument is provided): "No issues found. Checked for bugs and CLAUDE.md compliance."

  7. Create a list of all comments that you plan on leaving. This is only for you to make sure you are comfortable with the comments. Do not post this list anywhere.

  8. Post inline comments for each issue using gh pr review with inline comments. For each comment:

    • Provide a brief description of the issue
    • For small, self-contained fixes, include a committable suggestion block
    • For larger fixes (6+ lines, structural changes, or changes spanning multiple locations), describe the issue and suggested fix without a suggestion block
    • Never post a committable suggestion UNLESS committing the suggestion fixes the issue entirely. If follow up steps are required, do not leave a committable suggestion.

    IMPORTANT: Only post ONE comment per unique issue. Do not post duplicate comments.

Use this list when evaluating issues in Steps 4 and 5 (these are false positives, do NOT flag):

  • Pre-existing issues
  • Something that appears to be a bug but is actually correct
  • Pedantic nitpicks that a senior engineer would not flag
  • Issues that a linter will catch (do not run the linter to verify)
  • General code quality concerns (e.g., lack of test coverage, general security issues) unless explicitly required in CLAUDE.md
  • Issues mentioned in CLAUDE.md but explicitly silenced in the code (e.g., via a lint ignore comment)

Notes:

  • Use gh CLI to interact with GitHub (e.g., fetch pull requests, create comments). Do not use web fetch.
  • Create a todo list before starting.
  • You must cite and link each issue in inline comments (e.g., if referring to a CLAUDE.md, include a link to it).
  • If no issues are found, post a comment with the following format:

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.


  • When linking to code in inline comments, follow the following format precisely, otherwise the Markdown preview won't render correctly: https://github.com/OWNER/REPO/blob/FULL_SHA/path/to/file.py#L10-L15
    • Requires full git sha
    • You must provide the full sha. Commands like https://github.com/owner/repo/blob/$(git rev-parse HEAD)/foo/bar will not work, since your comment will be directly rendered in Markdown.
    • Repo name must match the repo you're code reviewing
    • sign after the file name

    • Line range format is L[start]-L[end]
    • Provide at least 1 line of context before and after, centered on the line you are commenting about (eg. if you are commenting about lines 5-6, you should link to L4-7)

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/automated-code-review-for-pull-requests-mm8o520s/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/automated-code-review-for-pull-requests-mm8o520s' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/automated-code-review-for-pull-requests-mm8o520s/download' --output '.skill-downloads/automated-code-review-for-pull-requests-mm8o520s/SKILL.md.part' && mv '.skill-downloads/automated-code-review-for-pull-requests-mm8o520s/SKILL.md.part' '.skill-downloads/automated-code-review-for-pull-requests-mm8o520s/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Bash(gh issue view:*), Bash(gh search:*), Bash(gh issue list:*), Bash(gh pr comment:*), Bash(gh pr diff:*), Bash(gh pr view:*), Bash(gh pr list:*)

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/automated-code-review-for-pull-requests-mm8o520s/SKILL.md' && test -s '.skill-downloads/automated-code-review-for-pull-requests-mm8o520s/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/code-review' && cp -R '.skill-downloads/automated-code-review-for-pull-requests-mm8o520s' '.claude/skills/code-review'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/automated-code-review-for-pull-requests-mm8o520s'

openskills read 'automated-code-review-for-pull-requests-mm8o520s'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/automated-code-review-for-pull-requests-mm8o520s/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills