SKILL.md--- name: open-code-review-delegate description: > Review workspace changes, PRs, commits, or branch comparisons with the host agent's model. OCR's CLI selects files and resolves rules; the host reviews them for defects and explains changes that affect users or callers. Use when the user has no separate API key for OCR or wants to reuse their coding-agent subscription or model setup. For OCR's full native pipeline with its own model provider, choose open-code-review instead. license: Apache-2.0 compatibility: > Requires the `ocr` CLI installed (via `npm install -g @alibaba-group/open-code-review` or GitHub release binary). Does NOT require a configured LLM endpoint — delegation mode is LLM-free on the OCR side. metadata: author: alibaba homepage: https://github.com/alibaba/open-code-review version: "1.0.0" --- # Open Code Review — Delegation Mode ## Workflow ### Step 1: Preview — Determine What to Review Skip OCR provider setup and `ocr llm test`; the host agent's authentication, usage limits, and costs still apply. ```bash ocr delegate preview --format json [--from <ref> [--to <ref>]] [--commit <hash>] [--exclude <patterns>] ``` With `--from` and no `--to`, both delegate subcommands default to `HEAD`. Range review compares the merge-base to the target commit and excludes staged, unstaged, and untracked changes. Omit range/commit flags for workspace mode; range and commit flags are mutually exclusive. This outputs: - **mode** (workspace / range / commit) - **from / to / commit / merge_base** — ref metadata for constructing git commands - **Reviewable file list** — paths, status, insertions/deletions - **Excluded files** — with exclusion reason **Common invocations:** | Scenario | Command | |----------|---------| | Workspace changes | `ocr delegate preview` | | Branch comparison | `ocr delegate preview --from main --to feature` | | Current branch against main | `ocr delegate preview --from main` | | Single commit | `ocr delegate preview -c abc123` | ### Step 2: Get Rules for Files ```bash ocr delegate rule --format json [--from <ref> [--to <ref>]] [--commit <hash>] <path1> <path2> ... ``` Pass the reviewable file paths from Step 1. Output is grouped by rule content — files sharing the same rule appear under one group, avoiding repetition. Pass the same range or commit flags as in Step 1 so rules are resolved against the same target. For example, pair `ocr delegate preview --from main` with `ocr delegate rule --from main --format json <path...>`. ### Step 3: Get Diffs Choose the diff command using the mode and refs from Step 1. Use `git --no-pager` for every Git call during the review. The diff commands disable external diff programs, text conversion, and color to produce plain patches. **Range mode** (merge_base provided in preview output): ```bash git --no-pager diff --no-ext-diff --no-textconv --no-color <merge_base>..<to> -- "<path>" ``` **Commit