test-impact-graphlisted
Install: claude install-skill neuralforge-labs/tlmforge
# Test impact graph (TDAD)
When you change `backend/auth/token.py`, you don't need to run the entire 500-test suite to
know whether the change broke something — you need to run exactly the tests that import
`token.py` (directly or transitively). This skill builds that import graph and returns the
impacted set.
## When to use
**Triggers:**
- "Which tests should I run after this diff?"
- "Test impact for these files."
- "Skip tests that aren't affected."
- After a refactor, when the user wants to confirm nothing broke without paying for the full suite
**When NOT to use:**
- Pure UI changes (Playwright/E2E tests don't follow Python imports — fall back to running the relevant E2E suite manually)
- Changes to test infrastructure (conftest.py, fixtures) — these affect EVERY test by definition; run the full suite
- Diff includes config/yaml/json files that are loaded at test runtime — the analyzer can't see runtime loads, so be conservative
## How it works
1. **Parse all `.py` files in the project** with Python's `ast` module
2. **For each file, extract its `import X`, `from X import Y`** statements as edges in a graph
3. **Resolve module paths to file paths** using the project's package layout
4. **Reverse the graph**: for each module, list the test files that depend on it (transitively)
5. **Given a list of changed files**, return the union of impacted test files
The skill ships with `analyzer.py` — a self-contained Python script that takes `--src-root`
and `--changed-files