Test Impact Graph
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 f...
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 (pat...
Install
Quick install
npx skills add https://github.com/neuralforge-labs/tlmforgenpx skills add neuralforge-labs/tlmforge --agent claude-codenpx skills add neuralforge-labs/tlmforge --agent cursornpx skills add neuralforge-labs/tlmforge --agent codexnpx skills add neuralforge-labs/tlmforge --agent opencodenpx skills add neuralforge-labs/tlmforge --agent github-copilotnpx skills add neuralforge-labs/tlmforge --agent windsurfMore install options
Shorthand — useful for multi-skill repos:
npx skills add neuralforge-labs/tlmforgeManual — clone the repo and drop the folder into your agent's skills directory:
git clone https://github.com/neuralforge-labs/tlmforge.gitcp -r tlmforge ~/.claude/skills/Test Impact Graph
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 (pat...
---
name: test-impact-graph
description: |
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.
---
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 importtoken.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
- Parse all
.pyfiles in the project with Python'sastmodule - For each file, extract its
import X,from X import Ystatements as edges in a graph - Resolve module paths to file paths using the project's package layout
- Reverse the graph: for each module, list the test files that depend on it (transitively)
- 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 and emits the impacted test list.
Usage
$ python3 ~/.claude/skills/test-impact-graph/analyzer.py \
--src-root ~/myproject/backend \
--tests-root ~/myproject/backend/tests \
--changed-files backend/auth/token.py backend/payments/billing.py
backend/tests/test_auth_token.py
backend/tests/test_login_flow.py
backend/tests/test_billing_lifecycle.py
# 3 tests impacted (vs 487 in full suite — 162x reduction)
Wire into the user's CI / dev loop:
# In a pre-push hook or local script
changed=$(git diff --name-only HEAD)
impacted=$(python3 ~/.claude/skills/test-impact-graph/analyzer.py \
--src-root . --tests-root ./tests --changed-files $changed)
pytest $impacted
Limitations (acknowledge upfront)
- Static analysis only. Dynamic imports (
importlib.import_module(name),__import__)
- Python only. Flutter/Dart, JavaScript, etc. need their own analyzer. Not in scope here.
- conftest.py and fixture changes. Pytest fixtures cross test files via shared discovery.
conftest.py or tests/fixtures/* as "run the full suite."
- External imports. Changes in third-party packages aren't in your repo, so the analyzer
pip install -U + full-suite-run for dependency upgrades.
When the analyzer's output looks wrong
- Test you expected to be impacted is missing → check whether your code uses a dynamic import
- Test you didn't expect → check whether a transitive dependency exists you forgot about (often signals coupling worth refactoring)
- Empty result on a real diff → the changed file probably isn't imported anywhere; either it's dead code or the analyzer's source-root config is wrong
Calibration discipline
- Always run the impacted tests; don't skip them.
- If the impacted set is small (1-3 tests) on a non-trivial diff, double-check by running the full suite once before merging — a too-small impacted set is a signal of a bug in the analyzer or unusual import patterns.
- For security-touching diffs (auth, encryption, payments), run the full suite regardless. The cost saving isn't worth the risk.
---
Source: https://github.com/neuralforge-labs/tlmforge
Author: neuralforge-labs
Discovered via: skillsdirectory.com
Genre: development
SKILL.md source
---
name: Test Impact Graph
description: 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 f...
---
# Test Impact Graph
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 (pat...
---
name: test-impact-graph
description: |
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.
---
# 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` and emits the impacted test list.
## Usage
```bash
$ python3 ~/.claude/skills/test-impact-graph/analyzer.py \
--src-root ~/myproject/backend \
--tests-root ~/myproject/backend/tests \
--changed-files backend/auth/token.py backend/payments/billing.py
backend/tests/test_auth_token.py
backend/tests/test_login_flow.py
backend/tests/test_billing_lifecycle.py
# 3 tests impacted (vs 487 in full suite — 162x reduction)
```
Wire into the user's CI / dev loop:
```bash
# In a pre-push hook or local script
changed=$(git diff --name-only HEAD)
impacted=$(python3 ~/.claude/skills/test-impact-graph/analyzer.py \
--src-root . --tests-root ./tests --changed-files $changed)
pytest $impacted
```
## Limitations (acknowledge upfront)
- **Static analysis only.** Dynamic imports (`importlib.import_module(name)`, `__import__`)
are invisible. If your code does runtime metaprogramming, the impact graph misses tests
that exercise that code path. Workaround: maintain an explicit "always-run-these" list.
- **Python only.** Flutter/Dart, JavaScript, etc. need their own analyzer. Not in scope here.
- **conftest.py and fixture changes.** Pytest fixtures cross test files via shared discovery.
Treat any change to `conftest.py` or `tests/fixtures/*` as "run the full suite."
- **External imports.** Changes in third-party packages aren't in your repo, so the analyzer
doesn't see them. Use `pip install -U` + full-suite-run for dependency upgrades.
## When the analyzer's output looks wrong
- Test you expected to be impacted is missing → check whether your code uses a dynamic import
- Test you didn't expect → check whether a transitive dependency exists you forgot about (often signals coupling worth refactoring)
- Empty result on a real diff → the changed file probably isn't imported anywhere; either it's dead code or the analyzer's source-root config is wrong
## Calibration discipline
- Always run the impacted tests; don't skip them.
- If the impacted set is small (1-3 tests) on a non-trivial diff, double-check by running the full suite once before merging — a too-small impacted set is a signal of a bug in the analyzer or unusual import patterns.
- For security-touching diffs (auth, encryption, payments), run the full suite regardless. The cost saving isn't worth the risk.
---
**Source**: https://github.com/neuralforge-labs/tlmforge
**Author**: neuralforge-labs
**Discovered via**: skillsdirectory.com
**Genre**: development
Related skills 6
caveman
Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.
secure-linux-web-hosting
Use when setting up, hardening, or reviewing a cloud server for self-hosting, including DNS, SSH, firewalls, Nginx, static-site hosting, reverse-proxying an app, HTTPS with Let's Encrypt or ACME clients, safe HTTP-to-HTTPS redirects, or optional post-launch network tuning such as BBR.
readme-i18n
Use when the user wants to translate a repository README, make a repo multilingual, localize docs, add a language switcher, internationalize the README, or update localized README variants in a GitHub-style repository.
lark-shared
Use when first setting up lark-cli, running auth login, switching user/bot identity (--as), handling permission denied or scope errors, needing to update lark-cli, or seeing _notice in JSON output.
improve-codebase-architecture
Find deepening opportunities in a codebase, informed by the domain language in CONTEXT.md and the decisions in docs/adr/. Use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.
paper-context-resolver
Optional RigorPilot helper for README-first deep learning repo reproduction. Use only when the README and repository files leave a narrow reproduction-critical gap and the task is to resolve a specific paper detail such as dataset split, preprocessing, evaluation protocol, checkpoint mapping, or runtime assumption from primary paper sources while recording conflicts. Do not use for general paper summary, repo scanning, environment setup, command execution, title-only paper lookup, or replacin...