open-code-review-delegate
Skill209 starsChanged 2 months agoApache-2.0View on GitHub
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.
- Installs packages
6 other projects use a version of this, 5 of them edited; 5 of 5 edited versions we compared changed its rules; 2 new projects in the last 4 weeks, against 0 the 4 before.
How people change it
5 of 5 edited versions changed its rules, and some changes recur.
Of the 5 edited versions we compared: 5 made changes of their own.
Rules people drop
- If an OCR command fails with
command not found, install the CLI withnpm install -g @alibaba-group/open-code-reviewif your environment permits, then retry the same command. If installation is not permitted, explain the prerequisite and stop; …dropped by 5 of 5 - After Git exits with code 0, read and review the entire file in chunks, then remove it. If Git fails or times out, retry or record
skippedwith the error. Check unexpectedly empty output against a fresh preview.dropped by 4 of 5 - Do not silently truncate the source file.dropped by 1 of 5
- If a faithful summary is not possible, omit the OCR background entirely and read the original material directly during the review.dropped by 1 of 5
Rules people add
- A rule we can't quote: its licence doesn't allow itadded by 4 of 5
We split this file and each edited version into the rules they give an agent and match them by wording. A version that adds no rule of its own and has not changed since this file last did reads as an older text, so what it lacks is not counted as dropped. We keep no past texts of a file, so that is inferred, and an edited version that started from an older text still counts its gaps as drops.
Adopted by
Surging: 2 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Most recently taken up by
- continew-org/continew-adminedited, first seen Nov 1, 2026
- ClaireAll/skillsedited, first seen Nov 1, 2026
- liushikuan63/Qoder-Optimizationedited, first seen Nov 1, 2026
- chinfi-codex/ch-skillsedited, first seen Aug 26, 2026
- alibaba/open-code-reviewword for word, first seen Aug 16, 2026
- Looted/kibiedited, first seen Jun 2, 2026
Other versions6 projects use a version of this.
Word for word · 1
- alibaba/open-code-review★ 57k100% same
Edited · 5
- continew-org/continew-admin★ 2.2k88% same
- Looted/kibi★ 1483% same
- chinfi-codex/ch-skills★ 476% same
- ClaireAll/skills★ 281% same
- liushikuan63/Qoder-Optimization★ 285% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository5 other files it gives its agents.
- .agents/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- glide-component-segregatorSkill
- glide-setupSkill
- glideSkill
The file
We split this skill into the rules it gives an agent
8 rules. 3 are common, 0 are distinctive, and 5 are very specific to this project.
3
Common
Most of the 5 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 99
After Git exits with code 0, read and review the entire file in chunks, then remove it.
- Very specific: line 103
Create a checklist containing every reviewable_files entry.
- Very specific: line 105
Use (path, status) as the checklist identity.
- Very specific: line 135
Before reporting, verify that every previewed file is accounted for.
- Common: line 149
If the user requested "review and fix":
- Common: line 190
Do not silently truncate the source file.
- Common: line 200
If a faithful summary is not possible, omit the OCR background entirely and read the original material directly during the review.
- Very specific: line 205
If an OCR command fails with command not found, install the CLI with npm install -g @alibaba-group/open-code-review if your environment …
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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.
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
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):
git --no-pager diff --no-ext-diff --no-textconv --no-color <merge_base>..<to> -- "<path>"Commit mode:
git --no-pager show --no-ext-diff --no-textconv --no-color <commit> -- "<path>"Workspace mode:
# Tracked files
git --no-pager diff --no-ext-diff --no-textconv --no-color HEAD -- "<path>"
# New untracked files — read directly (entire file is new code)
cat "<path>"To read context:
git --no-pager log --no-color --oneline -- "<path>"
git --no-pager blame --no-textconv -- "<path>"
git --no-pager show --no-ext-diff --no-textconv --no-color "<ref>:<path>"For large diffs, add --output="<absolute-diff-file>" to the command for the selected mode. Choose a unique absolute path outside the repository and create its parent directory. Use the same path in file-reading tool calls:
git --no-pager diff --no-ext-diff --no-textconv --no-color --output="<absolute-diff-file>" <merge_base>..<to> -- "<path>"After Git exits with code 0, read and review the entire file in chunks, then remove it. If Git fails or times out, retry or record skipped with the error. Check unexpectedly empty output against a fresh preview.
Step 4: Review Each File
Create a checklist containing every reviewable_files entry. For each reviewable file:
Use (path, status) as the checklist identity. Workspace mode can report the same path twice when a staged deletion is followed by an untracked recreation.
- Get its diff (Step 3)
- Consult its Rule Group (from Step 2) for the review checklist
- Conduct a thorough review, using appropriate context tools as needed
- Mark the file
reviewed, orskippedwith a concrete reason
For large changes, review in bounded batches grouped by shared rules and diff size. Do not stop after finding the first high-severity issue.
While reading each diff, ask which existing caller or user workflow, if any, behaves differently. Reuse the same evidence; follow a caller, contract, or test only when it helps establish a concrete before/after scenario. Compare the sides selected in Step 3 (the new side in workspace mode is the live working tree). Assess behavior changes as you review the diff. Do not run ocr review --analysis or pass --analysis to ocr delegate.
A removed interface may matter even when there are no new lines to review. If preview excludes a file solely as deleted, use its old side as context when needed, without counting it as reviewed. Respect all other exclusions when following evidence.
Step 5: Format Output
Each comment must follow this structure:
| Field | Type | Required | Description |
| path | string | yes | Relative file path |
| content | string | yes | Review comment describing the issue |
| start_line | integer | no | Start line in the new file |
| end_line | integer | no | End line in the new file |
| category | enum | no | bug, security, performance, maintainability, test, style, documentation, other |
| severity | enum | no | critical, high, medium, low |
Step 6: Classify and Report
Identify the review mode as delegation.
Before reporting, verify that every previewed file is accounted for. Include total_files, reviewed_files, skipped_files, and coverage_rate in the summary. A skipped file must include its reason.
Group findings by severity:
- Critical/High: Bugs, security issues, data loss risks — always report
- Medium: Performance concerns, error handling gaps, maintainability issues — report with context
- Low: Style nits, minor suggestions — report only if clearly valuable
Discard likely false positives silently.
Report a material behavior change even if it is intentional and there are no defects. Name the affected workflow, what happened before and what happens now, and cite the supporting location. For example, removing a public option can break scripts that still pass it. Keep this impact distinct from severity-rated findings and file coverage; if it explains a finding, describe it there only once. Qualify material uncertainties, and omit the impact section when there is no concrete change to report.
Step 7: Fix (Optional)
If the user requested "review and fix":
- Apply High/Critical fixes directly
- Describe Medium fixes that require manual intervention
- Skip Low-priority items unless trivial
Sub-commands Reference
| Command | Purpose |
ocr delegate preview | Which files to review + mode/ref metadata |
ocr delegate rule <path...> | Review rules grouped by content |
Shared Flags
| Flag | Description |
--from <ref> | Source ref for range mode |
--to <ref> | Target ref for range mode; defaults to HEAD when --from is supplied in either subcommand |
-c, --commit <hash> | Single commit mode |
--repo <path> | Repository root (default: cwd) |
--rule <path> | Custom rule.json path |
--exclude <patterns> | Comma-separated exclude patterns |
-b, --background <text> | Business context |
-B, --background-file <path> | Business context from Markdown file (takes precedence over -b) |
-f, --format <text|json> | Output format; use json for agent integrations |
Gotchas
- Host-driven analysis — OCR's native review agent, positioning, and reflection modules do not run in delegation mode.
- Rules are grouped — Files sharing the same rule are grouped together in the output. You can pass any number of paths per call; for large changes, fetch rules per-batch as you review.
- Working directory matters —
ocr delegateoperates on the Git repo at the current directory. Use--repo /pathto override. - Untracked files in workspace mode —
previewincludes untracked files. For these, read the file directly instead of usinggit diff. - Background context — pass
--backgroundtopreviewwhen you have requirement context; it appears in the output for your reference during review. - Coverage is mandatory — every
reviewable_filesentry must end as reviewed or explicitly skipped; do not silently omit files.
Recovering Oversized Background Context
--background-file has two independent limits. The raw file must not exceed
1 MiB, and the sanitized content must not exceed 8000 characters. Either
condition aborts the command. When the command reports either limit:
- Do not silently truncate the source file.
- Summarize the original material while preserving its requirements, constraints, acceptance criteria, and other review-critical details.
- Retry the affected command by passing the summary as one shell-safe
argument (for example, use a quoted/escaped argument produced by the host
shell, or write it to a new size-bounded file and pass that file). Do not
place untrusted summary text directly in a double-quoted shell template;
$(), backticks, quotes, and variable references can still be evaluated. Omit the original--background-fileso the CLI does not reload the same oversized file and fail again. - If a faithful summary is not possible, omit the OCR background entirely and read the original material directly during the review.
Troubleshooting CLI Version Compatibility
If an OCR command fails with command not found, install the CLI with npm install -g @alibaba-group/open-code-review if your environment permits, then retry the same command. If installation is not permitted, explain the prerequisite and stop; do not substitute ocr review or ask for an API key.
The --format flag is available in ocr v1.9.0 and later. The Skill and the
installed CLI can be updated independently. If a requested preview or rule
command with --format json fails specifically with unknown flag: --format,
rerun it without the flag and use text output for the rest of the delegation
run. Preserve the explicit mode, ref, file, and rule information from that
output; do not parse text output as JSON or invent missing schema fields. Do
not retry without the flag for any other error; report it and stop the affected
workflow.
The host-agent Skill may consume the equivalent text output to complete its
review checklist. Programmatic integrations that require schema_version or
other JSON fields must require a JSON-capable CLI instead: verify with
ocr --version and upgrade when necessary:
npm install -g @alibaba-group/open-code-reviewDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

