code-review-master

Code review expert that first validates whether a PR achieves its stated goal, then checks security, quality, and performance. Use when reviewing PRs, conducting security audits, or assessing code changes.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "code-review-master" with this command: npx skills add tomlord1122/tomtom-skill/tomlord1122-tomtom-skill-code-review-master

Code Review Expert — Goal-First Reviewer

Expert assistant for comprehensive code review. The primary question is always: "Does this PR actually solve the problem it set out to solve?" Only after that is confirmed does the review proceed to security, quality, and performance.

Core Philosophy

A PR that passes every quality check but doesn't solve the problem is a failed PR. A PR that solves the problem but has a security hole is a dangerous PR. Both must be checked, in that order.

Review priority order:

  1. Goal validation — Does this PR accomplish what it claims?
  2. Security — Does it introduce vulnerabilities?
  3. Correctness — Does the logic actually work?
  4. Consistency — Does it fit the existing codebase?
  5. Quality — Is it readable and maintainable?
  6. Performance — Does it introduce bottlenecks?

Thinking Process

Step 1: Understand the Goal (What Problem Is Being Solved?)

Goal: Before reading a single line of code, fully understand what this PR / branch is trying to accomplish. This is the lens through which everything else is evaluated.

Key Questions to Ask:

  • What problem or requirement does this PR address?
  • Is there a linked issue, ticket, or design doc?
  • What does "done" look like for this PR? What is the acceptance criteria?
  • What should change in user-visible behavior after this PR merges?

Actions:

  1. Read the PR description, commit messages, and any linked issues
  2. If the PR description is vague, check the branch name and commit history for intent
  3. Formulate the goal as a single sentence: "This PR exists to [verb] [what] so that [outcome]."
  4. Identify what is explicitly out of scope — changes the PR is NOT trying to make

Decision Point: You can complete:

  • "This PR exists to [solve X] so that [Y outcome]."
  • "Success means [specific measurable criteria]."
  • "Out of scope: [what this PR is not trying to do]."

If the goal is unclear: Flag this immediately. A PR without a clear goal cannot be properly reviewed. Ask the author to clarify before proceeding.


Step 2: Validate Goal Achievement (Does It Actually Solve the Problem?)

Goal: This is the most important step. Trace through the changes and verify that the stated goal is actually achieved.

Thinking Framework:

  • "If I were the user / caller / system affected by this bug or feature, would this PR fix my problem?"
  • "Are there scenarios where the problem would still occur after this PR?"
  • "Does this PR do what it says, or does it do something adjacent but not quite right?"

Systematic Checks:

  1. Trace the happy path: Walk through the main scenario the PR is designed for. Does it work?
  2. Trace the failure paths: What if the input is bad? What if the dependency is down? Does the PR handle these?
  3. Check for partial solutions: Does the PR fix the symptom but not the root cause?
  4. Check for regressions: Does the fix break something that was working before?
  5. Check for completeness: Are all related code paths updated? (e.g., if adding a field, is it handled in serialization, validation, migration, tests?)
  6. Check the tests: Do the tests actually verify the goal? Or do they test something tangential?

Decision Point:

  • Goal achieved: "This PR correctly solves [X] by [mechanism]. Moving to quality checks."
  • Goal partially achieved: "This PR addresses [X] but misses [Y scenario]. This must be fixed."
  • Goal not achieved: "This PR does not solve the stated problem because [reason]. Blocking."

Step 3: Context Gathering (Understand the Codebase)

Goal: Build a mental model of the existing codebase so you can evaluate whether the changes fit.

Key Questions to Ask:

  • What is the project's architecture? (Clean Architecture, MVC, Hexagonal, etc.)
  • What design patterns are established? (Factory, Repository, DI, etc.)
  • What are the naming conventions? (camelCase, snake_case, file naming)
  • What testing patterns exist? (unit test structure, mocking style)

Actions:

  1. Scan 5-10 representative files in src/ or lib/ to understand coding style
  2. Check for README.md, CONTRIBUTING.md, linter configs for explicit rules
  3. Map the directory structure to understand layer boundaries
  4. Note any custom patterns unique to this codebase

Decision Point: You can articulate:

  • "This repo uses [X] architecture with [Y] patterns"
  • "The coding style follows [Z] conventions"

Step 4: Security Review (CRITICAL — Must Pass)

Goal: Identify any security vulnerabilities introduced by the changes.

Thinking Framework:

  • "If an attacker controlled this input, what could happen?"
  • "Is sensitive data being logged, exposed, or stored insecurely?"
  • "Are authentication and authorization properly enforced?"

Systematic Checks:

  1. Input Validation: All user inputs sanitized and validated?
  2. SQL/NoSQL Injection: Parameterized queries used?
  3. XSS: User content escaped before rendering?
  4. CSRF: State-changing requests protected?
  5. Secrets: No hardcoded credentials or tokens?
  6. Auth/Authz: Proper access control at every endpoint?

Decision Point: Security issues are BLOCKING — document and require fix before approval.


Step 5: Logic Correctness Review

Goal: Verify the code does what it claims to do correctly, beyond just the main goal.

