Impact analysis

From berkcangumusisik/claude-code-practices · View interactive version

Impact analysis is an AI agent skill from the GitHub repository berkcangumusisik/claude-code-practices. Analyzes the impact of changing a file or function - what else would break

How to use this skill

Skill file

Impact Analysis

Target: $1 $2

  1. Find all direct consumers:
grep -rn "from.*$1\|require.*$1\|import.*$1" src/ --include="*.ts" --include="*.tsx" | grep -v "node_modules"
  1. For each consumer, find their consumers (2 levels deep):
# For each file found above, repeat the grep
  1. Check for indirect usage:
  1. Check test coverage of the target:
grep -rn "$2\|$(basename $1 .ts)" src/ --include="*.test.*" --include="*.spec.*"
  1. Produce impact map:
src/auth/token.ts → changing this affects:
  DIRECT (3 files):
    src/middleware/auth.ts      ← critical path
    src/api/users.ts           ← medium risk
    src/utils/session.ts       ← low risk
  INDIRECT (7 files via middleware/auth.ts):
    src/api/*.ts               ← all protected routes
  TESTS (2 files):
    src/auth/token.test.ts
    src/middleware/auth.test.ts
  1. Recommend: what tests to run, what to manually verify.
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.