dependency-analysis
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
- Implementation: See enhanced-analyzer.js
- Report Generation: See generate-report.js
- Import Patterns: See references/import-patterns.md
- Peer Dependencies: See references/peer-dependency-analysis.md
- Deep Analysis: See references/deep-dependency-patterns.md
- Output Formats: See references/output-formats.md
More from hubvue/skills
prompt-interviewer
Senior Prompt Engineer and Prompt Interviewer that interviews users to refine and complete their prompts through structured analysis and iterative questioning. Use when a user has an initial prompt but needs help refining it for better LLM performance: (1) When a prompt lacks clarity or context, (2) When constraints or boundaries are missing, (3) When output formats or quality criteria are undefined, (4) When there are ambiguities or conflicting requirements
15context-probe
Minimal Context Sentinel Installer (All-Layers Broadcast). Installs a hard Context Sentinel rule into EVERY detected rule file to force assistant to append a sentinel token to every response. Use when (1) Installing context monitoring via /context-probe, (2) Checking installation status via /context-probe status, (3) Uninstalling via /context-probe off.
4skills-workflow
Interactive skills workflow for chaining multiple skills where the output of step i becomes the input of step i-1. Use when you need to: (1) Chain multiple skills together in a specific order, (2) Pass outputs between skills as inputs, (3) Execute complex multi-step workflows with traceability, (4) Run skills in dry-run mode before execution, (5) Debug or audit multi-skill workflows
3release-skills
Release workflow for baoyu-skills plugin. Use when user says "release", "发布", "push", "推送", "new version", "新版本", "bump version", "更新版本", or wants to publish changes to remote. Analyzes changes since last tag, updates CHANGELOG (EN/CN), bumps marketplace.json version, commits, and creates version tag. MUST be used before any git push with uncommitted skill changes.
3api-generator
Autonomous Frontend Code Generation Agent specialized in project-aware API integration. Use when user provides backend API specs needing frontend request code, mock data to convert to request types and handlers, API endpoints to add with types mocks and tests, or new API integration following existing project conventions. Automatically detects TypeScript, request patterns, mock infrastructure, and test frameworks to generate artifact-gated code.
3skills-workflow-builder
Create a new dedicated workflow skill by reusing the existing skills-workflow (to collect/normalize a pipeline) and the existing skill-creator (to materialize the new skill). Use when you want a reusable workflow skill without re-entering skill order/templates each time.
3