ocr-review-loop
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "ocr-review-loop" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-db3f88d97a9e472c7605e5e45b707517378acdf1bb699553ee44ecb0f53c1204. Verify the upstream source and version against https://skillhub.cn/skills/user_1c27fa1e/ocr-review-loop before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
OCR Review Loop: code review based on Alibaba's open-source ocr CLI tool, forming a review → classify → fix → suppress duplicates → re-review loop until no high/medium priority issues remain, fixing only issues that must be fixed.
Introduction source: third_party · user_1c27fa1e · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Software, accounts and paid services
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: ocr-review-loop
user-invocable: true
description: >
基于阿里开源的 `ocr` CLI 工具进行代码审查,形成"审查 → 分类 → 修复 → 抑制重复 → 再审查"的循环,
直到无高/中优先级问题为止。不过度开发,只修复必须修的问题。OCR Review Loop
概述
基于 ocr CLI(alibaba/open-code-review)进行迭代式代码审查。核心流程:
审查 → 分类(高/中/低) → 修复高+中 → 抑制已修复项 → 再审查 → 直到干净
Step 0: 发现所有仓库
多仓库项目必须覆盖每个子仓库,不遗漏:
- 扫描项目根目录下所有含
.git的子目录 - 展示仓库清单给用户确认,等待确认后再继续
- 工作区无改动的仓库直接跳过,不浪费 LLM 调用
- 对每个仓库独立运行审查循环
- 输出最终报告时按仓库分组汇总
前置检查
which ocr || echo "NOT INSTALLED"
ocr llm test
若未安装:npm install -g @alibaba-group/open-code-review
工作流程
Step 1: 收集业务上下文
分析审查目标(commit / 分支 / 工作区改动),提取简洁的业务上下文,通过 --background 传给 OCR。
Step 2: 运行审查
始终使用 --audience agent 抑制进度 UI:
ocr review --audience agent --background "业务上下文" [目标参数]
| 场景 | 命令 |
|---|---|
| 审查工作区改动 | ocr review --audience agent -b "context" |
| 审查分支对比 | ocr review --audience agent -b "context" --from main --to feature |
| 审查单个 commit | ocr review --audience agent -b "context" --commit abc123 |
| 预览审查范围 | ocr review --preview |
Step 3: 分类
对每条审查意见按优先级分类:
- 高:明确的 bug、安全漏洞、数据风险、空指针 → 必须修
- 中:合理关切但依赖上下文、风格/性能建议 → 选择性修
- 低:大概率误报、上下文不足、吹毛求疵 → 直接丢弃
分类完成后,必须先输出本轮问题清单,再进入修复或确认:
- 本轮有高/中优先级问题时,必须逐项列出文件、行号、问题和处置方式。
- 本轮只有低优先级问题时,也要明确写“无高优先级问题”“无中优先级问题”“低优先级已忽略”。
- 每个问题必须带唯一编号,建议格式为
R{轮次}-{序号},后续引用时只报编号即可。
Step 4: 修复
- 先列出所有高+中优先级问题清单
- 按优先级排序,逐一修复
- 在开始修复前,先把“本轮发现 / 高优先级 / 中优先级 / 处置方式”完整汇总给用户确认
- 高优先级可以直接修,但必须先展示完整汇总结果;不要边审查边直接改代码
- 同一文件多问题时,从文件底部往顶部修,避免行号漂移导致后续修复定位错误
- 中优先级问题修复前先问用户确认,高优先级直接修
- 每完成一项,标注已修复
- 不过度开发:只修问题本身,不顺便重构无关代码
修复完成后,输出本轮修复清单:
## 修复清单
| 编号 | 优先级 | 文件:行号 | 问题 | 状态 |
|------|--------|-----------|------|------|
| R1-1 | 高 | Foo.java:42 | 空指针 | ✅ 已修复 |
| R1-2 | 中 | Bar.ts:88 | SQL拼接 | ✅ 已修复 |
| R1-3 | 中 | Baz.java:15 | 命名不规范 | ⏭️ 跳过,业务允许 |
Step 5: 抑制重复
对于已确认修复的问题,在下一轮审查前,将对应规则写入项目级抑制配置:
# 项目级规则文件: .opencodereview/rule.json
避免同一问题反复出现。
Step 6: 循环
修复完成后,重新运行 ocr review,验证:
- 高优先级问题清零
- 中优先级问题清零或已确认无需修复
- 无新增高优先级问题
若仍有高/中优先级问题,回到 Step 3,继续循环。
Step 7: 结束条件
循环终止条件:
- 高优先级 = 0 且 中优先级 ≤ 0(或剩余中优先级已明确判定无需修复)→ 审查通过
以下情况强制终止,不允许无限循环:
- 同一仓库已跑 3 轮仍未清零 → 终止并标注 ⚠️,列出剩余未解决问题
- 同一问题连续 3 轮出现且已确认无法修复 → 放入暂缓修复清单,记录到项目 TODO,后续审查不再报
输出格式
仓库发现清单
审查开始前,展示待审查仓库:
## 待审查仓库清单
| # | 仓库 | 状态 |
|---|------|------|
| 1 | /path/repo-a | ✅ 有改动 |
| 2 | /path/repo-b | ⏭️ 无改动,跳过 |
| 3 | /path/repo-c | ✅ 有改动 |
每轮审查输出
## [repo-name] 第 N 轮审查
**审查文件数**: N
**本轮发现**: X 高 / Y 中
### 本轮问题清单
| 编号 | 优先级 | 文件:行号 | 问题 | 处置 |
|------|--------|-----------|------|------|
| R1-1 | 高 | path/file:10 | 问题描述 | 直接修复 |
| R1-2 | 中 | path/file:20 | 问题描述 | 先确认后修复 |
### 高优先级
- **`path/file:行号`** — 问题描述
> 修复建议: xxx
### 中优先级
- **`path/file:行号`** — 问题描述
> 修复建议: xxx
如果本轮没有高/中优先级问题,仍然要明确输出:
## [repo-name] 第 N 轮审查
**审查文件数**: N
**本轮发现**: 0 高 / 0 中
### 本轮问题清单
- 无高优先级问题。
- 无中优先级问题。
- 仅有低优先级问题,已忽略。
最终报告(按仓库分组)
## 审查完成
| 仓库 | 轮数 | 高修 | 中修 | 跳过 | 结果 |
|------|------|------|------|------|------|
| repo-a | 2 | 3 | 1 | 0 | ✅ 通过 |
| repo-b | 1 | 1 | 0 | 0 | ✅ 通过 |
| repo-c | 3 | 2 | 1 | 1 | ⚠️ 达上限,剩余1个中优先级问题 |
**总计**: 3 个仓库 / 6 轮 / 7 个高优修复 / 2 个中优修复 / 审查通过 ✅
未通过时标注异常项:
### 未解决问题
| 编号 | 仓库 | 文件:行号 | 问题 | 处置 |
|------|------|-----------|------|------|
| R3-2 | repo-c | Foo.java:42 | 线程安全 | ⚠️ 暂缓修复,已记录 TODO |
重要约束
- 不过度开发 — 只修问题本身,不顺手重构
- 不高估 — 不确定的降级为中或低
- 不虚构 — 审查结果基于
ocr实际输出,不编造问题 - commit 前需用户确认
- 低优先级一律忽略,不展示不讨论
Current listing version
1.0.0
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 基于阿里开源 OCR CLI 实现端到端代码审查闭环,解决开发者高频刚需
- 支持多仓库、优先级分类、修复确认、抑制重复,功能完整且实用
Highlights
- 触发词精准(ocr CLI、代码审查),边界清晰,覆盖主要使用场景
Highlights
- 结构完整,7 步流程清晰,含输出格式与约束,示例充分
Highlights
- 工具来源明确,参数规范,异常处理健全,修复前需用户确认,循环有终止条件
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Install or fetch external dependencies
Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.
Mentioned in main document · lines 36
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Translation pending; see source documentation.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.