agentleFS
mhenkemhenke/claude-code-unplugged/skills/code-review/SKILL.md

code-review

Skill1 starsChanged 6 months agoMITView on GitHub

Automated PR and code reviewer guidelines

  • Installs packages

194 other projects use a version of this, 2 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use close-spec, design-with-images and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • dzhngSkill

    close-spec

    When a spec under specs/<feature>/ is done shipping (a write-spec build, or any planned task that produced a spec), archive it to specs/done/ and rewrite it from a build-plan into a durable rationale — the why, the principles, the invariants — pointing back to the real code for the how. Use when implementation has landed and the plan no longer matches what shipped, or the user says a feature/spec is finished. Pairs with [write-spec](../write-spec/SKILL.md) (the plan this closes) and [review](../review/SKILL.md) (run before closing).

    Also in 5 projects that use this

  • dzhngSkill

    design-with-images

    Explore UI and visual design with image generation, then iterate the real implementation against the user-selected concept. Use when brainstorming visual directions, offering mockup variants, or implementing an approved generated design; do not stop at the mockups or the first code approximation.

    Also in 5 projects that use this

  • PydanticSkill

    add-new-model

    Add support for a newly-released language or image generation model in pydantic-ai (e.g. openai:gpt-5.6, anthropic:claude-sonnet-5, openai:gpt-image-2). Use when a provider ships a new model id and you need to wire literals, profile flags, adapters, and tests to recognize it. Handles SDK-lag, gateway list conventions, capability probing, and direct image-model geometry. Also use when Anthropic, OpenAI or Google deprecates or retires a model, to update the deprecation tables.

    Also in 10 projects that use this

  • Microsoft AzureSkill

    azsdk-common-apiview-feedback-resolution

    Analyze and resolve APIView review feedback on Azure SDK PRs. **UTILITY SKILL**. USE FOR: APIView comments, API review feedback, SDK API surface changes. DO NOT USE FOR: general code review, non-APIView feedback. INVOKES: azure-sdk-mcp:azsdk_apiview_get_comments, azure-sdk-mcp:azsdk_customized_code_update, azure-sdk-mcp:azsdk_typespec_delegate_apiview_feedback, azure-sdk-mcp:azsdk_run_typespec_validation, azure-sdk-mcp:azsdk_package_generate_code.

    Also in 6 projects that use this

  • Microsoft AzureSkill

    azsdk-common-generate-sdk-locally

    Generate and finalize Azure SDKs locally from TypeSpec, including build, checks, tests, changelog, metadata, and version updates by default. WHEN: "generate SDK locally", "build SDK", "run SDK tests", "run CI checks", "validate package", "run checks", "update changelog", "fix SDK build errors", "resolve SDK generation errors", "customize TypeSpec", "rename SDK client", "rename SDK model", "hide operation from SDK", "fix analyzer errors", "resolve customization drift", "create subclient", "update metadata", "update version". INVOKES: azsdk_verify_setup, azsdk_package_generate_code, azsdk_package_build_code, azsdk_package_run_check, azsdk_package_run_tests, azsdk_customized_code_update, azsdk_package_update_changelog_content, azsdk_package_update_metadata, azsdk_package_update_version.

    Also in 6 projects that use this

  • +4 more from dzhng
  • +3 more from Azure

The file

Show its rules and text

We split this skill into the rules it gives an agent

36 rules. 0 are common, 29 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 186 edited versions we read keep these.

  • 29

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    0: Not confident, false positive

    line 88
  2. Distinctive:

    Run on all non-trivial pull requests

    line 111
  3. Distinctive:

    Update CLAUDE.md based on recurring review patterns

    line 113
  4. Distinctive:

    All pull requests with meaningful changes

    line 116
  5. Distinctive:

    Consider splitting large PRs into smaller ones

    line 167
  6. Distinctive:

    Default threshold is 80 (already filters most false positives)

    line 174
  7. Distinctive:

    Consider if the flagged issue is actually valid

    line 176
  8. Distinctive:

    No issues scored ≥80 (no comment needed)

    line 188
  9. Distinctive:

    Must use full SHA (not abbreviated)

    line 199
  10. Very specific:

    Must use #L notation

    line 200
  11. Distinctive:

    Must include line range with at least 1 line of context

    line 201
  12. Distinctive:

    Verify repository has GitHub remote

    line 210
  13. Distinctive:

    Iterate on guidelines: Update CLAUDE.md based on patterns

    line 217
  14. Distinctive:

    Add performance analysis agents

    line 236
  15. Distinctive:

    Add accessibility checking agents

    line 237
  16. Distinctive:

    Add documentation quality checks

    line 238
  17. Distinctive:

    All tools are functional and will work without error.

    line 277
  18. Distinctive:

    Only call a tool if it is required to complete the task.

    line 278
  19. Distinctive:

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

    line 288
  20. Distinctive:

    Look for problems that exist in the introduced code.

    line 307
  21. Distinctive:

    If you are not certain an issue is real, do not flag it.

    line 319
  22. Distinctive:

    If issues were found, list each issue with a brief description.

    line 328
  23. Distinctive:

    If no issues were found, state: "No issues found.

    line 329
  24. Very specific:

    If --comment argument was NOT provided, stop here.

    line 331
  25. Very specific:

    If --comment argument IS provided and NO issues were found, post a summary comment using gh pr comment and stop.

    line 333
  26. Very specific:

    If --comment argument IS provided and issues were found, continue to step 8.

    line 335
  27. Distinctive:

    Create a list of all comments that you plan on leaving.

    line 337
  28. Distinctive:

    Never post a committable suggestion UNLESS committing the suggestion fixes the issue entirely.

    line 343
  29. Distinctive:

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

    line 347
  30. Distinctive:

    Use gh CLI to interact with GitHub (e.g., fetch pull requests, create comments).

    line 358
  31. Distinctive:

    Create a todo list before starting.

    line 359
  32. Very specific:

    If no issues are found and --comment argument is provided, post a comment with the following format:

    line 361
  33. Distinctive:

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

    line 367
  34. Very specific:

    When linking to code in inline comments, follow the following format precisely, otherwise the Markdown preview won't render correctly: …

    line 371
  35. Very specific:

    Before executing commands or submitting reviews, you MUST output a structured XML <verification_gate> block evaluating the following checks:

    line 385
  36. Distinctive:

    Do not proceed until you have output this verification gate.

    line 396

