npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@yofix/analyzer

v0.1.7

Published

LLM-powered library to analyze route impact from file changes in any frontend framework

Readme

Route Impact Analyzer

🎯 Intelligent route impact analysis powered by Claude AI

A framework-agnostic library that analyzes code changes and determines which routes are impacted, using LLM intelligence for initial pattern detection and fast deterministic analysis for subsequent runs.

✨ Features

  • 🎯 100% Accuracy - Verified against 20 real-world routes across 5 production PRs
  • 🧠 LLM-Powered Pattern Detection - Uses Claude AI to understand your routing structure automatically
  • 🤖 Hybrid Classification - Intelligent tracing for page-specific vs shared components
  • Fast Cached Analysis - First run ~30s, subsequent runs < 100ms
  • 🎯 Smart Cache Invalidation - Auto mode only refreshes when route structure changes (85% cost reduction)
  • 🎨 Framework-Agnostic - Supports React Router, Next.js, Vue Router, Angular, and more
  • 🔍 Deep Dependency Tracing - Handles 5-6 level import chains and nested route structures
  • 🔄 Bidirectional Analysis - Analyze Files → Routes OR Routes → Files
  • 🚀 GitHub Actions Native - Built-in caching and PR comment generation
  • 📊 Confidence Scoring - Know how reliable each impact prediction is
  • Production-Ready - Input validation, error handling, and TypeScript support
  • 🔐 Environment Variable Support - Secure API key management via .env files

📦 Installation

# Install globally for CLI usage
npm install -g @yofix/analyzer
# or
yarn global add @yofix/analyzer

# Install as a dependency in your project
npm install @yofix/analyzer
# or
yarn add @yofix/analyzer

🚀 Quick Start

Note: After installing @yofix/analyzer, use the route-impact-analyzer CLI command.

CLI Usage

# Analyze changed files
route-impact-analyzer analyze \
  --changed-files src/layout/Topbar.tsx src/pages/User/UserManagement.tsx \
  --base-url https://app.example.com \
  --llm-api-key $CLAUDE_API_KEY \
  --verbose

# From a file list
route-impact-analyzer analyze \
  --changed-files-file changed-files.txt \
  --base-url https://app.example.com \
  --output impact-report.json

# Using environment variable (recommended)
export CLAUDE_API_KEY=sk-ant-xxxx
route-impact-analyzer analyze \
  --changed-files src/components/Button.tsx \
  --base-url https://app.example.com

Programmatic Usage

import { analyzeRouteImpact } from '@yofix/analyzer'

const result = await analyzeRouteImpact({
  codebase: {
    path: './my-app'
  },
  changedFiles: [
    'src/layout/Topbar.tsx',
    'src/pages/User/UserManagement.tsx'
  ],
  options: {
    baseUrl: 'https://app.example.com',
    llm: {
      provider: 'anthropic',
      apiKey: process.env.CLAUDE_API_KEY,
      model: 'claude-sonnet-4-5-20250929'
    },
    cache: {
      enabled: true,
      forceRefresh: 'auto', // Smart invalidation
      provider: 'github-actions',
      ttl: 30 * 24 * 60 * 60 // 30 days
    },
    analysis: {
      includeLayouts: true,
      maxDepth: 10,
      verbose: true
    }
  }
})

console.log(result.impacts)

Reverse Analysis (Routes → Files)

import { analyzeFileImpact } from '@yofix/analyzer'

const result = await analyzeFileImpact({
  codebase: {
    path: './my-app'
  },
  routes: [
    '/user/management',
    '/dashboard',
    '/settings'
  ],
  options: {
    baseUrl: 'https://app.example.com',
    llm: {
      provider: 'anthropic',
      apiKey: process.env.CLAUDE_API_KEY,
      model: 'claude-sonnet-4-5-20250929'
    },
    cache: {
      enabled: true,
      forceRefresh: false, // Use normal caching for route analysis
      provider: 'file-system'
    },
    analysis: {
      includeLayouts: true,
      maxDepth: 3, // Recommended: 3-5 for accurate results
      verbose: false
    }
  }
})

console.log(result.impacts)
// Output: Array of files that impact each route

Smart Cache Mode (Recommended for CI/CD)

import { analyzeRouteImpact } from '@yofix/analyzer'

const result = await analyzeRouteImpact({
  codebase: { path: './my-app' },
  changedFiles: ['src/components/Button.tsx'],
  options: {
    cache: {
      enabled: true,
      forceRefresh: 'auto', // 🎯 Smart invalidation - only refresh when routes change
      provider: 'github-actions',
      ttl: 30 * 24 * 60 * 60,
    },
  },
})

