Why Use This
This skill provides specialized capabilities for HoangNguyen0403's codebase.
Use Cases
- Developing new features in the HoangNguyen0403 repository
- Refactoring existing code to follow HoangNguyen0403 standards
- Understanding and working with HoangNguyen0403's codebase structure
Install Guide
2 steps - 1
- 2
Install inside Ananke
Click Install Skill, paste the link below, then press Install.
https://github.com/HoangNguyen0403/agent-skills-standard/tree/develop/skills/nestjs/api-standards
Skill Snapshot
Auto scan of skill assets. Informational only.
Valid SKILL.md
Checks against SKILL.md specification
Source & Community
Updated At Jan 18, 2026, 04:24 AM
Skill Stats
SKILL.md 52 Lines
Total Files 1
Total Size 0 B
License NOASSERTION
---
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]
---
# 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 `TransformInterceptor` to wrap data in `{ statusCode, data, meta }`.
## Pagination Standards (Pro)
- **DTOs**: Use strict `PageOptionsDto` (page/take/order) and `PageDto<T>` (data/meta).
- **Swagger Logic**: Generics require `ApiExtraModels` and schema path resolution.
- **Reference**: See [Pagination Wrapper Implementation](references/pagination-wrapper.md) for the complete `ApiPaginatedResponse` decorator code.
## Custom Error Response
- **Standard Error Object**:
```typescript
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.