code-review-graph
하는 일
이 스킬은 프로젝트 파일들이 어떻게 연결되는지 보여 주는 지도를 만듭니다. AI가 프로젝트 전체 대신 변경이 닿은 파일에 집중하도록 돕습니다. 큰 코드베이스를 가진 팀을 위한 스킬입니다.
사용하는 경우
- ✓파일이 많은 큰 프로젝트에서 변경 사항을 검토할 때.
- ✓코드베이스가 너무 커서 AI가 읽을 공간이 부족해질 때.
- ✓한 변경 주변의 파일로만 검토 범위를 좁히고 싶은 경우.
스킬 링크
https://github.com/vudovn/ag-kit/blob/main/.agents/skills/code-review-graph/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 최신 변경 전에 코드 그래프를 써서 영향받는 파일을 보여 주세요. 검토는 그다음에 해 주세요.”
매주 새 스킬 5개. 읽는 데 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
- 업데이트
- 2026. 10. 18.
댓글
- …
이 저장소의 다른 스킬
batch-operations
8.2k에이전트가 함수 이름 바꾸기나 오래된 import 교체처럼 같은 변경을 여러 파일에 한꺼번에 적용하도록 돕습니다.
brainstorming
8.2k에이전트가 새로운 것이나 복잡한 것을 만들기 전에 명확한 질문을 하도록 가르쳐 목표를 먼저 이해하게 합니다.
code-review-checklist
8.2k에이전트에게 정확성, 보안, 성능, 테스트, 문서를 검토하는 체크리스트를 주고, AI 관련 위험도 포함합니다.
context-compression
8.2k에이전트가 끝난 작업을 요약하고 핵심 결정은 남겨 긴 채팅 세션을 줄이도록 가르쳐 집중력을 유지하게 합니다.