The analyze_impact tool helps you understand the risk and scope of modifying a file. Before making changes, use it to see what other files would be affected and get a risk score that reflects the potential impact.
Stellarion uses BFS (Breadth-First Search) graph traversal on the dependency graph to find all files that depend on the target file, both directly and transitively. It then calculates a risk score based on file importance, criticality, and the number of affected files.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
path | string | Yes | - | File path to analyze impact for |
includeTransitive | boolean | No | true | Include indirect dependencies |
includeCategories | boolean | No | false | Categorize affected files by type |
detectCircular | boolean | No | false | Check for circular dependencies |
maxDepth | number | No | 5 | Maximum depth for transitive analysis |
excludeTests | boolean | No | false | Exclude test files from analysis |
excludeNodeModules | boolean | No | true | Exclude node_modules from analysis |
mcp__stellarion__analyze_impact path:src/core/engine.ts includeCategories:true detectCircular:true
Natural Language:
What would be affected if I change src/services/auth.ts?
Direct MCP Call:
mcp__stellarion__analyze_impact path:src/services/auth.ts
Returns: All files that depend on auth.ts, directly and indirectly, with risk score
Natural Language:
Analyze the impact of changing src/db/connection.ts and group the affected files by type
Direct MCP Call:
mcp__stellarion__analyze_impact path:src/db/connection.ts includeCategories:true
Returns: Affected files grouped into components, services, utilities, and tests
Natural Language:
What production files would be affected if I change this utility?
Direct MCP Call:
mcp__stellarion__analyze_impact path:src/utils/helpers.ts excludeTests:true
Returns: Only production file impact, excluding test files
Natural Language:
What's the risk of modifying src/core/engine.ts?
Direct MCP Call:
mcp__stellarion__analyze_impact path:src/core/engine.ts includeCategories:true detectCircular:true
Returns: Risk score with detailed breakdown of factors
Natural Language:
Show me the immediate impact of changing this file (just direct dependencies)
Direct MCP Call:
mcp__stellarion__analyze_impact path:src/api/routes.ts maxDepth:1
Returns: Only directly dependent files, not transitive dependencies
Natural Language:
If I change this file, would it trigger any circular dependency issues?
Direct MCP Call:
mcp__stellarion__analyze_impact path:src/services/user.ts detectCircular:true
Returns: Impact analysis plus any circular dependencies in the impact chain
| Field | Description |
|---|---|
| Direct dependents | Files that directly import this file |
| Transitive dependents | Files that indirectly depend on this file |
| Total affected count | Number of files that would be affected |
| Affected file list | Paths of all affected files |
A score from 0.0 to 1.0 calculated from multiple factors:
| Factor | Weight | Description |
|---|---|---|
| File importance | +0.3 | Is it index.ts, main.ts, or app.ts? |
| Critical file | +0.3 | Is it config, database, or auth related? |
| Affected count | up to +0.4 | How many files depend on it? |
| Test file | -0.3 | Test files reduce risk |
| Score Range | Level | Recommendation |
|---|---|---|
| 0.0 - 0.3 | Low | Safe to modify with basic testing |
| 0.3 - 0.5 | Medium | Review carefully, test affected areas |
| 0.5 - 0.7 | High | Thorough testing needed, consider incremental changes |
| 0.7 - 1.0 | Critical | Extra caution required, plan for regression testing |
Files are grouped into:
| Category | Description |
|---|---|
| Components | UI components, React/Vue components |
| Services | Business logic, API services |
| Utilities | Helper functions, shared utilities |
| Tests | Test files, spec files |
| Configuration | Config files, environment setup |
excludeTests: true for production impact: Focus on what matters for usersBefore making changes:
# 1. Check impact
mcp__stellarion__analyze_impact path:src/core/auth.ts includeCategories:true
# 2. If high risk, check complexity
mcp__stellarion__analyze_quality type:complexity path:src/core/auth.ts
# 3. Understand dependencies
mcp__stellarion__analyze_structure type:dependencies path:src/core/auth.ts
# 4. Plan changes with full context