nestjs-api-standards

Installation
SKILL.md

NestJS API Standards & Common Patterns

Priority: P1 (OPERATIONAL)

Workflow: Standardize API Endpoint

  1. Create Response DTO — Define dedicated DTO for every endpoint return type.
  2. Map entity to DTO — Use plainToInstance(UserResponseDto, user) in service or controller.
  3. Apply TransformInterceptor — Bind globally to wrap all responses in { statusCode, data, meta }.
  4. Add nested validation — Decorate nested DTO properties with @ValidateNested() + @Type().
  5. Document with Swagger — Apply @ApiResponse({ status, type }) with exact types per endpoint.

Response Wrapper Example

See implementation examples

Entity-to-DTO Mapping Example

See implementation examples

Installs
3
GitHub Stars
521
First Seen
Jun 22, 2026
nestjs-api-standards — hoangnguyen0403/agent-skills-standard