Claude Code prompt to build an admin panel
Admin panels are schema-shaped, so the agent should read your schema before inventing screens. Claude Code inspects the models in the repo, builds CRUD views on top of your existing auth and UI stack, and hands you a seeded login at a running URL, with the role check and audit log covered by tests it already ran.
Last updated
Build an internal admin panel in this repo for managing {{resource}} records. Generate it from the existing schema: read the models or migrations first and list the entities and fields you found before writing UI. Features: table views with server-side pagination, sorting, and a filter bar; a detail view with inline edit; soft delete with a restore action; and an audit log table recording who changed what, written on every mutation. Guard the whole thing behind the app's existing auth with an admin role check at the route level, not per component. No new UI framework; use what the repo already renders with. Seed a dev admin user in a script I can run. Write tests for the role check, one paginated list, and the audit write, run them, then start the app and print the admin URL and the seeded login so I can click through.Customize it
Runs in your browser. Nothing you type here is sent anywhere.
Build an internal admin panel in this repo for managing users records. Generate it from the existing schema: read the models or migrations first and list the entities and fields you found before writing UI. Features: table views with server-side pagination, sorting, and a filter bar; a detail view with inline edit; soft delete with a restore action; and an audit log table recording who changed what, written on every mutation. Guard the whole thing behind the app's existing auth with an admin role check at the route level, not per component. No new UI framework; use what the repo already renders with. Seed a dev admin user in a script I can run. Write tests for the role check, one paginated list, and the audit write, run them, then start the app and print the admin URL and the seeded login so I can click through.
Same task in other tools
Questions about this prompt
Why enforce the admin check at the route level rather than hiding buttons?
A hidden button leaves the API behind it wide open to anyone with curl. Route-level middleware fails closed, and the prompt's test asserts that a non-admin request gets rejected by the server, not the UI.
I only need to manage two entities. Should the agent still read the whole schema?
Yes, the schema read is cheap and catches relations your two entities point at. Then name the entities in the prompt so UI generation, seeds, and tests stay scoped to them.
Mutations made through scripts skip the audit log. What is wrong?
The audit write landed in the UI or route layer instead of the data layer. Ask Claude Code to move it into the repository or model layer, then re-run the audit test through a direct API call to prove script paths are covered.