Skill · Published 2026-08-09

dependency-diagram

Download dependency-diagram.zip 100% test coverage Ported from dependency_graph + repo_map (composed)

A Claude Skill for the moment prose stops being the right format: see a codebase’s shape instead of reading a description of it. Drop the output straight into a PR description, an ADR, or a design doc.

What it does

Renders one diagram from two things at once — which files depend on which, and what each file exposes:

python3 dependency_diagram.py <src-dir>                        # Mermaid classDiagram (default)
python3 dependency_diagram.py <src-dir> --style block           # Mermaid flowchart, boxes only
python3 dependency_diagram.py <src-dir> --focus path/to/file.rs  # one file's direct neighborhood only

--style class (default) shows each file as a block with its top-level symbols as members and dependency edges as arrows — dependencies and interfaces in one picture. --style block drops the member detail for a plainer boxes-and-arrows view once a tree has too many files for the class style to stay readable. Both are plain Mermaid text — paste straight into a ```mermaid fence anywhere that renders it.

Multi-language: every language repo-map recognizes (90 languages) gets a real box with its real top-level symbols; every language dependency-graph has a resolver for (70 of those 90) also gets real, resolved wires between boxes — not just Rust. A Python file with a real relative import and a Rust file with a real use statement now both draw real arrows in the same diagram.

Where this came from

Unlike this bundle’s other skills, not a 1:1 port of one PinkyAI engine module — there’s no diagram-rendering mechanism in the engine beyond this same composition. Built by carrying in dependency-graph’s and repo-map’s own current algorithms — regenerated directly from their current source whenever either changes, not hand-copied once and left to drift (each skill here ships as an independent download, so importing across skill directories isn’t an option). Its own fresh test suite, covering this skill’s own composition logic specifically, is currently at 100% statement coverage.

Honest scope

Inherits both source skills’ limits, since it runs their exact logic: node coverage (90 languages) is wider than edge coverage (70), by design — a file in a language dependency-graph has no resolver for still gets an accurate box, just no wires, the honest choice over a confident-looking edge from a resolver that doesn’t exist. First-party edges only, a brace-depth/keyword text scanner (not a real grammar) for imports, and a per-line regex heuristic (not a real parser) for symbols. --focus shows one file’s direct neighbors only — for a full transitive blast radius, use dependency-graph itself.

Preview the real source

Read straight out of this skill's own source directory, unedited — the exact bytes that ship inside dependency-diagram.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