Dep graph

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

Dep graph is an AI agent skill from the GitHub repository berkcangumusisik/claude-code-practices. Maps module dependencies and finds circular imports and coupling issues

How to use this skill

Skill file

Dependency Graph Analysis

Entry: $1 (or src/index.ts if not specified)

  1. Try dependency analysis tools:
npx madge --circular src/ 2>/dev/null | head -30
npx depcruise --include-only "^src" --output-type text src/ 2>/dev/null | head -50
  1. Manual circular dependency search:
# Files that import each other
grep -rn "^import.*from" src/ --include="*.ts" | awk '{print $NF}' | sort | uniq -c | sort -rn | head -20
  1. Identify:
  1. For each circular import: propose how to break the cycle (extract shared types, invert dependency, use dependency injection).
  1. Draw a simplified text dependency graph for the top-level modules.
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.