NestJS API Standards
NestJS API Standards & Common Patterns
Priority: P1 (OPERATIONAL)
Standardized API response patterns and common NestJS conventions.
Generic Response Wrapper
- Concept: Standardize all successful API responses.
- Implementation: Use
TransformInterceptorto wrap data in{ statusCode, data, meta }.
Pagination Standards (Pro)
- DTOs: Use strict
PageOptionsDto(page/take/order) andPageDto<T>(data/meta). - Swagger Logic: Generics require
ApiExtraModelsand schema path resolution. - Reference: See Pagination Wrapper Implementation for the complete
ApiPaginatedResponsedecorator code.
Custom Error Response
-
Standard Error Object:
export class ApiErrorResponse { @ApiProperty() statusCode: number; @ApiProperty() message: string; @ApiProperty() error: string; @ApiProperty() timestamp: string; @ApiProperty() path: string; } -
Docs: Apply
@ApiBadRequestResponse({ type: ApiErrorResponse })globally or per controller.
More from diegosouzapw/awesome-omni-skill
music-assistant
Control Home Assistant Music Assistant - browse library, search, play, manage preferences and moods.
12agent-code-generator
Generates Agent definitions (.md files) based on user intent and standard templates.
6terragrunt-generator
Comprehensive toolkit for generating best practice Terragrunt configurations (HCL files) following current standards and conventions. Use this skill when creating new Terragrunt resources (root configs, child modules, stacks, environment setups), or building multi-environment Terragrunt projects.
6api contract sync manager
Validate OpenAPI, Swagger, and GraphQL schemas match backend implementation. Detect breaking changes, generate TypeScript clients, and ensure API documentation stays synchronized. Use when working with API spec files (.yaml, .json, .graphql), reviewing API changes, generating frontend types, or validating endpoint implementations.
5upstash/workflow typescript sdk skill
Lightweight guidance for using the Upstash Workflow SDK to define, trigger, and manage workflows. Use this Skill whenever a user wants to create workflow endpoints, run steps, or interact with the Upstash Workflow client.
5upstash/search typescript sdk
Entry point for documentation skills covering Upstash Search quick starts, core concepts, and TypeScript SDK usage. Use when a user asks how to get started, how indexing works, or how to use the TS client.
5