Slice · AI prompt
Service slice for SEO metadata generation — Anthropic-backed action with per-user 24h cost guard + portable persona prop. No public route. Backend exposes generate + generateAndApply mutations gated by requireAdmin; consumers inject brand voice via the personaContext arg (or buildSeoSystemPrompt factory).
# Install `seo` — SEO — AI Metadata Generator
> Service slice for SEO metadata generation — Anthropic-backed action with per-user 24h cost guard + portable persona prop.
📚 Knowledge base : https://resource.rahmanef.com/llms.txt
📦 Slice detail : https://resource.rahmanef.com/slices/seo
🧠 JSON catalog : https://resource.rahmanef.com/api/knowledge?slice=seo
🔗 Source : https://github.com/rahmanef63/resource-site/tree/main/frontend/slices/seo
## 1. Install
```bash
npx rahman-resources add seo
# alias: npx rr add seo
```
The CLI copies `frontend/slices/seo/` into your project + augments `.env.example` + installs npm deps automatically. Run it from your project root.
## 2. What it ships
- peer slices (cascade install):
- `convex-auth` — Cost guard + requireAdmin gates use convex-auth user identity.
- env vars:
- `ANTHROPIC_API_KEY` (server, required)
- convex feature paths: `convex/features/seo`
## 3. Wire it up
Run `rr add seo`. Call seo.generate from server actions or admin mutations with `personaContext` describing your brand voice (or rely on the generic default). Cost guard rate-limits per-user within 24h via callsInWindow query.
## 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.