Skip to content
Code Review
Command

/delegate-review

Run OCR in delegation mode — OCR handles file selection and rules, the host agent performs the actual review.

From plugin
open-code-review
49k4 skills4 commands
> /plugin marketplace add alibaba/open-code-review
> /plugin install open-code-review@open-code-review

Command definition

delegate-review.md
description: Run OCR in delegation mode — OCR handles file selection and rules, the host agent performs the actual review.

Invoke OpenCodeReview (OCR) in delegation mode. OCR determines which files to review and provides review rules; you perform the actual code review using your own capabilities.

Workflow

Step 1: Preview

ocr delegate preview [user-args]
  • Default (no user arguments): workspace mode (staged + unstaged + untracked).
  • If the user provides `--commit` or `-c`: pass through as-is.
  • If the user provides `--from` and `--to`: pass through as-is.
  • (Optional) Provide `--background "context"` or `-b "context"` for business context.
  • If `ocr` is not found, install it: `npm i -g @alibaba-group/open-code-review`.

This outputs mode/ref metadata and the reviewable file list.

Step 2: Get Rules

Pass all reviewable file paths to get their review checklists:

ocr delegate rule <path1> <path2> ...

Step 3: Get Diffs and Review

Choose the diff command using the mode and refs from Step 1. Use `git --no-pager` for every Git call during the review.

The diff commands disable external diff programs, text conversion, and color to produce plain patches.

  • Range: `git --no-pager diff --no-ext-diff --no-textconv --no-color <merge_base>..<to> -- "<path>"`
  • Commit: `git --no-pager show --no-ext-diff --no-textconv --no-color <commit> -- "<path>"`
  • Workspace: `git --no-pager diff --no-ext-diff --no-textconv --no-color HEAD -- "<path>"` (or `cat "<path>"` for untracked files)

To read context:

git --no-pager log --no-color --oneline -- "<path>"
git --no-pager blame --no-textconv -- "<path>"
git --no-pager show --no-ext-diff --no-textconv --no-color "<ref>:<path>"

For large diffs, add `--output="<absolute-diff-file>"` to the command for the selected mode. Choose a unique absolute path outside the repository and create its parent directory. Use the same path in file-reading tool calls:

git --no-pager diff --no-ext-diff --no-textconv --no-color --output="<absolute-diff-file>" <merge_base>..<to> -- "<path>"

After Git exits with code 0, read and review the entire file in chunks, then remove it. If Git fails or times out, retry or record `skipped` with the error. Check unexpectedly empty output against a fresh preview.

Then review focusing on: correctness, security, performance, error handling, concurrency, maintainability. Only comment on changed code (+ lines).

Step 4: Report and Fix

Record each previewed `(path, status)` as `reviewed` or `skipped`. Give a reason for every skipped entry, and report `total_files`, `reviewed_files`, `skipped_files`, and `coverage_rate`.

Classify each issue by severity:

  • **High**: Obvious bugs, security issues, data loss, or clear mistakes with precise fix proposals
  • **Medium**: Reasonable concerns, performance suggestions, or fixes requiring manual work
  • **Low**: Discard silently (likely false positives, nitpicks, or insufficient context)

Automatically fix High and Medium issues that are safe and well-defined.

Read more
@alibaba
Ships withopen-code-review

Secure, fast, efficient, battle-tested at Alibaba's scale. Hybrid architecture code review tool: deterministic pipelines + LLM Agent, precise line-level comments, built-in multi-language ruleset (NPE, thread-safety, XSS, SQL injection), OpenAI & Anthropic compatible.

Stars on GitHub

Momentum

stars in total
49.3k
Star history of alibaba/open-code-review on GitHub, a chart by star-history.com

Other commands on open-code-review.

commit

commit

Command

Please summarize your current changes, generate a commit message in English, then add and commit. Never include any AI tool or…

tag

tag

Command

Create an annotated git tag with an auto-generated summary of changes since the last tag.

More commands from other plugins.

fixing-pr

fixing-pr

Command

Fix CI failures, resolve merge conflicts with the base branch, and address PR review comments

@streamlit@streamlitInstall Command