
Nestjs Drizzle Crud Generator
Spin up a full NestJS entity module—schema, Zod DTOs, service queries, controller routes, and Jest tests—from a field list in one generator pass.
Install
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill nestjs-drizzle-crud-generatorWhat is this skill?
- Runs generate_crud.py with --feature, --fields JSON, and --output path
- Produces modules, controllers, services, Zod-validated DTOs, and Drizzle schemas
- Follows zaccheroni-monorepo-style NestJS + Drizzle patterns from the kit
- Includes Jest unit tests with mocked database layer
- Allowed tools: Read, Write, Edit, Glob, Grep, Bash for repo-wide codegen
Adoption & trust: 997 installs on skills.sh; 271 GitHub stars; 2/3 security scanners passed (skills.sh audits).
Recommended Skills
Entra App Registrationmicrosoft/azure-skills
Azure Aigatewaymicrosoft/azure-skills
Lark Openapi Explorerlarksuite/cli
Supabasesupabase/agent-skills
Firebase Auth Basicsfirebase/agent-skills
Firebase Data Connectfirebase/agent-skills
Journey fit
Primary fit
CRUD module scaffolding is core backend product work during active implementation, not launch or ops monitoring. Drizzle schemas, Nest services, and REST-style endpoints are backend deliverables Prism indexes under build/backend.
Common Questions / FAQ
Is Nestjs Drizzle Crud Generator safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Nestjs Drizzle Crud Generator
# NestJS Drizzle CRUD Generator ## Overview Automatically generates complete CRUD modules for NestJS applications using Drizzle ORM. Creates all necessary files following the zaccheroni-monorepo patterns: feature modules, controllers, services, Zod-validated DTOs, Drizzle schemas, and Jest unit tests. ## When to Use - Creating new entity modules with full CRUD endpoints - Building database-backed features in NestJS - Generating type-safe DTOs with Zod validation - Adding services with Drizzle ORM queries - Creating unit tests with mocked database ## Instructions ### Step 1: Define Entity Fields Gather entity definition: - Entity name (e.g., `user`, `product`, `order`) - List of fields with types (see `references/field-types.md` for supported types) - Required fields vs optional fields with defaults ### Step 2: Run the Generator ```bash python scripts/generate_crud.py --feature <name> --fields '<json-array>' --output <path> ``` ### Step 3: Verify Generated Files Check that all expected files were created: ```bash ls -la libs/server/<feature-name>/src/lib/ ``` Expected structure: ``` controllers/ services/ dto/ schema/ <feature>-feature.module.ts ``` ### Step 4: Run TypeScript Compilation ```bash cd libs/server && npx tsc --noEmit ``` ### Step 5: Execute Unit Tests ```bash cd libs/server && npm test -- --testPathPattern=<feature-name> ``` ## Examples ### Generate a User module ```bash python scripts/generate_crud.py \ --feature user \ --fields '[{"name": "name", "type": "string", "required": true}, {"name": "email", "type": "email", "required": true}, {"name": "password", "type": "string", "required": true}]' \ --output ./libs/server ``` ### Generate a Product module ```bash python scripts/generate_crud.py \ --feature product \ --fields '[{"name": "title", "type": "string", "required": true}, {"name": "price", "type": "number", "required": true}, {"name": "description", "type": "text", "required": false}, {"name": "inStock", "type": "boolean", "required": false, "default": true}]' \ --output ./libs/server ``` ## Generated Structure ``` libs/server/{feature-name}/ ├── src/ │ ├── index.ts │ └── lib/ │ ├── {feature}-feature.module.ts │ ├── controllers/ │ │ ├── index.ts │ │ └── {feature}.controller.ts │ ├── services/ │ │ ├── index.ts │ │ ├── {feature}.service.ts │ │ └── {feature}.service.spec.ts │ ├── dto/ │ │ ├── index.ts │ │ └── {feature}.dto.ts │ └── schema/ │ └── {feature}.table.ts ``` ## Features ### Module - Uses `forRootAsync` pattern for lazy configuration - Exports generated service for other modules - Imports DatabaseModule for feature tables ### Controller - Full CRUD endpoints: POST, GET, PATCH, DELETE - Query parameter validation for pagination - Zod validation pipe integration ### Service - Drizzle ORM query methods - Soft delete support (via `deletedAt` column) - Pagination with limit/offset - Filtering support - Type-safe return types ### DTOs - Zod schemas for Create and Update - Query parameter schemas for filtering - NestJS DTO integration ### Tests - Jest test suite - Mocked Drizzle database - Test cases for all CRUD operations ## Manual Integration After generation, integrate into your app module: ```typescript // app.module.ts import { {{FeatureName}}FeatureModule } from '@your-org/server-{{feature}}'; @Module({ impor