Untangle the web of dependencies in your project. Spot circular references that break builds, find unused imports bloating your bundle, and identify version conflicts before they cause production headaches.

Quick Start

Jump straight in with these copy-paste prompts to understand your project's dependency landscape:

Full Project Dependency Analysis
Use houtini-lm to analyse all dependencies in this project: C:/my-react-app
Find Circular Dependencies
Check for circular dependencies in C:/project/src - focus on components that might be importing each other
Unused Import Detection
Find unused imports in my Node.js project at C:/api-server to reduce bundle size
Package.json Version Conflicts
Check my package.json for version conflicts: C:/project/package.json

Pro Tip

Run dependency analysis before major refactoring sessions - it'll show you exactly how components are connected and what's safe to change.

What It Does

Dependencies are the invisible threads that hold your project together - until they become the tangled mess that brings it crashing down. analyze_dependencies maps these relationships with surgical precision, identifying issues that could break your build, slow your app, or create maintenance nightmares.

Think of it as having an experienced architect review your project's blueprint, spotting structural weaknesses before they become real problems. The analysis goes beyond simple import statements to understand the deeper architectural implications of how your code is connected.

Here's what gets thoroughly examined:

  • Circular Dependencies - Those sneaky import loops that break builds and confuse bundlers
  • Unused Imports - Dead weight making your bundles larger and your IDE slower
  • Version Conflicts - Package.json mismatches that cause mysterious runtime errors
  • Coupling Analysis - Which components are too tightly connected for their own good
  • Architecture Insights - How your dependencies reflect (or betray) your intended design

The analysis is smart about false positives - it understands dynamic imports, conditional requires, and framework-specific patterns that might look unused but are actually essential.

Parameters

Customise the analysis to focus on exactly what matters for your project:

Parameter Type Required Default Description
projectPath string Yes* -

Path to your project root directory

Example: "C:/my-react-app"
filePath string Yes* -

Single file to analyse (alternative to projectPath)

Perfect for focused analysis of specific files
analysisType string No "comprehensive"

Focus area: "imports", "circular", "unused", "coupling", "comprehensive"

Use "circular" when you suspect import loops
analysisDepth string No "detailed"

Analysis depth: "basic", "detailed", "comprehensive"

"comprehensive" for complex monorepos
checkDevDependencies boolean No false

Include devDependencies in analysis

Enable when analysing build tools and test utilities
includePackageJson boolean No true

Analyse package.json for version conflicts

Essential for identifying dependency version mismatches
maxDepth number No 4

Maximum directory depth for dependency discovery (1-5)

Increase for deep nested structures
ignorePatterns array No ["node_modules", "*.min.js"]

File patterns to ignore during analysis

Add patterns like ["dist/", "build/", "*.test.js"]

*Either projectPath or filePath is required - use projectPath for comprehensive analysis

Real-World Examples

Here's how to use dependency analysis in different scenarios:

๐Ÿ” Full Project Analysis

Comprehensive Dependency Review
houtini-lm:analyze_dependencies with:
- projectPath: "C:/my-react-app"
- analysisType: "comprehensive"
- analysisDepth: "detailed"
- includePackageJson: true
- checkDevDependencies: true

๐ŸŒ€ Circular Dependency Detection

Find Import Loops
houtini-lm:analyze_dependencies with:
- projectPath: "C:/complex-app/src"
- analysisType: "circular"
- analysisDepth: "comprehensive"
- maxDepth: 5

๐Ÿงน Bundle Size Optimisation

Find Unused Imports
houtini-lm:analyze_dependencies with:
- projectPath: "C:/frontend-app"
- analysisType: "unused"
- ignorePatterns: ["*.test.js", "*.stories.js", "dist/"]
- analysisDepth: "detailed"

๐Ÿ“ฆ Package.json Audit

Version Conflict Detection
houtini-lm:analyze_dependencies with:
- filePath: "C:/project/package.json"
- includePackageJson: true
- checkDevDependencies: true
- analysisType: "imports"

๐Ÿ—๏ธ Architecture Review

Component Coupling Analysis
houtini-lm:analyze_dependencies with:
- projectPath: "C:/enterprise-app/src"
- analysisType: "coupling"
- analysisDepth: "comprehensive"
- maxDepth: 4

