首頁
概念地圖
學習路線
安裝指南
文件教學
程式碼對照
實作案例
關於
← 回首頁
學習路線
從「裝好」到「讀 Go 源碼」的五層路線
L0
裝好它
幾分鐘內讓 ocr 跑起來
安裝
npm 一行安裝、Homebrew/MacPorts、curl 安裝腳本、GitHub Release 二進位、from source。
命令一覽
知道 review/scan/rules/config/llm/session/viewer/version 各做什麼。
L1
跑起來
配置 LLM 並完成第一次評審
快速開始
ocr config provider / model → ocr llm test → ocr review。
設定
18 個內建 provider、OCR_LLM_* 環境變數、超時、max_tokens、extra_body。
實作案例
看真實 repo 掃描出的互動知識圖譜。
L2
用規則與工具
理解過濾、規則鏈與 6 個工具
評審規則
四層優先級鏈、rule.json 格式、五重門過濾、ocr rules check。
6 個工具
task_done / code_comment / file_read / file_read_diff / file_find / code_search。
CLI 進階
--preview、--audience agent、--format json、--resume、--background、--concurrency。
L3
讀原理
理解管線、壓縮與整合
運作原理
為什麼「確定性 × Agent」混合勝過純語言驅動的 skill。
架構總覽
diff provider → 過濾 → per-file 子任務(plan+main)→ 評論流水線 → 持久化。
整合
Agent Skill、Claude Code 外掛、OpenCode 工具、GitHub Actions / GitLab CI、MCP。
委託模式
宿主 Agent 提供 LLM、OCR 只做工程架構——不用自己設 API key。
Benchmark
50 repo / 200 PR / 10 語言,Precision 與 F1 高、token 約 1/9。
Session Viewer
五條泳道看每一輪 LLM 往返。
遙測
OpenTelemetry span/metric/event,不導出 prompt 內容。
L4
讀 Go 源碼
直接進 OCR 的逐函數講解
cmd/main.go
單一二進位入口、rootCmd 分派。
review_cmd.go
review 命令的參數解析與執行、工具 registry 組裝。
scan_cmd.go
全檔掃描模式:不需 Git diff。
delegate_cmd.go
委託模式:preview + rule 子命令。
internal/agent
Agent.Run、dispatchSubtasks、檔案過濾。
internal/llmloop
per-file 迴圈、記憶三分區壓縮、工具執行。
internal/diff
Git diff 解析、三種模式、行解析。
internal/config/rules
四層規則鏈、system_rules.json。
internal/tool
6 個工具的定義、registry、provider。
全部程式碼對照
10 頁逐函數講解。
看完這條路線你應該能
:獨立安裝並用 OCR 評審任何 repo、寫自己的 rule.json、解釋「確定性 × Agent」為何比通用 agent 更省 token 更精準、並能追著 review_cmd.go 看整個執行流程。