Skip to content
rmnr
DocsTourSlicesBest PracticeAgentsInstall

Command Palette

Search for a command to run...

New

Slice · AI prompt

File Explorer — Tree + CRUD + Preview + Properties

React + Svelte file manager over one injectable filesystem adapter — CRUD, history, upload, preview, properties, and tools.

Resource detail View source
Copy this prompt into Claude / Codex / Cursor
file-explorer.prompt.mdmarkdown
# Install `file-explorer` — File Explorer — Tree + CRUD + Preview + Properties

> React + Svelte file manager over one injectable filesystem adapter — CRUD, history, upload, preview, properties, and tools.

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

## 1. Install

```bash
npx rahman-resources add file-explorer
# alias: npx rr add file-explorer
```

The CLI copies `frontend/slices/file-explorer/` 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: `button`, `input`, `scroll-area`, `separator`, `dropdown-menu`, `sheet`, `dialog`

## 3. Wire it up

React/default: `npx rr add file-explorer`. SvelteKit: `npx rr add file-explorer --framework sveltekit`. Both share the FileExplorerAdapter, writable mock/live/Convex adapter factories, history/operations/file-kind cores, preview/property semantics, and fileExplorerTools. React keeps shadcn/Lucide and auto-registers tools through the narrow agent hook; Svelte installs only svelte@^5 plus portable adapter/core files and can optionally register tools via its registerTools prop. Inject a real filesystem adapter for production and keep authorization/server path bounds in that backend — UI mode/read-only checks are convenience, not a security 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.