extract-dependencies

Analyze imports and identify all module dependencies. Use when mapping project structure.

⭐8stars🔀4forks📁View on GitHub🕐Updated Jan 3, 2026

When & Why to Use This Skill

The extract-dependencies skill is a specialized developer tool designed to automatically analyze and map the complex web of module dependencies within a codebase. By scanning import statements, it identifies external libraries, internal module relationships, and circular dependencies, providing essential insights for maintaining a clean and scalable project architecture.

Use Cases

  • Architectural Mapping: Visualize the project structure and module coupling to understand the high-level design and interaction between different system components.
  • Refactoring and Decoupling: Identify circular dependencies and tightly coupled modules to plan effective code cleanup and improve system modularity.
  • Dependency Auditing: Generate a comprehensive list of external and internal dependencies to facilitate version updates, security vulnerability assessments, and the removal of redundant code.
  • Onboarding and Documentation: Help new developers quickly grasp the codebase structure by providing a clear map of how different modules and files are interconnected.
nameextract-dependencies
description"Analyze imports and identify all module dependencies. Use when mapping project structure."
mcp_fallbacknone
categoryanalysis
tier2
user-invocablefalse

Extract Dependencies

Analyze import statements and identify all external and internal module dependencies in codebase.

When to Use

  • Understanding module coupling
  • Planning dependency updates
  • Identifying circular dependencies
  • Generating dependency graphs

Quick Reference

# Python dependency extraction
grep -r "^import\|^from" --include="*.py" . | sort | uniq

# Generate dependency graph
pipdeptree

# Check for circular dependencies
python3 -c "import ast; [print(f.name) for f in ast.walk(ast.parse(open('file.py').read())) if isinstance(f, ast.Import)]"

Workflow

  1. Scan imports: Extract all import statements from codebase
  2. Categorize dependencies: Separate external, internal, standard library
  3. Map relationships: Create graph of which modules import which
  4. Identify chains: Trace dependency chains (A→B→C)
  5. Report analysis: Document dependency structure and issues

Output Format

Dependency analysis:

  • External dependencies (with versions)
  • Internal module dependencies
  • Dependency graph (text or ASCII art)
  • Circular dependencies (if found)
  • Recommended import order
  • Unnecessary or redundant dependencies

References

  • See check-dependencies skill for validation
  • See analyze-code-structure skill for module organization
  • See pixi.toml for declared project dependencies