nestjs-config

nestjs-config is a skill for Claude Code from dkmqflx/nestjs-best-practices-plugin. It costs 53 tokens per session (583 once invoked), scanned A, original, MIT.

Guidance for managing NestJS application settings with environment variables, typed configuration, and startup validation. Environment variables keep settings such as credentials outside the source code.

In plain words
What is it for?
Use it when setting up ConfigModule or ConfigService, reading .env values, validating configuration, grouping related settings, or preparing an .env.example file.
Why use it?
It helps catch missing or invalid settings before the application runs and keeps secrets out of the code repository.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the nestjs-best-practices plugin — 12 skills shipped together

Good fit Use it when setting up ConfigModule or ConfigService, reading .env values, validating configuration, grouping related settings, or preparing an .env.example file.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dkmqflx/nestjs-best-practices-plugin/nestjs-config
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add dkmqflx/nestjs-best-practices-plugin --skill nestjs-config
Clone the repo
git clone --depth 1 https://github.com/dkmqflx/nestjs-best-practices-plugin

Made for: Claude Code.

Or install nestjs-best-practices, the plugin that ships this one along with the rest of its 12 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nestjs-config

README.md
[![agentmods](https://agentmods.dev/badge/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-config/github.svg)](https://agentmods.dev/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-config)
Your own site
<a href="https://agentmods.dev/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-config"><img src="https://agentmods.dev/badge/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-config/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for nestjs-config

Your own site · 80×15
<a href="https://agentmods.dev/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-config"><img src="https://agentmods.dev/badge/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-config.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 583 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00053 $0.00583
Opus 5 $0.00026 $0.00292
Sonnet 5 $0.00011 $0.00117
Haiku 4.5 $0.00005 $0.00058

Measured 10d ago against content hash 6a8164a324c9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

nestjs-config scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/nestjs-best-practices/skills/nestjs-config/SKILL.md · 59 lines

How it starts

The opening of the file, as written. The whole thing — 59 lines — stays where its author put it; the contents beside it link to each section on GitHub.

NestJS Configuration

Best practices for configuring a NestJS application with @nestjs/config (v10/v11), based on the official documentation (https://docs.nestjs.com/techniques/configuration). Each rule pairs an incorrect example with the official correct pattern. Priorities run from security and fail-fast correctness (CRITICAL) down to ergonomics and performance.

When to Apply

Reference these guidelines when:

  • Registering ConfigModule.forRoot() in the root/app module
  • Reading environment variables anywhere in the app (services, providers, main.ts)
  • Validating environment at boot with Joi or class-validator
  • Grouping related config with registerAs() namespaces and typed access
  • Handling secrets, .env files, and .env.example
  • Reviewing or refactoring how a NestJS app reads configuration

Rules

Impact Rule Summary
CRITICAL no-secrets-in-repo Keep secrets in env/secret manager; commit only .env.example
CRITICAL validate-env-schema Validate env at boot so misconfig fails fast
HIGH global-config-module ConfigModule.forRoot({ isGlobal: true }) once, at the root
HIGH configservice-over-process-env Inject ConfigService; don't read process.env scattered everywhere
MEDIUM namespaced-typed-config registerAs() namespaces + typed access for grouped config
MEDIUM type-safe-get Type get<T>() / use infer: true to avoid undefined surprises
LOW cache-config cache: true for performance; mind env-file load order

How to Use

Read the individual rule file for the explanation and before/after example:

rules/no-secrets-in-repo.md
rules/validate-env-schema.md
rules/global-config-module.md
rules/configservice-over-process-env.md
rules/namespaced-typed-config.md
rules/type-safe-get.md
rules/cache-config.md

Each rule file contains:

  • A short explanation of why it matters, tied to the official docs
  • An Incorrect example (the antipattern)
  • A Correct example (the official pattern)

Read the full file on GitHub · 59 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 59 lines · 53 tokens per session scan A 6a8164a324c9

Subscribe to this mod's changes

nestjs-config is a skill published in the GitHub repository dkmqflx/nestjs-best-practices-plugin (1 stars, last pushed 2mo ago), licensed MIT. It adds 53 tokens to every session and 583 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

lov-optimize-tauri-backend

Optimize Tauri backend architecture and development ergonomics for Tauri 2 apps, especially Rust restart pain, oversized src-tauri/src/lib.rs files, excessive #[tauri::command] surfaces, stringly invoke APIs, long IPC streams, and dev-state recovery. Use when the user asks about Tauri hot reload, Rust-side restarts…

lovstudio/skills · 125 tokens

lov-cli2anything

A tool for turning authorized observations of a website’s API into an OpenAPI description, Swagger interface, JavaScript SDK, or local command-line tool. OpenAPI is a machine-readable description of how an API can be called.

lovstudio/skills · 55 tokens

lov-init-auth

A React authentication setup tool for Supabase, a hosted service that provides user accounts and data features. It adds account access, recovery, email confirmation, and desktop-browser OAuth, where OAuth lets users sign in through another provider.

lovstudio/skills · 42 tokens

lov-install-zenmux-api

A backend integration tool for connecting an application to the ZenMux API through a server-side proxy. It keeps API keys on the server instead of exposing them in browser code.

lovstudio/skills · 47 tokens

lov-refactor-api

A backend API refactoring workflow that finds duplicate endpoints and consolidates their implementation while keeping existing callers working. It checks inputs, outputs, permissions, and known callers before changing code.

lovstudio/skills · 41 tokens

domain-modeling

Build or sharpen a project's domain language and durable decisions. Use when terminology is fuzzy or contradictory, relationships need scenario testing, the code disagrees with the stated model, or a glossary or ADR-class decision must be updated; do not trigger merely to read existing context.

HECer/yoke · 57 tokens