Slice · AI prompt
Omnibar, bookmarks, history + a screenshot viewport that forwards input — drive any headless Chromium via one adapter.
# Install `browser` — Browser — remote headless-browser chrome
> Omnibar, bookmarks, history + a screenshot viewport that forwards input — drive any headless Chromium via one adapter.
📚 Knowledge base : https://resource.rahmanef.com/llms.txt
📦 Slice detail : https://resource.rahmanef.com/slices/browser
🧠 JSON catalog : https://resource.rahmanef.com/api/knowledge?slice=browser
🔗 Source : https://github.com/rahmanef63/resource-site/tree/main/frontend/slices/browser
## 1. Install
```bash
npx rahman-resources add browser
# alias: npx rr add browser
```
The CLI copies `frontend/slices/browser/` 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`, `badge`, `dropdown-menu`, `tooltip`, `scroll-area`
## 3. Wire it up
Stack: Next 16 + React 19 + Tailwind 4 + shadcn/ui. Remote headless-browser chrome. Demo renderer by default; real backend injected.
STEP 1 — Install. `npx rr add browser`. Ensure `@/features/browser` resolves and Tailwind scans the slice folder.
STEP 2 — Deps. npm: `lucide-react`. shadcn: `npx shadcn@latest add button input badge dropdown-menu tooltip scroll-area`.
STEP 3 — Mount. `<Browser />` in a height-bearing box — unwired, an offline canvas demo renderer fakes the viewport (omnibar/bookmarks/history all work). Or register `browserApp` in an appshell manifest.
STEP 4 — Real headless browser. `configureBrowser({ state, screenshot, act })` against a Playwright service: state → { url, title }; screenshot → PNG Blob; act(path, body) handles navigate|click|type|key|scroll|back|forward|reload. AUTH those routes — a remote browser holds logged-in sessions.
## 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.