← ClaudeAtlas

test-impact-graphlisted

Use this skill to identify which tests are impacted by a code change — the diff-to-tests reverse dependency graph (TDAD pattern). Triggers on phrases like "which tests should I run", "test impact for this diff", "skip tests that don't matter", or after a refactor when the user wants to skip running the full suite. Reads a Python codebase and computes the transitive set of test files that import (directly or via intermediate modules) the changed source files. Output: a list of test files (paths) to run, with the import chain that connects each test to a changed file. Reduces typical CI loops 5-10x for diff-scoped changes.
neuralforge-labs/tlmforge · ★ 4 · Code & Development · score 55
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