Graph build

From athola/claude-night-market · View interactive version

Graph build is an AI agent skill from the GitHub repository athola/claude-night-market. 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.

How to use this skill

Skill file

Build Code Knowledge Graph

Build or update the .gauntlet/graph.db knowledge graph

for the current codebase.

Steps

  1. Detect target: Use the current working directory

or a user-specified path.

  1. Check for existing graph: If .gauntlet/graph.db

exists, run an incremental update. Otherwise, run a

full build.

  1. Run the build script:

For full build:

```bash

uv run --project ${CLAUDE_PLUGIN_ROOT} python \

${CLAUDE_PLUGIN_ROOT}/scripts/graph_build.py <dir>

```

For incremental update:

```bash

uv run --project ${CLAUDE_PLUGIN_ROOT} python \

${CLAUDE_PLUGIN_ROOT}/scripts/graph_build.py <dir> --incremental

```

The build runs in the plugin's own environment because

a system python3 may lack tree-sitter. Without it a

build exits 2 with an error key rather than reporting

files it did not parse.

An incremental update diffs against --base-ref, which

defaults to the commit of the last successful build.

Commits made since then are re-parsed. A graph built

before that commit was recorded falls back to HEAD,

which covers uncommitted changes only: run a full build

once.

  1. Report results: Show the JSON output including

files parsed, nodes created, edges created, and

duration.

  1. Suggest next steps: Recommend searching the graph

or running blast radius analysis.

When To Use

When NOT To Use

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

unchanged files

CALLS target was found: exact (module qualifier, self/cls

scope, or a unique definition in the caller's plugin), name_guess

(a method picked by bare name on a receiver of unknown type, a

unique definition in another plugin, or a bare call that

matched several definitions and only one sits in the caller's

own plugins/<name>/, as with vendored copies), or empty (declared

edge, external call, or a row from a graph built before the

column existed). Treat name_guess edges as unconfirmed: blast

radius lists them under name_guess_callers. A

database lacking the column gains it when opened. Its old edges

stay empty until a full build, and blast radius sets

graph_predates_resolution while the last full build is older

than 1.10.4.

in the metadata table; an incremental build leaves it

alone. At session start, a graph built by an older

version is rebuilt in the background (log:

.gauntlet/rebuild.log). Opt out with

rebuild_on_upgrade: false in .gauntlet/config.yaml or

.gauntlet/config.json.

build exits 75 without touching the graph.

Exit Criteria

the skill completes; .gauntlet/.gitignore exists to prevent

the database from being committed

nodes_created, edges_created, duration; values are

non-zero for non-empty codebases

exists (script invoked with --incremental); full build only

on first run

or run blast-radius analysis

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.