with one click
nestjs-api-standards
Response wrapping, pagination, and error standardization.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Response wrapping, pagination, and error standardization.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Universal coding standards, best practices, and patterns for TypeScript, JavaScript, React, and Node.js development.
This skill leverages the database-diff-tool plugin to compare database schemas, generate migration scripts, and provide rollback procedures. It is triggered when the user requests database schema comparisons, migration script generation, or database synchronization. Use this skill when asked to identify differences between database schemas (PostgreSQL or MySQL), create safe migration scripts with transaction safety, validate changes before deployment, or generate rollback procedures. The skill is activated by requests involving terms like "database diff", "schema comparison", "generate migration script", "database synchronization", or `/db-diff`.
Create a database migration to add a table, add columns to an existing table, add a setting, or otherwise change the schema of Ghost's MySQL database.
Database performance optimization, schema design, query analysis, and connection management across PostgreSQL, MySQL, MongoDB, and SQLite with ORM integration. Use this skill for queries, indexes, connection pooling, transactions, and database architecture decisions.
Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.
Implement comprehensive testing strategies using Jest, Vitest, and Testing Library for unit tests, integration tests, and end-to-end testing with mocking, fixtures, and test-driven development. Use when writing JavaScript/TypeScript tests, setting up test infrastructure, or implementing TDD/BDD workflows.
| name | NestJS API Standards |
| description | Response wrapping, pagination, and error standardization. |
| metadata | {"labels":["nestjs","api","pagination","response"],"triggers":{"files":["**/*.controller.ts","**/*.dto.ts"],"keywords":["ApiResponse","Pagination","TransformInterceptor"]}} |
Standardized API response patterns and common NestJS conventions.
TransformInterceptor to wrap data in { statusCode, data, meta }.PageOptionsDto (page/take/order) and PageDto<T> (data/meta).ApiExtraModels and schema path resolution.ApiPaginatedResponse decorator code.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.