Files
coderabbitai__skills/commands/coderabbit-review.md
T
2026-04-28 01:44:15 -07:00

1.9 KiB

description, argument-hint, allowed-tools
description argument-hint allowed-tools
Run CodeRabbit AI code review on your changes [type] [--base <branch>] Bash(coderabbit:*), Bash(cr:*), Bash(git:*)

CodeRabbit Code Review

Run an AI-powered code review using CodeRabbit.

Context

  • Current directory: !pwd
  • Git repo: !git rev-parse --is-inside-work-tree 2>/dev/null && echo "Yes" || echo "No"
  • Branch: !git branch --show-current 2>/dev/null || echo "detached HEAD"
  • Has changes: !git status --porcelain 2>/dev/null | head -1 | grep -q . && echo "Yes" || echo "No"

Instructions

Review code based on: $ARGUMENTS

Prerequisites Check

Skip these checks if you already verified them earlier in this session.

Otherwise, run:

coderabbit --version 2>/dev/null && coderabbit auth status 2>&1 | head -3

If CLI not found, tell user:

CodeRabbit CLI is not installed. Install it from the official docs:

https://www.coderabbit.ai/cli

Prefer a package manager or a verified binary, then restart your shell and try again.

If "Not logged in", tell user:

You need to authenticate. Run in your terminal:

coderabbit auth login

Then try again.

Run Review

Once prerequisites are met:

# type defaults to "all"; add --base only when specified
coderabbit review --agent -t "${type:-all}" ${base:+--base "$base"}

Where type and base come from $ARGUMENTS:

  • all (default) - All changes
  • committed - Committed changes only
  • uncommitted - Uncommitted only

Add --base <branch> only when a base branch is specified.

Present Results

Group findings by severity:

  1. Critical - Security vulnerabilities, data loss risks, crashes
  2. Warning - Bugs, performance issues, anti-patterns
  3. Info - Style issues, suggestions, minor improvements

Offer to apply fixes from the --agent findings when the output includes actionable remediation details.