Dashboard CRUD
List, create, edit, and delete one entity, with empty, error, and delete confirmation states.
When to use it
Use when the app already authenticates and the middle is missing: one table and one form. For several entities, run the prompt once per entity.
Variables
[APP_NAME][ENTITY][FIELDS][ROLES][STACK][EMPTY_EXAMPLE]
Copy prompt
In [APP_NAME], stack [STACK], implement CRUD for [ENTITY]. Fields: [FIELDS] Who can create, edit, and delete: [ROLES] Empty-list sentence: [EMPTY_EXAMPLE] Rules - A list with simple search on the first text field. Paginate by 20 once it grows past that. Do not load the whole table on the client if the stack can query. - Create and edit share one form. Show per-field errors when validation fails. Do not clear the form on error. - Delete asks for confirmation with the record's name. Someone not allowed to delete in [ROLES] does not see the button. - The empty state uses [EMPTY_EXAMPLE] and a create button, if that person can create. - A loading state and an error state with retry. An error is not an empty list. - Dates use the timezone the stack already uses. Do not invent a second format. - Do not add an extra entity, a chart, or CSV export. Deliver 1. Where the table or collection was created. 2. The UI files. 3. A manual test: empty list, invalid create, valid create, edit, delete cancelled, delete confirmed, role without permission. If [FIELDS] has no types, stop and ask for each field's type before generating a migration.
How to run this prompt
- Name one entity. One at a time. Fields with a type: text, number, date, enum.
- Say who can delete. If only an admin deletes, write that in ROLES.
- Open the empty list. The first visit, with no rows, must show the EMPTY_EXAMPLE sentence.
Where this breaks
Without ROLES, the model lets everyone delete. Without EMPTY_EXAMPLE, an empty list becomes an endless spinner.
Result
Slot for a screenshot or demo. No result is published yet.