# Delegated Code Review

Has the host agent perform the code review while OCR handles file selection and rules.

- Repository: https://github.com/alibaba/open-code-review (49236 stars)
- Category: Git and review
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add alibaba/open-code-review --skill open-code-review-delegate -g -a claude-code -y`
Codex: `npx skills add alibaba/open-code-review --skill open-code-review-delegate -g -a codex -y`
Cursor: `npx skills add alibaba/open-code-review --skill open-code-review-delegate -g -a cursor -y`
Gemini CLI: `npx skills add alibaba/open-code-review --skill open-code-review-delegate -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add alibaba/open-code-review`

## Description

Delegation mode for open-code-review (OCR). Instead of OCR calling an LLM endpoint, this skill instructs the host agent to perform the code review itself, using OCR only for deterministic engineering: file selection and rule resolution. Use when the host agent should drive the review with its own LLM capabilities.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Open Code Review, Delegation Mode

This Codex plugin skill intentionally mirrors the canonical skill at
`skills/open-code-review-delegate/SKILL.md`. Keep both files synchronized when
updating OCR delegation instructions; a symlink is avoided because plugin
installs may only materialize the plugin subtree.

A skill for performing AI code review where OCR provides deterministic engineering (file filtering, rule resolution) and the host agent performs the actual review using its own intelligence and tools.

## Workflow

### Step 1: Preview, Determine What to Review

```bash
ocr delegate preview --format json [--from <ref> --to <ref>] [--commit <hash>] [--exclude <patterns>]
```

This outputs:
- **mode** (workspace / range / commit)
- **from / to / commit / merge_base**, ref metadata for constructing git commands
- **Reviewable file list**, paths, status, insertions/deletions
- **Excluded files**, with exclusion reason

**Common invocations:**

| Scenario | Command |
|----------|---------|
| Workspace changes | `ocr delegate preview` |
| Branch comparison | `ocr delegate preview --from main --to feature` |
| Single commit | `ocr delegate preview -c abc123` |

### Step 2: Get Rules for Files

```bash
ocr delegate rule --format json <path1> <path2> ...
```

Pass the reviewable file paths from Step 1. Output is grouped by rule content, files sharing the same rule appear under one group, avoiding repetition.

### Step 3: Get Diffs

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 mode** (merge_base provided in preview output):
```bash
git --no-pager diff --no-ext-diff --no-textconv --no-color <merge_base>..<to> -- "<path>"
```

**Commit mode**:
```bash
git --no-pager show --no-ext-diff --no-textconv --no-color <commit> -- "<path>"
```

The rest: https://github.com/alibaba/open-code-review/blob/HEAD/plugins/open-code-review/skills/open-code-review-delegate/SKILL.md
