nestjs config doctor

    by Saeed Gholami

    3

    Diagnoses NestJS ConfigModule, .env, and Docker/Kubernetes environment failures — finds missing vars and misconfigurations before your app boots.

    Free

    5 usesSecurity scanned

    Works with the AI Agents you already use

    nestjs config doctor

    Example session with this skill installed

    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.

    • Read your context and instructions
    • Compiled the nestjs config doctor

    # 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 1. Update the Kubernetes Secret to use key DATABASE_URL (not database_url) 2. Fix deployment.yaml secretKeyRef.key to DATABASE_URL 3. Add Joi or Zod validation in ConfigModule.forRoot() 4. Replace ConfigService.get() with getOrThrow() for required variables 5. Redeploy and verify /health endpoint responds

    2. Fix deployment.yaml

    Connects securely to your tools. The creator never sees your data.

    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.example template from project analysis
    • Validates Docker ENV injection 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
    • ConfigService returns undefined for expected variables
    • Service runs locally but fails in Docker or Kubernetes
    • Startup validation errors from Joi or Zod schemas
    • Generating .env.example for 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 use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    5 uses

    Times used to date

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 4 months ago

    • Free with an Agensi account

    Permissions

    Read Files
    Terminal / Shell

    File Scopes

    package.json
    .env*
    .gitignore
    src/**
    **/app.module.ts
    **/main.ts
    Dockerfile
    docker-compose*.yml
    k8s/**
    **/deployment.yaml

    Read Files: Required to inspect package.json, .env files, TypeScript source, Dockerfile, and Kubernetes manifests for configuration issues. Terminal / Shell: Optional helper for ripgrep-based discovery commands referenced in the skill. The agent may also use built-in file search instead. This skill does not require write access, network access, browser access, or host environment variables. It performs read-only analysis of the buyer's project files.

    Listed4 months ago

    What's inside

    Creator

    Saeed Gholami

    Saeed Gholami

    Frequently Asked Questions

    The Config Doctor performs a 14-point diagnostic matrix to identify why your NestJS app won't boot or why ConfigService is returning undefined, covering everything from manual .env errors to complex Kubernetes Secret mismatches.

    Yes, the skill validates Docker ENV injection and checks for alignment between your NestJS code and Kubernetes ConfigMap/Secret keys to ensure seamless environment transitions.

    The skill is designed for NestJS versions 9 through 11 and works with standard @nestjs/config setups, including Joi and Zod validation schemas.

    Security is a priority; the skill operates in a read-only capacity and is programmed to redact actual sensitive secret values from all diagnostic reports and outputs.

    By analyzing your project's service usage and existing configuration files, the skill automatically generates a comprehensive .env.example template for use in team onboarding and CI/CD.

    The skill focuses exclusively on the configuration layer and environment setup; it does not perform live database connections, full security audits, or modifications to your core business logic.

    New in DevOps & Cloud

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for DevOps & Cloud.

    Free