nestjs-api-standards
Installation
SKILL.md
NestJS API Standards & Common Patterns
Priority: P1 (OPERATIONAL)
Workflow: Standardize API Endpoint
- Create Response DTO — Define dedicated DTO for every endpoint return type.
- Map entity to DTO — Use
plainToInstance(UserResponseDto, user)in service or controller. - Apply TransformInterceptor — Bind globally to wrap all responses in
{ statusCode, data, meta }. - Add nested validation — Decorate nested DTO properties with
@ValidateNested()+@Type(). - Document with Swagger — Apply
@ApiResponse({ status, type })with exact types per endpoint.