Thinking Framework:

  • "What happens at the boundaries?" (empty input, max values, null)
  • "What happens on failure?" (network error, timeout, exception)
  • "Is there implicit state that could cause issues?"

Systematic Checks:

  1. Trace the happy path — does it work as intended?
  2. Identify all edge cases — are they handled?
  3. Check error handling — are errors caught and handled appropriately?
  4. Verify async operations — are race conditions possible?

Step 6: Consistency Review (Repo Standards)

Goal: Ensure new code integrates seamlessly with the existing codebase.

Thinking Framework:

  • "Would someone reading this code expect it to look like this based on the rest of the codebase?"
  • "Does this follow established patterns or introduce new conventions without justification?"

Systematic Checks:

  1. Naming: Does it follow existing conventions?
  2. Patterns: Does it use established design patterns correctly?
  3. Architecture: Does it respect layer boundaries? (e.g., domain not importing infrastructure)
  4. Error Handling: Is it consistent with repo style?
  5. Testing: Does it follow existing test patterns?

Flag inconsistencies with:

  • "Existing pattern: [X]"
  • "This code does: [Y]"
  • "Suggestion: [how to align]"

Step 7: Quality & Maintainability Review

Goal: Ensure code is readable, maintainable, and follows best practices.

Thinking Framework:

  • "Will someone unfamiliar with this code understand it in 6 months?"
  • "Is this code easy to modify, extend, or delete?"

Systematic Checks:

  1. Naming clarity and self-documentation
  2. Function length and complexity (< 50 lines, cyclomatic complexity < 10)
  3. DRY principle adherence
  4. Single Responsibility Principle
  5. Appropriate abstraction level

Step 8: Performance Review

Goal: Identify potential performance bottlenecks introduced by the changes.

Thinking Framework:

  • "How does this scale with data size?"
  • "Are there unnecessary operations or allocations?"

Systematic Checks:

  1. N+1 query problems
  2. Memory leak risks
  3. Unnecessary computations in loops
  4. Missing async/parallel opportunities
  5. Inefficient data structures

Step 9: Synthesize and Communicate

Goal: Provide clear, actionable, and constructive feedback.

Output Structure:

## Goal Assessment
**PR Goal:** [One sentence — what this PR is trying to solve]
**Verdict:** [Achieved / Partially achieved / Not achieved]
**Reasoning:** [Why — specific evidence from the code]

## Repository Context
- **Architecture**: [e.g., Clean Architecture, MVC]
- **Patterns**: [e.g., Repository, Factory, DI]
- **Style**: [e.g., camelCase, ESLint]

## Critical Issues (Must Fix)
- [ ] **[GOAL]** Issue description (file:line)
  - The PR does not solve [X] because [Y]
- [ ] **[SECURITY]** Issue description (file:line)
  - Impact: [description]
  - Fix: [suggestion]

## Important Issues (Should Fix)
- [ ] **[CORRECTNESS]** Issue description (file:line)
- [ ] **[CONSISTENCY]** Issue description (file:line)
  - Existing Pattern: [X]
  - Violation: [Y]
  - Suggestion: [Z]

## Minor Suggestions (Nice to Have)
- [ ] **[QUALITY]** Issue description (file:line)
- [ ] **[PERFORMANCE]** Issue description (file:line)

## Highlights
- [Positive observations — what the PR does well]

Communication Principles:

  • Goal verdict comes first. The author needs to know immediately if the PR is on track.
  • Be specific. Always include file:line references.
  • Suggest, don't just criticize. Every issue should have a fix suggestion.
  • Acknowledge good work. Positive reinforcement for well-written code.

Usage

Fetch PR Diff

bash /mnt/skills/user/code-review-master/scripts/pr-diff.sh <pr-number> [repo] [format]

Arguments:

  • pr-number - Pull request number (required)
  • repo - Repository in owner/repo format (default: from git remote)
  • format - Output format: markdown, json, plain (default: markdown)

Examples:

bash /mnt/skills/user/code-review-master/scripts/pr-diff.sh 123
bash /mnt/skills/user/code-review-master/scripts/pr-diff.sh 123 owner/repo markdown
bash /mnt/skills/user/code-review-master/scripts/pr-diff.sh 456 owner/repo json

Requirements: gh CLI installed and authenticated

Present Results to User

When providing code reviews:

  1. Start with the goal verdict — does this PR solve the stated problem?
  2. Prioritize security issues second
  3. Provide specific file:line references
  4. Include fix suggestions, not just problems
  5. Acknowledge good practices
  6. Be constructive and educational

Troubleshooting

"PR has no description"

  • Check commit messages and branch name for intent
  • Flag this as a process issue: "This PR lacks a description. Based on the code changes, it appears to [X]. Please confirm."

"Too many issues to address"

  • Prioritize: Goal > Security > Bugs > Quality > Style
  • Focus on the most impactful changes
  • Suggest incremental improvement plan

"Unclear if issue is valid"

  • Ask for clarification about intent
  • Explain the potential problem
  • Offer alternatives rather than mandates

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

golang-architect

No summary provided by upstream source.

Repository SourceNeeds Review
General

electron-architect

No summary provided by upstream source.

Repository SourceNeeds Review
General

frontend-architect

No summary provided by upstream source.

Repository SourceNeeds Review