open-code-review
What it does
This tool analyzes your programming code to find issues. It checks recent changes, compares different code versions, or reviews a specific point in history. It can even suggest fixes.
When to use it
- ✓Reviewing code you just wrote before submitting it.
- ✓Comparing two versions of your project to see quality differences.
- ✓Checking if a colleague made changes that need attention.
Skill link
https://github.com/alibaba/open-code-review/blob/main/plugins/open-code-review/skills/open-code-review/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Review my code and suggest fixes.”
5 new skills a week. 1 minute to read.
open-code-review: full guide
Reading a code change line by line is slow, and mistakes slip through when you are tired or when the change is large. This skill lets your agent run Open Code Review (the `ocr` command-line tool) on your Git changes and return comments tied to specific lines. It can review your uncommitted work, a single commit, a branch, or a GitHub pull request.
It is for developers who want a second look before they push, and for team members who must check someone else's change. Before you start, note one limit: this version uses its own AI model, so you need to set up an LLM provider for `ocr` first. If you want the agent to use its own model instead, the skill text points to a separate skill called open-code-review-delegate.
Use cases
Check your work before a commit
You changed six files today and some are not staged yet. Ask the agent to review your working copy. OCR looks at staged, unstaged and new untracked files together, so a forgotten file is still covered. You get line-level comments to read before you commit.
Review a pull request from a colleague
A teammate opens pull request 42 and asks you to approve it. Give the agent the number or the URL. It runs a helper script that needs GitHub's `gh` tool, reads the PR at its exact revisions, and reports findings with the PR address and the saved report path.
Understand what a merged commit changed
You return from leave and want to know what one commit did. Ask for a review of that commit. For commits and branch ranges the skill also runs an analysis by default, which explains the behavior and impact of the change, not only the problems.
Step by step
- 1Install the `ocr` command: run `npm install -g @alibaba-group/open-code-review`, or download the program from the GitHub releases page.
- 2Configure an LLM provider for `ocr` before the first run. It supports Anthropic, OpenAI Chat Completions, OpenAI Responses and AWS Bedrock. Without this, the review fails.
- 3Put the skill folder in your skills directory, for example `~/.claude/skills/open-code-review/`, and open your agent inside the Git repository you want reviewed.
- 4Ask for a review in plain words and add a sentence of business context, such as what the change is meant to do. The skill passes it to OCR to improve the comments.
- 5Read the report. The agent should split findings into reproduced and uncertain ones. Ask for fixes only after you have read them.
Example
What to ask
“Review the current branch against main. This change adds a retry to the payment webhook handler, so duplicate events must not charge twice.”
What you get
The agent runs OCR on the commits since main, with analysis. You get a summary of what the change does, then two groups of findings: reproduced ones with the check performed and the result, and uncertain ones with what would settle them. Each has a file and line. No code is edited.
Tips
- ✓Give background. A short note on what the change is for helps OCR judge intent, and the skill lists it as recommended.
- ✓The agent treats every OCR comment as a claim to check, not a fact. Read the uncertain group carefully, because those items were not confirmed.
- ✓Large diffs can hit limits. A file whose diff alone is too big for the token budget is skipped, so check the coverage notes in the report to see what was not reviewed.
- ✓Say clearly whether you want fixes. If you only ask for a review, the agent should ask permission before editing anything.
Alternatives
- ponytail-audit
Pick it when you want a full audit of existing code, including security and slow code, not a review of recent changes.
- verify-and-stop
Pick it when the question is whether finished work meets its requirements, with a clear pass or fail result.
- test-driven-development
Pick it when you want bugs prevented by writing tests first, instead of reviewing the code afterwards.
Questions and answers
Do I need a separate API key to use this skill?
Yes. This version runs OCR with its own model provider, so you must configure one before the first run. If you want the agent's own model and no extra credentials, the skill points to open-code-review-delegate.
Can it review a pull request from a fork or another repository?
Yes. A bare number refers to the default repository of your checkout, which can be the upstream one. You can pass an explicit `--repo OWNER/REPO`. PR mode needs Python 3 and an authenticated `gh` tool.
Will it change my code without asking?
No. It fixes code only when you ask for review and fix. If you only ask for a review, it should ask before applying changes, and it should confirm fixes with you before committing.
How it works
The tool uses a program called 'ocr' to read your code changes. It analyzes these changes, identifies potential errors or improvements, and presents a detailed, line-by-line report.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Open Code Review
This Codex plugin skill intentionally mirrors the canonical skill at
skills/open-code-review/SKILL.md. Keep both files synchronized when updating
OCR agent instructions; a symlink is avoided because plugin installs may only
materialize the plugin subtree.
A skill for invoking open-code-review (ocr) — an open-source AI code review CLI that reads Git diffs and generates structured, line-level review comments.
Workflow
Step 1: Gather Business Context
Analyze the review target (commits, branch, or changes) to extract concise business context. Pass this context via --background to improve review quality.
Step 2: Run Code Review
Do not pre-check whether ocr is installed — skip probes like command -v ocr or ocr --version. Assume the CLI is available and run the review directly; that saves a tool call on the common path. Only if the review fails with command not found should you install it per Troubleshooting.
Run the OCR command with appropriate flags. Always pass business context via --background when available:
ocr review --audience agent --background "business context here" [user-args]
Argument handling:
- Background context (RECOMMENDED): use
--background "context"or-b "context"to provide business context for better review quality - Default (no user arguments): reviews staged, unstaged, and untracked changes (workspace mode)
- Specific commit: use
--commitor-cto review a single commit against its parent - Branch comparison: use
--from <ref>and--to <ref>to review diff between two refs - Timeout: effective timeout per review group =
--timeout× review rounds. Default--timeout 15with default effortmedium(2 rounds) gives 30 minutes;low/highgive 15/45 minutes. - Concurrency: default concurrency is 8 file workers; reduce with
--concurrency <n>if rate limits are hit - Preview mode: use
--previewor-pto preview which files will be reviewed without running the LLM - Output file: use
--output <path>to write the full result to a file instead of stdout. If the command fails withunknown flag: --output, do not continue the review with plain stdout. Ask the user whether to upgrade (npm i -g @alibaba-group/open-code-review@latest) and wait for the answer before proceeding. After the user confirms and the upgrade succeeds, rerun with--output. - Installation: if
ocrcommand is not found, install it by runningnpm i -g @alibaba-group/open-code-review
Common invocation patterns:
| User says | Command to run |
|---|---|
| "review my changes" / "review the working copy" | ocr review --audience agent -b "context" |
| "review this PR" / "review feature branch" | ocr review --audience agent -b "context" --from main --to <branch> |
| "review commit abc123" | ocr review --audience agent -b "context" --commit abc123 |
| "what would be reviewed?" (dry-run) | ocr review --preview |
Output mode:
- Always use
--audience agentto suppress progress UI and emit only the final summary - Prevent output truncation: For large reviews or restricted tool environments, pass
--output /tmp/ocr_out.txtand inspect the file in full via a file reading tool instead of piping stdout throughtailorhead, which drops earlier review comments.
On failure: If ocr review exits non-zero (e.g. an LLM connection error), do not retry blindly — consult the Troubleshooting section below for the matching fix before re-running.
Step 3: Report
OCR output includes structured severity (critical / high / medium / low) and category (bug / security / performance / maintainability / test / style / documentation / other) on each comment. Present results grouped by severity, discarding low severity items that are likely false positives or nitpicks.
Step 4: Fix
Before applying fixes, check whether the user requested automatic fixes:
- If the user explicitly requested "review and fix" or similar, proceed with automatic fixes
- If the user only requested "review" without fix intent, ask for permission before applying any changes
When fixing issues and suggestions:
- Focus on critical, high, and medium severity items
- Apply fixes directly to the code when safe and well-defined
- For complex fixes requiring manual intervention, clearly describe what needs to be done
…
FAQ
What is 'code'?
Code is a set of instructions that tell a computer what to do. Think of it like a recipe for a computer program.
What is 'code review'?
It's the process of looking at someone else's code (or your own) to find errors, suggest improvements, or ensure it follows certain quality standards.
What are 'changes' or 'diffs'?
These are the differences between two versions of a file or project. The tool focuses on these differences to understand what changed and review only what's necessary.
Details
Original description by the author
Performs AI-powered code review on Git changes using the `ocr` CLI from alibaba/open-code-review. Use when the user asks to review code, review a pull request, review staged/unstaged changes, review a commit, or compare branches for code quality issues. Produces line-level review comments and can automatically apply fixes when requested. With appropriate review rules, can detect various types of i
repo: alibaba/open-code-review
Popularity
- GitHub stars
- 47k
- Ranking position
- #6316
- License
- Apache-2.0
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
Similar skills
test-driven-development
311kTeaches your agent to write a failing test first, watch it fail, then write the smallest code that passes, before building any feature or fix.
verification-before-completion
311kTeaches your agent to run real checks and read their output before claiming that a task, fix, or build is complete or passing.
migrate-to-shoehorn
310kReplaces risky type casts in your test files with the shoehorn library, so tests can use partial data and still pass type checks.