@smallfishworld/open-code-review-svn 1.11.2-svn.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,231 @@
1
+ <div align="center">
2
+ <a href="https://open-codereview.ai">
3
+ <img src="imgs/logo-core.svg" alt="OpenCodeReview logo" width="180" />
4
+ </a>
5
+ <h1>OpenCodeReview</h1>
6
+ </div>
7
+
8
+ <p align="center">
9
+ <a href="https://trendshift.io/repositories/41087?utm_source=repository-badge&amp;utm_medium=badge&amp;utm_campaign=badge-repository-41087" target="_blank" rel="noopener noreferrer">
10
+ <img src="https://trendshift.io/api/badge/repositories/41087" alt="alibaba%2Fopen-code-review | Trendshift" style="width: 280px; height: 60px;" width="280" height="60" />
11
+ </a>
12
+ <a href="https://trendshift.io/repositories/41087" target="_blank">
13
+ <img src="https://trendshift.io/api/badge/trendshift/repositories/41087/weekly?language=Go" alt="alibaba%2Fopen-code-review | Trendshift" style="width: 280px; height: 60px;" width="280" height="60" />
14
+ </a>
15
+ </p>
16
+ <p align="center">
17
+ <a href="https://www.npmjs.com/package/@smallfishworld/open-code-review-svn"><img alt="npm" src="https://img.shields.io/npm/v/@smallfishworld/open-code-review-svn?style=flat-square" /></a>
18
+ <a href="https://github.com/alibaba/open-code-review/actions/workflows/release.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/alibaba/open-code-review/release.yml?style=flat-square" /></a>
19
+ <a href="https://github.com/alibaba/open-code-review/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/alibaba/open-code-review?style=flat-square" /></a>
20
+ <a href="https://deepwiki.com/alibaba/open-code-review"><img alt="Ask DeepWiki" src="https://deepwiki.com/badge.svg" /></a>
21
+ <a href="https://www.bestpractices.dev/projects/13328"><img alt="OpenSSF Best Practices" src="https://img.shields.io/badge/OpenSSF-Gold-D4AF37?style=flat-square" /></a>
22
+ </p>
23
+ <p align="center">
24
+ <a href="#supported-platforms"><img alt="Windows" src="https://img.shields.io/badge/Windows-supported-blue.svg" /></a>
25
+ <a href="#supported-platforms"><img alt="macOS" src="https://img.shields.io/badge/macOS-supported-blue.svg" /></a>
26
+ <a href="#supported-platforms"><img alt="Linux" src="https://img.shields.io/badge/Linux-supported-blue.svg" /></a>
27
+ <a href="#supported-agents"><img alt="Claude Code" src="https://img.shields.io/badge/Claude_Code-supported-blueviolet.svg" /></a>
28
+ <a href="#supported-agents"><img alt="Codex" src="https://img.shields.io/badge/Codex-supported-blueviolet.svg" /></a>
29
+ <a href="#supported-agents"><img alt="Cursor" src="https://img.shields.io/badge/Cursor-supported-blueviolet.svg" /></a>
30
+ </p>
31
+ <p align="center">
32
+ <a href="README.md">English</a> | <a href="README.zh-CN.md">简体中文</a> | <a href="README.ja-JP.md">日本語</a> | 한국어 | <a href="README.ru-RU.md">Русский</a>
33
+ </p>
34
+
35
+ ---
36
+
37
+ ## Open Code Review란?
38
+
39
+ Open Code Review는 AI 기반 코드 리뷰 CLI 도구입니다. Alibaba Group의 내부 공식 AI 코드 리뷰 어시스턴트에서 시작했으며, 지난 2년 동안 수만 명의 개발자에게 제공되어 수백만 건의 코드 결함을 찾아냈습니다. 대규모 환경에서 충분히 검증한 뒤 커뮤니티를 위해 오픈 소스 프로젝트로 공개했습니다. 모델 endpoint만 설정하면 바로 사용할 수 있습니다.
40
+
41
+ 이 도구는 Git diff를 읽고, 변경 파일을 tool-use 기능을 가진 agent를 통해 설정 가능한 LLM으로 전달한 뒤, 라인 단위 위치 정보가 포함된 구조화된 리뷰 코멘트를 생성합니다. agent는 전체 파일 내용 읽기, 코드베이스 검색, 다른 변경 파일 확인 등을 통해 맥락을 확보하고 표면적인 diff 피드백이 아닌 깊이 있는 리뷰를 수행할 수 있습니다. diff 리뷰 외에도 `ocr scan`은 전체 파일을 리뷰할 수 있어, 익숙하지 않은 코드베이스를 감사하거나 의미 있는 diff가 없는 디렉터리를 검토하는 데 유용합니다.
42
+
43
+ 자세한 내용은 [공식 웹사이트](https://open-codereview.ai)를 참조하세요.
44
+
45
+ ![Highlights](imgs/highlights-en.png)
46
+
47
+ ## 벤치마크
48
+
49
+ > 범용 Agent(Claude Code)와 비교할 때, Open Code Review는 동일한 기반 모델에서 유의미하게 높은 **정밀도(Precision)**와 **F1 점수**를 달성하며, 토큰 소비량은 **약 1/9** 수준이고 리뷰 속도도 더 빠릅니다. 다만 재현율(Recall)은 범용 Agent보다 낮습니다 — 이는 노이즈를 줄이고 정밀도를 우선하는 설계적 트레이드오프입니다.
50
+
51
+ 실제 코드 리뷰 기반 벤치마크. **50**개 인기 오픈소스 저장소에서 **200**개 실제 Pull Request를 엄선하고, **10**개 프로그래밍 언어를 커버 — 80명 이상의 시니어 엔지니어가 교차 검증(**1,505**개 어노테이션된 결함).
52
+
53
+ <a href="https://huggingface.co/datasets/Alibaba-Aone/aacr-bench"><img src="https://huggingface.co/favicon.ico" alt="Hugging Face" width="20" height="20" /> Hugging Face에서 AACR-Bench 데이터셋 살펴보기</a>.
54
+
55
+ | 지표 | 측정 내용 | 중요한 이유 |
56
+ |------|-----------|-------------|
57
+ | **F1** | 정밀도와 재현율의 조화 평균 | 리뷰 품질을 나타내는 최적의 단일 지표 |
58
+ | **정밀도 (Precision)** | 보고된 이슈 중 실제 결함 비율 | 높을수록 확인할 오탐이 적음 |
59
+ | **재현율 (Recall)** | 실제 결함 중 발견된 비율 | 높을수록 놓치는 이슈가 적음 |
60
+ | **평균 시간 (Avg Time)** | 리뷰당 실제 소요 시간 | CI 파이프라인 대기 시간에 영향 |
61
+ | **평균 토큰 (Avg Token)** | 리뷰당 총 토큰 소비량 | API 비용에 직접 영향 |
62
+
63
+ ![Benchmark](imgs/benchmark-en.png)
64
+
65
+ ## 왜 Open Code Review인가?
66
+
67
+ ### 범용 Agent의 문제
68
+
69
+ Claude Code Skills 같은 범용 agent로 코드 리뷰를 해봤다면 다음 문제를 경험했을 수 있습니다.
70
+
71
+ - **불완전한 커버리지**: 큰 changeset에서는 일부 파일만 선택적으로 리뷰하고 중요한 파일을 놓치기 쉽습니다.
72
+ - **위치 드리프트**: 지적된 문제가 실제 코드 위치와 맞지 않거나 라인 번호와 파일 참조가 어긋나는 일이 자주 발생합니다.
73
+ - **불안정한 품질**: 자연어 기반 Skill은 디버깅이 어렵고, 작은 prompt 변화에도 리뷰 품질이 크게 흔들릴 수 있습니다.
74
+
75
+ 근본 원인은 순수 언어 중심 아키텍처가 리뷰 프로세스에 강한 제약을 제공하지 못한다는 점입니다.
76
+
77
+ ### 핵심 설계: 결정적 엔지니어링과 Agent의 하이브리드
78
+
79
+ Open Code Review의 핵심 철학은 결정적 엔지니어링과 agent를 결합해 각자가 가장 잘하는 일을 맡기는 것입니다.
80
+
81
+ **결정적 엔지니어링: 강한 제약**
82
+
83
+ 반드시 정확해야 하는 리뷰 단계는 언어 모델이 아니라 엔지니어링 로직이 보장합니다.
84
+
85
+ - **정확한 파일 선택**: 어떤 파일을 리뷰하고 어떤 파일을 필터링할지 결정해 중요한 변경이 누락되지 않도록 합니다.
86
+ - **스마트 파일 번들링**: 관련 파일을 하나의 리뷰 단위로 묶습니다. 예를 들어 `message_en.properties`와 `message_zh.properties`를 함께 묶습니다. 각 번들은 독립된 context를 가진 sub-agent로 실행되며, 대규모 changeset에서도 안정적인 divide-and-conquer 전략과 동시 리뷰를 지원합니다.
87
+ - **세밀한 rule 매칭**: 각 파일의 특성에 맞는 리뷰 rule을 매칭해 모델의 주의를 집중시키고 정보 노이즈를 줄입니다. 순수 자연어 기반 rule 안내보다 template engine 기반 rule 매칭이 더 안정적이고 예측 가능합니다.
88
+ - **외부 위치 지정 및 reflection 모듈**: 독립적인 comment positioning과 comment reflection 모듈이 AI 피드백의 위치 정확도와 내용 정확도를 체계적으로 개선합니다.
89
+
90
+ **Agent: 동적 의사결정**
91
+
92
+ agent의 강점은 동적 판단과 동적 context 검색이 중요한 지점에 집중됩니다.
93
+
94
+ - **시나리오 최적화 prompt**: 코드 리뷰에 깊이 최적화된 prompt template으로 효과를 높이고 token 사용량을 줄입니다.
95
+ - **시나리오 최적화 toolset**: 대규모 production 데이터의 tool-call trace를 분석해 도출했습니다. 호출 빈도 분포, tool별 반복률, 신규 tool이 전체 call chain에 미치는 영향 등을 반영해 범용 agent toolkit보다 코드 리뷰에 더 안정적이고 예측 가능한 전용 toolset을 제공합니다.
96
+
97
+ ## 사용 방법
98
+
99
+ ### 사전 요구 사항
100
+
101
+ - **Git >= 2.41** — Git workspace, range, 단일 commit 리뷰에 필요합니다.
102
+ - **SVN >= 1.9** — SVN working copy의 commit 전 변경 사항을 리뷰할 때만 필요합니다.
103
+
104
+ ### CLI
105
+
106
+ #### 설치
107
+
108
+ ```bash
109
+ npm install -g @smallfishworld/open-code-review-svn
110
+ ```
111
+
112
+ 설치 후 `ocr` 명령을 전역에서 사용할 수 있습니다.
113
+
114
+ 기타 설치 방법(설치 스크립트, GitHub Release binary, 소스 빌드)은 [설치 가이드](https://open-codereview.ai/docs/installation)를 참조하세요.
115
+
116
+ #### Quick Start
117
+
118
+ **1. LLM 설정**
119
+
120
+ 코드 리뷰 전에 LLM 설정이 필요합니다. [위임 모드](https://open-codereview.ai/docs/delegate)를 사용하는 경우에는 불필요합니다.
121
+
122
+ ```bash
123
+ ocr config provider # built-in provider 선택 또는 custom provider 추가
124
+ ocr config model # 활성 provider의 model 선택
125
+ ```
126
+
127
+ ![Provider setup](imgs/providers.jpg)
128
+
129
+ 대화형 UI가 provider 선택, API key 입력, model 설정을 안내하며, 완료 후 자동으로 연결 테스트를 수행합니다.
130
+
131
+ CLI 설정, 환경 변수, 커스텀 provider 등 고급 설정은 [설정 가이드](https://open-codereview.ai/docs/configuration)를 참조하세요.
132
+
133
+ **2. 리뷰 실행**
134
+
135
+ ```bash
136
+ cd your-project
137
+
138
+ # Workspace mode: staged, unstaged, untracked 변경을 모두 리뷰
139
+ ocr review
140
+
141
+ # SVN workspace mode: 수정, 추가, 삭제 및 version control 미등록 파일 리뷰
142
+ # Range와 단일 commit mode는 현재 Git에서만 지원합니다.
143
+ ocr review --repo /path/to/svn-working-copy
144
+
145
+ # 브랜치 범위 — main에서 분기된 이후 feature-branch의 변경 사항을 리뷰합니다 (머지베이스 모드)
146
+ ocr review --from main --to feature-branch
147
+
148
+ # 단일 commit
149
+ ocr review --commit abc123
150
+
151
+ # 중단된 range 또는 단일 commit review 재개
152
+ ocr session list
153
+ ocr review --from main --to feature-branch --resume <session-id>
154
+
155
+ # 전체 파일 스캔 — diff 대신 파일 전체를 리뷰 (git 이력 불필요)
156
+ ocr scan # 전체 repository 스캔
157
+ ocr scan --path internal/agent # 디렉터리 또는 특정 파일 스캔
158
+ ocr scan --resume <session-id> # 중단된 전체 파일 스캔 재개
159
+
160
+ # 결과를 파일로 저장 (AI 호스트 에이전트 권장)
161
+ ocr review --format json --output result.json
162
+
163
+ # 위임 모드 — AI 코딩 에이전트가 직접 리뷰 수행
164
+ # OCR은 파일 선택과 규칙 해석만 담당; LLM 설정 불필요
165
+ ocr delegate preview
166
+ ocr delegate rule src/main.go src/handler.go
167
+ ```
168
+
169
+ ### SVN 작업 사본 리뷰
170
+
171
+ 이 포크는 SVN(Apache Subversion) 작업 사본에서 커밋되지 않은 변경 사항을 커밋 전에 리뷰할 수 있습니다. OCR이 작업 사본 루트를 자동으로 감지하므로 루트 또는 어느 하위 디렉터리에서든 명령을 실행할 수 있습니다.
172
+
173
+ SVN 작업 공간 모드에서 지원되는 항목:
174
+
175
+ - `svn status`가 보고하는 수정됨, 추가 예정 및 삭제 예정 파일.
176
+ - 버전 관리되지 않는 파일과 디렉터리(버전 관리되지 않는 디렉터리 내부 파일도 재귀적으로 검색).
177
+ - 텍스트 및 바이너리 변경, 공백이 포함된 파일 이름, Git 작업 공간 리뷰와 동일한 리뷰 규칙 및 출력 형식.
178
+
179
+ 커밋하기 전에 현재 SVN 작업 사본을 리뷰합니다:
180
+
181
+ ```bash
182
+ cd /path/to/svn-working-copy
183
+ svn status
184
+ ocr review
185
+ ```
186
+
187
+ 작업 사본을 명시적으로 지정하고 결과를 저장할 수도 있습니다:
188
+
189
+ ```bash
190
+ ocr review --repo /path/to/svn-working-copy
191
+ ocr review --repo /path/to/svn-working-copy --format json --output svn-review.json
192
+ ```
193
+
194
+ 현재 SVN은 작업 공간 리뷰만 지원합니다. `--from`, `--to`, `--commit`, 세션 재개처럼 Git 기록에 의존하는 모드는 SVN 작업 사본에서 사용할 수 없습니다. SVN에서 무시된 파일은 리뷰되지 않으므로 포함하려면 `svn add`를 실행하거나 SVN ignore 속성을 조정하세요.
195
+
196
+ ## Documentation
197
+
198
+ 전체 문서는 **[open-codereview.ai/docs](https://open-codereview.ai/docs)** 에서 확인할 수 있습니다:
199
+
200
+ - [빠른 시작](https://open-codereview.ai/docs/quickstart) — 설치하고 첫 리뷰 실행하기
201
+ - [설치](https://open-codereview.ai/docs/installation) — 모든 플랫폼 및 패키지 매니저
202
+ - [CLI 레퍼런스](https://open-codereview.ai/docs/cli-reference) — 모든 명령어와 플래그
203
+ - [리뷰 규칙](https://open-codereview.ai/docs/review-rules) — 리뷰 규칙 커스터마이징, 경로 필터링 및 타겟팅
204
+ - [설정](https://open-codereview.ai/docs/configuration) — 설정 키와 환경 변수
205
+ - [MCP 서버](https://open-codereview.ai/docs/mcp) — 외부 도구로 리뷰 에이전트 확장
206
+ - 코딩 에이전트 연동 — 사용하는 플랫폼 선택
207
+ - [Claude Code](plugins/open-code-review/README.md#claude-code) — 리뷰 슬래시 명령이 포함된 플러그인 설치
208
+ - [Codex](plugins/open-code-review/README.md#codex) — 호출 가능한 리뷰 스킬이 포함된 플러그인 설치
209
+ - [Cursor](plugins/open-code-review/README.md#cursor) — 이식 가능한 리뷰 스킬이 포함된 플러그인 설치
210
+ - [OpenCode](plugins/open-code-review/opencode/README.md) — 네이티브 리뷰 도구와 슬래시 명령 설치
211
+ - [QCA Forward](plugins/open-code-review/qca/README.md) — QCA 호스트 모델과 게시 가능한 템플릿으로 위임 모드 실행
212
+ - [Skill 호환 에이전트](https://open-codereview.ai/docs/agent-skill) — 이식 가능한 에이전트 스킬 설치
213
+ - 리뷰 실행 모드 — 연동 후 리뷰를 수행할 LLM 선택
214
+ - [기본 모드(OCR 관리)](https://open-codereview.ai/docs/configuration) — OCR이 설정된 LLM을 사용해 리뷰 수행
215
+ - [위임 모드](https://open-codereview.ai/docs/delegate) — 코딩 에이전트가 자체 LLM을 사용해 리뷰 수행; OCR API 키 불필요
216
+ - [CI/CD 연동](https://open-codereview.ai/docs/cicd) — GitHub Actions, GitLab CI, GitFlic CI, Gerrit 통합
217
+ - [세션 뷰어](https://open-codereview.ai/docs/viewer) — 브라우저에서 리뷰 세션 탐색 및 재생
218
+ - [텔레메트리](https://open-codereview.ai/docs/telemetry) — 관측성을 위한 OpenTelemetry 통합
219
+ - [FAQ](https://open-codereview.ai/docs/faq) — 자주 묻는 질문과 문제 해결
220
+
221
+ ## Contributing
222
+
223
+ 이 프로젝트는 기여해 주신 모든 분들 덕분에 존재합니다. 개발 환경 설정, coding guideline, pull request 제출 방법은 [CONTRIBUTING.ko-KR.md](CONTRIBUTING.ko-KR.md)를 참고하세요.
224
+
225
+ <a href="https://github.com/alibaba/open-code-review/graphs/contributors">
226
+ <img src="https://contrib.rocks/image?repo=alibaba/open-code-review" />
227
+ </a>
228
+
229
+ ## License
230
+
231
+ [Apache-2.0](LICENSE) Copyright 2026 Alibaba
package/README.md ADDED
@@ -0,0 +1,231 @@
1
+ <div align="center">
2
+ <a href="https://open-codereview.ai">
3
+ <img src="imgs/logo-core.svg" alt="OpenCodeReview logo" width="180" />
4
+ </a>
5
+ <h1>OpenCodeReview</h1>
6
+ </div>
7
+
8
+ <p align="center">
9
+ <a href="https://trendshift.io/repositories/41087?utm_source=repository-badge&amp;utm_medium=badge&amp;utm_campaign=badge-repository-41087" target="_blank" rel="noopener noreferrer">
10
+ <img src="https://trendshift.io/api/badge/repositories/41087" alt="alibaba%2Fopen-code-review | Trendshift" style="width: 280px; height: 60px;" width="280" height="60" />
11
+ </a>
12
+ <a href="https://trendshift.io/repositories/41087" target="_blank">
13
+ <img src="https://trendshift.io/api/badge/trendshift/repositories/41087/weekly?language=Go" alt="alibaba%2Fopen-code-review | Trendshift" style="width: 280px; height: 60px;" width="280" height="60" />
14
+ </a>
15
+ </p>
16
+ <p align="center">
17
+ <a href="https://www.npmjs.com/package/@smallfishworld/open-code-review-svn"><img alt="npm" src="https://img.shields.io/npm/v/@smallfishworld/open-code-review-svn?style=flat-square" /></a>
18
+ <a href="https://github.com/alibaba/open-code-review/actions/workflows/release.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/alibaba/open-code-review/release.yml?style=flat-square" /></a>
19
+ <a href="https://github.com/alibaba/open-code-review/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/alibaba/open-code-review?style=flat-square" /></a>
20
+ <a href="https://deepwiki.com/alibaba/open-code-review"><img alt="Ask DeepWiki" src="https://deepwiki.com/badge.svg" /></a>
21
+ <a href="https://www.bestpractices.dev/projects/13328"><img alt="OpenSSF Best Practices" src="https://img.shields.io/badge/OpenSSF-Gold-D4AF37?style=flat-square" /></a>
22
+ </p>
23
+ <p align="center">
24
+ <a href="#supported-platforms"><img alt="Windows" src="https://img.shields.io/badge/Windows-supported-blue.svg" /></a>
25
+ <a href="#supported-platforms"><img alt="macOS" src="https://img.shields.io/badge/macOS-supported-blue.svg" /></a>
26
+ <a href="#supported-platforms"><img alt="Linux" src="https://img.shields.io/badge/Linux-supported-blue.svg" /></a>
27
+ <a href="#supported-agents"><img alt="Claude Code" src="https://img.shields.io/badge/Claude_Code-supported-blueviolet.svg" /></a>
28
+ <a href="#supported-agents"><img alt="Codex" src="https://img.shields.io/badge/Codex-supported-blueviolet.svg" /></a>
29
+ <a href="#supported-agents"><img alt="Cursor" src="https://img.shields.io/badge/Cursor-supported-blueviolet.svg" /></a>
30
+ </p>
31
+ <p align="center">
32
+ English | <a href="README.zh-CN.md">简体中文</a> | <a href="README.ja-JP.md">日本語</a> | <a href="README.ko-KR.md">한국어</a> | <a href="README.ru-RU.md">Русский</a>
33
+ </p>
34
+
35
+ ---
36
+
37
+ ## What is Open Code Review?
38
+
39
+ Open Code Review is an AI-powered code review CLI tool. It originated as Alibaba Group's internal official AI code review assistant — over the past two years, it has served tens of thousands of developers and identified millions of code defects. After thorough validation at massive scale, we incubated it into an open source project for the community. Simply configure a model endpoint to get started.
40
+
41
+ It reads Git diffs, sends changed files to a configurable LLM via an agent with tool-use capabilities, and generates structured review comments with line-level precision. The agent can read full file contents, search the codebase, inspect other changed files for context, and produce deep reviews — not just surface-level diff feedback. Beyond diff review, `ocr scan` reviews entire files for auditing unfamiliar codebases or directories that have no meaningful diff.
42
+
43
+ Visit the [official website](https://open-codereview.ai) for more details.
44
+
45
+ ![Highlights](imgs/highlights-en.png)
46
+
47
+ ## Benchmark
48
+
49
+ > Compared to general-purpose agents (Claude Code), Open Code Review achieves significantly higher **Precision** and **F1** with the same underlying model, while consuming only **~1/9 of the tokens** and completing reviews faster. Note that its Recall is lower than general-purpose agents — a deliberate trade-off favoring precision over noise.
50
+
51
+ A real-world code review benchmark built from **50** popular open-source repositories, **200** real Pull Requests, and **10** programming languages — cross-validated by 80+ senior engineers (**1,505** annotated ground-truth issues).
52
+
53
+ <a href="https://huggingface.co/datasets/Alibaba-Aone/aacr-bench"><img src="https://huggingface.co/favicon.ico" alt="Hugging Face" width="20" height="20" /> Explore the AACR-Bench dataset on Hugging Face</a>.
54
+
55
+ | Metric | What it measures | Why it matters |
56
+ |--------|-----------------|----------------|
57
+ | **F1** | Harmonic mean of precision and recall | Best single number for overall review quality |
58
+ | **Precision** | Proportion of reported issues that are real defects | Higher = fewer false alarms to triage |
59
+ | **Recall** | Proportion of real defects that are found | Higher = fewer issues slip through review |
60
+ | **Avg Time** | Wall-clock time per review | Matters for CI pipeline latency |
61
+ | **Avg Token** | Total tokens consumed per review | Directly impacts API cost |
62
+
63
+ ![Benchmark](imgs/benchmark-en.png)
64
+
65
+ ## Why Open Code Review?
66
+
67
+ ### The Problem with General-Purpose Agents
68
+
69
+ If you've used general-purpose agents like Claude Code with Skills for code review, you've likely encountered these pain points:
70
+
71
+ - **Incomplete coverage** — On larger changesets, agents tend to "cut corners," selectively reviewing only some files and missing others.
72
+ - **Position drift** — Reported issues frequently don't match the actual code location, with line numbers or file references drifting off target.
73
+ - **Unstable quality** — Natural-language-driven Skills are hard to debug, and review quality fluctuates significantly with minor prompt variations.
74
+
75
+ The root cause: a purely language-driven architecture lacks hard constraints on the review process.
76
+
77
+ ### Core Design: Deterministic Engineering × Agent Hybrid
78
+
79
+ Open Code Review's core philosophy is to combine deterministic engineering with an agent, each handling what it does best.
80
+
81
+ **Deterministic Engineering — Hard Constraints**
82
+
83
+ For review steps that *must not go wrong*, engineering logic — not the language model — guarantees correctness:
84
+
85
+ - **Precise file selection** — Determines exactly which files need review and which should be filtered, ensuring no important change is missed.
86
+ - **Smart file bundling** — Groups related files into a single review unit (e.g., `message_en.properties` and `message_zh.properties` are bundled together). Each bundle runs as a sub-agent with isolated context — a divide-and-conquer strategy that stays stable on very large changesets and naturally supports concurrent review.
87
+ - **Fine-grained rule matching** — Matches review rules to each file's characteristics, keeping the model's attention sharply focused and eliminating information noise at the source. Compared to purely language-driven rule guidance, template-engine-based rule matching is more stable and predictable.
88
+ - **External positioning and reflection modules** — Independent comment-positioning and comment-reflection modules systematically improve both the location accuracy and content accuracy of AI feedback.
89
+
90
+ **Agent — Dynamic Decision-Making**
91
+
92
+ The agent's strengths are concentrated where they matter most — dynamic decisions and dynamic context retrieval:
93
+
94
+ - **Scenario-tuned prompts** — Prompt templates deeply optimized for code review, improving effectiveness while reducing token consumption.
95
+ - **Scenario-tuned toolset** — Distilled from deep analysis of tool-call traces in large-scale production data — including call frequency distributions, per-tool repetition rates, and the impact of new tools on the overall call chain — resulting in a purpose-built toolset that is more stable and predictable for code review than a generic agent toolkit.
96
+
97
+ ## How to Use
98
+
99
+ ### Prerequisites
100
+
101
+ - **Git >= 2.41** — Required for Git workspace, range, and commit reviews.
102
+ - **SVN >= 1.9** — Required only for reviewing uncommitted changes in an SVN working copy.
103
+
104
+ ### CLI
105
+
106
+ #### Install
107
+
108
+ ```bash
109
+ npm install -g @smallfishworld/open-code-review-svn
110
+ ```
111
+
112
+ After installation, the `ocr` command is available globally.
113
+
114
+ For other installation methods (install script, GitHub Release binary, from source), see [Installation](https://open-codereview.ai/docs/installation).
115
+
116
+ #### Quick Start
117
+
118
+ **1. Configure LLM**
119
+
120
+ You must configure an LLM before reviewing code, unless you use [Delegation Mode](https://open-codereview.ai/docs/delegate).
121
+
122
+ ```bash
123
+ ocr config provider # Select a built-in provider or add a custom one
124
+ ocr config model # Pick a model for the active provider
125
+ ```
126
+
127
+ ![Provider setup](imgs/providers.jpg)
128
+
129
+ The interactive UI guides you through provider selection, API key entry, and model configuration, then automatically tests connectivity.
130
+
131
+ For CLI setup, environment variables, custom providers, and other advanced configuration, see [Configuration](https://open-codereview.ai/docs/configuration).
132
+
133
+ **2. Review**
134
+
135
+ ```bash
136
+ cd your-project
137
+
138
+ # Workspace mode — review all staged, unstaged, and untracked changes
139
+ ocr review
140
+
141
+ # SVN workspace mode — review modified, added, deleted, and unversioned files
142
+ # Range and commit modes are currently Git-only.
143
+ ocr review --repo /path/to/svn-working-copy
144
+
145
+ # Branch range — reviews feature-branch's changes since it diverged from main (merge-base mode)
146
+ ocr review --from main --to feature-branch
147
+
148
+ # Single commit
149
+ ocr review --commit abc123
150
+
151
+ # Resume an interrupted range or commit review
152
+ ocr session list
153
+ ocr review --from main --to feature-branch --resume <session-id>
154
+
155
+ # Full-file scan — review whole files instead of a diff (no git history needed)
156
+ ocr scan # scan the entire repository
157
+ ocr scan --path internal/agent # scan a directory or specific files
158
+ ocr scan --resume <session-id> # resume an interrupted full-file scan
159
+
160
+ # Save results to a file (recommended for AI host agents)
161
+ ocr review --format json --output result.json
162
+
163
+ # Delegation mode — let your AI coding agent perform the review itself
164
+ # OCR handles file selection and rule resolution; no LLM configuration needed
165
+ ocr delegate preview
166
+ ocr delegate rule src/main.go src/handler.go
167
+ ```
168
+
169
+ ### SVN Workspace Review
170
+
171
+ This fork supports pre-commit review of uncommitted changes in an SVN (Apache Subversion) working copy. OCR automatically detects the working-copy root, so the command can be run from the root or any subdirectory.
172
+
173
+ Supported in SVN workspace mode:
174
+
175
+ - Modified, scheduled-for-add, and scheduled-for-delete files reported by `svn status`.
176
+ - Unversioned files and directories, including files discovered recursively inside an unversioned directory.
177
+ - Text and binary changes, file names containing spaces, and the same review rules and output formats used by Git workspace reviews.
178
+
179
+ Review the current SVN working copy before committing:
180
+
181
+ ```bash
182
+ cd /path/to/svn-working-copy
183
+ svn status
184
+ ocr review
185
+ ```
186
+
187
+ Or select a working copy explicitly and save the result:
188
+
189
+ ```bash
190
+ ocr review --repo /path/to/svn-working-copy
191
+ ocr review --repo /path/to/svn-working-copy --format json --output svn-review.json
192
+ ```
193
+
194
+ SVN support currently covers workspace review only. Git-specific history modes such as `--from`, `--to`, `--commit`, and session resume are not available for SVN working copies. Files ignored by SVN are not reviewed; use `svn add` or adjust the SVN ignore properties when they should be included.
195
+
196
+ ## Documentation
197
+
198
+ Full documentation lives at **[open-codereview.ai/docs](https://open-codereview.ai/docs)**:
199
+
200
+ - [Quickstart](https://open-codereview.ai/docs/quickstart) — install and run your first review
201
+ - [Installation](https://open-codereview.ai/docs/installation) — all platforms and package managers
202
+ - [CLI Reference](https://open-codereview.ai/docs/cli-reference) — every command and flag
203
+ - [Review Rules](https://open-codereview.ai/docs/review-rules) — customize review rules with path filtering and targeting
204
+ - [Configuration](https://open-codereview.ai/docs/configuration) — config keys and environment variables
205
+ - [MCP Server](https://open-codereview.ai/docs/mcp) — extend the review agent with external tools
206
+ - Coding Agent Integrations — choose the platform you use
207
+ - [Claude Code](plugins/open-code-review/README.md#claude-code) — install a plugin with review slash commands
208
+ - [Codex](plugins/open-code-review/README.md#codex) — install a plugin with callable review skills
209
+ - [Cursor](plugins/open-code-review/README.md#cursor) — install a plugin with portable review skills
210
+ - [OpenCode](plugins/open-code-review/opencode/README.md) — install native review tools and slash commands
211
+ - [QCA Forward](plugins/open-code-review/qca/README.md) — run delegation mode with the QCA host model and a ready-to-publish template
212
+ - [Skill-compatible agents](https://open-codereview.ai/docs/agent-skill) — install the portable agent skill
213
+ - Review Execution Modes — after integration, choose which LLM performs the review
214
+ - [Default (OCR-managed)](https://open-codereview.ai/docs/configuration) — OCR runs the review using its configured LLM
215
+ - [Delegation Mode](https://open-codereview.ai/docs/delegate) — your coding agent runs the review using its own LLM; no OCR API key required
216
+ - [CI/CD Integration](https://open-codereview.ai/docs/cicd) — GitHub Actions, GitLab CI, GitFlic CI, and Gerrit integration
217
+ - [Session Viewer](https://open-codereview.ai/docs/viewer) — browse and replay review sessions in browser
218
+ - [Telemetry](https://open-codereview.ai/docs/telemetry) — OpenTelemetry integration for observability
219
+ - [FAQ](https://open-codereview.ai/docs/faq) — common questions and troubleshooting
220
+
221
+ ## Contributing
222
+
223
+ This project exists thanks to all the people who contribute. See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, coding guidelines, and how to submit pull requests.
224
+
225
+ <a href="https://github.com/alibaba/open-code-review/graphs/contributors">
226
+ <img src="https://contrib.rocks/image?repo=alibaba/open-code-review" />
227
+ </a>
228
+
229
+ ## License
230
+
231
+ [Apache-2.0](LICENSE) — Copyright 2026 Alibaba