Configuration Validator

VerifiedCaution

Validates configuration files and environment variables to prevent runtime errors. Detects missing settings and validates their format and types.

Sby Skills Guide Bot
DevOpsIntermediate
3/1/2026
Claude CodeCursorCodex
#environment-variables#configuration#validation#secrets-safety#deployment

Recommended for

Automated summary

Checks configuration files and environment variables (.env, config.json, settings.py, application.yml) to surface missing, malformed, or undocumented settings before deployment.

Strengths

  • Diffs .env.example against .env with comm/grep to list missing variables
  • Ships ready-to-paste format and type checks for Node.js and Python, including PORT and URL validation
  • Suggests schema validation (Joi example) plus basic security checks: .env in .gitignore, hardcoded secrets
  • Generates a .env.example from the real file using sed

Limitations

  • Relies on grep heuristics limited to uppercase variable names, so other naming conventions may be missed
  • Code samples are mostly JavaScript/Node.js and Python, with Joi as the only schema library mentioned
  • Does not run the app, so runtime validation must be added to the code by the user
  • Secret detection is a simple grep, not a real credential scanner
When to use it

Use it whenever you add or change environment variables, or when a deployment fails because of a missing configuration setting.

When not to use it

Avoid it for configs managed by an external service (Vault, SSM) or as a replacement for a thorough security audit.

Security analysis

Caution
Quality score86/100

The skill is legitimate configuration validation, but it instructs the agent to read .env files that often contain secrets and to write generated files via Bash/Write. These are powerful capabilities used for a reasonable purpose, so it warrants caution rather than being outright risky.

Findings
  • •Uses Bash and Write tools to read .env files, which may contain secrets, and to generate/overwrite .env.example files.
  • •The sed command `sed 's/=.*/=/' .env > .env.example` can overwrite an existing .env.example without confirmation.
  • •No exfiltration or destructive actions are present, but secrets could be exposed in agent context during validation.
How this analysis is made

Examples

Audit .env completeness
Compare my .env and .env.example, list every variable that's missing from .env, and flag any values that look malformed.
Generate example template
Create a safe .env.example from my .env with placeholder values, and make sure .env is in .gitignore.
Add startup validation
Add a startup check to my Node.js app that validates required env vars and their types (PORT, DATABASE_URL, API_KEY) and fails fast with a clear error.

name: configuration-validator description: Validates environment variables, config files, and ensures all required settings are documented. Use when working with .env files, configs, or deployment settings. allowed-tools: Read, Grep, Glob, Write, Bash

Configuration Validator

Validates configuration files and environment variables to prevent runtime errors and missing settings.

When to Use

  • Working with environment variables or config files
  • Deployment or configuration issues
  • User mentions ".env", "config", "environment variables", or "settings"

Instructions

1. Find Configuration Files

Search for:

  • .env, .env.example, .env.local
  • config/, config.js, config.json
  • settings.py, application.yml
  • appsettings.json, .env.production

2. Detect Missing Variables

Compare .env.example vs .env:

# Variables in example but not in .env
comm -23 <(grep -o '^[A-Z_]*' .env.example | sort) <(grep -o '^[A-Z_]*' .env | sort)

Common required variables:

DATABASE_URL
API_KEY
SECRET_KEY
NODE_ENV
PORT

3. Validate Variable Format

Check for common issues:

// Missing quotes for values with spaces
DATABASE_URL=postgres://localhost/db name  // Bad
DATABASE_URL="postgres://localhost/db name"  // Good

// Missing protocol
API_URL=example.com  // Bad
API_URL=https://example.com  // Good

// Boolean as string
DEBUG=true  // Might be interpreted as string
DEBUG=1  // More explicit

4. Validate Required Variables at Runtime

Node.js example:

const requiredEnvVars = [
  'DATABASE_URL',
  'API_KEY',
  'JWT_SECRET'
];

const missing = requiredEnvVars.filter(v => !process.env[v]);

if (missing.length > 0) {
  throw new Error(`Missing required env vars: ${missing.join(', ')}`);
}

Python example:

import os

REQUIRED_ENV_VARS = [
    'DATABASE_URL',
    'SECRET_KEY',
    'ALLOWED_HOSTS'
]

missing = [var for var in REQUIRED_ENV_VARS if not os.getenv(var)]

if missing:
    raise EnvironmentError(f"Missing env vars: {', '.join(missing)}")

5. Type Validation

Validate types:

const config = {
  port: parseInt(process.env.PORT || '3000', 10),
  debug: process.env.DEBUG === 'true',
  apiUrl: new URL(process.env.API_URL), // Throws if invalid
  maxConnections: Number(process.env.MAX_CONNECTIONS),
};

