nestjs config doctor
Diagnoses NestJS ConfigModule, .env, and Docker/Kubernetes environment failures — finds missing vars and misconfigurations before your app boots.
Free
Works with the AI tools you already use
See it in action
You say
My NestJS app starts fine on my laptop but crashes in Kubernetes with "ConfigService unable to load variable DATABASE_URL". Diagnose my ConfigModule setup, .env files, and k8s/deployment.yaml and tell me exactly what is misconfigured.
Your agent does
NestJS Configuration Diagnostic Report
| Field | Value | |-------|-------| | Project | billing-service | | NestJS version | 10.4.0 | | Status | MISCONFIGURED | | Root cause | Kubernetes Secret key mismatch for DATABASE_URL |
Summary
Local development works via .env. In Kubernetes, the deployment references secretKeyRef.key: database_url but the application expects DATABASE_URL. Linux environment variables are case-sensitive.
Findings
[CRITICAL] K8s Secret key case mismatch
- Location: k8s/deployment.yaml:34
- Issue: Secret key database_url does not match DATABASE_URL in code
- Impact: ConfigService.getOrThrow('DATABASE_URL') throws at startup in production
- Recommendation: Align the Secret key to DATABASE_URL
Environment variable inventory
| Variable | Used in | Present in .env | In .env.example | Validated at startup | |----------|---------|-----------------|-----------------|----------------------| | DATABASE_URL | app.module.ts | Yes | Yes | No | | JWT_SECRET | auth.module.ts | Yes | No | No |
Recommended .env.example
NODE_ENV=development PORT=3000 DATABASE_URL= JWT_SECRET=
Resolution steps
- Update the Kubernetes Secret to use key DATABASE_URL (not database_url)
- Fix deployment.yaml secretKeyRef.key to DATABASE_URL
- Add Joi or Zod validation in ConfigModule.forRoot()
- Replace ConfigService.get() with getOrThrow() for required variables
- Redeploy and verify /health endpoint responds
About this skill
Overview
NestJS Config & Environment Doctor is a specialized diagnostic skill for NestJS applications that fail to start, load incorrect configuration, or behave differently across local, container, and Kubernetes environments. It performs structured, evidence-based analysis of your configuration layer and delivers actionable remediation guidance.
The Problem
NestJS configuration failures are among the most common blockers before production deployment. Applications may boot with missing environment variables, fail silently when ConfigService.get() returns undefined, or work locally while breaking in Docker or Kubernetes due to misaligned Secret keys or missing validation. Generic debugging prompts do not follow a repeatable NestJS-specific diagnostic process.
What This Skill Does
- Executes a 14-point diagnostic matrix across
ConfigModule, environment files, and deployment configuration - Determines configuration health status: BROKEN, MISCONFIGURED, or OK
- Identifies root cause with file-level evidence and severity-ranked findings
- Maps environment variables to their usage across the codebase
- Generates a complete
.env.exampletemplate from project analysis - Validates Docker
ENVinjection and Kubernetes Secret/ConfigMap key alignment - Recommends Joi or Zod startup validation patterns where validation is missing
Supported Stack
NestJS 9–11, @nestjs/config, Joi, Zod, Docker, Kubernetes ConfigMap and Secret resources.
Ideal Use Cases
- Application fails to start with configuration-related errors
ConfigServicereturns undefined for expected variables- Service runs locally but fails in Docker or Kubernetes
- Startup validation errors from Joi or Zod schemas
- Generating
.env.examplefor team onboarding or CI/CD pipelines
Security & Privacy
This skill operates read-only and never outputs actual secret values from .env files. Sensitive values are redacted in all diagnostic output.
Known Limitations
- Scope is limited to configuration and environment setup
- Does not perform full production-readiness or security audits
- Does not connect to live clusters, containers, or databases
- Does not modify source code unless explicitly requested by the user
How to install
Drop the file into your AI Agent. Works with Claude, Cursor, ChatGPT, and 20+ more.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
1 install
Downloaded by developers to date
Free forever
No account required to browse
Trust & safety
Security scanned
Verified clean 1 month ago
- Free to download with an account
Creator
Saeed Gholami
Frequently Asked Questions
Popular in DevOps & Deployment
devsecops-expert
Senior-level DevOps automation for CI/CD, IaC, Kubernetes, and production-ready GitOps pipelines.

Production Code Readiness Reviewer
A rigorous production-readiness auditor that identifies logic defects, security risks, and test gaps in code changes.
env-doctor
Diagnoses why your project will not start. Checks runtime versions, dependencies, environment variables, databases, ports, and build artifacts systematically.

🩺 Env Doctor
Diagnose local setup failures across Node, Python, Go, and Docker without exposing secrets or killing processes blindly. Checks runtimes, dependencies, env key names, service health, and port ownership, then gives PowerShell fixes on Windows or Bash fixes on macOS/Linux.