create-backend-entity-with-global-type

Create NestJS TypeORM entities and shared TypeScript types for feature modules.

Updated Apr 29, 2026
One-click install
npx skills add https://github.com/moking55/next-nest-monorepo-boilerplate --skill create-backend-entity-with-global-type
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-backend-entity-with-global-type
Source: https://github.com/moking55/next-nest-monorepo-boilerplate/tree/main/.agents/skills/create-backend-entity-with-global-type
Command: npx skills add https://github.com/moking55/next-nest-monorepo-boilerplate --skill create-backend-entity-with-global-type

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents inconsistent backend models and frontend contracts by guiding developers to create NestJS TypeORM entities alongside correctly structured shared TypeScript types.

Core Features & Use Cases

  • Shared Type Design: Determines when interfaces and union types belong in packages/shared-types versus backend-only modules.
  • TypeORM Entity Creation: Provides patterns for building database entities with BaseCustomEntity inheritance, decorators, indexes, and enum handling.
  • Use Case: Build a new product or feature module where the API contract, database schema, and frontend-consumed types must remain synchronized.

Quick Start

Use the create-backend-entity-with-global-type skill to generate the entity and shared types for a new NestJS feature.

Frequently Asked Questions about create-backend-entity-with-global-type

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

FAQPage Schema
How do I keep NestJS TypeORM entities and frontend TypeScript types synchronized in a monorepo?

To keep NestJS TypeORM entities and frontend TypeScript types synchronized, generate both simultaneously using shared package export conventions, ensuring API response models and database schemas align. This prevents inconsistent backend models and frontend contracts.

When should I put TypeScript interfaces in shared-types versus backend-only modules?

TypeScript interfaces belong in shared-types packages when frontend applications consume the API response models, enums, or union types. Place interfaces in backend-only modules when the types represent internal database logic or schemas not exposed to the frontend.

How do I create a NestJS TypeORM entity with BaseCustomEntity inheritance?

To create a NestJS TypeORM entity with BaseCustomEntity inheritance, apply TypeORM decorators, define database schema columns, add indexes, and handle enums. This pattern ensures consistent entity creation across feature module development.

Does this approach work for generating TypeScript enums and API response models?

Yes, this approach works for generating TypeScript enums and API response models. It establishes a unified contract by creating database schemas alongside shared types, ensuring type alignment between backend and frontend applications.

What's the best way to structure a new feature module with TypeORM decorators and shared types?

The best way to structure a new feature module is to define the TypeORM entity with decorators and BaseCustomEntity inheritance first, then extract the shared TypeScript types and enums into a shared-types package for monorepo export.

Why do my backend models and frontend contracts become inconsistent during feature development?

Backend models and frontend contracts become inconsistent when database schemas and API response models are maintained separately without shared TypeScript types. Synchronizing TypeORM entities and frontend types prevents this drift.