configuration-validator
Validates environment variables, config files, and ensures all required settings are documented. Use when working with .env files, configs, or deployment settings.
Best use case
configuration-validator is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. Validates environment variables, config files, and ensures all required settings are documented. Use when working with .env files, configs, or deployment settings.
Validates environment variables, config files, and ensures all required settings are documented. Use when working with .env files, configs, or deployment settings.
Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.
Practical example
Example input
Use the "configuration-validator" skill to help with this workflow task. Context: Validates environment variables, config files, and ensures all required settings are documented. Use when working with .env files, configs, or deployment settings.
Example output
A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.
When to use this skill
- Use this skill when you want a reusable workflow rather than writing the same prompt again and again.
When not to use this skill
- Do not use this when you only need a one-off answer and do not need a reusable workflow.
- Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/configuration-validator/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How configuration-validator Compares
| Feature / Agent | configuration-validator | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Validates environment variables, config files, and ensures all required settings are documented. Use when working with .env files, configs, or deployment settings.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 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:**
```bash
# 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:**
```javascript
// 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:**
```javascript
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:**
```python
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:**
```javascript
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:
```bash
# 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):**
```javascript
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:**
```bash
# 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:**
```javascript
require('dotenv').config({
path: `.env.${process.env.NODE_ENV || 'development'}`
});
```
### 10. Document All Variables
**Create CONFIG.md:**
```markdown
# 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`:
```javascript
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`Related Skills
ui-visual-validator
Rigorous visual validation expert specializing in UI testing, design system compliance, and accessibility verification. Masters screenshot analysis, visual regression testing, and component validation. Use PROACTIVELY to verify UI modifications have achieved their intended goals through comprehensive visual analysis.
shellcheck-configuration
Master ShellCheck static analysis configuration and usage for shell script quality. Use when setting up linting infrastructure, fixing code issues, or ensuring script portability.
sast-configuration
Configure Static Application Security Testing (SAST) tools for automated vulnerability detection in application code. Use when setting up security scanning, implementing DevSecOps practices, or automating code vulnerability detection.
prometheus-configuration
Set up Prometheus for comprehensive metric collection, storage, and monitoring of infrastructure and applications. Use when implementing metrics collection, setting up monitoring infrastructure, or configuring alerting systems.
n8n-node-configuration
Operation-aware node configuration guidance. Use when configuring nodes, understanding property dependencies, determining required fields, choosing between get_node detail levels, or learning common configuration patterns by node type.
mtls-configuration
Configure mutual TLS (mTLS) for zero-trust service-to-service communication. Use when implementing zero-trust networking, certificate management, or securing internal service communication.
conductor-validator
Validates Conductor project artifacts for completeness, consistency, and correctness. Use after setup, when diagnosing issues, or before implementation to verify project context.
azure-appconfiguration-java
Azure App Configuration SDK for Java. Centralized application configuration management with key-value settings, feature flags, and snapshots. Triggers: "ConfigurationClient java", "app configuration java", "feature flag java", "configuration setting java", "azure config java".
ml-antipattern-validator
Prevents 30+ critical AI/ML mistakes including data leakage, evaluation errors, training pitfalls, and deployment issues. Use when working with ML training, testing, model evaluation, or deployment.
data-validator
Validate data against schemas, business rules, and data quality standards.
docs-validator
Documentation quality validator for Logseq Template Graph. Checks documentation completeness, accuracy, formatting, links, and consistency. Activates when asked to "validate docs", "check documentation", "audit docs quality", "find broken links", or similar requests. Provides actionable feedback and specific fixes for documentation issues.
system-integration-validator
Validates system integration before deployment. Use when checking ports, database connections, frontend-backend APIs, or debugging blocked/stuck workflows. Detects dead ends, bottlenecks, circular dependencies.