code-review-graph
Fungsinya
Skill ini menyiapkan peta bagaimana berkas-berkas dalam proyek saling terhubung. Skill ini membantu AI Anda fokus pada berkas yang disentuh perubahan, bukan membaca seluruh proyek. Skill ini untuk tim dengan basis kode yang besar.
Kapan dipakai
- โSaat Anda meninjau perubahan dalam proyek besar dengan banyak berkas.
- โSaat AI Anda kehabisan ruang karena basis kodenya terlalu besar untuk dibaca.
- โSaat Anda ingin membatasi tinjauan pada berkas di sekitar satu perubahan.
Link skill
https://github.com/vudovn/ag-kit/blob/main/.agents/skills/code-review-graph/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
โPakai graf kode untuk menunjukkan berkas mana yang terdampak oleh perubahan terbaru saya sebelum kamu meninjaunya.โ
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill memakai server MCP yang mengurai kode menjadi graf strukturnya, yang disimpan dalam basis data lokal. AI mengkueri graf itu untuk menemukan berkas yang mungkin terdampak oleh perubahan.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Code Review Graph โ Token-Efficient Codebase Context via MCP
Cut AI token usage substantially on large codebases by giving the AI a structural map instead of letting it read everything. Savings scale with codebase size โ marginal on small projects, large on monorepos.
Overview
code-review-graph is an MCP server that uses Tree-sitter to parse your codebase into an AST graph stored in SQLite. When your AI assistant needs context for a task, it queries the graph first โ getting only the files in the blast radius of your change โ instead of reading every file in the directory.
Token Impact (illustrative โ varies by codebase):
| Codebase Type | Pattern |
|---|---|
| Large monorepo (10K+ files) | Biggest savings โ graph reads a small fraction of files |
| Mid-size app (1-5K files) | Meaningful reduction on multi-file changes |
| Small project (<200 files) | Little benefit โ graph overhead can exceed savings |
Quality angle: scoping the AI to the blast radius reduces noise, which tends to improve review focus. Measure on your own repo rather than relying on a fixed multiplier.
Bootstrap Protocol (opt-in)
When invoked during /plan or standard usage on a mid-to-large project, check whether graph analysis is available before relying on it:
- Step 1: Check if the tool is installed:
Get-Command code-review-graph(Windows) orwhich code-review-graph(macOS/Linux). - Step 2: Check if a
.code-review-graph/directory exists in the workspace. - Step 3: If installed but the index is missing, ask the user before running
code-review-graph build(it scans the whole project). - Step 4: If not installed and the project is large, ask the user: "Would you like to
pip install code-review-graphand build a local map to cut token usage for this project?" Never install or run build without confirmation.
When to Use vs When to Skip
โ Install it if:
- Codebase is 500+ files
- You make multi-file changes with cross-module dependencies
- You spend $20+/month on AI assistant tokens
- You work with monorepos, microservices, or cross-package TypeScript
- You want better review quality in addition to cost savings
โ Skip it if:
- Codebase is under ~200 files with isolated single-file changes
- Heavy use of dynamic patterns (reflection, runtime code gen, dynamic imports)
- You want zero-maintenance โ the graph needs to stay in sync
- Team hasn't standardized on an AI coding tool yet
โ ๏ธ Evaluate first if:
- Codebase is 200โ500 files โ benchmark before committing
- Mix of static and dynamic patterns โ test on representative commits
How It Works (4 Layers)
Layer 1: PARSE โ Tree-sitter builds ASTs from 19 languages
Layer 2: STORE โ Nodes + edges saved in SQLite graph
Layer 3: TRACE โ BFS computes blast radius of changes
Layer 4: SERVE โ MCP exposes graph to AI assistants
What the Graph Contains
- Nodes: Files, functions, methods, classes, imports, tests
- Edges: "A calls B", "X imports Y", "TestZ covers FunctionW", "ClassA extends ClassB"
- Metadata: Name, type, file path, line range per node
- Privacy: Structural metadata only โ NO source code content in the graph
Supported Languages (19)
Python, TypeScript, JavaScript, Go, Rust, Java, C#, Ruby, Kotlin, Swift, PHP, C/C++, Vue SFC, Solidity, Dart, R, Perl, Lua, Jupyter/Databricks notebooks.
Installation
Prerequisites
- Python 3.9+ (
python3 --version) - pip or pipx installed
- An MCP-compatible AI client (AG Kit, Claude Code, Cursor, Windsurf, Zed)
- Git-tracked codebase (for incremental updates)
Step 1: Install the Package
# Recommended: isolated environment
pipx install code-review-graph
# Alternative: fastest, no permanent install
uvx code-review-graph install
# Alternative: global pip
pip install code-review-graph
Step 2: Configure MCP Client
# Auto-detect all supported tools
code-review-graph install
# Or target a specific platform
code-review-graph install --platform claude-code
code-review-graph install --platform cursor
code-review-graph install --platform windsurf
Restart your editor after this step. The MCP server activates on restart.
Step 3: Build the Initial Graph
cd /your/project
code-review-graph build
| Codebase Size | Expected Build Time |
|---|---|
| 500 files | 10โ30 seconds |
Pertanyaan umum
Apakah ini berguna untuk proyek kecil?
Skill menyatakan manfaatnya kecil pada proyek kecil, karena pengaturannya bisa lebih mahal daripada manfaatnya.
Apa yang disimpan graf?
Ia menyimpan struktur kode dalam basis data SQLite yang dibangun dengan pengurai Tree-sitter.
Apakah ini menggantikan membaca kode?
Ia mempersempit berkas mana yang dibaca AI, tetapi tinjauan tetap bergantung pada kode yang dilihatnya.
Detail
Deskripsi asli dari pembuat
Token-efficient code review using Tree-sitter AST graphs and MCP. Cuts AI token usage on large codebases by computing the blast radius of changes instead of reading entire codebases. Uses a SQLite graph database for structural analysis.
repo: vudovn/ag-kit
Popularitas
- Bintang GitHub
- 8.2k
- Peringkat
- #12528
- Lisensi
- MIT
- Diperbarui
- 18/10/2026
Komentar
- โฆ
Skill lain dari repositori ini
batch-operations
8.2kMembantu agent Anda membuat perubahan yang sama di banyak berkas sekaligus, misalnya mengganti nama fungsi atau mengganti impor lama di semua tempat.
brainstorming
8.2kMengajari agent Anda untuk mengajukan pertanyaan klarifikasi sebelum membangun sesuatu yang baru atau rumit, agar ia memahami tujuan Anda terlebih dahulu.
code-review-checklist
8.2kMemberi agent Anda daftar periksa untuk meninjau kode dari sisi kebenaran, keamanan, performa, pengujian, dan dokumentasi, termasuk risiko khusus AI.
context-compression
8.2kMengajari agent Anda untuk memperpendek sesi chat yang panjang dengan merangkum pekerjaan yang sudah selesai dan menyimpan keputusan penting, agar tetap fokus.
Skill serupa
diffs
394kMemungkinkan agent Anda menghasilkan diff perubahan yang nyata dan dapat dibagikan sebagai tautan viewer atau file gambar, bukan ringkasan yang ditulis manual.
coding-agent
394kMembantu agent Anda menyerahkan pekerjaan pemrograman besar ke Codex, Claude Code, atau OpenCode di latar belakang, lalu memeriksa kemajuannya.
gh-issues
394kMembantu agent Anda menemukan issue GitHub, memilih yang dikerjakan, dan membuka pull request perbaikan, termasuk tindak lanjut komentar tinjauan.