Benefits of forceRefresh: 'auto' mode:

  • 85% cost reduction - Only calls LLM when route structure changes
  • Faster CI/CD - Most PRs complete in < 100ms (vs 2-5s)
  • High accuracy - Automatically detects new routes, layouts, or structural changes
  • Zero config - Works out of the box with all frameworks

See COST_SAVINGS.md for detailed cost analysis.

🎯 Example Output

Route Impact (Files → Routes)

{
  "success": true,
  "metadata": {
    "timestamp": 1704067200000,
    "analysisType": "cached",
    "framework": "react-router",
    "totalFiles": 2,
    "cacheAge": 86400000
  },
  "impacts": [
    {
      "changedFile": "src/layout/Topbar.tsx",
      "impactedRoutes": [
        "https://app.example.com/home",
        "https://app.example.com/user/management",
        "https://app.example.com/dashboard",
        "https://app.example.com/settings"
      ],
      "reason": "layout",
      "confidence": "high"
    },
    {
      "changedFile": "src/pages/User/UserManagement.tsx",
      "impactedRoutes": [
        "https://app.example.com/user/management"
      ],
      "reason": "direct",
      "confidence": "high"
    }
  ]
}

File Impact (Routes → Files)

{
  "success": true,
  "metadata": {
    "timestamp": 1704067200000,
    "analysisType": "cached",
    "framework": "react-router",
    "totalFiles": 3,
    "cacheAge": 86400000
  },
  "impacts": [
    {
      "route": "https://app.example.com/user/management",
      "impactingFiles": [
        "src/pages/User/UserManagement.tsx",
        "src/layout/PrivateLayout.tsx",
        "src/components/UserTable.tsx",
        "src/hooks/useUserData.ts",
        "src/contexts/AuthContext.tsx"
      ],
      "reason": "shared-component",
      "confidence": "medium"
    }
  ]
}

🔧 GitHub Actions Integration

name: Route Impact Analysis

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  analyze-routes:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Get changed files
        id: changed-files
        run: |
          git diff --name-only ${{ github.event.pull_request.base.sha }} > changed-files.txt

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Install analyzer
        run: npm install -g @yofix/analyzer

      - name: Run Analysis
        run: |
          route-impact-analyzer analyze \
            --changed-files-file changed-files.txt \
            --base-url https://app.example.com \
            --llm-api-key ${{ secrets.CLAUDE_API_KEY }} \
            --output impact-report.json \
            --verbose

      - name: Comment PR
        uses: actions/github-script@v7
        with:
          script: |
            const fs = require('fs')
            const report = JSON.parse(fs.readFileSync('impact-report.json'))

            if (!report.success || report.impacts.length === 0) {
              return
            }

            let comment = `## 🎯 Route Impact Analysis\n\n`
            comment += `**Framework:** ${report.metadata.framework}\n`
            comment += `**Analysis Type:** ${report.metadata.analysisType}\n\n`

            for (const impact of report.impacts) {
              comment += `### \`${impact.changedFile}\`\n`
              comment += `**Impacted Routes (${impact.impactedRoutes.length}):**\n`
              impact.impactedRoutes.slice(0, 10).forEach(route => {
                comment += `- ${route}\n`
              })
              if (impact.impactedRoutes.length > 10) {
                comment += `- ...and ${impact.impactedRoutes.length - 10} more\n`
              }
              comment += `**Reason:** ${impact.reason} (${impact.confidence} confidence)\n\n`
            }

            github.rest.issues.createComment({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              body: comment
            })

🏗️ How It Works

Architecture Overview

The analyzer combines LLM intelligence for pattern detection with deterministic static analysis for fast, accurate impact tracing. Here's the technical breakdown:

🔍 Core Components & File References

1. Entry Points (src/index.ts, src/cli.ts)

  • analyzeRouteImpact() - Main API for Files → Routes analysis
  • analyzeFileImpact() - Reverse API for Routes → Files analysis
  • CLI powered by Commander.js with options for batch processing

2. Framework Detection (src/core/FrameworkDetector.ts)

  • Analyzes package.json dependencies
  • Inspects directory structure (pages/, app/, routes/)
  • Identifies routing strategy (file-based vs centralized)
  • Supports: React Router, Next.js, Vue Router, Angular, Remix, Nuxt, SvelteKit

