code-review-graph
यह क्या करती है
यह स्किल प्रोजेक्ट की फ़ाइलों के आपसी जुड़ाव का मानचित्र बनाती है। यह आपके AI को पूरा प्रोजेक्ट पढ़ने की जगह बदलाव से जुड़ी फ़ाइलों पर ध्यान देने में मदद करती है। यह बड़े कोडबेस वाली टीमों के लिए है।
कब इस्तेमाल करें
- ✓जब आप बड़े प्रोजेक्ट में कई फ़ाइलों वाले बदलाव की समीक्षा कर रहे हों।
- ✓जब आपका AI कोडबेस बहुत बड़ा होने के कारण जगह कम पड़ने लगे।
- ✓जब आप किसी एक बदलाव के आसपास की फ़ाइलों तक समीक्षा सीमित रखना चाहें।
Skill का लिंक
https://github.com/vudovn/ag-kit/blob/main/.agents/skills/code-review-graph/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे नवीनतम बदलाव की समीक्षा से पहले कोड ग्राफ़ से दिखाइए कि कौन सी फ़ाइलें प्रभावित हैं।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह स्किल एक MCP सर्वर इस्तेमाल करती है, जो कोड को उसकी संरचना के ग्राफ़ में बदलकर स्थानीय डेटाबेस में रखता है। AI उस ग्राफ़ से पूछता है कि किसी बदलाव से कौन सी फ़ाइलें प्रभावित हो सकती हैं।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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 |
अक्सर पूछे जाने वाले सवाल
क्या यह छोटे प्रोजेक्ट में काम आती है?
स्किल के अनुसार छोटे प्रोजेक्ट में इसका लाभ कम है, जहाँ सेटअप की लागत बचत से ज़्यादा हो सकती है।
ग्राफ़ में क्या स्टोर होता है?
कोड की संरचना Tree-sitter पार्सिंग से बने SQLite डेटाबेस में स्टोर होती है।
क्या यह कोड पढ़ने की जगह ले लेती है?
यह बताती है कि AI कौन सी फ़ाइलें पढ़े, लेकिन समीक्षा अब भी उसी कोड पर निर्भर है जो वह देखता है।
जानकारी
लेखक का मूल विवरण
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
लोकप्रियता
- GitHub स्टार
- 8.2k
- रैंकिंग में स्थान
- #12528
- लाइसेंस
- MIT
- अपडेट की गई
- 18/10/2026
कमेंट
- …
इस repository की और skills
batch-operations
8.2kयह आपके एजेंट को एक ही बदलाव कई फ़ाइलों में एक साथ करने में मदद करती है, जैसे किसी फ़ंक्शन का नाम बदलना या पुराना इम्पोर्ट हर जगह बदलना।
brainstorming
8.2kयह आपके एजेंट को कुछ भी नया या जटिल बनाने से पहले स्पष्ट सवाल पूछना सिखाती है, ताकि वह पहले आपका लक्ष्य समझे।
code-review-checklist
8.2kयह आपके एजेंट को सही होने, सुरक्षा, प्रदर्शन, परीक्षण और डॉक्यूमेंटेशन के लिए कोड जाँचने की चेकलिस्ट देती है, AI से जुड़े जोखिमों सहित।
context-compression
8.2kयह आपके एजेंट को पूरे हो चुके काम का सार बनाकर और मुख्य फ़ैसले रखकर लंबे चैट सत्र छोटे करना सिखाती है, ताकि वह केंद्रित रहे।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।