Code prompts
Code prompt

Generate CRUD boilerplate (then justify the choices)

You need basic CRUD endpoints/handlers and don't want to type it all out, but you also don't want generic AI slop.

Works best in: Claude

Generate CRUD boilerplate for {{resource name}} in {{framework + language}}.

Resource shape:
{{paste schema / interface / model}}

Requirements:
- {{auth model — JWT / session / public}}
- {{database — Postgres / MongoDB / etc.}}
- Pagination on the list endpoint (cursor or offset, whichever fits)
- Soft delete (don't actually delete rows)

Output:
1. The route file / handlers
2. Validation (use the conventional library for this stack)
3. Error responses with sensible status codes
4. Tests for each endpoint, happy path

Then briefly justify:
- Where I diverged from "default" framework conventions and why
- One thing that's stub-quality in this code that I'd need to revisit before production
·Open in·Share
boilerplateCRUDAPI

More code prompts

All code prompts

Go deeper