claude-review
npx machina-cli add skill dceoy/ai-coding-agent-skills/claude-review --openclawClaude Review Skill
Use Claude Code CLI to perform automated code reviews that identify issues and suggest improvements. This is a read-only analysis skill.
When to Use
- User asks to "review" code
- User wants to check for bugs or issues
- User mentions "security", "performance", or "quality"
- Before committing code
- During pull request review
- User asks "what's wrong with this code?"
Prerequisites
Verify Claude Code CLI is available:
claude --version # Should display installed version
Basic Usage
Step 1: Determine Scope
Decide what to review:
- Uncommitted changes
- Specific file(s)
- Last commit
- Entire codebase
Step 2: Check Current State
git status
git diff --stat
git diff
Step 3: Execute Claude Code Review
Run Claude Code with a review-focused prompt (use -p/--print to output once and exit):
claude -p "Perform comprehensive code review of [SCOPE].
Check for:
1. CRITICAL ISSUES (must fix): security, runtime errors, data loss, breaking changes
2. IMPORTANT ISSUES (should fix): logic bugs, performance, error handling, type safety
3. SUGGESTIONS (consider): refactors, readability, docs
For each issue:
- Severity (Critical/Important/Suggestion)
- File path and line number
- Why it's a problem
- How to fix it
Do NOT make any changes - this is review only."
If your CLI does not support -p, run claude and paste the prompt.
Step 4: Present Findings
Organize results by severity and include file references.
Example Reviews
claude -p "Review all uncommitted changes for bugs, security issues, and performance problems. Do NOT modify code."
claude -p "Security review of src/auth/*.ts focusing on SQL injection, XSS, auth/authorization, secrets, and input validation. Do NOT modify code."
Best Practices
- Categorize by severity
- Include specific file paths and line numbers
- Explain why each issue matters
- Verify findings to avoid false positives
Error Handling
- If Claude Code CLI is not available, ensure it's installed and in your PATH
- If the review is too broad, narrow the scope
- If issues are unclear, request clarification or smaller scope
Related Skills
claude-askfor understanding code before reviewingclaude-execfor fixing issues found in review
Limitations
- Static analysis only
- May generate false positives
- Cannot run tests or execute code
Source
git clone https://github.com/dceoy/ai-coding-agent-skills/blob/main/skills/claude-review/SKILL.mdView on GitHub Overview
Use Claude Code CLI to perform automated, read-only code reviews that identify bugs, security vulnerabilities, performance issues, and quality problems. This helps reviewers catch issues before commits or PRs and speeds up feedback.
How This Skill Works
It runs Claude Code CLI with a review-focused prompt to enumerate issues by severity, capture file paths and line numbers, and provide explanations and suggested fixes. It never modifies source code; you review the findings and decide on actions.
When to Use It
- User asks to review code
- User wants to check for bugs or issues
- User mentions security, performance, or quality concerns
- Before committing code
- During pull request review
- User asks 'what's wrong with this code?'
Quick Start
- Step 1: Determine scope (uncommitted changes, specific file(s), last commit, or entire codebase).
- Step 2: Run Claude Code with a review-focused prompt (use `-p`/`--print` to output once and exit): claude -p "Perform comprehensive code review of [SCOPE]. Check for: 1. CRITICAL ISSUES (must fix): security, runtime errors, data loss, breaking changes 2. IMPORTANT ISSUES (should fix): logic bugs, performance, error handling, type safety 3. SUGGESTIONS (consider): refactors, readability, docs. For each issue: - Severity (Critical/Important/Suggestion) - File path and line number - Why it's a problem - How to fix it Do NOT make any changes - this is review only."
- Step 3: Present findings organized by severity with file references and actionable next steps.
Best Practices
- Categorize findings by severity (Critical/Important/Suggestion)
- Include precise file paths and line numbers
- Explain why each issue matters and its potential impact
- Verify findings to avoid false positives
- Keep the review read-only and provide clear next steps
Example Use Cases
- claude -p "Review all uncommitted changes for bugs, security issues, and performance problems. Do NOT modify code."
- claude -p "Security review of src/auth/*.ts focusing on SQL injection, XSS, auth/authorization, secrets, and input validation. Do NOT modify code."
- claude -p "Review changes before committing to catch critical issues."
- claude -p "PR review: analyze new code in reducers for potential runtime errors."
- claude -p "Full codebase review for quality issues without modifying code."