open-code-review
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 issues including bugs, security vulnerabilities, performance problems, and code quality concerns.
Security Assessment
Detected risks:
About open-code-review
Performs AI-powered code review on Git changes using the ocr CLI from alibaba/open-code-review. It reads Git diffs and generates structured, line-level review comments, and can automatically apply fixes when requested. Use it when asked to review code, review a pull request, review staged or unstaged changes, review a commit, or compare branches for quality issues such as bugs, security vulnerabilities, performance problems, and code quality concerns.
Before reviewing, it verifies the environment: confirm the ocr CLI is installed (installing via npm install of @alibaba-group/open-code-review if not) and confirm LLM connectivity with the ocr llm test command. A working LLM, either Anthropic or OpenAI-compatible, must be configured first, either through environment variables (OCR_LLM_URL, OCR_LLM_TOKEN, OCR_LLM_MODEL, OCR_USE_ANTHROPIC) or persistent ocr config entries; credentials must come from the user and are never invented or hardcoded.
The workflow gathers concise business context and passes it via --background, then runs ocr review with --audience agent, which suppresses progress UI and emits only the final summary. Targets can be the default workspace mode (staged, unstaged, and untracked changes), a single commit via --commit, or a branch comparison via --from and --to, with --preview to dry-run and --timeout and --concurrency to tune runs. Each returned comment (path, content, line range, optional suggestion and reasoning) is classified High, Medium, or Low and reported grouped by priority; when line positioning fails with both lines at 0, the skill locates the code manually. Fixes focus on High and Medium items and require permission unless explicitly requested. Project-specific rules resolve from --rule, a repo or home rule.json, or built-in defaults. It is licensed Apache-2.0.
FAQ
What are the prerequisites before running a review?
The ocr CLI must be installed via npm, and a supported LLM (Anthropic or OpenAI-compatible) must be configured and pass the ocr llm test command.
What can it review?
The default workspace of staged, unstaged, and untracked changes, a single commit via --commit, or a branch diff via --from and --to; --preview dry-runs which files would be reviewed.
How are review comments prioritized?
Each comment is classified High, Medium, or Low; High and Medium are reported and targeted for fixes, while Low items are discarded silently.
Will it change my code automatically?
Only if you explicitly requested review-and-fix; otherwise it asks permission before applying changes, focusing on High and Medium priority items.
Can I add project-specific review rules?
Yes, rules resolve from a --rule path, then a repo or home rule.json, then built-in defaults, and a merge flag can combine a user rule with the matched system rule.
Install open-code-review
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
alibaba/open-code-review