open-code-review
GitHub集成阿里 Open Code Review CLI,支持代码审查、PR审核及安全扫描。通过ocr命令分析git差异或工作区,输出结构化JSON结果,按严重性报告问题并辅助修复,严格遵循安全规范与路径过滤。
触发场景
安装
npx skills add mereyabdenbekuly-ctrl/clodex-ide --skill open-code-review -g -y
SKILL.md
Frontmatter
{
"name": "open-code-review",
"description": "Use Alibaba Open Code Review (`ocr`) to review git diffs, staged changes, branches, or scan a workspace, then summarize findings and optionally fix high-confidence issues."
}
Open Code Review Plugin
Use this skill when the user asks for an AI code review, PR review, security review, bug-risk review, regression check, or asks to run alibaba/open-code-review.
This plugin integrates Alibaba Open Code Review through its local CLI command ocr. It should run inside the mounted workspace, never against unrelated directories.
Prerequisites
First check whether the CLI exists:
ocr --version
If ocr is missing, tell the user to install Alibaba Open Code Review from https://github.com/alibaba/open-code-review and stop. Do not fabricate review results.
Review Modes
Prefer the narrowest review that matches the request:
# Review current working-tree changes.
ocr review
# Review staged changes only.
ocr review --staged
# Review changes against a base branch.
ocr review --base main
# Machine-readable output for agent post-processing.
ocr review --format json --audience agent
# Broader workspace scan when the user asks for a full audit.
ocr scan --format json --audience agent
If the repository's default branch is not obvious, inspect git first:
git rev-parse --show-toplevel
git branch --show-current
git remote show origin
Workflow
- Confirm the workspace is a git repository.
- Inspect the change scope with
git status --shortand, when useful,git diff --stat. - Run
ocr review --format json --audience agentfor changed files, orocr scan --format json --audience agentfor an explicit full audit. - Parse the JSON when possible. If the command only returns text, summarize the text faithfully.
- Report findings ordered by severity, with file paths and line numbers when available.
- If the user asks to fix findings, use normal Clodex edit tools so changes become Pending Edits for user review.
Output Style
Lead with actionable findings. Keep summaries short.
Use this shape:
Found N issue(s).
- [High] path/to/file.ts:42 — Issue title.
Impact: ...
Fix: ...
No high-confidence issues found.
When no issues are found, say that clearly and mention the reviewed scope.
Guardrails
- Do not apply OCR suggestions blindly. Verify every proposed fix against the code.
- Do not hide uncertain findings. Mark them as "Needs verification".
- Do not show internal mount prefixes like
w48b2/; use project-relative paths. - Do not run full scans unless the user asks for a broad audit, because they can be slow and token-heavy.
版本历史
- 0f01f5b 当前 2026-07-19 09:02


