Catch integration disasters before they happen. Analyze how your files work together and spot API mismatches, missing imports, and breaking changes that would otherwise explode in production.

Quick Start

Jump straight in with these real-world integration checks:

API Compatibility Check
Check if these API files work together: C:/api/users.ts and C:/frontend/UserService.ts
Cross-System Integration
Analyse integration between C:/backend/PaymentService.php and C:/frontend/CheckoutForm.tsx
Component Dependencies
Review how these React components integrate: C:/components/Header.tsx, C:/components/UserMenu.tsx

Save Yourself the Pain

Integration bugs are the worst kind - they work locally, pass tests individually, then fail spectacularly when systems talk to each other. This function catches those nasty surprises early.

What It Does

Ever had that sinking feeling when your perfectly working components suddenly break because someone changed an API? compare_integration is your early warning system for integration disasters.

This function performs sophisticated cross-file analysis to understand how your code components interact, then identifies potential breaking points before they bite you in production. It's like having an integration specialist review your system boundaries.

🔍 What It Analyzes

  • API Compatibility - Method signatures, data structures, response formats
  • Import/Export Relationships - Missing dependencies, circular references
  • Interface Mismatches - Type incompatibilities, parameter misalignments
  • Data Flow Integrity - How data moves between system boundaries
  • Breaking Change Detection - Changes that could break dependent code
  • Cross-System Communication - Frontend-backend integration patterns

The analysis is intelligent and context-aware - it understands different architectural patterns and can spot subtle integration issues that would be easy to miss during code reviews.

Parameters

Here's how to configure your integration analysis for maximum insight:

Parameter Type Required Default Description
files array Yes* -

Array of file paths to analyze for integration

Example: ["C:/api/users.ts", "C:/components/UserList.tsx"]
projectPath string Yes* -

Project root for comprehensive cross-file analysis

Perfect for analyzing entire system boundaries
analysisType string No "integration"

Focus: "integration", "compatibility", "dependencies", "comprehensive"

Default: "integration" - cross-system communication patterns
analysisDepth string No "detailed"

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

Use "comprehensive" for critical system integrations
focus array No []

Specific areas: ["method_compatibility", "namespace_dependencies", "data_flow", "missing_connections"]

Target specific integration concerns
maxDepth number No 3

Maximum directory depth for multi-file discovery (1-5)

Increase for deep project structures

*Either files or projectPath is required - use files for specific comparisons, projectPath for system-wide analysis

Real-World Examples

Here's how to catch integration issues in different scenarios:

Frontend-Backend API Integration

API Compatibility Check
houtini-lm:compare_integration with:
- files: ["C:/api/controllers/UserController.php", "C:/frontend/services/UserService.ts"]
- analysisType: "integration"
- focus: ["method_compatibility", "data_flow"]
- analysisDepth: "comprehensive"

React Component Dependencies

Component Integration Analysis
houtini-lm:compare_integration with:
- files: ["C:/components/PaymentForm.tsx", "C:/hooks/usePayment.ts", "C:/utils/paymentValidation.ts"]
- analysisType: "dependencies"
- focus: ["missing_connections", "namespace_dependencies"]

Microservices Communication

Service Integration Review
houtini-lm:compare_integration with:
- files: ["C:/services/auth/AuthService.js", "C:/services/user/UserService.js", "C:/gateway/routes.js"]
- analysisType: "comprehensive"
- focus: ["method_compatibility", "data_flow"]
- analysisDepth: "comprehensive"

Database Integration Patterns

ORM and Repository Analysis
houtini-lm:compare_integration with:
- files: ["C:/models/User.php", "C:/repositories/UserRepository.php", "C:/controllers/UserController.php"]
- analysisType: "integration"
- focus: ["method_compatibility", "data_flow"]

Entire Project Integration Review

System-Wide Integration Analysis
houtini-lm:compare_integration with:
- projectPath: "C:/my-full-stack-app"
- analysisType: "comprehensive"
- focus: ["method_compatibility", "missing_connections", "data_flow"]
- maxDepth: 4

What You Get Back

The analysis delivers actionable insights that prevent integration disasters:

🎯 Integration Compatibility Assessment

  • Risk scoring - How likely is this integration to break?
  • Compatibility matrix - Which components work well together
  • Breaking change detection - Changes that could affect dependent systems
  • Version compatibility - Framework and dependency version conflicts

🔗 Missing Import Detection

  • Unresolved dependencies - imports that can't be found
  • Circular reference detection - dangerous dependency loops
  • Resolution suggestions - specific fixes with import paths
  • Dependency health - overall dependency structure assessment

⚡ Interface Mismatch Identification

  • Method signature mismatches - parameter count/type differences
  • Data structure incompatibilities - object shape mismatches
  • Type system conflicts - TypeScript interface violations
  • API contract violations - deviations from expected interfaces

🌊 Data Flow Analysis

  • Cross-boundary data tracking - how data moves between systems
  • Transformation requirements - where data shape changes
  • Validation gaps - missing input/output validation
  • Security boundaries - data exposure across system boundaries

🔧 Actionable Remediation Steps

  • Specific fixes - exact code changes with examples
  • Migration guidance - step-by-step update instructions
  • Testing recommendations - integration tests to prevent regressions
  • Refactoring opportunities - improvements to integration patterns

