rmnr
DocsTourSlicesBest PracticeAgentsInstall

Command Palette

Search for a command to run...

New

Slice · AI prompt

Settings — account + appearance shells

Two adapter-driven settings shells — account (async load+save) and appearance (sync per-setting) — the slice owns no data.

Resource detail View source
Copy this prompt into Claude / Codex / Cursor
settings.prompt.mdmarkdown
# Install `settings` — Settings — account + appearance shells

> Two adapter-driven settings shells — account (async load+save) and appearance (sync per-setting) — the slice owns no data.

📚 Knowledge base : https://resource.rahmanef.com/llms.txt
📦 Slice detail   : https://resource.rahmanef.com/slices/settings
🧠 JSON catalog   : https://resource.rahmanef.com/api/knowledge?slice=settings
🔗 Source         : https://github.com/rahmanef63/resource-site/tree/main/frontend/slices/settings

## 1. Install

```bash
npx rahman-resources add settings
# alias: npx rr add settings
```

The CLI copies `frontend/slices/settings/` 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: `alert-dialog`, `avatar`, `button`, `card`, `input`, `label`, `select`, `separator`, `skeleton`, `switch`, `textarea`, `toggle-group`

## 3. Wire it up

Run `npx rr add settings` for both, or `npx rr add settings account` / `appearance` for one. account: implement SettingsAdapter { load, save } over your backend (Convex query + mutation), pass to <SettingsShell adapter>; save gets per-section partial patches (shallow-merge server-side); onDeleteAccount wires the danger zone. appearance: build an AppearanceAdapter (per-setting SegSetting values) from your appearance store, pass to <AppearancePanel appearance>; or compose custom panels from <SettingsSection>/<SettingsRow>/<Segmented>/<AccentSwatches>.

## 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.