Code Review Skill for Claude Code

A comprehensive code review skill combining automated tooling with LLM analysis for thorough, actionable feedback.

Views0
PublishedJan 14, 2026

Loading actions...

5 minBeginnerpromptSingle file

Skill content

Main instructions and any bundled files for this skill.

markdown

Code Review Skill for Claude Code

A comprehensive code review skill combining automated tooling with LLM analysis for thorough, actionable feedback.

Features

  • Multi-phase review: automated tools, test quality, micro/macrostructure, general quality
  • Language support: PHP, TypeScript/JavaScript, and Python projects
  • Docker execution: Run tools in isolated containers for consistency
  • Project setup: Generate coding standards and tool configs automatically
  • GitLab CI integration: Automated reviews on merge requests with inline comments
  • Configurable: Custom thresholds, focus areas, and exclusions

Installation

Copy the skill/ folder contents to your Claude Code skills directory:

mkdir -p ~/.claude/skills/code-review
cp -r skill/* ~/.claude/skills/code-review/

Or clone and link:

git clone https://gitlab.com/hfietz/claude-code-review.git
ln -s "$(pwd)/claude-code-review/skill" ~/.claude/skills/code-review

Usage

Code Review

/code-review [options]

Options:
  --scope=full|diff|files    What to review (default: auto-detect)
  --base=<branch>            Base branch for diff (default: main/master)
  --output=human|json        Output format (default: human)
  --focus=all|style|tests|arch|quality  What to emphasize
  --files=<glob>             Specific files to review
  --skip-tools               Skip automated tools, LLM-only analysis
  --docker / --no-docker     Force Docker execution mode

Project Setup

Prepare a project with coding standards and tool configurations:

/code-review --setup [options]

Options:
  --language=php|python|typescript|auto  Target language
  --strict                               Use stricter thresholds
  --dry-run                              Preview changes

This generates:

  • Coding conventions section in CLAUDE.md
  • Tool configs (phpstan.neon, eslint.config.js, ruff.toml)
  • Project-specific .code-review.yaml

GitLab CI Setup

Set up automated code review in GitLab pipelines:

/code-review --setup-gitlab

This generates:

  • .gitlab-ci.yml with lint, test, and review stages
  • Scripts for Claude API integration
  • Instructions for CI variables

Docker Images

Pre-built containers with all review tools:

# Pull images
docker pull registry.gitlab.com/hfietz/claude-code-review/review-php:latest
docker pull registry.gitlab.com/hfietz/claude-code-review/review-python:latest
docker pull registry.gitlab.com/hfietz/claude-code-review/review-typescript:latest
ImageTools
review-phpPHPStan, PHPCS, PHPMD, PHPUnit, Deptrac
review-pythonRuff, mypy, Pyright, pytest, Bandit, Radon
review-typescriptESLint, TypeScript, Vitest, madge, dependency-cruiser

GitLab CI Integration

The skill can set up automated code review in your GitLab pipelines:

  1. Run /code-review --setup-gitlab in your project
  2. Set CI variables in GitLab:
    • ANTHROPIC_API_KEY - Claude API key (protected, masked)
    • GITLAB_TOKEN - Token with api scope for posting comments
  3. Push to trigger pipeline

On merge requests, Claude will:

  • Review the diff for bugs, security issues, and code quality
  • Post inline comments on specific lines
  • Add a summary comment with findings

Configuration

Create .code-review.yaml in your project root:

version: 1

thresholds:
  function_length: 40
  class_length: 300
  complexity: 10
  coverage:
    target: 80

focus:
  security: high
  performance: medium
  style: medium

exclude:
  paths:
    - vendor/
    - node_modules/
    - "*.generated.*"

docker:
  enabled: auto  # auto, always, never

License

MIT

Share: