跳到正文
Skillpedia
测试47k · #6316

open-code-review

它能做什么

这个工具会分析你的编程代码,找出其中的问题。它可以检查最近的改动、比较不同版本的代码,或者回看某个历史节点的代码。它甚至还能给出修改建议。

适用场景

  • ✓在提交代码之前,审查你刚写好的代码。
  • ✓比较你项目的两个版本,看看质量上有什么差别。
  • ✓检查同事是否做了需要关注的改动。

技能链接

https://github.com/alibaba/open-code-review/blob/main/plugins/open-code-review/skills/open-code-review/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/alibaba/open-code-review/blob/main/plugins/open-code-review/skills/open-code-review/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“帮我审查代码,并给出修改建议。”

每周 5 个新技能,1 分钟读完。

工作原理

这个工具会使用一个名为 “ocr” 的程序来读取你的代码改动。它会分析这些改动,找出可能的错误或可以改进的地方,并给出一份逐行的详细报告。

技术内容(原始 SKILL.md)

作者在 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 --commit or -c to 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 15 with default effort medium (2 rounds) gives 30 minutes; low/high give 15/45 minutes.
  • Concurrency: default concurrency is 8 file workers; reduce with --concurrency <n> if rate limits are hit
  • Preview mode: use --preview or -p to 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 with unknown 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 ocr command is not found, install it by running npm 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 agent to suppress progress UI and emit only the final summary
  • Prevent output truncation: For large reviews or restricted tool environments, pass --output /tmp/ocr_out.txt and inspect the file in full via a file reading tool instead of piping stdout through tail or head, 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

…

常见问题

什么是“代码”?

代码是一组告诉计算机该做什么的指令。你可以把它想象成计算机程序的菜谱。

什么是“代码审查”?

代码审查是指查看别人(或你自己)的代码,找出错误、提出改进建议,或者确认代码是否符合某些质量标准的过程。

什么是“改动”或“diff”?

它们指的是同一个文件或项目两个版本之间的差异。这个工具会重点关注这些差异,从而了解改了什么,只审查必要的部分。

详情

作者的原始描述

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

热度

GitHub 星标
47k
排名
#6316
许可证
Apache-2.0
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能