Slice · AI prompt
Multi-page CMS: list/create/edit/publish pages built from 11 block kinds — localStorage or your own backend.
# Install `pages-cms` — Pages CMS — block-composed multi-page editor
> Multi-page CMS: list/create/edit/publish pages built from 11 block kinds — localStorage or your own backend.
📚 Knowledge base : https://resource.rahmanef.com/llms.txt
📦 Slice detail : https://resource.rahmanef.com/slices/pages-cms
🧠 JSON catalog : https://resource.rahmanef.com/api/knowledge?slice=pages-cms
🔗 Source : https://github.com/rahmanef63/resource-site/tree/main/frontend/slices/pages-cms
## 1. Install
```bash
npx rahman-resources add pages-cms
# alias: npx rr add pages-cms
```
The CLI copies `frontend/slices/pages-cms/` 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`, `table`, `input`, `textarea`, `label`, `select`, `switch`, `card`, `dialog`
## 3. Wire it up
Run `npx rr add pages-cms`. Wrap your admin surface in <LocalPagesProvider seed={defaultPages()}> (localStorage, zero backend) or supply your own PagesStore via <PagesProvider>. Render <PagesView publicBase adminBase> for the list and <PageEditorView id publicBase adminBase> for the editor route. Public catch-all looks up the page by slug and renders <BlocksRenderer blocks={page.blocks} />. Add block kinds by extending the PageBlock union + emptyBlock + the renderer/editor switches.
## 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.