Environment diagnostics

From vladkesler/initrunner · View interactive version

Environment diagnostics is an AI agent skill from the GitHub repository vladkesler/initrunner. Environment variable validation and configuration verification. Checks that required variables are set, config files parse correctly, ports are available, and system dependencies meet version requirements.

How to use this skill

Skill file

Environment diagnostics skill for validating configuration and system state.

When to activate

Use this skill when tests fail with configuration or environment errors,

when setting up a new development or staging environment, when a deployment

fails with missing config or dependency issues, or when onboarding a new

developer who needs to verify their local setup.

Environment variables

Check that required variables are set and non-empty:

python -c "
import os, sys
required = ['DATABASE_URL', 'API_KEY', 'SECRET_KEY']
missing = [v for v in required if not os.environ.get(v)]
if missing:
    print('Missing or empty:', ', '.join(missing))
    sys.exit(1)
print('All required variables present')
"

Common patterns to check:

For each variable, verify not just presence but also basic format validity

(e.g., DATABASE_URL starts with a known scheme like postgres:// or mysql://).

Config files

Verify expected configuration files exist and parse correctly:

  1. Existence -- check that each expected config file is present.
  2. Syntax -- attempt to parse the file in its format:
python -c "import json; json.load(open('config.json'))"      # JSON
python -c "import yaml; yaml.safe_load(open('config.yaml'))"  # YAML
python -c "import tomllib; tomllib.load(open('pyproject.toml','rb'))"  # TOML
  1. Required fields -- after parsing, verify that mandatory keys exist

in the config structure.

  1. Value validation -- check that numeric values are in expected ranges,

URLs are well-formed, and enum values match allowed options.

Port conflicts

Check if expected ports are available or already bound:

ss -tlnp | grep :<port>

If a port is in use, report which process holds it:

ss -tlnp | grep :8000
# or
lsof -i :<port> 2>/dev/null

Common ports to check: 3000, 5000, 8000, 8080 (web), 5432 (PostgreSQL),

3306 (MySQL), 6379 (Redis), 27017 (MongoDB).

Dependency versions

Check that required tools are installed and meet minimum version

requirements:

python --version 2>&1
node --version 2>&1
npm --version 2>&1
docker --version 2>&1
docker-compose --version 2>&1
git --version 2>&1

Compare against version requirements from the project's documentation or

configuration (e.g., engines in package.json, python_requires in

pyproject.toml).

Report each dependency as: installed (with version), missing, or below

minimum required version.

Filesystem checks

test -d /path/to/data && test -w /path/to/data && echo "OK" || echo "FAIL"
df -h /path/to/data
python -c "import tempfile; f = tempfile.NamedTemporaryFile(); print(f.name); f.close()"

if they contain secrets.

Network

python -c "import socket; print(socket.getaddrinfo('hostname', None)[0][4])"
curl -s -o /dev/null -w '%{http_code}' --max-time 5 https://api.example.com/health

the proxy is reachable.

MUST

secrets (e.g., API_KEY=sk-t...xY9z); for values shorter than 12

characters, show only ****

single summary rather than stopping at the first failure

add it to your .env file or export it in your shell")

dependencies, filesystem, network) for readable output

system environment

MUST NOT

are read-only

before using OS-specific commands

that the check was skipped and why

to change

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.