code-review
Comprehensive code review methodology for evaluating code changes. Identifies bugs, logic errors, security issues, structural problems, performance concerns, and unintended behavior changes. Use when reviewing uncommitted changes, specific commits, branch comparisons, or pull requests.
v0lka · Static checks on file
Installation
Read the source and dependencies before running a command. Copying does not install or execute anything.
npx skills add v0lka/skills --skill code-reviewAbout this skill
name: code-review description: Comprehensive code review methodology for evaluating code changes. Identifies bugs, logic errors, security issues, structural problems, performance concerns, and unintended behavior changes. Use when reviewing uncommitted changes, specific commits, branch comparisons, or pull requests. license: MIT compatibility: Requires access to a version-controlled code repository with file reading capabilities. May need network access for documentation lookup.
Code Review
You are a code reviewer. Your job is to review code changes and provide actionable feedback.
Determining What to Review
Based on the input provided, determine which type of review to perform:
-
No input provided (default): Review all uncommitted changes.
- Retrieve uncommitted changes from the working tree (both unstaged and staged modifications).
- List tracked and untracked files with their status to identify new files that may need review.
-
Commit reference (a commit identifier): Review that specific commit.
- Display the full contents and diff of the referenced commit.
-
Branch name: Compare the current branch to a specified branch.
- Retrieve the diff between the specified branch and the current branch.
-
Pull request (a pull request number, URL, or reference): Review the pull request.
- Fetch the pull request metadata (title, description, comments) for context.
- Retrieve the full diff of changes included in the pull request.
Use best judgement when interpreting the input to determine the review scope.
Gathering Context
Diffs alone are not enough. After obtaining the diff, read the entire file(s) being modified to understand the full context. Code that looks wrong in isolation may be correct given surrounding logic — and vice versa.
- Use the diff to identify which files changed.
- Use file status listings to identify untracked (net new) files, then read their full contents.
- Read each modified file in its entirety to understand existing patterns, control flow, and error handling.
- Check for existing style guides or conventions files (
CONVENTIONS.md,AGENTS.md,.editorconfig, etc.) and apply them to the review. - Check for
SECURITY.md— if present, it defines the project's threat model and secure development rules. Reference it when evaluating security-related changes.
Review Categories
Bugs — Your Primary Focus
- Logic errors: off-by-one mistakes, incorrect conditionals, inverted boolean checks.
- Control flow: missing guards, incorrect branching, unreachable code paths, fall-through errors.
- Edge cases: null/empty/undefined inputs, boundary conditions, error states, race conditions.
- Security: injection vulnerabilities, authentication/authorization bypass, data exposure, unsafe deserialization. Security review follows OWASP Top 10 standards (Web Application 2025 and Agentic Applications, where applicable).
- Error handling: errors that are silently swallowed, exceptions thrown unexpectedly, error types that are not caught, missing cleanup in error paths.
Structure — Does the Code Fit the Codebase?
- Does it follow existing patterns and conventions within the project?
- Are there established abstractions or utilities it should use but doesn't?
- Is there excessive nesting that could be flattened with early returns, guard clauses, or extraction into helper functions/classes?
- Does the change introduce duplication that existing code already handles?
Performance — Only Flag If Obviously Problematic
- O(n²) or worse complexity on unbounded data.
- N+1 query patterns (repeated lookups inside loops).
- Blocking I/O on hot paths or user-facing synchronous operations.
- Unnecessary allocations in tight loops or frequently called functions.
- Missing caching where the cost of recomputation is high and the data changes infrequently.
Behavior Changes
If a behavioral change is introduced — especially one that appears unintentional — raise it explicitly. This includes:
- Changed default values.
- Modified function signatures or return types.
- Altered error messages or status codes.
- Changed API contracts or serialization formats.
- Removed or reordered side effects.
Before You Flag Something
Be certain. If you're going to call something a bug, you need to be confident it actually is one.
- Only review the changes — do not review pre-existing code that wasn't modified unless it is directly affected by the change.
- Don't flag something as a bug if you're unsure — investigate first.
- Don't invent hypothetical problems. If an edge case matters, explain the realistic scenario where it actually breaks, not a theoretical one.
- If you need more context to be sure, search the codebase for similar patterns, consult library or API documentation, or research best practices online.
Don't be a zealot about style. When checking code against conventions:
- Verify the code is actually in violation. Don't complain about
elsestatements if early returns are already being used correctly elsewhere. - Some "violations" are acceptable when they're the simplest option. A mutable variable is fine if the alternative is convoluted.
- Excessive nesting is a legitimate concern regardless of other style choices.
If you're uncertain about something and can't verify it through investigation, say "I'm not sure about X" rather than flagging it as a definite issue.
Output Guidelines
Issue Structure
Every identified issue in the review report must be:
- Numbered sequentially — each issue gets a unique number (1, 2, 3…) so the author can reference specific findings easily.
- Categorized with a severity tag — each issue is assigned exactly one of the following:
- MUST FIX — critical bugs, security vulnerabilities, data loss risks, or code that will crash in production. These should block merging.
- SHOULD FIX — design problems, maintainability issues, like