NestJS standards prioritizing Dependency Injection, strict module encapsulation, custom guards, and precise DTO typing.
To leverage NestJS's Angular-inspired architecture fully. Enforces strict Dependency Injection mapping and eliminates bleeding logic between modules.
AI Agents generating NestJS modules, controllers, or providers.
A needs a service from module B,
module B MUST explicitly export it, and A MUST explicitly import module
B. Do not use wildcard global modules unless fundamentally required (e.g.,
Config, Database).class-validatorclass-transformerValidationPipeany or generic Record<string, any>.@Body()/@Param(), and
returning responses.@UseGuards() rather than placing if (user_role != 'admin') inside
services.*.module.ts, *.controller.ts, *.service.ts.