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
npx -y skills add dkmqflx/nestjs-best-practices-plugin --skill nestjs-configAssembled 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,
.envfiles, 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)
All examples target @nestjs/config for NestJS v10/v11 and avoid deprecated APIs.