3. LLM-Powered Pattern Analysis (src/core/PatternAnalyzer.ts + src/llm/ClaudeProvider.ts)

  • Gathers codebase context (file tree up to 200 files, sample routes, package.json)
  • Sends structured prompts to Claude AI via ClaudeProvider
  • Extracts routing patterns, layout components, and component mappings
  • NEW: Identifies sharedComponents array (globally used components like Button, Table)
  • NEW: Identifies pageSpecificDirectories array (page-local component directories)
  • Uses AST parsing to enrich patterns with actual route definitions
  • Resolves import aliases from tsconfig.json/jsconfig.json
  • Critical: Handles nested routes by recursively combining parent + child paths

4. Static Analysis Engine (src/core/StaticAnalyzer.ts)

  • Builds dependency graph using Breadth-First Search (BFS)
  • Parses imports with Babel AST (src/utils/ASTParser.util.ts)
  • Resolves barrel exports (index.ts re-export patterns)
  • Creates forward/reverse dependency links
  • Complexity: O(n + m) where n = files, m = imports

5. Route Impact Tracer (src/core/RouteTracer.ts)

  • Hybrid Classification System for intelligent dependency tracing:
    • page-specific: Components in /pages/*/components - traces FULL hierarchy
    • truly-shared: Global components (e.g., /components/Button) - only direct dependents
    • cross-page: Page importing from another page - traces through
    • layout: Layout/wrapper components - affects all routes using it
    • utility: Pure utility functions - only direct dependents
  • Classifies impact types:
    • Direct: Changed file IS the page component (high confidence)
    • Layout: Changed file IS a layout wrapper (high confidence)
    • Shared: Changed file used transitively (medium/low confidence based on classification)
  • Calculates confidence scores based on dependency depth and classification:
    • Depth 1 → High confidence
    • Depth 2-3 → Medium confidence
    • Depth > 3 → Low confidence
  • Critical Fix: Uses .filter() to find ALL routes per component (not just first route)
  • Deduplicates and merges results

6. Cache Management (src/cache/CacheManager.ts)

  • Dual provider support: GitHub Actions + File System
  • 30-day TTL (configurable)
  • Cache key based on project root + SHA256 hash
  • Stores pattern cache (~50-500 KB typically)

7. AST Parsing & Import Resolution

  • src/utils/ASTParser.util.ts - Babel parser for JS/TS/JSX/TSX
  • src/utils/PathResolver.util.ts - Resolves import aliases (@/*src/*)
  • src/utils/FileSystem.util.ts - File I/O and glob operations

📊 Execution Flow

Phase 1: Input Validation & Setup

User Input (changed files + options)
    ↓
Validation with Zod schemas (src/validation.ts)
    ↓
Normalize paths to project-relative
    ↓
Initialize CacheManager

Phase 2: Pattern Detection (First Run Only)

CacheManager.load()
    ↓
[Cache Hit] → Skip to Phase 3
[Cache Miss] ↓
FrameworkDetector.detect()
    ↓
PatternAnalyzer.gatherCodebaseContext()
  - Read package.json
  - Scan file tree (max 100 files)
  - Find route files based on framework
  - Read sample routes (max 15 files)
    ↓
ClaudeProvider.detectPatterns() [LLM API Call ~2-5s]
  - Send context to Claude AI
  - Parse JSON response with patterns
    ↓
PatternAnalyzer.enrichPatternCache()
  - AST parsing of all route files
  - Extract actual route definitions
  - Resolve component paths through imports
  - Build comprehensive route mappings
    ↓
CacheManager.save(patternCache)

Phase 3: Dependency Graph Building

PatternCache
    ↓
StaticAnalyzer.buildDependencyGraph()
  - Start files: routes + layouts + page components
  - BFS traversal (max depth: 10)
  - For each file:
    ├─ Parse AST to extract imports
    ├─ Resolve import paths (handle aliases)
    ├─ Resolve barrel exports (index.ts)
    ├─ Create DependencyNode
    └─ Link dependencies + dependents
    ↓
DependencyGraph {
  nodes: Map<filePath, DependencyNode>
  routes: Map<componentPath, RouteMapping>
}

Phase 4: Route Impact Tracing

DependencyGraph + ChangedFiles
    ↓
RouteTracer.traceImpacts()
  - For each changed file:
    ├─ Check: Is it a page component?
    │   Yes → Direct impact (high confidence)
    ├─ Check: Is it a layout component?
    │   Yes → All routes using layout (high confidence)
    └─ Otherwise: Find dependent routes
        ├─ BFS to find files depending on this
        ├─ Calculate dependency depth
        └─ Assign confidence score
    ↓
Merge and deduplicate results
    ↓
AnalysisResult {
  success: true,
  metadata: { timestamp, framework, analysisType },
  impacts: RouteImpact[]
}

🧮 Key Algorithms

Dependency Finding (BFS)

// Simplified algorithm from StaticAnalyzer.findDependents()
function findDependents(graph, changedFile, maxDepth) {
  const queue = [{ file: changedFile, depth: 0 }]
  const visited = new Set()
  const dependents = []

  while (queue.length > 0) {
    const { file, depth } = queue.shift()

    if (depth > maxDepth || visited.has(file)) continue
    visited.add(file)

    const node = graph.nodes.get(file)
    for (const dependent of node.dependents) {
      queue.push({ file: dependent, depth: depth + 1 })
      dependents.push(dependent)
    }
  }

  return dependents
}

Confidence Scoring

// From RouteTracer.calculateConfidence()
function calculateConfidence(depth) {
  if (depth === 1) return 'high'
  if (depth <= 3) return 'medium'
  return 'low'
}

Barrel Export Resolution

// From StaticAnalyzer.resolveBarrelExport()
// Detects: export { Button } from './components/Button'
// Resolves: 'src/pages' → ['src/pages/Home.tsx', 'src/pages/About.tsx']

⚡ Performance Characteristics

| Operation | First Run | Cached Run | Complexity | |-----------|-----------|------------|------------| | Pattern Detection | 2-5 seconds | < 100ms | O(n) LLM call | | Graph Building | 100-500ms | 100-500ms | O(n + m) | | Route Tracing | 50-200ms | 50-200ms | O(k × d) | | Total | ~3-6 seconds | < 1 second | - |

  • n = number of files
  • m = number of imports
  • k = number of changed files
  • d = max traversal depth

🎯 Why This Approach?

Hybrid Strategy Benefits:

  1. LLM for Pattern Detection - Handles any framework/structure automatically
  2. Static Analysis for Tracing - Fast, deterministic, and accurate
  3. Caching - Best of both worlds (smart + fast)

Challenges Solved:

  • Nested Routes: AST parser recursively processes children arrays with proper path concatenation
  • Layout Components: Detected via usage patterns, not naming conventions
  • Import Aliases: Resolved from tsconfig.json dynamically
  • Barrel Exports: AST-based re-export resolution
  • Confidence Scoring: Prevents false positives from distant dependencies
  • Multiple Routes Per Component: Components mapping to multiple routes (e.g., /marketing/new AND /tru-roi/new)
  • Deep Import Chains: Page-specific components traced through 5-6 level hierarchies
  • False Positive Prevention: Truly-shared components limited to direct dependents only

🔧 Key Technical Improvements (v1.1.0)

1. Hybrid Component Classification

Problem: Original logic only counted direct dependents, missing deep import chains for page-specific components.

Solution: Implemented intelligent classification system:

switch (classification) {
  case 'page-specific':
    shouldInclude = true  // Trace through FULL hierarchy
    break
  case 'truly-shared':
    shouldInclude = directDependents.has(dependent)  // Only direct
    break
  // ... other classifications
}

Impact: CampaignDetailDrawer went from 2 routes → 7 routes (found all /tru-roi/* variants)

2. Multiple Routes Per Component

Problem: Used .find() which only returned first route when components mapped to multiple routes.

Solution: Changed to .filter() to get ALL routes:

// Before: const mapping = routeMappings.find(m => m.component === file)
// After:  const mappings = routeMappings.filter(m => m.component === file)

Impact: ConfigurationCenter went from 1 route → 5 routes (all variants found)

3. Nested Route Extraction

Problem: AST parser wasn't recursively processing children arrays in route objects.

Solution: Rewrote extractReactRouterRoutes() to:

  • Recursively process nested structures
  • Concatenate parent + child paths (e.g., /tru-roi + /campaign-metrics)
  • Handle index routes that use parent path

Impact: Cache now correctly extracts 254 routes vs 270 duplicates before

4. Enhanced LLM Pattern Detection

Problem: LLM didn't have enough context to identify page-specific vs shared components.

Solution: Enhanced prompts with:

  • 200 files (up from 100)
  • sharedComponents array extraction (25 components)
  • pageSpecificDirectories array extraction (28 directories)

Impact: 100% classification accuracy for page-specific components


First Run (Pattern Detection with LLM)

  1. Framework Detection - Identifies your framework (React Router, Next.js, Vue, etc.)
  2. Pattern Analysis - Claude AI analyzes your codebase to understand:
    • Where routes are defined
    • How components map to routes
    • Which files are layouts/wrappers
    • Import alias patterns
  3. Cache Generation - Saves patterns for 30 days

Subsequent Runs (Deterministic Analysis)

  1. Load Cached Patterns - Retrieves patterns from cache (< 100ms)
  2. Build Dependency Graph - Maps all file dependencies
  3. Trace Impacts - Determines which routes are affected by changes
  4. Output Results - Returns impacted routes with confidence scores

🚀 Future Improvements & Roadmap

🎯 Planned Features

1. Enhanced Analysis Capabilities

  • CSS/Style Impact Detection - Track which routes are affected by global CSS changes
  • State Management Tracing - Detect impacts through Redux/Zustand/Context providers
  • API Route Analysis - Map frontend routes to backend API endpoints
  • Performance Impact Scoring - Estimate bundle size changes per route
  • Dead Code Detection - Identify unused route components

2. Smart Caching Enhancements

  • Incremental Cache Updates - Update only changed patterns instead of full refresh
  • Multi-Project Cache Sharing - Share patterns across monorepo packages
  • Redis/DynamoDB Support - Distributed caching for team environments
  • Cache Versioning - Support multiple pattern versions simultaneously
  • Partial Cache Invalidation - Invalidate only affected routes, not entire cache

3. Advanced Dependency Analysis

  • Circular Dependency Detection - Warn about problematic import cycles
  • Dynamic Import Tracing - Better handling of React.lazy() and code splitting
  • Webpack/Vite Bundle Analysis - Integrate with build tools for accurate bundling
  • Cross-Package Dependencies - Support for monorepo/workspace analysis
  • CSS-in-JS Dependency Tracking - Trace styled-components/Emotion impacts

4. Framework-Specific Optimizations

  • Next.js App Router Metadata - Track metadata file impacts (layout.tsx, page.tsx)
  • Next.js Server Actions - Trace server action dependencies
  • Remix Loader/Action Tracing - Detect impacts on data loaders
  • Vue 3 Composition API - Better support for composables and provide/inject
  • Angular Lazy Loading - Improved module boundary detection

5. Developer Experience

  • VS Code Extension - Real-time route impact preview in editor
  • Git Hook Integration - Pre-commit route impact validation
  • Interactive CLI Mode - TUI for exploring impacts visually
  • Watch Mode - Continuous analysis during development
  • Diff Visualization - Visual graph of affected routes

6. CI/CD & Collaboration

  • GitLab CI Integration - Native support for GitLab caching
  • Custom Webhook Support - Send impacts to Slack/Teams/Discord
  • PR Size Estimation - Predict review effort based on route impacts
  • Test Selection - Suggest which E2E tests to run based on impacts
  • Release Notes Generation - Auto-generate changelog by route

7. Accuracy & Intelligence

  • Machine Learning Confidence - Train models on historical accuracy
  • User Feedback Loop - Learn from manual overrides
  • Multi-LLM Support - OpenAI GPT-4, Google Gemini as alternatives
  • Hybrid Analysis - Combine LLM + static analysis scores
  • Custom Pattern Training - Allow teams to define custom patterns

8. Performance & Scalability

  • Parallel AST Parsing - Use worker threads for large codebases
  • Streaming Analysis - Process files incrementally for huge repos
  • Selective Indexing - Only analyze changed subtrees
  • Binary Cache Format - Faster serialization with Protocol Buffers
  • Graph Database Integration - Use Neo4j for complex dependency queries

9. Testing & Validation

  • Impact Verification Mode - Run tests on affected routes to confirm
  • Historical Accuracy Tracking - Dashboard showing prediction success rate
  • A/B Testing Support - Track impacts across feature flags
  • Regression Testing - Ensure cache updates don't break existing patterns

10. Enterprise Features

  • Team Collaboration - Share and merge pattern databases
  • Audit Logging - Track all analysis runs and cache modifications
  • Custom Rules Engine - Define organization-specific impact rules
  • Multi-Tenant Support - Isolate caches per team/project
  • SLA Monitoring - Track analysis performance and reliability

💡 Implementation Suggestions

Quick Wins (Low Effort, High Impact)

  1. Add --watch mode to CLI for continuous analysis
  2. Export GitHub Actions workflow as reusable action
  3. Add JSON schema validation for cache files
  4. Implement cache warmup CLI command
  5. Add support for .gitignore patterns in exclusions

Medium Term (Moderate Effort)

  1. Build VS Code extension with real-time preview
  2. Add CSS/SCSS dependency tracking
  3. Implement incremental cache updates
  4. Add support for dynamic imports
  5. Create interactive TUI with blessed/ink

Long Term (High Effort, High Value)

  1. Machine learning for confidence scoring
  2. Full monorepo/workspace support
  3. Graph database integration for complex queries
  4. Performance impact prediction
  5. Custom LLM fine-tuning for specific codebases

🛠️ Contributing Ideas

Want to contribute? Here are some areas where help is needed:

  • Framework Support - Add support for Qwik, Solid.js, Astro
  • Testing - Write E2E tests with real-world codebases
  • Documentation - Create video tutorials and blog posts
  • Benchmarking - Compare accuracy across different frameworks
  • Bug Fixes - Check Issues for open bugs

📈 Metrics & Success Criteria

Current Performance (Verified):

  • Pattern detection: ~30-35 seconds (first run with LLM)
  • Cached analysis: < 100ms (using existing patterns)
  • Accuracy: 100% ✅ (verified against 20 real-world routes across 5 PRs)
  • Direct impacts: 100% accuracy (high confidence)
  • Shared components: 100% accuracy (medium/low confidence based on depth)
  • False positives: 0
  • False negatives: 0

Achievement Status:

  • ✅ Accuracy: 100% for all impact types (exceeded 95% goal)
  • ✅ First run: ~30s (LLM analysis + graph building)
  • ✅ Cached run: < 100ms (exceeded 500ms goal)
  • ✅ Support: 7+ frameworks
  • ✅ Cache hit rate: ~85% with auto mode

See VERIFICATION_RESULTS.md and MANUAL_VERIFICATION.md for detailed accuracy validation.


📚 Supported Frameworks

  • ✅ React Router (v5, v6)
  • ✅ Next.js (Pages Router, App Router)
  • ✅ Vue Router
  • ✅ Angular Router
  • ✅ Remix
  • ✅ Nuxt
  • ✅ SvelteKit

⚙️ Configuration Options

LLM Config

llm: {
  provider: 'anthropic',
  apiKey: process.env.CLAUDE_API_KEY,
  model: 'claude-sonnet-4-5-20250929', // or 'claude-3-opus'
  maxTokens: 4096,
  temperature: 0.3
}

Cache Config

cache: {
  enabled: true,                     // Enable/disable caching (default: true)
  forceRefresh: 'auto',              // false | true | 'auto' (default: false)
                                     // false = use cache (default behavior)
                                     // true = always refresh
                                     // 'auto' = smart invalidation (recommended for CI/CD)
  provider: 'github-actions',        // or 'file-system', 'redis'
  ttl: 30 * 24 * 60 * 60,           // 30 days in seconds (default)
  cacheKey: 'custom-key'             // Optional custom cache key
}

forceRefresh Modes Explained:

| Mode | When to Use | LLM Calls | Cost | Accuracy | |------|-------------|-----------|------|----------| | false (default) | Local dev, stable codebases | Only on first run | Low | High (until routes change) | | 'auto' ⭐ | CI/CD (recommended) | Only when routes change (~15% of PRs) | Lowest | Highest | | true | Testing, debugging | Every run | Highest | Highest |

Note: If forceRefresh is not specified, it defaults to false (normal caching behavior).

Analysis Options

analysis: {
  includeLayouts: true,          // Include layout component impacts
  maxDepth: 10,                  // Max dependency traversal depth
  excludePatterns: [             // Patterns to exclude
    '**/*.test.tsx',
    '**/*.spec.ts'
  ],
  verbose: true                  // Verbose logging
}

🧪 Testing

# Run tests
npm test

# Run with coverage
npm test -- --coverage

# Run in watch mode
npm test -- --watch

📖 API Reference

See docs/API.md for detailed API documentation.

🤝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md for details.

📄 License

MIT License - see LICENSE for details.

🙏 Acknowledgments

🔐 Environment Variables

The library supports loading API keys from environment variables. Create a .env file in your project root:

CLAUDE_API_KEY=sk-ant-xxxx

Or export it in your shell:

export CLAUDE_API_KEY=sk-ant-xxxx

The CLI will automatically read from process.env.CLAUDE_API_KEY if --llm-api-key is not provided.

📧 Support


Made with ❤️ for better CI/CD workflows