Impact

From mbwsims/claude-universe · View interactive version

Impact is an AI agent skill from the GitHub repository mbwsims/claude-universe. This skill should be used when the user asks to "check the impact", "what will break if I change this", "blast radius", "impact analysis", "what depends on this", "who imports this", "is it safe to change this", mentions "/impact", or wants to understand the consequences of modifying a specific file

How to use this skill

Skill file

Impact Analysis

Before changing a file, understand the blast radius. What depends on it? What tests cover

it? What breaks if you change its API? This skill prevents the "I changed one file and

broke 12 others" problem.

Workflow

1. Identify the Target

Read the target file. Understand what it exports:

2. Find Direct Dependents

With lenskit-mcp (preferred): Call lenskit_graph to get the full dependency graph.

Extract direct and transitive dependents from the graph data. Also call lenskit_analyze

on the target file for metrics (churn, complexity, coupling).

If lenskit tools are unavailable: Build the dependency data manually:

Grep for files that import from the target:

grep -rl "from.*{module-path}" src/

For each importer, note WHAT they import (which specific exports they use).

3. Find Transitive Dependents

With lenskit_graph data (preferred): Use the graph edges to traverse transitive

dependents programmatically. Starting from the target file, follow all incoming edges

(files that import it), then follow THEIR incoming edges, up to 3 levels deep.

target.ts
  <- service.ts (imports: functionA, TypeB)
    <- handler.ts (imports: service)
      <- route.ts (imports: handler)

The deeper the chain, the wider the blast radius.

Without lenskit_graph: Build the transitive chain manually with iterative grep:

# Level 1: direct importers of the target
grep -rl "from.*target-module" src/ --include="*.ts" --include="*.tsx"

# Level 2: for each Level 1 result, find ITS importers
grep -rl "from.*service" src/ --include="*.ts" --include="*.tsx"

# Level 3: repeat for Level 2 results (stop here — deeper is diminishing returns)

Substitute the actual module names at each level. Stop at 3 levels — transitive

impact beyond that is noise for most decisions. If you find more than 20 transitive

dependents, note the count but focus the report on the direct dependents and the

highest-risk transitive paths.

Type-only imports: Distinguish between value imports and type-only imports:

won't break this importer. Only type signature changes matter.

this importer.

When reporting dependents, annotate which ones are type-only. These have lower

risk and don't need runtime testing when only implementation changes.

Circular dependency handling: If the graph data shows the target file is part of

a circular dependency cycle, flag this prominently:

dependency injection, or restructure to remove the circularity)

in both directions

4. Find Test Coverage

Search for tests that cover the target file:

Note: if there are NO tests covering the target, that's a critical finding — changes

are unprotected.

5. Assess Risk by Export

For each export from the target file:

| Export | Importers | Tests | Risk |

|--------|-----------|-------|------|

| functionA | 8 files | 3 tests | High — widely used, partially tested |

| TypeB | 12 files | N/A (type) | Medium — type change affects many files |

| CONSTANT_C | 2 files | 0 tests | Low — few users, but untested |

6. Present the Analysis

Report format:

## Impact Analysis — {file}

### Exports
{List of everything this file exports}

### Dependency Graph

{file}
  ← {n} direct importers
    ← {n} transitive (2 levels deep)

### Direct Dependents

| File | Imports | Has Tests |
|------|---------|-----------|
| src/api/handler.ts | functionA, TypeB | Yes |
| src/lib/service.ts | functionA | No |
| ... |

### Test Coverage
- Direct tests: {file or "none"}
- Tests importing this file: {count}
- Untested dependents: {list}

### Risk Assessment

**Safe to change:**
- Internal implementation (no API change) — {n} dependents unaffected
- TypeB (only used as type annotation) — compile-time check catches issues

**Risky to change:**
- functionA signature — 8 files depend on current API, 3 are untested
- Default export — if renamed, all {n} importers break

### Recommendations
{What to do before making changes: add tests, update dependents, etc.}

Related Skills

Guidelines

affected than one that calls a function.

and interface changes (risky — signature, return type, behavior change).

higher risk.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.