Build Code Knowledge Graph
Build or update the .gauntlet/graph.db knowledge graph
for the current codebase.
Steps
Detect target: Use the current working directory
or a user-specified path.
Check for existing graph: If .gauntlet/graph.db
exists, run an incremental update. Otherwise, run a
full build.
Run the build script:
For full build:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/graph_build.py <dir>
For incremental update:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/graph_build.py <dir> --incremental
Report results: Show the JSON output including
files parsed, nodes created, edges created, and
duration.
Suggest next steps: Recommend searching the graph
or running blast radius analysis.
When To Use
- At the start of a session to build structural awareness
- After significant code changes to update the graph
- Before running blast radius analysis or flow tracing
- When the user asks about codebase structure
When NOT To Use
- Querying a graph that already exists (use
gauntlet:graph-search)
- Building the challenge knowledge base (use
gauntlet:extract)
What Gets Parsed
The graph extracts nodes (File, Class, Function, Type,
Test) and edges (CALLS, IMPORTS_FROM, INHERITS, CONTAINS,
IMPLEMENTS, TESTED_BY) from 20+ languages including
Python, JavaScript, TypeScript, Go, Rust, Java, C/C++,
Ruby, and PHP.
Storage
- Database:
.gauntlet/graph.db (SQLite with WAL mode)
- Auto-creates
.gauntlet/.gitignore to prevent commits
- Incremental updates use SHA-256 hashing to skip
unchanged files
Exit Criteria
Source: athola/claude-night-market → plugins/gauntlet/skills/graph-build/SKILL.md
1---2name: graph-build3description: Builds or updates the code knowledge graph via tree-sitter AST and SQLite. Use when setting up the graph before search or blast-radius analysis.4---5
6
7# Build Code Knowledge Graph
8
9Build or update the `.gauntlet/graph.db` knowledge graph
10for the current codebase.
11
12## Steps
13
141. **Detect target**: Use the current working directory
15 or a user-specified path.
16
172. **Check for existing graph**: If `.gauntlet/graph.db`
18 exists, run an incremental update. Otherwise, run a
19 full build.
20
213. **Run the build script**:
22
23 For full build:
24 ```bash
25 python3 ${CLAUDE_PLUGIN_ROOT}/scripts/graph_build.py <dir>
26 ```
27
28 For incremental update:
29 ```bash
30 python3 ${CLAUDE_PLUGIN_ROOT}/scripts/graph_build.py <dir> --incremental
31 ```
32
334. **Report results**: Show the JSON output including
34 files parsed, nodes created, edges created, and
35 duration.
36
375. **Suggest next steps**: Recommend searching the graph
38 or running blast radius analysis.
39
40## When To Use
41
42- At the start of a session to build structural awareness
43- After significant code changes to update the graph
44- Before running blast radius analysis or flow tracing
45- When the user asks about codebase structure
46
47## When NOT To Use
48
49- Querying a graph that already exists (use `gauntlet:graph-search`)
50- Building the challenge knowledge base (use `gauntlet:extract`)
51
52## What Gets Parsed
53
54The graph extracts nodes (File, Class, Function, Type,
55Test) and edges (CALLS, IMPORTS_FROM, INHERITS, CONTAINS,
56IMPLEMENTS, TESTED_BY) from 20+ languages including
57Python, JavaScript, TypeScript, Go, Rust, Java, C/C++,
58Ruby, and PHP.
59
60## Storage
61
62- Database: `.gauntlet/graph.db` (SQLite with WAL mode)
63- Auto-creates `.gauntlet/.gitignore` to prevent commits
64- Incremental updates use SHA-256 hashing to skip
65 unchanged files
66
67## Exit Criteria
68
69- [ ] `.gauntlet/graph.db` exists and is a valid SQLite file after
70 the skill completes; `.gauntlet/.gitignore` exists to prevent
71 the database from being committed
72- [ ] Build report JSON includes all four keys: `files_parsed`,
73 `nodes_created`, `edges_created`, `duration`; values are
74 non-zero for non-empty codebases
75- [ ] Incremental update path used when `.gauntlet/graph.db` already
76 exists (script invoked with `--incremental`); full build only
77 on first run
78- [ ] Next-step suggestions presented to the user: search the graph
79 or run blast-radius analysis
80
81---
82
83**Source:** [`athola/claude-night-market`](https://github.com/athola/claude-night-market) → `plugins/gauntlet/skills/graph-build/SKILL.md`