Nestjs modules di
Skill dkmqflx/nestjs-best-practices-plugin/plugins/nestjs-best-practices/skills/nestjs-modules-di
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-modules-diAssembled 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 module organization and dependency injection best practices. Use when writing or reviewing NestJS modules, providers, or DI wiring. Triggers on @Module, @Injectable, provider registration, injection scopes, dynamic modules, or circular dependencies.
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.0 KB, as published. Nobody here has run it
NestJS Modules & Dependency Injection
Best-practices reference for organizing NestJS applications into encapsulated feature modules and wiring providers through the IoC container correctly. Covers module boundaries, provider visibility, dynamic modules, injection scopes, custom provider tokens, and circular dependencies.
When to Apply
- Designing or reviewing
@Modulestructure and feature boundaries - Registering providers and deciding what to
export - Building configurable libraries with
forRoot/forRootAsync - Choosing an injection scope (singleton vs REQUEST vs TRANSIENT)
- Wiring custom providers (
useClass/useValue/useFactory) and injection tokens - Resolving or avoiding circular dependencies
- Deciding whether a module should be
@Global()
Rules
feature-module-boundaries- one module per feature/domain; keep providers encapsulatedexport-shared-providers- only providers listed inexportsare visible to importing modulesdynamic-modules-forroot- configure reusable modules viaforRoot/forRootAsyncreturningDynamicModuleinjection-scopes-default-singleton- prefer default singleton scope; REQUEST scope bubbles up and hurts performancecustom-provider-tokens- useuseClass/useValue/useFactorywith injection tokens and interfacesconstructor-injection- prefer constructor injection over property injectionavoid-circular-dependencies- restructure first; useforwardRefonly as a last resortglobal-module-sparingly- reserve@Global()for truly cross-cutting modules (config, logger)
How to Use
Read individual rule files in rules/ for explanation + incorrect/correct examples.