一键导入
nestjs-api-standards
Response wrapping, pagination, and error standardization.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Response wrapping, pagination, and error standardization.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
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.