Skip to content
| Marketplace
Sign in
Visual Studio Code>Linters>Contract Drift DetectorNew to Visual Studio Code? Get it now.
Contract Drift Detector

Contract Drift Detector

devcontractguard

| (0) | Free
Professional drift detection for config, environment, API, and route contracts. Detect inconsistencies before they break production.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

ContractGuard 🛡️

Professional drift detection for config, environment, API, and route contracts.

Detect contract drift before it breaks production. Automatically identify inconsistencies in your configuration files, environment variables, API routes, and code references with actionable recommendations.

Features

✨ Environment Variable Drift Detection

  • Detects inconsistencies between .env, .env.production, .env.development files
  • Identifies missing or extra variables
  • Prevents runtime errors from configuration mismatches

🔗 Configuration Contract Validation

  • Scans for multiple package.json files and config inconsistencies
  • Validates configuration file presence and completeness
  • Helps maintain consistent settings across your project

🛣️ Route & API Endpoint Checks

  • Detects route/API definition files
  • Identifies potential route mismatches
  • Ensures API contract consistency

⚠️ Stale Reference Warnings

  • Finds TODO, FIXME, and XXX comments
  • Identifies outdated code references
  • Helps reduce technical debt

📊 Professional Results Dashboard

  • Health score (0-100) with color-coded status
  • Detailed statistics and metrics
  • Grouped issues by severity and type
  • Actionable recommendations for each issue

📤 Multiple Export Formats

  • JSON - for automation and CI/CD integration
  • CSV - for spreadsheet analysis
  • HTML - professional reports for stakeholders

Installation

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
  3. Search for "ContractGuard"
  4. Click Install

Quick Start

  1. Open a project folder in VS Code
  2. Press Ctrl+Shift+D (Cmd+Shift+D on Mac) to open drift scan
  3. Click "Run Drift Scan" button
  4. Review the results with health score, statistics, and issues
  5. Export results in JSON, CSV, or HTML format

Commands

Command Shortcut Description
ContractGuard: Show Drift Scan Ctrl+Shift+D Open the main drift scan panel
ContractGuard: Quick Scan Ctrl+Shift+Alt+D Run a quick scan with notifications
ContractGuard: Export Results Command Palette Export latest scan results

How It Works

Environment Variable Scanning

  • Reads all .env* files in your project
  • Compares variables across different environment files
  • Detects missing variables that should be consistent
  • Alerts on extra variables that may indicate drift

Configuration Analysis

  • Searches for package.json, tsconfig.json, .env.example files
  • Detects multiple configuration files that suggest inconsistency
  • Validates configuration presence and structure

Route & API Detection

  • Scans common route/API patterns
  • Identifies route definition files for analysis
  • Checks for consistency in API definitions

Code Quality Checks

  • Searches for TODO, FIXME, and XXX comments
  • Identifies potential stale code references
  • Helps track and reduce technical debt

Results Dashboard

Health Score

  • 80+: Excellent ✓ - Keep it up!
  • 60-79: Good - Minor improvements needed
  • 40-59: Fair - Address warnings
  • 0-39: Critical - Immediate action required

Statistics

  • Total issues found
  • Breakdown by severity (Errors, Warnings, Info)
  • Issues by category (Environment, Config, Routes, References)
  • Number of files affected

Issues & Recommendations

Each issue includes:

  • Type: Category of the issue
  • Severity: Error, Warning, or Info
  • Message: What was detected
  • Details: Specific information
  • Recommendation: How to fix it

Export Formats

JSON Export

Perfect for automation and CI/CD pipelines.

CSV Export

Great for spreadsheet analysis and reporting.

HTML Export

Professional report for sharing with stakeholders.

Tips & Best Practices

Prevent Environment Drift

  1. Use .env.example as your source of truth
  2. Add new variables to all environment files simultaneously
  3. Document required variables and their purposes
  4. Run ContractGuard in your CI/CD pipeline

Maintain Configuration Consistency

  1. Keep a single package.json at project root (unless monorepo)
  2. Use configuration management tools for consistency
  3. Document all configuration requirements
  4. Review configuration regularly with your team

Reduce Technical Debt

  1. Convert TODO/FIXME comments to GitHub issues
  2. Schedule regular technical debt reviews
  3. Address warnings before they become errors
  4. Export reports to track improvement over time

Requirements

  • VS Code 1.89.0 or higher
  • Node.js projects (or any project with config/env files)

License

MIT License - see LICENSE file for details


Made with ❤️ to prevent production breaking changes

Usage

  1. Open a project
  2. Run ContractGuard: Show Drift Scan
  3. Review warnings

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft