generate-crud

Generate complete CRUD operations for an entity

SKILL.md

GitHub

Generate CRUD Operations

Generate Controller, Service, Repository, DTO, and Tests for an entity.

What To Do

  1. Analyze existing patterns: Read an existing entity implementation to match conventions.
  2. Generate files:
    • Controller with GET (all, by id), POST, PUT, DELETE endpoints
    • Service interface + implementation with validation
    • Repository interface + implementation (CosmosDB)
    • DTO with ToDomain() and FromDomain() static methods
    • Unit tests for service layer
  3. Register in DI: Add service and repository to Program.cs

Arguments

  • <entity-name>: Entity name in PascalCase
  • --with-tests: Generate test file (default: true)
  • --with-dto: Generate DTO classes (default: true)