---
name: Build Graph
slug: build-graph
category: Quality
description: Build Graph initializes or incrementally updates a persistent code review knowledge graph for a repository via MCP tools. Use it for first-time setup, after major refactoring, or when the graph is stale; hooks normally keep it updated automatically.
github: "https://github.com/tirth8205/code-review-graph/tree/main/skills/build-graph"
language: Python
stars: 30048
forks: 2760
install: "npx degit https://github.com/tirth8205/code-review-graph/tree/main/skills/build-graph ~/.claude/skills/build-graph"
installs_to: ~/.claude/skills/build-graph
source_path: skills/build-graph/SKILL.md
collection_size: 7
category_size: 1354
collection_url: "https://dirskills.com/collections/tirth8205/code-review-graph"
added: 2026-08-14T07:11:47.472Z
last_synced: 2026-08-14T07:11:47.472Z
canonical_url: "https://dirskills.com/skills/build-graph"
---

# Build Graph

Build Graph initializes or incrementally updates a persistent code review knowledge graph for a repository via MCP tools. Use it for first-time setup, after major refactoring, or when the graph is stale; hooks normally keep it updated automatically.

**Install:**

```bash
npx degit https://github.com/tirth8205/code-review-graph/tree/main/skills/build-graph ~/.claude/skills/build-graph
```

## README

# Build Graph

Build or incrementally update the persistent code knowledge graph for this repository.

## Steps

1. **Check graph status** by calling the `list_graph_stats_tool` MCP tool.
   - If the graph has never been built (last_updated is null), proceed with a full build.
   - If the graph exists, proceed with an incremental update.

2. **Build the graph** by calling the `build_or_update_graph_tool` MCP tool:
   - For first-time setup: `build_or_update_graph_tool(full_rebuild=True)`
   - For updates: `build_or_update_graph_tool()` (incremental by default)

3. **Verify** by calling `list_graph_stats_tool` again and report the results:
   - Number of files parsed
   - Number of nodes and edges created
   - Languages detected
   - Any errors encountered

## When to Use

- First time setting up the graph for a repository
- After major refactoring or branch switches
- If the graph seems stale or out of sync
- The graph auto-updates via hooks on edit/commit, so manual builds are rarely needed

## Notes

- The graph is stored as a SQLite database (`.code-review-graph/graph.db`) in the repo root
- Binary files, generated files, and patterns in `.code-review-graphignore` are skipped
- Supported languages: Python, TypeScript/JavaScript, Vue, Go, Rust, Java, Scala, C#, Ruby, Kotlin, Swift, PHP, Solidity, C/C++