Prevention Over Cure

Each finding includes risk assessment and prevention strategies. Much better to fix integration issues during development than debug them in production at 3am!

Perfect Use Cases

This function shines in these critical scenarios:

🚀 Pre-Deployment Integration Checks

Before pushing to production, verify that your API changes won't break the frontend, your database schema updates are compatible with your ORM, and your microservices can still talk to each other.

🔄 Refactoring Safety

When restructuring code or updating dependencies, ensure you haven't accidentally broken the contracts between your components. Perfect for large refactoring projects where manual checking would be error-prone.

👥 Team Coordination

When multiple developers are working on connected components, catch integration issues early. Great for preventing the "it works on my machine but breaks the build" problems.

📦 Dependency Updates

Before updating major dependencies or frameworks, analyze how the changes might affect your integration points. Spot breaking changes before they break your build.

🏗️ Architecture Reviews

Validate that your system architecture actually works as designed. Spot architectural assumptions that aren't holding up in the real code.

🔍 Legacy Code Integration

When integrating with or replacing legacy systems, understand exactly how the old and new systems connect, and where potential issues might lurk.

⚡ Performance Impact Analysis

Understand how changes to one component might affect performance of dependent components. Spot integration patterns that could cause performance bottlenecks.

Focus Areas Explained

Target your analysis to specific integration concerns:

🔧 method_compatibility

Deep analysis of method signatures, parameter types, and return values across file boundaries. Perfect for API compatibility checks and interface validation.

  • Parameter count and type mismatches
  • Return type compatibility
  • Method naming consistency
  • Optional vs required parameters

🔗 namespace_dependencies

Analysis of import/export relationships and module dependencies. Great for catching missing imports and circular dependency issues.

  • Missing import statements
  • Circular dependency detection
  • Namespace conflicts
  • Module resolution issues

🌊 data_flow

Tracking how data moves between components and across system boundaries. Essential for understanding integration points and data transformation requirements.

  • Data structure compatibility
  • Transformation requirements
  • Validation gaps
  • Security boundary analysis

❓ missing_connections

Identification of integration points that should exist but don't, or connections that are assumed but not implemented.

  • Expected but missing integrations
  • Orphaned components
  • Dead integration code
  • Architectural gaps

Pro Tip

Combine multiple focus areas for comprehensive analysis. For critical integrations, use all four focus areas to ensure nothing slips through the cracks.

Best Practices

Get the most reliable integration analysis:

📁 Be Strategic About File Selection

Choose files that represent integration boundaries:

  • API endpoints and their client-side consumers
  • Database models and their repository layers
  • Component interfaces and their implementations
  • Service boundaries in microservice architectures

🎯 Use Targeted Focus Areas

Match your focus to your specific concerns:

  • Pre-deployment: method_compatibility + data_flow
  • Refactoring: namespace_dependencies + missing_connections
  • New features: data_flow + method_compatibility
  • Architecture review: all focus areas for comprehensive analysis

⚡ Analysis Depth Strategy

  • "basic" - Quick compatibility check for minor changes
  • "detailed" - Standard integration review for regular development
  • "comprehensive" - Deep analysis for critical systems or major changes

🔄 Integration Testing Workflow

Make this part of your development process:

  1. Run integration analysis after significant changes
  2. Check integration compatibility before merging branches
  3. Analyze cross-team component interactions regularly
  4. Use findings to improve integration test coverage

📊 Team Coordination

  • Share integration analysis results with affected team members
  • Use findings to improve API design and documentation
  • Establish integration checkpoints in your development workflow
  • Track integration health over time

Remember

Integration analysis is most valuable when done proactively. Don't wait for production issues - catch integration problems during development when they're easy to fix.

Troubleshooting

Common issues and their solutions:

Analysis reports false positives or misses obvious issues

The integration analysis isn't providing accurate insights.

  • Increase analysis depth to "comprehensive" for better accuracy
  • Use specific focus areas instead of general analysis
  • Ensure you're analyzing the right integration boundaries
  • Include more context files that show the full integration picture
Can't analyze files from different projects or repositories

Need to analyze integration between separate codebases.

  • Copy relevant files to a common accessible location
  • Use the code parameter instead of filePath for external files
  • Analyze integration contracts (interfaces/types) rather than implementation
  • Focus on API documentation and schema files that define boundaries
Analysis is too slow for large projects

Integration analysis takes too long or times out on large codebases.

  • Use specific file lists instead of entire project analysis
  • Reduce maxDepth to limit directory traversal
  • Start with "basic" analysis depth and upgrade if needed
  • Focus on critical integration points rather than comprehensive analysis
Missing integration issues in complex architectures

Complex systems with multiple layers aren't being analyzed properly.

  • Include all layers of your architecture in the file list
  • Use "comprehensive" analysis type for complex systems
  • Add all focus areas: ["method_compatibility", "namespace_dependencies", "data_flow", "missing_connections"]
  • Analyze integration points separately for each system boundary
Framework-specific integration patterns not recognized

The analysis doesn't understand React, Laravel, or other framework patterns.

  • Include framework context in file names or comments
  • Analyze framework-specific integration files (hooks, providers, middleware)
  • Use comprehensive analysis depth for better framework understanding
  • Include configuration and setup files that define framework integration patterns