Analysis Types Explained

Choose the right focus for your specific needs:

๐Ÿ”„ "circular" - Import Loop Detection

Perfect when your build is failing with cryptic circular dependency errors or your bundler is complaining about import cycles.

  • Maps complete import chains that loop back to themselves
  • Identifies the exact files and imports causing the cycle
  • Suggests specific fixes to break the loops
  • Prioritises cycles that are most likely to cause build failures

๐Ÿ—‘๏ธ "unused" - Dead Import Elimination

Ideal for bundle size optimisation and cleaning up codebases. Helps reduce bundle size and improves build performance.

  • Identifies imports that are declared but never used
  • Understands dynamic imports and conditional requires
  • Estimates potential bundle size savings
  • Provides safe removal recommendations

๐Ÿ”— "coupling" - Component Relationship Analysis

Great for architecture reviews and planning refactoring. Shows which components are too tightly connected.

  • Measures how tightly connected your components are
  • Identifies components that import too many others
  • Suggests architectural improvements
  • Highlights potential single points of failure

๐Ÿ“ฆ "imports" - General Import Analysis

Good for understanding overall import patterns and package.json consistency.

  • Maps all import relationships across your project
  • Checks package.json consistency
  • Identifies version conflicts and peer dependency issues
  • Provides import pattern insights

๐ŸŽฏ "comprehensive" - Full Analysis

The complete picture - combines all analysis types for thorough dependency health check.

  • All of the above analyses combined
  • Architectural recommendations
  • Prioritised list of issues to fix
  • Executive summary of dependency health

What You Get Back

The analysis delivers actionable insights that help you clean up and optimise your project:

๐ŸŒ€ Circular Dependency Detection

  • Import chain mapping - Exact path of circular references
  • Risk assessment - Which cycles are most likely to break builds
  • Specific fix suggestions - Concrete steps to break the cycles
  • Alternative architecture patterns - Better ways to structure the relationships

๐Ÿ—‘๏ธ Unused Import Identification

  • Dead import list - Specific imports that can be safely removed
  • Bundle size impact - Estimated size savings from cleanup
  • Safety assessment - Confidence level for each removal
  • Dynamic import detection - Understanding of runtime imports

๐Ÿ“Š Version Conflict Analysis

  • Version mismatches - Package.json conflicts and their implications
  • Peer dependency issues - Missing or incorrect peer dependencies
  • Update recommendations - Safe upgrade paths for conflicted packages
  • Compatibility warnings - Versions that might cause runtime issues

๐Ÿ”— Coupling Analysis

  • Component connectivity scores - How tightly coupled your modules are
  • High-risk dependencies - Components that import too many others
  • Architectural insights - Suggestions for better separation of concerns
  • Refactoring opportunities - Safe ways to reduce coupling

๐Ÿ“ˆ Architectural Recommendations

  • Dependency health score - Overall assessment of project health
  • Priority fixes - Which issues to tackle first
  • Maintenance insights - How dependencies affect long-term maintainability
  • Performance implications - How dependencies impact bundle size and load times

Visual Dependency Maps

Complex dependency relationships are presented in clear, scannable formats that help you understand the big picture whilst focusing on specific issues.

Perfect Use Cases

Here's when dependency analysis becomes your project-saving superpower:

๐Ÿšจ Build Failures and Circular Dependencies

When your build suddenly breaks with mysterious circular dependency errors, this analysis quickly identifies the exact import chain causing the problem and suggests specific fixes.

๐Ÿ“ฆ Bundle Size Optimisation

Before launching to production, identify unused imports that are bloating your bundle. Perfect for performance-critical applications where every kilobyte matters.

๐Ÿ—๏ธ Architecture Reviews

Planning a refactor? Understanding current dependency relationships prevents you from accidentally breaking things and helps design better component boundaries.

๐Ÿ” Legacy Code Investigation

Inherited a complex codebase? Map the dependency relationships to understand how components are connected before making changes.

๐ŸŒฑ Monorepo Management

Large monorepos with multiple packages benefit hugely from understanding cross-package dependencies and potential version conflicts.

๐Ÿš€ Pre-Deployment Checks

Run comprehensive dependency analysis before major releases to catch issues that might cause runtime errors or performance problems.

