agentleFS
nisarthnisarth/claude-skills-store/skills/engineering/code-review/SKILL.md

code-review

Skill1 starsChanged 7 months agoMITView on GitHub

Review code changes for security, performance, and correctness. Trigger with a PR URL or diff, "review this before I merge", "is this code safe?", or when checking a change for N+1 queries, injection risks, missing edge cases, or error handling gaps.

194 other projects use a version of this, 1 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 in 9 projects that use this

  • transitive-bullshitSkill

    compare-screenshots

    Compare screenshots against the intended design, distinguishing approved references from historical baselines. Use for iterative implementation matching, before/after visual review, objective image telemetry, or checking a lone capture for flat, empty, or badly framed content.

    Also in 5 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
  • +2 more from Azure

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. 0 are common, 12 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 184 edited versions we read keep these.

  • 12

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    PR URL: Use gh pr diff <number> to fetch the diff.

    line 32
  2. Very specific:

    File path: Use git diff HEAD -- <path> or read the file directly.

    line 33
  3. Distinctive:

    "staged": Use git diff --cached to review staged changes.

    line 34
  4. Very specific:

    No input: Use git diff for unstaged changes, or git diff HEAD~1 for the last commit.

    line 35
  5. Distinctive:

    Read surrounding code in modified files to understand usage patterns.

    line 38
  6. Distinctive:

    Check for related tests that cover the changed code.

    line 39
  7. Very specific:

    Look at the project's linting config (.eslintrc, .flake8, pyproject.toml) for style expectations.

    line 40
  8. Distinctive:

    Verify that new code paths have corresponding tests.

    line 79
  9. Distinctive:

    Check that edge cases (empty input, null, boundary values) are tested.

    line 80
  10. Distinctive:

    Look for tests of error/failure paths, not just happy paths.

    line 81
  11. Distinctive:

    Action: Run git diff --cached, analyze the diff, produce a categorized review.

    line 131
  12. Very specific:

    Action: Run gh pr diff 42, focus analysis on security concerns, still note other critical issues.

    line 134
  13. Distinctive:

    Action: Read the file, analyze for security vulnerabilities, report findings.

    line 137
  14. Distinctive:

    Always explain WHY something is an issue, not just that it is one.

    line 141
  15. Distinctive:

    If the diff is large (>500 lines), summarize the scope first and ask if the user wants a full review or wants to focus on specific files.

    line 145
  16. Distinctive:

    Consider the project's existing patterns before flagging style issues — consistency with the codebase matters more than personal preference.

    line 146
  17. Distinctive:

    When in doubt about intent, ask a clarifying question rather than assuming a bug.

    line 147

“Common” is measured: kept by at least 6 in 10 of the 184 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 Review

Perform a structured code review that checks for security vulnerabilities, performance issues, correctness bugs, and maintainability concerns. Produce actionable feedback organized by severity.

Workflow

Step 1: Gather the Diff

Determine what code to review based on user input:

  • PR URL: Use gh pr diff <number> to fetch the diff.
  • File path: Use git diff HEAD -- <path> or read the file directly.
  • "staged": Use git diff --cached to review staged changes.
  • No input: Use git diff for unstaged changes, or git diff HEAD~1 for the last commit.

Also gather context:

  • Read surrounding code in modified files to understand usage patterns.
  • Check for related tests that cover the changed code.
  • Look at the project's linting config (.eslintrc, .flake8, pyproject.toml) for style expectations.

Step 2: Analyze for Issues

Review the diff systematically across these categories:

Security (Critical)

  • SQL injection, XSS, command injection, path traversal
  • Hardcoded secrets, API keys, credentials
  • Missing authentication or authorization checks
  • Insecure deserialization, unsafe eval usage
  • SSRF, open redirect, CSRF vulnerabilities
  • Missing input validation or sanitization

Correctness (High)

  • Off-by-one errors, boundary conditions
  • Null/undefined dereference risks
  • Race conditions, deadlocks in concurrent code
  • Missing error handling, swallowed exceptions
  • Incorrect type conversions or comparisons
  • Logic errors in conditionals, loops, recursion

Performance (Medium)

  • N+1 query patterns in database access
  • Missing database indexes for new queries
  • Unbounded collection growth, memory leaks
  • Unnecessary computation inside loops
  • Missing pagination for large result sets
  • Blocking I/O in async contexts

Maintainability (Low)

  • Functions exceeding 50 lines or high cyclomatic complexity
  • Duplicated code that should be extracted
  • Poor naming that obscures intent
  • Missing or misleading comments
  • Dead code, unused imports, unreachable branches

Step 3: Check Test Coverage

  • Verify that new code paths have corresponding tests.
  • Check that edge cases (empty input, null, boundary values) are tested.
  • Look for tests of error/failure paths, not just happy paths.
  • Flag any mocking that hides real integration issues.

Step 4: Produce the Review

Organize findings by severity and provide actionable feedback.

Output Format

## Code Review Summary

**Files reviewed**: <count>
**Overall assessment**: APPROVE / REQUEST CHANGES / COMMENT

### Critical Issues (must fix before merge)

#### [C1] <Title> — <file>:<line>
**Category**: Security | Correctness
**Issue**: <what is wrong and why it matters>
**Suggestion**:
```<language>
// suggested fix

Warnings (should fix)

[W1] <Title> — <file>:<line>

Category: Performance | Correctness Issue: <description> Suggestion: <how to fix>

Suggestions (nice to have)

[S1] <Title> — <file>:<line>

Category: Maintainability | Style Note: <description>

Positive Highlights

  • <something done well worth calling out>

Test Coverage

  • New code paths are tested
  • Edge cases are covered
  • Error paths are tested

## Examples

**User**: "Review my staged changes"
**Action**: Run `git diff --cached`, analyze the diff, produce a categorized review.

**User**: "Review PR #42 with a focus on security"
**Action**: Run `gh pr diff 42`, focus analysis on security concerns, still note other critical issues.

**User**: "Is this code safe?" (with a file path)
**Action**: Read the file, analyze for security vulnerabilities, report findings.

## Best Practices

- Always explain WHY something is an issue, not just that it is one.
- Provide concrete fix suggestions with code snippets, not vague advice.
- Acknowledge good patterns — reviews that only contain criticism are demoralizing.
- Distinguish between blocking issues and stylistic preferences.
- If the diff is large (>500 lines), summarize the scope first and ask if the user wants a full review or wants to focus on specific files.
- Consider the project's existing patterns before flagging style issues — consistency with the codebase matters more than personal preference.
- When in doubt about intent, ask a clarifying question rather than assuming a bug.

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.