“Common” is measured: kept by at least 6 in 10 of the 186 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Code Reviewer

Overview

Code Review Plugin

Automated code review for pull requests using multiple specialized agents with confidence-based scoring to filter false positives.

Overview

The Code Review Plugin automates pull request review by launching multiple agents in parallel to independently audit changes from different perspectives. It uses confidence scoring to filter out false positives, ensuring only high-quality, actionable feedback is posted.

Commands

code-review

Performs automated code review on a pull request using multiple specialized agents.

What it does:

  1. Checks if review is needed (skips closed, draft, trivial, or already-reviewed PRs)
  2. Gathers relevant CLAUDE.md guideline files from the repository
  3. Summarizes the pull request changes
  4. Launches 4 parallel agents to independently review:
    • Agents #1 & #2: Audit for CLAUDE.md compliance
    • Agent #3: Scan for obvious bugs in changes
    • Agent #4: Analyze git blame/history for context-based issues
  5. Scores each issue 0-100 for confidence level
  6. Filters out issues below 80 confidence threshold
  7. Outputs review (to terminal by default, or as PR comment with --comment flag)

Usage:

/code-review [--comment]

Options:

  • --comment: Post the review as a comment on the pull request (default: outputs to terminal only)

Example workflow:

# On a PR branch, run locally (outputs to terminal):
/code-review

# Post review as PR comment:
/code-review --comment

# Claude will:
# - Launch 4 review agents in parallel
# - Score each issue for confidence
# - Output issues ≥80 confidence (to terminal or PR depending on flag)
# - Skip if no high-confidence issues found

Features:

  • Multiple independent agents for comprehensive review
  • Confidence-based scoring reduces false positives (threshold: 80)
  • CLAUDE.md compliance checking with explicit guideline verification
  • Bug detection focused on changes (not pre-existing issues)
  • Historical context analysis via git blame
  • Automatic skipping of closed, draft, or already-reviewed PRs
  • Links directly to code with full SHA and line ranges

Review comment format:

## Code review

Found 3 issues:

1. Missing error handling for OAuth callback (CLAUDE.md says "Always handle OAuth errors")

https://github.com/owner/repo/blob/abc123.../src/auth.ts#L67-L72

2. Memory leak: OAuth state not cleaned up (bug due to missing cleanup in finally block)

https://github.com/owner/repo/blob/abc123.../src/auth.ts#L88-L95

3. Inconsistent naming pattern (src/conventions/CLAUDE.md says "Use camelCase for functions")

https://github.com/owner/repo/blob/abc123.../src/utils.ts#L23-L28

Confidence scoring:

  • 0: Not confident, false positive
  • 25: Somewhat confident, might be real
  • 50: Moderately confident, real but minor
  • 75: Highly confident, real and important
  • 100: Absolutely certain, definitely real

False positives filtered:

  • Pre-existing issues not introduced in PR
  • Code that looks like a bug but isn't
  • Pedantic nitpicks
  • Issues linters will catch
  • General quality issues (unless in CLAUDE.md)
  • Issues with lint ignore comments

Installation

This plugin is included in the coding assistant repository. The command is automatically available when using coding assistant.

Best Practices

Using code-review

  • Maintain clear CLAUDE.md files for better compliance checking
  • Trust the 80+ confidence threshold - false positives are filtered
  • Run on all non-trivial pull requests
  • Review agent findings as a starting point for human review
  • Update CLAUDE.md based on recurring review patterns

When to use

  • All pull requests with meaningful changes
  • PRs touching critical code paths
  • PRs from multiple contributors
  • PRs where guideline compliance matters

