Slice · AI prompt
React + Svelte admin parity in 2 variants — generic shell or composed 26-section console, with exact per-variant Convex boundaries.
# Install `admin` — Admin — generic shell + composed console
> React + Svelte admin parity in 2 variants — generic shell or composed 26-section console, with exact per-variant Convex boundaries.
📚 Knowledge base : https://resource.rahmanef.com/llms.txt
📦 Slice detail : https://resource.rahmanef.com/slices/admin
🧠 JSON catalog : https://resource.rahmanef.com/api/knowledge?slice=admin
🔗 Source : https://github.com/rahmanef63/resource-site/tree/main/frontend/slices/admin
## 1. Install
```bash
npx rahman-resources add admin
# alias: npx rr add admin
```
The CLI copies `frontend/slices/admin/` into your project + augments `.env.example` + installs npm deps automatically. Run it from your project root.
## 2. What it ships
- npm: `lucide-react`
- shadcn primitives: `badge`, `button`, `card`, `input`, `progress`, `scroll-area`, `select`, `sheet`, `table`, `textarea`
- peer slices (cascade install):
- `convex-auth` — requireAdmin gate uses convex-auth identity.
- `rbac-roles` — console section gates are permission tokens resolved by rbac-roles.
- env vars:
- `SUPER_ADMIN_EMAIL` (convex) — shell variant — single super-admin gate.
- `PLATFORM_ADMIN_EMAILS` (convex) — console variant — comma-separated platform-admin allowlist.
- convex feature paths: `convex/features/admin`, `convex/features/admin_console`
## 3. Wire it up
React/default: `npx rr add admin shell|console`. SvelteKit: append `--framework sveltekit`. shell reuses resolveAdminLabels/buildAdminStats and pulls only convex/features/admin. console reuses the same access/catalog/URL core, includes five owned panels, and receives provider panels through React components or Svelte snippets; it pulls only convex/features/admin_console. Keep remote/admin routes server-gated; UI access filters are not an authorization boundary.
## Rules of engagement
- shadcn-only UI primitives. No raw `<button>` / `<dialog>` / native date or file inputs.
- 200-line hard cap per source file (extract neighbours when over).
- All Convex queries hit an index (`.withIndex(...)`); never bare `.collect()`.
- Public mutations/queries declare `args:` validators + authz.
- Full ruleset: https://resource.rahmanef.com/best-practice
The agent will fetch /llms.txt for the full ruleset and use /api/knowledge for the JSON catalog.