analyze_change_impact
Calculate change blast radius scores (0-100) and identify downstream dependents before modifying or deleting a function, class, or module to assess refactoring risk.
Instructions
Calculates change blast radius score (0-100) and identifies downstream dependents before modifying or deleting a target function, class, or module, distinguishing from 'analyze_code_dependencies' and 'audit_code_quality' by calculating targeted refactoring risk scores rather than mapping overall import graphs or profiling code complexity.
Parameters:
target_symbol(str, required): Name of the function, class, or method being modified or refactored.project_root(str, optional, default='.'): Root directory of the repository (default: current directory).file_path(str, optional, default=''): Optional file path where the target symbol is defined.
Behavior:
Read-only: Scans workspace AST and dependency graphs; does not alter files.
Idempotent: Deterministic blast radius scoring for identical repository states.
100% Offline: Local AST caller/callee traversal without remote API calls.
Auth & Rate Limits: Zero authentication or API keys required; completes in <300ms.
Error Handling: Returns 0 blast radius and not-found notice if the target symbol does not exist in AST index.
Usage Guidelines:
When to use: Run prior to editing a core interface, signature, or shared utility to gauge how many downstream files and tests will be impacted.
When NOT to use: Do not use for general whole-repository dependency mapping or PageRank centrality (use 'analyze_code_dependencies' instead); do not use for auditing static code complexity and code smells (use 'audit_code_quality' instead).
Returns: Markdown report with quantitative blast radius score (0-100), risk tier (LOW/MEDIUM/HIGH/CRITICAL), affected downstream modules, and test recommendations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | No | Optional file path where the target symbol is defined. | |
| project_root | No | Root directory of the repository (default: current directory). | . |
| target_symbol | Yes | Name of the function, class, or method being modified or refactored. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |