본문으로 건너뛰기
Skillpedia
일반 코딩8.2k · #12528

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/vudovn/ag-kit/blob/main/.agents/skills/code-review-graph/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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:

  1. Step 1: Check if the tool is installed: Get-Command code-review-graph (Windows) or which code-review-graph (macOS/Linux).
  2. Step 2: Check if a .code-review-graph/ directory exists in the workspace.
  3. Step 3: If installed but the index is missing, ask the user before running code-review-graph build (it scans the whole project).
  4. Step 4: If not installed and the project is large, ask the user: "Would you like to pip install code-review-graph and 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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