Fast read of a repo's import graph and hidden seams. Shows static dependents, covering tests, existing owners, plus non-imported peers linked by git co-change, contract tags, or shared env and data-file names. Use before editing a shared file or adding a helper, client or store.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Graph?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/sgathrid-graph)
---
name: graph
description: Fast read of a repo's import graph and hidden seams. Shows static dependents, covering tests, existing owners, plus non-imported peers linked by git co-change, contract tags, or shared env and data-file names. Use before editing a shared file or adding a helper, client or store.
---
# Graph
A fast read of static imports and three non-import seam signals, for the moments a text search answers slowly or only in part. It needs `node`, and `git` for `--diff` and co-change history.
```sh
G="${CLAUDE_PLUGIN_ROOT}/scripts/graph.mjs"
node "$G" --impact <file> [file2...] # before editing: dependents, tests, contracts, co-changed & boundary peers
node "$G" --owners <word> # before adding a helper: files and exports that already own the concept
node "$G" --diff [base] # before shipping: cycles, boundary crossings, hubs, untouched peers
node "$G" --cycles # every runtime import cycle
node "$G" --help # also supports --all, --json, --cwd <dir>, --fan-in <n>
```
## Reading the output
- `tests (N)` lists nearest static-import tests first; `boundary tests (N)` adds integration or e2e tests linked by a shared env var or data filename.
- `contracts (N)` lists peers declared via `LINT.IfChange`/`LINT.ThenChange` (one-way, can target docs or configs) or `@seam <id>` comments (symmetric across source and test files).
- `co-changed (no import)` lists non-imported files that historically changed with the target (`shared/target`, `shared/peer`). Check them for shared formats, commands or mirrored adapters.
- `shared boundaries (no import)` lists non-dependent peers in other modules or languages sharing an env var or data filename (`*.json`, `*.jsonl`, `*.lock`, `*.sock`, `*.db`, `*.sqlite`). `skipped common boundaries` names shared tokens dropped as too common to list; grep those directly if you edit them.
- Re-run `--impact` on any relevant `co-changed` or `shared boundaries` peer to see its own dependents and tests.
- In `--diff`, `high fan-in hubs touched` flags widely imported files, and `untouched contracts`, `untouched co-changed peers` (`>= 40%` of the changed file's commits) and `untouched boundary peers` flag likely forgotten twins.
- A `note:` line counts unresolved imports; treat those files as unseen. `clean` means no graph or seam finding, not that the change is safe.
- `--owners` searches file paths and exported symbols only (not env vars or literals) and splits camel, snake and kebab names; one distinctive word works best.
## One instrument
It sees static imports, git co-change, declared contract tags, and shared env or data-file names. It does not see arbitrary wire strings, runtime hook or event ordering, semantic drift under matching formats, or whether the design is right. Read the peers it surfaces and grep for any command or wire literal you spot in the code.