Agent Skill
2/7/2026

env-check

Validate environment configuration and check required variables are set. Use when setting up projects, debugging configuration issues, or verifying deployment readiness.

A
allanninal
0GitHub Stars
2Views
npx skills add allanninal/claude-code-skills

SKILL.md

Nameenv-check
DescriptionValidate environment configuration and check required variables are set. Use when setting up projects, debugging configuration issues, or verifying deployment readiness.

name: env-check description: Validate environment configuration and check required variables are set. Use when setting up projects, debugging configuration issues, or verifying deployment readiness. argument-hint: [environment] allowed-tools: Bash, Read, Glob, Grep

Environment Configuration Checker

Validate environment files and ensure all required variables are properly configured.

Arguments

  • $ARGUMENTS: Environment name - local, development, staging, production (optional - defaults to local)

Environment File Patterns

PatternPriorityUsage
.env.localHighestLocal overrides (never committed)
.env.developmentHighDevelopment environment
.env.stagingMediumStaging environment
.env.productionMediumProduction environment
.envLowDefault/fallback values
.env.exampleReferenceTemplate with all variables

Checks Performed

1. File Existence

# Check which env files exist
ls -la .env* 2>/dev/null

# Check for .env.example (required for documentation)
if [ ! -f ".env.example" ]; then
    echo "WARNING: No .env.example file found"
fi

2. Required Variables

Common Required Variables:

VariableProjectsPurpose
DATABASE_URLPostgreSQL projectsDatabase connection
MONGODB_URIMongoDB projectsMongoDB connection
JWT_SECRETAll backendsToken signing
AUTH0_*Auth0 projectsAuthentication
NEXT_PUBLIC_API_URLNext.jsAPI endpoint
PORTAll backendsServer port

Project-Specific Variables:

ProjectRequired Variables
eruditiontx-services-mvpMONGODB_URI, JWT_SECRET_KEY, JWT_ALGORITHM, JWT_ACCESS_TOKEN_EXPIRE_MINUTES
mathmatterstx-servicesMONGODB_URI, JWT_SECRET_KEY, MINIO_* (for storage)
notaryo.phDATABASE_URL, NEXTAUTH_SECRET, NEXTAUTH_URL
bocs-turboPer-app configuration

3. Variable Format Validation

# Check for empty values
grep -E "^[A-Z_]+=\s*$" .env

# Check for placeholder values
grep -E "(your_|changeme|TODO|FIXME|xxx)" .env

# Check URL format
grep -E "^.*_URL=" .env | while read line; do
    value=$(echo $line | cut -d'=' -f2)
    if [[ ! $value =~ ^https?:// ]]; then
        echo "WARNING: Invalid URL format: $line"
    fi
done

4. Security Checks

# Check if secrets are not placeholder values
grep -E "(SECRET|KEY|PASSWORD)" .env | while read line; do
    value=$(echo $line | cut -d'=' -f2)
    if [[ ${#value} -lt 16 ]]; then
        echo "WARNING: Secret appears too short: $(echo $line | cut -d'=' -f1)"
    fi
done

# Check .gitignore includes .env files
grep -q "\.env" .gitignore || echo "WARNING: .env not in .gitignore"

5. Compare with Example

# Get variables from .env.example
example_vars=$(grep -E "^[A-Z_]+=" .env.example | cut -d'=' -f1 | sort)

# Get variables from current .env
current_vars=$(grep -E "^[A-Z_]+=" .env 2>/dev/null | cut -d'=' -f1 | sort)

# Find missing variables
comm -23 <(echo "$example_vars") <(echo "$current_vars")

Output Format

Environment Check: [project-name]
Environment: [local/development/staging/production]

Files Found:
  .env.example     (reference)
  .env.local       (active)
  .env.development (available)

Required Variables:
  DATABASE_URL      SET
  JWT_SECRET        SET
  API_KEY           MISSING

Validation:
  Empty values:     0
  Placeholder values: 1 (API_KEY)
  Invalid URLs:     0

Security:
  Secrets length:   OK
  .gitignore:       OK

Missing from .env (found in .env.example):
  - STRIPE_SECRET_KEY
  - SENDGRID_API_KEY

Recommendations:
  1. Set API_KEY to a valid value
  2. Add STRIPE_SECRET_KEY to .env.local

Auto-Setup Mode

Create .env from .env.example:

# Copy example to local
cp .env.example .env.local

# Prompt user to fill in required values
echo "Please update the following variables in .env.local:"
grep -E "^[A-Z_]+=(|your_|changeme)" .env.example | cut -d'=' -f1

Environment-Specific Tips

Local Development

  • Use .env.local for personal settings
  • Never commit .env.local

CI/CD

  • Set variables in GitHub Secrets or CI platform
  • Use .env.ci or environment variables

Production

  • Never store production secrets in files
  • Use secret management (AWS Secrets Manager, Vault, etc.)
Skills Info
Original Name:env-checkAuthor:allanninal