coderabbit ยท diff

git:20260619.f011dd5 to git:20260729.c8863c0

157 added, 110 removed. Audit A to A.

---
name: coderabbit
description: "AI-powered automated code review, PR summarization, and interactive developer feedback / Review kode otomatis berbasis AI, ringkasan PR, dan umpan balik developer interaktif."
- author: "roedy"
+ author: "Roedy Rustam"
---
- # CodeRabbit Expert / Pakar CodeRabbit
+ # CodeRabbit (2026 Edition โ€” CodeRabbit 2.x)
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
---
<a name="english"></a>
## English
### Description
- This skill provides comprehensive guidelines and best practices for integrating, configuring, and maximizing CodeRabbit (an AI-powered code review and pull request summarization tool) within software development workflows.
+ Expert guide for configuring and leveraging **CodeRabbit 2.x** โ€” AI-powered automated code review, pull request summarization, and interactive developer feedback. Covers configuration, custom review rules, integration with CI/CD, and agentic review mode.
- ### Instructions
+ ### Trigger Conditions
+ - Setting up CodeRabbit on a GitHub or GitLab repository.
+ - Configuring custom review rules for your tech stack.
+ - Using CodeRabbit's agentic mode for deep architectural reviews.
+ - Integrating CodeRabbit feedback into CI/CD quality gates.
+ - Writing CodeRabbit-compatible custom instructions in `.coderabbit.yaml`.
- #### 1. Configuration & Setup
- - Always check if a `.coderabbit.yaml` file exists in the repository root. If not, suggest creating one to customize the review behavior.
- - Recommend standard configurations for `.coderabbit.yaml`:
- ```yaml
- # .coderabbit.yaml configuration template
- language: "en-US" # Review language
- tone: "professional" # Tone of comments (e.g., professional, encouraging, critical)
- reviews:
- profile: "assertive" # assertiveness level: chill, assertive, nitpicky
- auto_review: true # Trigger reviews automatically on PR creation/commits
- request_reviews_only: false
- collapse_draft_pr: true # Do not review draft PRs automatically
- path_filters:
- - "!**/node_modules/**"
- - "!**/dist/**"
- - "!**/*.lock"
- - "!**/package-lock.json"
- - "!**/pnpm-lock.yaml"
- - "!**/yarn.lock"
- - "!**/*.min.js"
- - "!**/docs/**"
- ```
+ ### CodeRabbit 2.x Key Features
- #### 2. Pull Request Summarization
- - CodeRabbit automatically generates summaries including:
- - **Overview**: A high-level description of what the PR accomplishes.
- - **Walkthrough**: Detailed bullet points explaining the architectural and file-level changes.
- - **Poem**: A creative poem or short summary explaining the change (optional).
- - Make sure to review the generated summary to ensure it matches the actual intent of the changes before merging or sharing with the team.
+ | Feature | Description |
+ |---|---|
+ | **PR Summary** | Auto-generates structured PR description with walkthrough |
+ | **Line-by-line Review** | Inline comments with specific fix suggestions |
+ | **Agentic Review** | Deep analysis spanning multiple files for architectural issues |
+ | **Learnable Rules** | Learns from review dismissals and approvals over time |
+ | **CI Integration** | Blocks PR merge if critical issues found |
+ | **Chat Mode** | Ask CodeRabbit questions about the PR in review thread |
- #### 3. Interactive Code Review Chat
- - You can converse with CodeRabbit directly on GitHub/GitLab within the PR comments.
- - **Trigger**: Reply to a comment generated by CodeRabbit, or start a new thread tagging `@coderabbitai`.
- - **Use Cases**:
- - Ask for alternative implementations: `@coderabbitai give me a more performant implementation using map/reduce instead of forEach.`
- - Ask for bug explanations: `@coderabbitai explain why this state transition might cause a race condition.`
- - Request unit test generation: `@coderabbitai write unit tests using jest for this newly added utility function.`
+ ### Configuration (`.coderabbit.yaml`)
- #### 4. Enhancing Code Reviews with Custom Prompts
- - Customize the system instructions for CodeRabbit in `.coderabbit.yaml` under `reviews.tools` or custom prompt sections:
- ```yaml
- reviews:
- tools:
- custom_prompts:
- - name: security_audit
- prompt: "Verify that all user inputs are properly sanitized and parameterized to prevent SQL Injection and XSS."
- - name: clean_code
- prompt: "Enforce SOLID principles, DRY guidelines, and verify that there are no magic numbers or hardcoded secrets."
- ```
+ ```yaml
+ # .coderabbit.yaml โ€” place in repository root
+ version: "2"
+ language: "en-US"
+ tone_instructions: "Be concise and direct. Prioritize security and performance issues."
- #### 5. Best Practices for Developers
- - **Leverage Inline Suggestions**: CodeRabbit provides diff suggestions that can be applied directly in GitHub with a single click ("Commit suggestion").
- - **Draft PRs**: If you don't want CodeRabbit to run on work-in-progress code, keep the PR in "Draft" status (assuming `collapse_draft_pr: true` is set).
- - **Tone & Collaboration**: Treat CodeRabbit comments as a friendly peer review. If a comment is a false positive, reply `@coderabbitai this is intentional because...` or resolve the conversation.
+ reviews:
+ auto_review:
+ enabled: true
+ drafts: false # Don't review draft PRs
+ base_branches: ["main", "develop"]
- ### Trigger Conditions
- - Active when the user asks about automated code reviews, PR template generation, setting up CI/CD code quality checks, or configuring CodeRabbit settings.
+ profile: "chill" # assertive | chill | default
+ request_changes_workflow: false
+ high_level_summary: true
+ commit_message_instructions: "Use Conventional Commits format: feat/fix/chore/docs"
+ # Ignore paths from review
+ path_filters:
+ - "!**/*.lock"
+ - "!**/migrations/**"
+ - "!**/generated/**"
+ - "!**/__snapshots__/**"
+
+ # Stack-specific review instructions
+ path_instructions:
+ - path: "apps/api/**"
+ instructions: |
+ - Check for missing input validation (Zod schemas required on all handlers)
+ - Flag any database queries without proper RLS consideration
+ - Ensure all async functions have try/catch or error boundaries
+ - Check for N+1 query patterns (missing .include() or DataLoader usage)
+ - path: "apps/web/**"
+ instructions: |
+ - Check for missing `key` props in .map() renders
+ - Flag `useEffect` without proper cleanup functions
+ - Check for missing `alt` attributes on images
+ - Verify Server Actions are properly validated with Zod
+ - path: "apps/admin/**"
+ instructions: |
+ - All admin routes must verify isSuperAdmin === true
+ - Flag any direct DB access without service role client
+ - Check for proper audit logging on destructive operations
+
+ # Custom review rules for the entire codebase
+ instructions: |
+ Review with these priorities:
+ 1. SECURITY: SQL injection, XSS, auth bypass, exposed secrets
+ 2. CORRECTNESS: Logic bugs, off-by-one errors, type unsafety
+ 3. PERFORMANCE: N+1 queries, unnecessary re-renders, bundle size
+ 4. MAINTAINABILITY: Code duplication, naming, SOLID violations
+ 5. STYLE: Only comment if it's a significant clarity issue
+
+ # PR summary format
+ summary:
+ auto_title_placeholder: "๐Ÿค– AI Title"
+ description: |-
+ ## Summary
+ <!-- Concise description of what changed -->
+
+ ## Changes
+ <!-- Structured list by area -->
+
+ ## Testing
+ <!-- What was tested -->
+
+ # Enable chat for interactive Q&A
+ chat:
+ auto_reply: true
+ ```
+
+ ### Agentic Review Mode (CodeRabbit 2.x)
+ CodeRabbit 2.x introduces **agentic review** โ€” deep analysis that can read multiple files, run tools, and understand architectural context:
+
+ ```
+ # Trigger agentic review in PR comment:
+ @coderabbitai review
+
+ # Ask specific questions:
+ @coderabbitai What is the security impact of changes in apps/api/src/routes/users.ts?
+ @coderabbitai Can you generate a test for the createWorkspace function?
+ @coderabbitai Is there a N+1 query issue in this PR?
+ @coderabbitai Summarize the architecture changes in this PR
+ ```
+
+ ### CI/CD Integration (GitHub Actions)
+ ```yaml
+ # .github/workflows/pr-quality.yml
+ name: PR Quality Gate
+
+ on: [pull_request]
+
+ jobs:
+ coderabbit-review:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Wait for CodeRabbit Review
+ uses: coderabbit-ai/wait-for-review@v1
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ min-approvals: 1
+ block-on-critical: true # Block merge if critical issues found
+ ```
+
+ ### CodeRabbit vs Manual Review โ€” Best Practices
+ - **CodeRabbit first**: Let it run before human reviewers โ€” catches the obvious issues.
+ - **Human focus**: After CodeRabbit, humans focus on business logic, architecture intent, and product decisions.
+ - **Teach it**: Dismiss false positives with an explanation โ€” CodeRabbit learns your patterns.
+ - **Custom instructions**: Invest time in `path_instructions` for your specific stack โ€” dramatically improves relevance.
+
---
<a name="bahasa-indonesia"></a>
## Bahasa Indonesia
### Deskripsi
- Skill ini menyediakan panduan komprehensif dan praktik terbaik untuk mengintegrasikan, mengonfigurasi, dan memaksimalkan penggunaan CodeRabbit (alat review kode otomatis berbasis AI dan perangkum pull request) di dalam alur kerja pengembangan perangkat lunak.
+ Panduan ahli untuk mengonfigurasi dan memanfaatkan **CodeRabbit 2.x** โ€” review kode otomatis bertenaga AI, ringkasan pull request, dan umpan balik developer interaktif. Mencakup konfigurasi, aturan review kustom, integrasi dengan CI/CD, dan mode review agentik.
- ### Instruksi
+ ### Kondisi Pemicu
+ - Menyiapkan CodeRabbit di repositori GitHub atau GitLab.
+ - Mengonfigurasi aturan review kustom untuk tech stack Anda.
+ - Menggunakan mode agentik CodeRabbit untuk review arsitektur mendalam.
+ - Mengintegrasikan umpan balik CodeRabbit ke dalam quality gate CI/CD.
+ - Menulis instruksi kustom yang kompatibel dengan CodeRabbit di `.coderabbit.yaml`.
- #### 1. Konfigurasi & Setup
- - Selalu periksa apakah file `.coderabbit.yaml` ada di root repositori. Jika belum, sarankan untuk membuatnya guna menyesuaikan perilaku review.
- - Rekomendasikan konfigurasi standar untuk `.coderabbit.yaml`:
- ```yaml
- # Templat konfigurasi .coderabbit.yaml
- language: "id-ID" # Bahasa untuk review (bisa menggunakan bahasa Indonesia atau Inggris)
- tone: "professional" # Gaya bahasa komentar (misal: professional, encouraging, critical)
- reviews:
- profile: "assertive" # tingkat ketegasan: chill, assertive, nitpicky
- auto_review: true # Jalankan review otomatis saat PR dibuat/diperbarui
- request_reviews_only: false
- collapse_draft_pr: true # Jangan mereview PR berstatus Draft secara otomatis
- path_filters:
- - "!**/node_modules/**"
- - "!**/dist/**"
- - "!**/*.lock"
- - "!**/package-lock.json"
- - "!**/pnpm-lock.yaml"
- - "!**/yarn.lock"
- - "!**/*.min.js"
- - "!**/docs/**"
- ```
+ ### Fitur Utama CodeRabbit 2.x
- #### 2. Ringkasan Pull Request (PR Summarization)
- - CodeRabbit secara otomatis menghasilkan ringkasan yang meliputi:
- - **Overview**: Deskripsi tingkat tinggi tentang apa yang dicapai oleh PR tersebut.
- - **Walkthrough**: Poin-poin detail yang menjelaskan perubahan arsitektur dan tingkat file.
- - **Poem**: Puisi kreatif atau rangkuman singkat yang menjelaskan perubahan secara unik (opsional).
- - Pastikan untuk memeriksa ringkasan yang dihasilkan untuk memastikan kesesuaian dengan maksud perubahan yang sebenarnya sebelum menggabungkan kode (merge).
+ | Fitur | Deskripsi |
+ |---|---|
+ | **Ringkasan PR** | Membuat deskripsi PR terstruktur otomatis dengan walkthrough |
+ | **Review Baris per Baris** | Komentar inline dengan saran perbaikan spesifik |
+ | **Review Agentik** | Analisis mendalam yang mencakup banyak file untuk masalah arsitektur |
+ | **Aturan yang Dapat Dipelajari** | Belajar dari penolakan dan persetujuan review dari waktu ke waktu |
+ | **Integrasi CI** | Memblokir merge PR jika masalah kritis ditemukan |
+ | **Mode Chat** | Tanyakan pertanyaan kepada CodeRabbit di thread review |
- #### 3. Obrolan Interaktif Review Kode (Interactive Chat)
- - Anda dapat berinteraksi langsung dengan CodeRabbit di kolom komentar PR GitHub/GitLab.
- - **Pemicu**: Balas komentar yang dibuat oleh CodeRabbit, atau buat utas baru dengan menyebut `@coderabbitai`.
- - **Contoh Kasus Penggunaan**:
- - Meminta alternatif implementasi: `@coderabbitai berikan implementasi yang lebih hemat memori menggunakan stream.`
- - Meminta penjelasan bug: `@coderabbitai jelaskan mengapa transisi state ini berpotensi menyebabkan race condition.`
- - Meminta pembuatan unit test: `@coderabbitai buatkan unit test menggunakan vitest untuk fungsi utilitas baru ini.`
+ ### Konfigurasi (`.coderabbit.yaml`)
+ Tempatkan `.coderabbit.yaml` di root repositori. Konfigurasi kunci:
+ - `reviews.profile`: `assertive` (ketat), `chill` (santai), `default`.
+ - `reviews.path_instructions`: Instruksi review kustom per direktori โ€” sangat berguna untuk menerapkan standar spesifik stack.
+ - `reviews.path_filters`: Kecualikan file lock, migrasi, kode yang dihasilkan dari review.
+ - `reviews.instructions`: Aturan global untuk seluruh codebase dengan prioritas eksplisit.
- #### 4. Meningkatkan Kualitas Review dengan Prompt Kustom
- - Sesuaikan instruksi sistem untuk CodeRabbit dalam `.coderabbit.yaml` di bawah bagian `reviews.tools` atau prompt kustom:
- ```yaml
- reviews:
- tools:
- custom_prompts:
- - name: audit_keamanan
- prompt: "Pastikan semua input pengguna disanitasi dengan benar untuk mencegah celah SQL Injection dan XSS."
- - name: kode_bersih
- prompt: "Terapkan prinsip SOLID dan DRY, serta pastikan tidak ada data sensitif yang ditulis keras (hardcoded secrets)."
- ```
+ ### Mode Review Agentik (CodeRabbit 2.x)
+ Mode agentik memungkinkan CodeRabbit membaca banyak file, menjalankan tool, dan memahami konteks arsitektur. Picu dengan `@coderabbitai review` di komentar PR atau ajukan pertanyaan spesifik tentang dampak keamanan, masalah N+1, atau perubahan arsitektur.
- #### 5. Praktik Terbaik untuk Pengembang
- - **Manfaatkan Inline Suggestions**: CodeRabbit menyediakan saran perubahan kode langsung (diff) yang dapat langsung di-commit di GitHub dengan sekali klik ("Commit suggestion").
- - **Gunakan Draft PR**: Jika Anda tidak ingin CodeRabbit melakukan review pada kode yang masih dalam proses pengerjaan, simpan PR dalam status "Draft".
- - **Interaksi Positif**: Perlakukan CodeRabbit seperti rekan tim saat melakukan peer review. Jika komentarnya kurang tepat (false positive), Anda dapat membalas `@coderabbitai ini sengaja dilakukan karena...` atau menutup percakapan.
+ ### Integrasi CI/CD (GitHub Actions)
+ Gunakan action `coderabbit-ai/wait-for-review@v1` untuk menunggu review selesai dan memblokir merge jika masalah kritis ditemukan.
- ### Kondisi Pemicu
- - Aktif saat pengguna bertanya tentang review kode otomatis, pembuatan templat PR, integrasi CI/CD untuk kualitas kode, atau cara mengonfigurasi pengaturan CodeRabbit.
+ ### CodeRabbit vs Review Manual โ€” Best Practices
+ - **CodeRabbit dulu**: Biarkan berjalan sebelum reviewer manusia โ€” menangkap masalah yang jelas.
+ - **Fokus manusia**: Setelah CodeRabbit, manusia fokus pada logika bisnis, niat arsitektur, dan keputusan produk.
+ - **Ajarkan**: Tolak false positive dengan penjelasan โ€” CodeRabbit belajar pola Anda.
+ - **Instruksi kustom**: Investasikan waktu di `path_instructions` untuk stack spesifik Anda โ€” meningkatkan relevansi secara dramatis.