// Validate
if (isNaN(config.port) || config.port < 1 || config.port > 65535) {
  throw new Error('PORT must be a valid port number');
}

6. Generate .env.example

Create template from actual .env:

# Remove values, keep keys
sed 's/=.*/=/' .env > .env.example

Or with placeholders:

DATABASE_URL=postgres://user:password@localhost:5432/dbname
API_KEY=your_api_key_here
SECRET_KEY=generate_random_secret
PORT=3000
NODE_ENV=development

7. Configuration Schema

Define schema (using Joi example):

const Joi = require('joi');

const envSchema = Joi.object({
  NODE_ENV: Joi.string()
    .valid('development', 'production', 'test')
    .required(),
  PORT: Joi.number()
    .port()
    .default(3000),
  DATABASE_URL: Joi.string()
    .uri()
    .required(),
  API_KEY: Joi.string()
    .min(32)
    .required(),
  DEBUG: Joi.boolean()
    .default(false),
}).unknown();

const { error, value } = envSchema.validate(process.env);

if (error) {
  throw new Error(`Config validation error: ${error.message}`);
}

module.exports = value;

8. Security Checks

Don't commit secrets:

# Check if .env is gitignored
if ! grep -q "^\.env$" .gitignore; then
  echo "Warning: .env not in .gitignore"
fi

# Check for hardcoded secrets in code
grep -r "api_key.*=.*['\"]" --exclude-dir=node_modules

Common security issues:

  • Hardcoded passwords/keys
  • Default secrets in production
  • Exposed sensitive configs
  • Unencrypted secrets

9. Environment-Specific Configs

Organize by environment:

.env.development
.env.staging
.env.production
.env.test

Load appropriately:

require('dotenv').config({
  path: `.env.${process.env.NODE_ENV || 'development'}`
});

10. Document All Variables

Create CONFIG.md:

# Configuration

## Environment Variables

### Required

- `DATABASE_URL`: PostgreSQL connection string
  - Format: `postgres://user:pass@host:port/db`
  - Example: `postgres://app:secret@localhost:5432/myapp`

- `API_KEY`: Third-party API key
  - Obtain from: https://dashboard.example.com
  - Required scopes: read, write

### Optional

- `PORT`: Server port (default: 3000)
- `DEBUG`: Enable debug logging (default: false)
- `MAX_CONNECTIONS`: Database pool size (default: 10)

## Setup

1. Copy `.env.example` to `.env`
2. Fill in all required values
3. Run `npm run validate-config` to verify

11. Validation Script

Create scripts/validate-config.js:

const fs = require('fs');

function validateConfig() {
  const required = ['DATABASE_URL', 'API_KEY'];
  const missing = required.filter(v => !process.env[v]);

  if (missing.length > 0) {
    console.error(`❌ Missing: ${missing.join(', ')}`);
    process.exit(1);
  }

  console.log('✓ All required config variables present');
}

validateConfig();

12. Best Practices

  • Never commit .env: Always gitignore
  • Maintain .env.example: Keep it updated
  • Validate on startup: Fail fast if misconfigured
  • Use strong defaults: Sensible fallbacks
  • Document everything: Explain each variable
  • Rotate secrets: Regularly update keys
  • Use secret managers: Vault, AWS Secrets Manager for production
  • Type check: Validate types, not just presence

Supporting Files

  • templates/config-validator.js
  • templates/.env.example
  • scripts/generate-env-example.sh

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/configuration-validator-mm78no5j/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/configuration-validator-mm78no5j' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/configuration-validator-mm78no5j/download' --output '.skill-downloads/configuration-validator-mm78no5j/SKILL.md.part' && mv '.skill-downloads/configuration-validator-mm78no5j/SKILL.md.part' '.skill-downloads/configuration-validator-mm78no5j/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Read, Grep, Glob, Write, Bash

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/configuration-validator-mm78no5j/SKILL.md' && test -s '.skill-downloads/configuration-validator-mm78no5j/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/configuration-validator' && cp -R '.skill-downloads/configuration-validator-mm78no5j' '.claude/skills/configuration-validator'

Cursor
test -f '.skill-downloads/configuration-validator-mm78no5j/SKILL.md' && test -s '.skill-downloads/configuration-validator-mm78no5j/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/configuration-validator' && cp -R '.skill-downloads/configuration-validator-mm78no5j' '.cursor/skills/configuration-validator'

Codex
test -f '.skill-downloads/configuration-validator-mm78no5j/SKILL.md' && test -s '.skill-downloads/configuration-validator-mm78no5j/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/configuration-validator' && cp -R '.skill-downloads/configuration-validator-mm78no5j' '.agents/skills/configuration-validator'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/configuration-validator-mm78no5j'

openskills read 'configuration-validator-mm78no5j'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/configuration-validator-mm78no5j/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills