open-code-review-delegate
Fungsinya
Tool ini membantu meninjau kode program. Tool ini menentukan bagian kode mana yang perlu dicek dan aturan apa yang harus diikuti, lalu menyerahkan analisis mendetail kepada kecerdasan agent utama. Tool ini berguna saat agent utama yang seharusnya melakukan review.
Kapan dipakai
- βSaat Anda ingin agent AI utama menganalisis kode.
- βUntuk mengecek perubahan pada kode atau kumpulan file tertentu.
- βSaat membandingkan berbagai versi kode untuk ditinjau.
Link skill
https://github.com/alibaba/open-code-review/blob/main/plugins/open-code-review/skills/open-code-review-delegate/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βTolong review kode saya, fokus pada keamanan dan performa.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Pertama, tool mengidentifikasi file yang akan ditinjau dan aturan yang berlaku. Kemudian, tool mengambil selisih (apa saja yang berubah) antarversi kode. Terakhir, agent utama menggunakan informasi ini untuk melakukan review.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Open Code Review β Delegation Mode
This Codex plugin skill intentionally mirrors the canonical skill at
skills/open-code-review-delegate/SKILL.md. Keep both files synchronized when
updating OCR delegation instructions; a symlink is avoided because plugin
installs may only materialize the plugin subtree.
A skill for performing AI code review where OCR provides deterministic engineering (file filtering, rule resolution) and the host agent performs the actual review using its own intelligence and tools.
Workflow
Step 1: Preview β Determine What to Review
ocr delegate preview --format json [--from <ref> --to <ref>] [--commit <hash>] [--exclude <patterns>]
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 |
| Single commit | ocr delegate preview -c abc123 |
Step 2: Get Rules for Files
ocr delegate rule --format json <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.
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.
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
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
β¦
Pertanyaan umum
Apa maksud 'delegasi'?
Artinya tool menyerahkan tugas analisis utama kepada agent AI utama, dan tool hanya fokus menyusun serta menyiapkan informasi yang dibutuhkan untuk analisis tersebut.
Apakah saya perlu pengetahuan pemrograman untuk memakai ini?
Tidak perlu. Tool ini dirancang untuk penggunaan yang sederhana. Anda cukup menyebutkan apa yang ingin ditinjau.
Apa itu 'aturan'?
Aturan adalah pedoman atau standar yang harus dipatuhi kode, misalnya praktik terbaik untuk keamanan atau gaya penulisan kode.
Detail
Deskripsi asli dari pembuat
Delegation mode for open-code-review (OCR). Instead of OCR calling an LLM endpoint, this skill instructs the host agent to perform the code review itself, using OCR only for deterministic engineering: file selection and rule resolution. Use when the host agent should drive the review with its own LLM capabilities.
repo: alibaba/open-code-review
Popularitas
- Bintang GitHub
- 47k
- Peringkat
- #6315
- Lisensi
- Apache-2.0
- Diperbarui
- 15/10/2026
Komentar
- β¦
Skill lain dari repositori ini
Skill serupa
test-driven-development
311kMengajari agent Anda menulis tes yang gagal dulu, melihatnya gagal, lalu menulis kode terkecil yang lulus, sebelum membangun fitur atau perbaikan apa pun.
verification-before-completion
311kMengajari agent Anda menjalankan pemeriksaan nyata dan membaca keluarannya sebelum menyatakan tugas, perbaikan, atau build sudah selesai atau lulus.
migrate-to-shoehorn
310kMengganti type cast berisiko di file tes Anda dengan pustaka shoehorn, sehingga tes bisa memakai data parsial dan tetap lulus pemeriksaan tipe.