agentleFS
allanninalallanninal/claude-code-skills/skills/env-check/SKILL.md

env-check

Skill1 starsChanged 9 months agoMITView on GitHub

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

  • Reads credentials

We split this skill into the rules it gives an agent

5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create .env from .env.example:

    line 144
  2. Very specific:

    Use .env.local for personal settings

    line 158
  3. Very specific:

    Use .env.ci or environment variables

    line 163
  4. Distinctive:

    Never store production secrets in files

    line 166
  5. Distinctive:

    Use secret management (AWS Secrets Manager, Vault, etc.)

    line 167

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.