Graph Tools

Graph Tools

trac3r00 e808218 2 files · 5.0 KB Updated

File contents

Graph Tools

Every dependency chain is an edge list until someone makes it queryable.

Commands

python3 scripts/graph_tools.py deps.json --stats
python3 scripts/graph_tools.py deps.json --path ui database
python3 scripts/graph_tools.py deps.json --fail-on-cycle   # CI: assert DAG

Input

{"edges": [["ui", "api"], ["api", "db"], ["db", "cache"]]}

Reports

  • Node/edge counts, in/out degree per node (--stats)
  • Cycles as readable paths (a -> b -> c -> a), exit 1 when found
  • Shortest path via BFS (--path FROM TO), exit 1 when none
  • --fail-on-cycle for CI gates on pipelines, imports, migrations

Pairs with

gate-graph (module overlap via AST fingerprints — the code-level view; this is the structure-level view), json-diff (compare two graph snapshots).

trac3r00/agent-skills/tree/main/skills/graph-tools commit e808218188

Frequently asked questions

npx skillmds@latest add trac3r00/graph-tools