When not to use

  • Closed or draft PRs (automatically skipped anyway)
  • Trivial automated PRs (automatically skipped)
  • Urgent hotfixes requiring immediate merge
  • PRs already reviewed (automatically skipped)

Workflow Integration

Standard PR review workflow:

# Create PR with changes
# Run local review (outputs to terminal)
/code-review

# Review the automated feedback
# Make any necessary fixes

# Optionally post as PR comment
/code-review --comment

# Merge when ready

As part of CI/CD:

# Trigger on PR creation or update
# Use --comment flag to post review comments
/code-review --comment
# Skip if review already exists

Requirements

  • Git repository with GitHub integration
  • GitHub CLI (gh) installed and authenticated
  • CLAUDE.md files (optional but recommended for guideline checking)

Troubleshooting

Review takes too long

Issue: Agents are slow on large PRs

Solution:

  • Normal for large changes - agents run in parallel
  • 4 independent agents ensure thoroughness
  • Consider splitting large PRs into smaller ones

Too many false positives

Issue: Review flags issues that aren't real

Solution:

  • Default threshold is 80 (already filters most false positives)
  • Make CLAUDE.md more specific about what matters
  • Consider if the flagged issue is actually valid

No review comment posted

Issue: code-review runs but no comment appears

Solution: Check if:

  • PR is closed (reviews skipped)
  • PR is draft (reviews skipped)
  • PR is trivial/automated (reviews skipped)
  • PR already has review (reviews skipped)
  • No issues scored ≥80 (no comment needed)

Link formatting broken

Issue: Code links don't render correctly in GitHub

Solution: Links must follow this exact format:

https://github.com/owner/repo/blob/[full-sha]/path/file.ext#L[start]-L[end]
  • Must use full SHA (not abbreviated)
  • Must use #L notation
  • Must include line range with at least 1 line of context

GitHub CLI not working

Issue: gh commands fail

Solution:

  • Install GitHub CLI: brew install gh (macOS) or see GitHub CLI installation
  • Authenticate: gh auth login
  • Verify repository has GitHub remote

Tips

  • Write specific CLAUDE.md files: Clear guidelines = better reviews
  • Include context in PRs: Helps agents understand intent
  • Use confidence scores: Issues ≥80 are usually correct
  • Iterate on guidelines: Update CLAUDE.md based on patterns
  • Review automatically: Set up as part of PR workflow
  • Trust the filtering: Threshold prevents noise

Configuration

Adjusting confidence threshold

The default threshold is 80. To adjust, modify the command file at commands/code-review.md:

Filter out any issues with a score less than 80.

Change 80 to your preferred threshold (0-100).

Customizing review focus

Edit commands/code-review.md to add or modify agent tasks:

  • Add security-focused agents
  • Add performance analysis agents
  • Add accessibility checking agents
  • Add documentation quality checks

Technical Details

Agent architecture

  • 2x CLAUDE.md compliance agents: Redundancy for guideline checks
  • 1x bug detector: Focused on obvious bugs in changes only
  • 1x history analyzer: Context from git blame and history
  • Nx confidence scorers: One per issue for independent scoring

Scoring system

  • Each issue independently scored 0-100
  • Scoring considers evidence strength and verification
  • Threshold (default 80) filters low-confidence issues
  • For CLAUDE.md issues: verifies guideline explicitly mentions it

GitHub integration

Uses gh CLI for:

  • Viewing PR details and diffs
  • Fetching repository data
  • Reading git blame and history
  • Posting review comments

Author

Boris Cherny (boris@anthropic.com)

Version

1.0.0

Commands / Workflows

Command: code-review

Description: Code review a pull request

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 fast lightweight 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 fast lightweight 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 standard 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 standard 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: high-capability 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: high-capability 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 high-capability subagents for bugs and logic issues, and standard 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. Output a summary of the review findings to the terminal:

    • If issues were found, list each issue with a brief description.
    • If no issues were found, state: "No issues found. Checked for bugs and CLAUDE.md compliance."

    If --comment argument was NOT provided, stop here. Do not post any GitHub comments.

    If --comment argument IS provided and NO issues were found, post a summary comment using gh pr comment and stop.

    If --comment argument IS provided and issues were found, continue to step 8.

  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 mcp__github_inline_comment__create_inline_comment with confirmed: true. 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 and --comment argument is provided, 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/anthropics/coding-assistant/blob/c21d3c10bc8e898b7ac1a2d745bdc9bc4e423afe/package.json#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)

🔒 Pre-Execution Verification Gate

Before executing commands or submitting reviews, you MUST output a structured XML <verification_gate> block evaluating the following checks:

  • conventions: All changes align with target guidelines. (PASS/FAIL)
  • correctness: Verify code correctness and lack of logical bugs. (PASS/FAIL)

Example output format:

<verification_gate>
  <conventions>PASS</conventions>
  <correctness>PASS</correctness>
</verification_gate>

Do not proceed until you have output this verification gate.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.