agentsclimarketplace

Nestjs config

Skill dkmqflx/nestjs-best-practices-plugin/plugins/nestjs-best-practices/skills/nestjs-config

Claude Code plugin: 12 NestJS best-practice skills (90 rules) grounded in the official NestJS docs

Install
npx -y skills add dkmqflx/nestjs-best-practices-plugin --skill nestjs-config

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

NestJS configuration and environment management best practices. Use when configuring a NestJS app — ConfigModule, environment variables, typed config, or env validation. Triggers on ConfigModule, ConfigService, process.env, registerAs, or .env handling.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

2.4 KB, as published. Nobody here has run it

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

ImpactRuleSummary
CRITICALno-secrets-in-repoKeep secrets in env/secret manager; commit only .env.example
CRITICALvalidate-env-schemaValidate env at boot so misconfig fails fast
HIGHglobal-config-moduleConfigModule.forRoot({ isGlobal: true }) once, at the root
HIGHconfigservice-over-process-envInject ConfigService; don't read process.env scattered everywhere
MEDIUMnamespaced-typed-configregisterAs() namespaces + typed access for grouped config
MEDIUMtype-safe-getType get<T>() / use infer: true to avoid undefined surprises
LOWcache-configcache: 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)

All examples target @nestjs/config for NestJS v10/v11 and avoid deprecated APIs.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.