๐Ÿ“š Developer Onboarding

Help new team members understand project structure by showing them how components are connected and which areas are most complex.

๐Ÿ”ง Refactoring Planning

Before breaking large components into smaller ones, understand the current dependency web to avoid creating circular references or overly coupled modules.

Best Practices

Get the most valuable insights from your dependency analysis:

๐ŸŽฏ Choose the Right Analysis Type

Match the analysis to your immediate needs:

  • "circular" - When builds are failing due to import loops
  • "unused" - When optimising bundle size or cleaning up code
  • "coupling" - When planning architecture changes or refactoring
  • "comprehensive" - For general health checks and major reviews

๐Ÿ“Š Regular Dependency Health Checks

Make dependency analysis part of your development workflow:

  • Run before major releases to catch potential issues
  • Include in code review process for architectural changes
  • Schedule monthly "dependency debt" review sessions
  • Check after adding major new packages or libraries

๐Ÿ”ง Configure for Your Project Structure

Tailor the analysis to your specific project setup:

  • Adjust maxDepth based on your directory nesting
  • Use ignorePatterns to exclude build artifacts and test files
  • Enable checkDevDependencies when analysing build tools
  • Include framework-specific patterns in your analysis context

โšก Start Focused, Then Go Comprehensive

For large projects, start with targeted analysis:

  • Begin with specific issues (circular dependencies, unused imports)
  • Use "basic" depth for initial assessment of very large codebases
  • Focus on critical paths and high-impact components first
  • Run comprehensive analysis after addressing major issues

๐Ÿ“ Document Your Dependency Strategy

Use analysis results to improve your team's practices:

  • Create guidelines based on coupling analysis findings
  • Set up automated checks for common dependency problems
  • Share architectural insights with your team
  • Track improvement over time with regular analyses

Remember

Don't try to fix everything at once. Prioritise circular dependencies (they break builds), then unused imports (they affect performance), then architectural improvements.

Troubleshooting

Common issues and how to resolve them:

Analysis missing obvious circular dependencies

Known circular dependencies aren't being detected.

  • Increase analysisDepth to "comprehensive"
  • Check that your maxDepth covers all relevant directories
  • Ensure the problematic files aren't in ignorePatterns
  • Try using a larger model (13B+ parameters) for better detection
  • Run analysis specifically on the suspected directories first
False positives for unused imports

Analysis is flagging imports that are actually used dynamically or conditionally.

  • Check the analysis carefully - it should understand dynamic imports
  • Add specific file patterns that use dynamic imports to context
  • Use "detailed" analysis depth which better understands complex usage patterns
  • Review the specific imports manually - the analysis provides file locations
  • Consider whether the imports are truly necessary if usage is very obscure
Package.json analysis not working

Version conflict detection isn't finding known package.json issues.

  • Ensure includePackageJson is set to true
  • Check the package.json file path is correct and accessible
  • Enable checkDevDependencies if conflicts are in dev packages
  • Try running analysis directly on the package.json file path
  • Verify your package.json is valid JSON (syntax errors can break analysis)
Analysis takes too long on large projects

Dependency analysis is timing out or taking much longer than expected.

  • Start with "basic" analysis depth for large codebases
  • Reduce maxDepth to 3 or 4 for initial analysis
  • Add more patterns to ignorePatterns (node_modules, dist, build)
  • Focus on specific directories rather than entire project initially
  • Ensure your LM Studio model has sufficient memory allocated
Missing framework-specific dependency patterns

Not getting React, Vue, or other framework-specific dependency insights.

  • The dependency analysis automatically detects frameworks from files
  • Ensure your framework files have typical extensions (.jsx, .vue, etc.)
  • Try running with "comprehensive" analysis depth
  • Check that framework files aren't being ignored by patterns
  • Use "coupling" analysis type for component relationship insights
No dependency issues found but build still fails

Analysis reports no issues but you're still experiencing dependency-related build failures.

  • Check if the build error mentions specific files - analyse those directly
  • Look for runtime-only dependencies that might not be detected statically
  • Review your bundler configuration - some circular deps only cause issues in specific build setups
  • Try running the analysis with checkDevDependencies: true
  • Consider using trace_execution_path to follow specific import chains