dependency-analysis

Installation
SKILL.md

Enhanced Dependency Analyzer

Comprehensive dependency analysis tool with visual reports, categorization, and actionable recommendations for optimizing frontend project dependencies.

Quick Start

Installation

npm install

Basic Analysis

# Run enhanced analyzer with markdown report
node scripts/enhanced-analyzer.js /path/to/project

# Full analysis with all features
node scripts/enhanced-analyzer.js /path/to/project \
  --generateFixScript \
  --generateGraph \
  --checkPeerDependencies \
  --checkOutdated \
  --checkSecurity

Advanced Options

# Parallel processing for large projects
node scripts/enhanced-analyzer.js /path/to/project --parallel

# Incremental analysis with cache
node scripts/enhanced-analyzer.js /path/to/project --incremental

# Analyze specific dependency scopes
node scripts/enhanced-analyzer.js /path/to/project --scope=dependencies

# Production-only analysis
node scripts/enhanced-analyzer.js /path/to/project --scope=dependencies --includeDev=false

Enhanced Features

🔍 Advanced Detection

  • Unused Dependencies: Smart detection with confidence scoring
  • Missing Dependencies: Runtime error prevention
  • Phantom Dependencies: Hidden dependency identification
  • Duplicate Functionality: Redundant package detection
  • Version Conflicts: Peer dependency resolution issues
  • Circular Dependencies: Import cycle detection with impact analysis

📊 Analysis Reports

  • Markdown Reports: Comprehensive, readable analysis reports
  • Dependency Graphs: Visual dependency relationship mapping
  • Category Breakdowns: Frontend, backend, devtools, testing, build tools
  • Health Scoring: Overall dependency quality metrics
  • Trend Analysis: Historical dependency changes

🚀 Performance Features

  • Parallel Processing: Faster analysis for large projects
  • Incremental Analysis: Cache-based repeat analysis
  • Smart Exclusions: Intelligent file/directory filtering
  • Batch Operations: Efficient batch dependency checks

🛠️ Automation Tools

  • Auto-fix Scripts: Generated shell scripts for cleanup
  • CI/CD Integration: TeamCity, GitHub Actions reports
  • Multiple Formats: JSON, CSV, Markdown outputs
  • Priority Recommendations: Actionable improvement suggestions

Output Formats

Enhanced JSON Output

{
  "success": true,
  "timestamp": "2024-01-15T10:30:00Z",
  "project": {
    "name": "my-project",
    "version": "1.0.0",
    "path": "/path/to/project"
  },
  "summary": {
    "total": 150,
    "unused": 5,
    "missing": 2,
    "phantom": 3,
    "outdated": 10,
    "vulnerable": 1,
    "peerConflicts": 2,
    "circular": 1,
    "duplicate": 3,
    "versionConflicts": 2
  },
  "categories": {
    "frontend": { "count": 45, "size": "2.3MB", "packages": [] },
    "backend": { "count": 12, "size": "1.1MB", "packages": [] },
    "devtools": { "count": 28, "size": "890KB", "packages": [] },
    "testing": { "count": 15, "size": "450KB", "packages": [] },
    "build": { "count": 20, "size": "670KB", "packages": [] },
    "other": { "count": 30, "size": "1.2MB", "packages": [] }
  },
  "recommendations": {
    "high": [],
    "medium": [],
    "low": []
  },
  "healthScore": 78,
  "markdownReport": "/path/to/DEPENDENCY_ANALYSIS_REPORT.md",
  "fixScript": "/path/to/FIX_DEPENDENCIES.sh"
}

Markdown Report Features

  • Comprehensive analysis summary
  • Dependency category breakdowns
  • Priority-based recommendations
  • Quick fix commands
  • Security vulnerability details
  • Easy integration with documentation tools

Command Line Interface

# Enhanced analyzer options
node scripts/enhanced-analyzer.js <project-path> [options]

Options:
  --generateFixScript Generate auto-fix shell script
  --generateGraph     Generate dependency graph data
  --parallel          Use parallel processing for speed
  --incremental       Use cache for faster repeat analysis
  --checkPeerDependencies  Analyze peer dependency conflicts
  --checkOutdated     Check for outdated packages
  --checkSecurity     Scan for security vulnerabilities
  --scope=<type>      Dependency scope: all|dependencies|devDependencies|peerDependencies
  --includeDev        Include devDependencies in analysis
  --cacheDir=<path>   Cache directory for incremental analysis
  --pretty            Pretty-print JSON output

Report Generation

Generate Multiple Report Formats

# Generate all report formats from analysis results
node scripts/generate-report.js analysis-result.json ./reports

# Available formats:
# - Markdown report (DEPENDENCY_ANALYSIS_REPORT.md)
# - JSON summary (DEPENDENCY_ANALYSIS_SUMMARY.json)
# - CSV issues (DEPENDENCY_ANALYSIS_ISSUES.csv)
# - TeamCity report (TEAMCITY_REPORT.txt)
# - GitHub Actions report (GITHUB_ACTIONS_REPORT.json)

Integration Examples

GitHub Actions Workflow

- name: Analyze Dependencies
  run: |
    node scripts/enhanced-analyzer.js . \
      --generateFixScript \
      --checkSecurity \
      --checkOutdated

- name: Upload Analysis Report
  uses: actions/upload-artifact@v3
  with:
    name: dependency-analysis
    path: DEPENDENCY_ANALYSIS_REPORT.md

TeamCity Integration

# Generate TeamCity-compatible report
node scripts/enhanced-analyzer.js . --checkSecurity
# TeamCity report automatically includes build statistics and problems

Advanced Usage Patterns

Custom Configuration

const analyzer = new EnhancedDependencyAnalyzer('/path/to/project', {
  parallel: true,
  incremental: true,
  generateFixScript: true,
  checkSecurity: true,
  maxDepth: 10,
  cacheDir: '.dependency-cache',
  excludePatterns: ['docs/**', 'examples/**']
});

const result = await analyzer.analyze();

Batch Project Analysis

# Analyze multiple projects
for project in project1 project2 project3; do
  node scripts/enhanced-analyzer.js $project \
    --generateFixScript
done

Framework Support

The enhanced analyzer provides deep support for:

  • React: Hooks, components, lazy loading
  • Vue: SFC, script setup, async components
  • Angular: Modules, services, lazy routes
  • Next.js: Dynamic imports, API routes
  • Nuxt.js: Auto-imports, composables
  • Svelte: Components, stores
  • Build Tools: Webpack, Vite, Rollup, esbuild

Performance Optimization

  • Parallel Analysis: Processes files concurrently for large projects
  • Smart Caching: Incremental analysis avoids re-scanning unchanged files
  • Batch Operations: Groups npm commands for efficiency
  • Memory Efficient: Streaming analysis for large codebases
  • Progress Tracking: Real-time analysis progress

Reference Documentation

Related skills

More from hubvue/skills

Installs
3
Repository
hubvue/skills
GitHub Stars
6
First Seen
Mar 21, 2026