entity-dto

Generate TypeORM entities and Create/Update DTOs for NestJS backends.

Updated Apr 6, 2026
One-click install
npx skills add https://github.com/lety-ai/lety-skill-hub --skill entity-dto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: entity-dto
Source: https://github.com/lety-ai/lety-skill-hub/tree/main/plugins/entity-dto/skills/entity-dto
Command: npx skills add https://github.com/lety-ai/lety-skill-hub --skill entity-dto

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill removes the manual, error-prone work of creating TypeORM entities and corresponding Create/Update DTOs for the Lety 2.0 Backend, ensuring consistent column naming, validation, Swagger docs, and serialization methods that follow NestJS and TypeORM best practices.

Core Features & Use Cases

  • Guided specification: Prompts for domain name, fields, relations, service scope, and indices before generation to avoid guessing.
  • Production-ready entity: Generates an Entity extending BaseEntity with explicit snake_case column names, indices, relations, sensitive-field handling, and a required toResponseDto() method.
  • Validated DTOs: Produces a Create DTO with appropriate class-validator and Swagger decorators and an Update DTO implemented via PartialType.
  • Best-practice checks: Flags issues such as missing explicit column names, exposed sensitive fields, or invalid validator combinations and recommends fixes.
  • Use case: Quickly scaffold a new domain model with relations and validation for a NestJS + TypeORM (Postgres) service while enforcing team conventions.

Quick Start

Generate a TypeORM entity and matching Create and Update DTOs for the provided domain name and field specification following the Lety 2.0 Backend best practices.

Frequently Asked Questions about entity-dto

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

FAQPage Schema
How do I generate TypeORM entities and DTOs for a NestJS backend?

To generate TypeORM entities and DTOs for a NestJS backend, provide your domain name, fields, and relations. The tool outputs files extending BaseEntity with explicit snake_case column names, Swagger ApiProperty, and class-validator decorators.

What is the best way to enforce snake_case column names in TypeORM?

The best way to enforce snake_case column names in TypeORM is to generate entities with explicit column naming rules. This ensures database schema consistency and prevents implicit naming mismatch errors across your PostgreSQL backend.

How do I add class-validator and Swagger decorators to a Create DTO?

To add class-validator and Swagger decorators to a Create DTO, define your domain fields and validation rules. The generator produces DTOs with appropriate ApiProperty annotations and validators, plus a PartialType-based Update DTO.

How do I implement a toResponseDto method in a NestJS entity?

To implement a toResponseDto method in a NestJS entity, generate the entity with response serialization enabled. The method is automatically included to transform entity data and exclude sensitive fields from API responses.

Does this TypeORM entity generator work with PostgreSQL?

Yes, this TypeORM entity generator works with PostgreSQL and is optimized for TypeORM 0.3.x. It generates domain models with correct PostgreSQL column types, relations, and indices following backend best practices.

Why does my generated Update DTO use PartialType?

Your generated Update DTO uses PartialType to inherit all properties and validation rules from the Create DTO while making them optional. This ensures consistent validation logic across create and update operations in NestJS.