Skip to content
code-review logo

Code Review

code-review

Review code changes between commits for security, logic, performance, and style issues

jpoutrin/product-forge0installs16stars

SKILL.md

Full skill instructions

code-review

Category: Development

Usage

/​code-review [<commit>] [--from <commit>] [--to <commit>]

Arguments

ArgumentDefaultDescription
<commit>-Single commit to review
--frommerge-base with mainStarting commit reference
--toHEADEnding commit reference

Examples

# Review all changes in current branch (from merge-base to HEAD)
/​code-review

# Review a specific commit
/​code-review abc1234

# Review a range of commits
/​code-review --from abc1234 --to def5678

# Review changes since a specific commit
/​code-review --from HEAD~5

# Review changes up to a specific commit
/​code-review --to feature-branch

Execution Method

This command delegates to the code-review-expert agent (Haiku model) for fast, cost-effective execution.

Delegation: Use the Task tool with:

  • subagent_type: "git-workflow:code-review-expert"
  • model: "haiku"
  • prompt: Include the commit range and current working directory

Example:

Task(subagent_type="git-workflow:code-review-expert", model="haiku", prompt="Review changes from abc1234 to HEAD in /​path/​to/​repo")

Execution Instructions for Claude Code

When this command is run, Claude Code should:

1. Parse Arguments

SINGLE_COMMIT = first positional argument (if provided)
FROM = --from value or merge-base with main/​master
TO = --to value or HEAD

If a single commit is provided:

  • Review just that commit: FROM = <commit>^, TO = <commit>

If no arguments:

  • FROM = merge-base with main (or master)
  • TO = HEAD

2. Validate Commit References

# Verify commits exist
git rev-parse --verify "$FROM" 2>/​dev/​null
git rev-parse --verify "$TO" 2>/​dev/​null

If invalid, show error with suggestions.

3. Gather Change Information

# Get overview
git diff --stat $FROM..$TO

# Get commit history
git log --oneline $FROM..$TO

# Get full diff for analysis
git diff $FROM..$TO

4. Analyze Changes

Review each file's changes for:

Critical Issues (must fix)

  • Security vulnerabilities (injection, XSS, auth bypass)
  • Hardcoded secrets or credentials
  • Data exposure risks

High Priority (should fix)

  • Logic bugs and incorrect behavior
  • Missing error handling
  • Null reference issues
  • Race conditions

Medium Priority (consider fixing)

  • Performance issues (N+1 queries, inefficient loops)
  • Code smells and maintainability issues
  • Missing input validation

Low Priority (optional)

  • Style inconsistencies
  • Minor code improvements
  • Documentation gaps

Test Coverage

  • New code without corresponding tests
  • Changed behavior without updated tests

5. Present Findings

Format output as:

Code Review: <from>..<to>
=========================

Files Changed: N (+X, -Y)
Commits: M

## Critical Issues
- [SECURITY] path/​file.py:42 - SQL injection via unsanitized input

## High Priority
- [LOGIC] path/​file.py:78 - Missing null check on user.profile

## Medium Priority
- [PERFORMANCE] path/​file.py:120 - Queries in loop, consider batch fetch

## Low Priority
- [STYLE] path/​file.py:15 - Inconsistent naming: userID vs user_id

## Test Coverage
- Missing tests for: new_feature() in path/​file.py

## Suggestions
- Consider adding retry logic for external API calls

---
Overall: NEEDS_CHANGES | APPROVED_WITH_COMMENTS | APPROVED

6. Overall Assessment

  • NEEDS_CHANGES: Critical or multiple high-priority issues found
  • APPROVED_WITH_COMMENTS: Only medium/​low issues, suggestions provided
  • APPROVED: No significant issues found

What to Review

CategoryLook For
SecurityInjection, auth, secrets, data exposure
LogicBugs, error handling, edge cases
PerformanceN+1 queries, inefficient algorithms
StyleNaming, consistency, complexity
TestsCoverage, quality, edge cases

What NOT to Flag

  • Subjective style preferences (unless inconsistent)
  • Theoretical issues that can't happen in context
  • Over-engineering suggestions
  • Minor naming bikeshedding

Error Handling

No changes to review
  The commits $FROM and $TO are identical.

Invalid commit reference
  Could not find commit: abc1234
  Try: git log --oneline -20

Not a git repository
  Navigate to a git repository first.

Related Commands

CommandPurpose
/​commitCreate commits with conventional format
/​rebaseRebase local changes on remote

More skills from jpoutrin

mcp-security logo
jpoutrin/product-forge

mcp-security

Use when securing MCP servers, preventing prompt injection, implementing authorization, validating user input, or building secure multi-agent pipelines. Provides 5-layer defense architecture patterns.

16 0
View
create-skill logo
jpoutrin/product-forge

create-skill

Create a new Claude Code agent skill with proper folder structure and SKILL.md format. Use when the user wants to add a model-invoked skill that Claude uses autonomously based on context. Handles skill folder creation with SKILL.md and optional reference files.

16 0
View
design-system logo
jpoutrin/product-forge

design-system

Design system management for building and reusing UI components, tokens, and patterns. Use when working with component libraries, design tokens, style guides, or reusable UI patterns to ensure consistency and promote component reuse.

16 0
View
fastmcp logo
jpoutrin/product-forge

fastmcp

FastMCP TypeScript framework patterns for MCP servers. Auto-loads when building MCP servers, creating tools/resources/prompts, implementing authentication, configuring transports, or working with FastMCP in TypeScript.

16 0
View
portman logo
jpoutrin/product-forge

portman

Port management for local development with git worktrees. Use when setting up local development environments, booking ports for services to avoid collisions between parallel worktrees, or configuring docker-compose with dynamic ports.

16 0
View
qa-test-management logo
jpoutrin/product-forge

qa-test-management

Automatic QA test lifecycle management, naming conventions, and directory structure. Use when creating, organizing, or tracking QA tests to ensure proper naming, directory structure, and status transitions.

16 0
View
create-command logo
jpoutrin/product-forge

create-command

Create a new Claude Code slash command with proper YAML frontmatter structure. Use when the user wants to add a custom slash command to a plugin. Handles command file creation with description, argument hints, allowed tools, and all advanced features.

16 0
View
dependency-alignment logo
jpoutrin/product-forge

dependency-alignment

Dependency version alignment and conflict resolution for parallel development. Use when extracting dependencies from Tech Specs to ensure version compatibility with existing project dependencies and transitive dependencies.

16 0
View
create-persona logo
jpoutrin/product-forge

create-persona

Create detailed user persona with guided questions

16 0
View
bl-sync logo
jpoutrin/product-forge

bl-sync

Sync git-branchless stack with main branch - fetch, rebase, and handle merges

16 0
View
bl-undo logo
jpoutrin/product-forge

bl-undo

Undo git-branchless operations - recover from mistakes interactively

16 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View