# .env Schema Validation and .env.example Generator

> Validate .env files against a JSON schema, draft a schema from an existing file, and keep a documented .env.example in sync. Reports key names only, never values. Offline scripts, templates and 41 tests.

.env Schema Validation and .env.example Generator is a paid AI agent skill on Agensi by José Miguel Gómez, in DevOps & Cloud. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $5 (one-time purchase)
- Creator: [José Miguel Gómez](https://www.agensi.io/creators/jose-miguel-gomez)
- Category: [DevOps & Cloud](https://www.agensi.io/skills/devops-cloud)
- Version: 1.0
- Last updated: 2026-12-03
- Security: scan passed (2026-12-03); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/env-schema-validation-and-env-example-generator
- Tags: devops, security, automation, documentation, testing, api

## What it does

- Creates a master blueprint from your existing configuration files to define required settings
- Validates your private files against the blueprint to catch missing keys or formatting errors
- Generates a safe example file for teammates that describes each setting without showing your secrets
- Detects when your example file and your blueprint get out of sync as the project grows
- Provides ready-to-use recipes for checking configuration during the automated build process
- Identifies specific error codes and line numbers for quick fixes without exposing private data

## Who it's for

- **Software founders and project leads:** Make sure every team member and server has the right settings without leaking passwords. Try: "Check if my .env file matches the project schema and tell me what is missing."
- **Developers building secure apps:** Automatically find missing variables or wrong formats before they break your app in production. Try: "Create a .env.example file from my current configuration so others know what to set up."
- **DevOps and Release Engineers:** Prevent broken deployments by catching configuration errors in your build pipeline. Try: "Run a drift check between our schema and the example environment file."

## About this skill

Setting up a new project or server often breaks because a secret variable is missing or typed wrong. This skill helps your AI agent manage those hidden configuration files safely. It looks at your settings to create a master blueprint, then checks your actual files against it to find errors.

It is built for privacy. Your AI agent will never see or repeat your actual passwords or keys. Instead, it only looks at the names of the settings and their format. It can draft a template for new team members to use, so they know exactly what to fill in without you having to hand over your own private keys.

**How it works**

1. Tell your AI agent which configuration file to look at.
2. The agent creates a blueprint that defines what each setting should look like.
3. You can ask the agent to check your real files against this blueprint to find mistakes.
4. The agent generates a safe template file with instructions for other users.
5. Use the provided recipes to make these checks happen automatically whenever code is updated.

**What you get:** A documented template and a report of any missing or incorrect settings in your configuration files.

## Requires

- Python

## Known limitations

It does not support complex variables that reference other variables. It only handles standard text files up to 10,000 lines.

## Technical details

Built with Python 3 scripts that use standard libraries for JSON and Regex validation. It includes schema_from_env.py for inference, dotenv_schema.py for validation, and check_example.py for drift detection. It follows a strict no-echo policy for values, only processing keys and metadata to prevent secret leakage into logs or LLM context. Supports custom regex patterns and basic data types (string, integer, boolean) via a custom JSON schema format defined in the references folder.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the .env Schema Validation and .env.example Generator skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### What problem does this skill help me solve?

This skill helps you find missing or incorrectly typed settings in your configuration files before they cause errors. It also automatically builds a template for your team to use so they know which settings to fill in without seeing your private passwords.

### Do I need to sign up for any extra services to use this?

You do not need any special accounts. You only need the configuration files you want to check and a computer with Python 3 to run the scripts.

### What exactly will I receive after the agent runs these scripts?

The skill gives you a blueprint of your settings, a report on any errors found, and a safe template file. It can also provide automated recipes for checking your work every time you update your code.

### Are there any types of configuration files or settings it cannot handle?

It cannot handle very large files over 10,000 lines or complex settings that pull data from other variables. It also will not automatically know your specific rules for things like number ranges or lists unless you review and update the blueprint it drafts.

### How does this keep my private passwords and API keys safe?

It is built to never read, print, or repeat your actual passwords or secret keys. It only looks at the names of the settings and their format to make sure they are correct, keeping your sensitive data private.

### How do I get my agent started with these tools?

You can start by asking your agent to look at a specific configuration file and draft a blueprint from it. From there, you can ask the agent to validate your files against that blueprint or create a documented example for your team.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
