Skill · Published 2026-08-10

dependency-graph

Download dependency-graph.zip 97% test coverage Ported from dependency_graph

A Claude Skill for reviewing a change: which files does this specific change actually touch, not “what’s the overall shape of this repo” (that’s repo-map, a different, complementary tool).

What it does

python3 dependency_graph.py <src-dir>
python3 dependency_graph.py <src-dir> --blast-radius path/to/changed.ts,path/to/other.py

Builds a first-party import graph, then reverse-BFSes from a changed-file set to every file that transitively imports from it — the minimal touched-file set a review should actually consider.

60 languages get a real, resolved edge — Rust, JS/TS, Python, Go, Java/Kotlin/Scala/Groovy, C#, Haskell, Ruby, PHP, C/C++/CUDA, Objective-C, Perl, PowerShell, Crystal, Nim, Lua, Elixir, shell/Fish/Tcl, Vue, Astro, Svelte, R, Julia, Zig, Solidity, Erlang, Racket, PureScript, Idris, Elm, Agda, Haxe, D, AWK, CMake, Prolog, Gleam, Makefile, LaTeX, Nix, Clojure, Common Lisp, Verilog/SystemVerilog, Jsonnet, F#, VB.NET, Fortran, Pascal/Delphi, Ada, and GDScript — each resolved through its own real resolution family (a language’s own import syntax genuinely differs in how it resolves to a file; one generic resolver would silently mis-report blast radius for languages it doesn’t actually fit). Bazel/Starlark’s own load("//path:file.bzl", ...) resolves too — BUILD, BUILD.bazel, WORKSPACE, WORKSPACE.bazel, MODULE.bazel, and .bzl library files all participate, with labels resolved against a discovered workspace root (closer to Go’s own module-root-relative resolution than a plain relative path); CMakeLists.txt reuses the identical mechanism CMake’s own .cmake library files use, and Makefile/makefile/GNUmakefile reuse the identical mechanism .mk library files use — GNU Make’s own include/ -include/sinclude directives, scoped deliberately to a same-directory bareword sibling only, since real GNU Make resolves against its own current working directory rather than the including file’s directory the way CMake does. Gleam got a real family a batch earlier — gleam.toml turned out to be exactly the kind of anchor go.mod already is, closing a gap this project’s own prior notes had stated as unresolvable. LaTeX’s own \input{/\include{ (extension optional, real LaTeX itself appends .tex when omitted) resolves too — a curly-brace-delimited argument rather than a quoted or parenthesized one, which needed the shared bareword-scan machinery to learn a new stop character (}), verified safe for every other bareword-tolerant language in this table. Nix’s own import <path> resolves too, but not through that same shared machinery — it’s the first family here with no quoted form at all and no extension-appending fallback (real Nix has none: import ./foo where only ./foo.nix exists on disk, and ./foo isn’t a directory, is a hard error, not a resolvable reference). What real Nix does support — import ./some-dir resolving to ./some-dir/default.nix — gets its own small resolver instead, since every other family’s directory fallback uses index.<ext>, a different fixed filename than Nix’s own convention. Dozens more extensions repo-map recognizes (Swift, Standard ML, Vala, GraphQL, Protobuf, and the rest) are still walked and included as graph nodes — never silently dropped — they simply don’t have a per-file signal to resolve into an edge.

Ten more languages joined in one batch: Clojure’s (:require [my.app.utils :as u] my.app.bare) resolves with its own real filename convention (a namespace segment’s hyphens become underscores) and real paren/bracket depth tracking, since a :require clause commonly spans several lines. Common Lisp’s (load "..."), Verilog/SystemVerilog’s `include "...", and Jsonnet’s import "..." all resolve too — Jsonnet is a real, self-caught correction of this project’s own prior claim that it was a schema format with no per-file signal, the same kind of reversal Gleam’s own family got a batch earlier. F#’s open, VB.NET’s Imports, Fortran’s use, and Pascal/Delphi’s uses (a real clause that commonly wraps across several lines) all resolve against a declared qualified name, the same family C#/Haskell already use. Ada’s with Package.Name; resolves through GNAT’s own real lowercase-hyphenated filename convention, and GDScript’s preload/load/extends "res://..." resolve against a discovered project.godot project root — both genuinely dedicated families, the same call Nix’s own family made a batch earlier.

Ten more joined the batch after that. OCaml and ReScript share a genuinely dedicated family: both implicitly define a module per file (the filename stem, capitalized), so open ModuleName resolves by lowercasing the name and searching for a matching file. CoffeeScript, Vim script, Assembly (NASM’s %include/GNU as’s .include), and Pug all joined as near-free extensions of the existing quoted-relative-path shape. SCSS and Sass got their own dedicated family instead of a generic one, because real Sass resolves @import "vars" against either vars.scss or the real underscore-prefixed partial convention _vars.scss — the actual common case in real Sass code, and a filename transform the generic resolver has no way to attempt. Terraform’s own module "x" { source = "../modules/foo" } also got a dedicated family: a real local module reference (Terraform’s own docs require ./ or ../) resolves to an entire directory of .tf files, the same shape Go’s own package resolution already has. A related, real, self-caught fix landed the same batch: twelve config/data formats repo-map had always given real symbols to — YAML, JSON, TOML, INI/.cfg/.conf, CSV/TSV, XML, .properties, Markdown, plus .tf/.tfvars/.hcl themselves — had never been walked as graph nodes at all, an invisible gap until this batch’s own Terraform work surfaced it.

Where this came from

Ported from PinkyAI’s own dependency_graph engine module, re-implemented independently in dependency-free Python with its own full test suite — currently at 97%+ statement coverage across 228 tests.

Honest scope

Import edges only — a first-party import-declaration graph, not a call graph, inheritance graph, test-coverage correlation, or semantic search, in any language. Only first-party edges are ever recorded; external package/crate imports are never counted (Bazel’s own @repo//... external-workspace references included). This port also trades the source’s real tree-sitter grammars for hand-written text scanning (kept dependency-free) — it won’t distinguish a real import from the same text sitting inside a comment or string literal, which a real parser doesn’t get wrong.

Preview the real source

Read straight out of this skill's own source directory, unedited — the exact bytes that ship inside dependency-graph.zip, not a rewritten excerpt. Switch tabs to read a file before downloading, or use Copy to paste it somewhere else.

Choose a file to preview

← Back to skills