dto-response

Generate TypeScript DTOs and Response classes with validation for NestJS APIs.

3|2|Updated Nov 13, 2025
One-click install
npx skills add https://github.com/bloominggrace/create-fullstack-service --skill dto-response
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dto-response
Source: https://github.com/bloominggrace/create-fullstack-service/tree/main/.cursor/skills/dto-response
Command: npx skills add https://github.com/bloominggrace/create-fullstack-service --skill dto-response

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the creation and modification of Data Transfer Objects (DTOs) and Response classes, ensuring consistency and adherence to best practices in your application's data handling.

Core Features & Use Cases

  • Input DTO Creation: Define request data structures with validation using class-validator.
  • Output Response Generation: Create response payloads using class-transformer's @Expose decorator.
  • Naming Conventions: Follows established patterns for DTOs and Responses (e.g., CreateEntityDto, FindEntityRes).
  • Use Case: When building a new API endpoint to create a user, use this skill to generate the CreateUserDto and CreateUserRes classes, including necessary validation rules.

Quick Start

Use the dto-response skill to create a CreateProductDto and CreateProductRes in the src/product/dto/ folder.

Frequently Asked Questions about dto-response

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate DTOs and Response classes for a NestJS API?

To generate DTOs and Response classes for a NestJS API, you define request data structures with class-validator and format structured output payloads using class-transformer's @Expose decorator. This approach ensures your API development adheres to established naming conventions like CreateEntityDto.

What is the best way to structure input validation for TypeScript request DTOs?

The best way to structure input validation for TypeScript request DTOs is using class-validator decorators within your Data Transfer Object classes. This method validates incoming request data structures systematically before processing, ensuring type safety and data integrity in your application.

How do I format API response payloads using class-transformer in TypeScript?

To format API response payloads using class-transformer in TypeScript, you apply the @Expose decorator to define specific output properties within Response classes. This creates structured response formatting that strictly controls what data is serialized and returned to the client.

Does this DTO generation skill follow specific naming conventions for API responses?

Yes, this DTO generation skill follows established naming conventions for API responses by generating classes with specific suffixes like FindEntityRes for output payloads and CreateEntityDto for inputs. These patterns ensure consistency across your NestJS application's file structure.

Can I use this skill to create both input and output data structures for a new API endpoint?

Yes, you can use this skill to create both input and output data structures for a new API endpoint. It generates request DTOs with validation rules using class-validator alongside structured response payloads with class-transformer, handling both sides of your API data transfer.