open-code-review-delegate
Lets your agent perform code reviews directly, using its own AI capabilities. It's useful when the main agent should control the review process.
What it does
This tool helps review programming code. It identifies which parts of the code need checking and which rules to follow, leaving the detailed analysis to the main agent's intelligence. It's useful when the main agent should be the one performing the review.
When to use it
- ✓When you want the main AI agent to analyze the code.
- ✓To check changes in specific code or a set of files.
- ✓When comparing different code versions for review.
Example of what to ask your AI
“Review the code for me, focusing on security and performance.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
First, the tool identifies the files to be reviewed and the applicable rules. Then, it gets the differences (what changed) between code versions. Finally, the main agent uses this information to perform the review.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add alibaba/open-code-review --skill open-code-review-delegateOr download just the file:
curl -L https://raw.githubusercontent.com/alibaba/open-code-review/main/plugins/open-code-review/skills/open-code-review-delegate/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
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
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
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):
git --no-pager diff --no-ext-diff --no-textconv --no-color <merge_base>..<to> -- "<path>"
Commit mode:
git --no-pager show --no-ext-diff --no-textconv --no-color <commit> -- "<path>"
Workspace mode:
# Tracked files
git --no-pager diff --no-ext-diff --no-textconv --no-color HEAD -- "<path>"
# New untracked files — read directly (entire file is new code)
cat "<path>"
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.
Step 4: Review Each File
Create a checklist containing every reviewable_files entry. For each reviewable file:
Use (path, status) as the checklist identity. Workspace mode can report the same path twice when a staged deletion is followed by an untracked recreation.
- Get its diff (Step 3)
- Consult its Rule Group (from Step 2) for the review checklist
- Conduct a thorough review, using appropriate context tools as needed
- Mark the file
reviewed, orskippedwith a concrete reason
For large changes, review in bounded batches grouped by shared rules and diff size. Do not stop after finding the first high-severity issue.
Step 5: Format Output
Each comment must follow this structure:
| Field | Type | Required | Description |
|---|---|---|---|
| path | string | yes | Relative file path |
| content | string | yes | Review comment describing the issue |
| start_line | integer | no | Start line in the new file |
| end_line | integer | no | End line in the new file |
| category | enum | no | bug, security, performance, maintainability, test, style, documentation, other |
| severity | enum | no | critical, high, medium, low |
Step 6: Classify and Report
Before reporting, verify that every previewed file is accounted for. Include total_files, reviewed_files, skipped_files, and coverage_rate in the summary. A skipped file must include its reason.
Group findings by severity:
- Critical/High: Bugs, security issues, data loss risks — always report
…
FAQ
What does 'delegation' mean?
It means the tool delegates the main analysis task to the primary AI agent, focusing only on organizing and preparing the necessary information for that analysis.
Do I need programming knowledge to use this?
No, the tool is designed for simple use. You just need to indicate what you want to review.
What are 'rules'?
These are guidelines or standards that the code should adhere to, such as best practices for security or programming style.
Details
Original description by the author
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.
repo: alibaba/open-code-review
Popularity
- GitHub stars
- 47k
- Ranking position
- #4694
- License
- Apache-2.0
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
Similar skills
cpp-testing
Makes your agent write and improve tests for C++ code. It helps set up testing tools and fix errors.
affaan-m/ECC
csharp-testing
Helps your agent create tests for C# and .NET code. It uses best practices to ensure tests are efficient and reliable.
affaan-m/ECC
django-tdd
Enables your agent to apply testing strategies for Django with pytest-django and TDD. It's useful for writing robust tests and ensuring code quality, especially for DRF APIs.
affaan-m/ECC