Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
ofershap avatar

Env Validation

  • 1 installs
  • Updated March 7, 2026
  • ofershap/env-guard

Validates a .env file against .env.example or a JSON schema, reporting missing, extra, or type-mismatched variables with a non-zero exit code on failure.

About

This skill compares a .env file against .env.example or a JSON schema and returns structured errors for missing, extra, or invalid variables. A developer uses it in CI or pre-deploy hooks to catch environment config problems before the app runs.

  • Zero-config diff of .env against .env.example
  • JSON schema mode plus exit code 1 for CI use

Env Validation by the numbers

  • 1 all-time installs (skills.sh)
  • Ranked #1,173 of 1,435 DevOps & CI/CD skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/ofershap/env-guard --skill env-validation

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1
Last updatedMarch 7, 2026
Repositoryofershap/env-guard

What it does

Validates a .env file against .env.example or a JSON schema, reporting missing, extra, or type-mismatched variables with a non-zero exit code on failure.

Files

SKILL.mdMarkdownGitHub ↗

Environment Variable Validation

Use this skill to validate .env files against .env.example or a JSON schema. Catches missing, extra, or invalid environment variables before your app does.

Usage

# Zero config — checks .env against .env.example
npx env-guard

# Custom paths
npx env-guard --env .env.production --example .env.example

# JSON schema validation
npx env-guard --schema env-schema.json

As a Library

import { validate } from "env-guard";

const result = validate({
  env: ".env",
  example: ".env.example",
});

if (!result.valid) {
  console.error(result.errors);
  process.exit(1);
}

Key Patterns

  • Zero config by default — compares .env against .env.example in the current directory
  • JSON schema mode validates types, patterns, and required fields
  • Returns structured errors: missing variables, extra variables, type mismatches
  • Zero dependencies — no supply chain risk
  • Exit code 1 on failure — safe to use in CI pipelines and pre-deploy hooks

Related skills

DevOps & CI/CDdevopstesting

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.