Admin
Add Admin Section
How to add a new admin section using the compact AI context guide.
AI Skill for admin tasks
Prompt: Type
/admin-tasks in your Copilot / Cursor or other chat to use skill with the provided context./admin-tasks Create admin section [name] with list/create/edit pages. Requirements: - Use DataTable (row select + batch delete). - Use FormBuilder forms. - Use shared confirm dialog. - Wire links, sidebar, and oRPC router.
Required Outputs
When adding a section, ensure these are updated:
src/config/links.tssrc/features/admin/common/config/navigation.tssrc/features/admin/<section>/model/*.schema.tssrc/features/admin/<section>/service/*.service.tssrc/features/admin/<section>/api/*.router.tssrc/lib/orpc/router.tssrc/features/admin/<section>/components/*-table.tsxsrc/features/admin/<section>/components/*-editor.tsxsrc/app/[locale]/(admin)/admin/<section>/{page,create,[id]/edit}
Validation
Always run:
pnpm typecheck && pnpm lintImportant Notes
- Use
useAdminConfirmDialogfor destructive confirmations. - Keep URL/query state in tables with
useQueryStates. - Keep form logic in
FormBuilder/useFormBuilder. - Keep changes scoped and consistent with existing admin patterns.