Skip to main content

When to Use This Skill

Use the Impact Analysis skill when you need to:
  • Assess safety before changing code
  • Understand what depends on a function or class
  • Calculate blast radius of a change
  • Determine who uses specific code
  • Review changes before committing
  • Plan refactoring work

Example Scenarios

Use gitnexus_impact({target: "functionName", direction: "upstream"}) to find all dependents at different depths.
Check d=1 (direct) dependents—these will definitely break. Review d=2 for likely affected code.
Use impact with maxDepth: 3 to see transitive dependencies up to 3 hops away.
Use context to see incoming references categorized by type (CALLS, IMPORTS, EXTENDS).

Workflow

Follow these steps for thorough impact analysis:

Step-by-Step Guide

1. Analyze Symbol Blast Radius
Returns depth-grouped dependencies:
2. Check Affected Processes
Find which execution flows touch the target symbol:
  • LoginFlow
  • TokenRefresh
  • APIMiddlewarePipeline
3. Pre-Commit Change Detection Before committing, map your git changes to affected processes:
Returns:
4. Assess Risk Use the decision matrix below to determine risk level.

Checklist

  • gitnexus_impact({target, direction: "upstream"}) to find dependents
  • Review d=1 items first (these WILL BREAK)
  • Check high-confidence (>0.8) dependencies
  • READ processes to check affected execution flows
  • gitnexus_detect_changes() for pre-commit check
  • Assess risk level and report to user

Understanding Impact Output

Depth Levels

Confidence Scores

GitNexus assigns confidence to each relationship:
  • 100%: Direct static call or import
  • 90-99%: Highly likely (named reference in same module)
  • 80-89%: Probable (string reference or dynamic import)
  • Under 80%: Filtered out by default (use minConfidence to adjust)

Relationship Types

Risk Assessment Matrix

Critical paths include:
  • Authentication flows
  • Payment processing
  • Data persistence
  • Security middleware
  • API gateway functions

Tools for Impact Analysis

gitnexus_impact

The primary tool for blast radius analysis:
Returns:
Parameters:
  • direction:
    • "upstream" → what depends on this (callers)
    • "downstream" → what this depends on (callees)
  • maxDepth: 1-3 recommended (higher = slower + more noise)
  • minConfidence: 0.8 recommended (lower = more false positives)

gitnexus_detect_changes

Git-diff based impact analysis:
Returns:
Best for:
  • Pre-commit checks
  • Understanding scope of current changes
  • Identifying affected test suites

gitnexus_context

For simple “who calls this” queries:
Use context when you need categorized references (calls vs imports vs extends). Use impact when you need depth-grouped blast radius.

Example: “What breaks if I change validateUser?”

Here’s a complete impact analysis walkthrough:

Step 1: Analyze Blast Radius

Result:

Step 2: Check Affected Processes

Processes that touch validateUser:
  • LoginFlow (step 2/7)
  • TokenRefresh (step 1/3)

Step 3: Assess Risk

Using the risk matrix:
  • Affected symbols: 6 (within MEDIUM range)
  • Affected processes: 2 (within MEDIUM range)
  • Critical path: Yes (LoginFlow is authentication)
Risk Level: HIGH (bumped from MEDIUM due to critical path)

Step 4: Recommendations

Report:
Changing validateUser will affect:
  • 2 direct callers (loginHandler, apiMiddleware) → will break
  • 2 indirect callers (authRouter, sessionManager) → likely affected
  • 2 execution flows (LoginFlow, TokenRefresh)
Risk: HIGH (authentication is a critical path) Recommended actions:
  1. Update loginHandler and apiMiddleware to match new signature
  2. Review authRouter and sessionManager for compatibility
  3. Run full auth test suite
  4. Regression test: LoginFlow and TokenRefresh

Advanced Techniques

Finding All Callers Across the Codebase

Finding High-Impact Symbols

Comparing Two Symbols

Run impact on both and compare the results:

Best Practices

Always Check d=1 First

Depth 1 dependencies will break—these are your highest priority.

Use detect_changes Before Commits

Run pre-commit checks to understand the full scope of your changes.

Watch for Critical Paths

Changes to auth, payments, or core systems require extra scrutiny.

Trust Confidence Scores

Focus on >80% confidence—lower scores may be false positives.

Pre-Commit Workflow

Before committing changes, follow this workflow:

Common Pitfalls

Ignoring d=2 Dependencies

Even if d=2 won’t immediately break, they’re likely affected. Always review them.

Not Checking Processes

A change might affect only 2 symbols but break 5 execution flows—always check processes.

Trusting Low Confidence

Confidence below 80% may be false positives (string references, dynamic imports). Review carefully.

Forgetting Test Files

By default, impact excludes tests. Use includeTests: true if you want to see test dependencies.

Next Steps

Learn Safe Refactoring

Once you understand impact, learn how to safely refactor code with automated rename