# Generate Crud

> Generate complete CRUD operations for an entity

- Skill: `majiayu000/generate-crud` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add majiayu000/generate-crud`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/generate-crud/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/generate-crud

---


# 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)
