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.
Detected risks:
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.
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.
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.
Each comment is classified High, Medium, or Low; High and Medium are reported and targeted for fixes, while Low items are discarded silently.
Only if you explicitly requested review-and-fix; otherwise it asks permission before applying changes, focusing on High and Medium priority items.
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.
Quick Setup:
.claude/skills/Repository
alibaba/open-code-review