Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add JoaoEquer/Oficina --skill rbac-designgit clone --depth 1 https://github.com/JoaoEquer/OficinaWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/joaoequer/oficina/rbac-design)<a href="https://agentmods.dev/skills/joaoequer/oficina/rbac-design"><img src="https://agentmods.dev/badge/skills/joaoequer/oficina/rbac-design.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00058 | $0.00736 |
| Opus 5 | $0.00029 | $0.00368 |
| Sonnet 5 | $0.00012 | $0.00147 |
| Haiku 4.5 | $0.00006 | $0.00074 |
Grade A, and why
rbac-design scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 61 lines — stays where its author put it; the contents beside it link to each section on GitHub.
RBAC design
Badly designed RBAC is guaranteed rework. This is the process and the model that work.
The model: roles + granular permissions (not pure roles)
Pure roles ("admin can do everything, editor can edit") break at the first real exception. The house model:
- Permission = atomic action on a domain (e.g.
task:create,document:approve,report:export). - Role = named set of permissions (N:N role ↔ permission).
- User receives roles (N:N user ↔ role), and the system resolves the effective permission set.
model Role {
id String @id @default(uuid())
workspaceId String
name String
permissions RolePermission[]
}
model Permission {
id String @id @default(uuid())
domain String // e.g. "task", "document", "report"
action String // e.g. "create", "read", "update", "approve", "delete"
roles RolePermission[]
@@unique([domain, action])
}
model RolePermission {
roleId String
permissionId String
role Role @relation(fields: [roleId], references: [id])
permission Permission @relation(fields: [permissionId], references: [id])
@@id([roleId, permissionId])
}
Server-side check via guard/decorator (@RequirePermission('document:approve')). The frontend uses permissions only to hide buttons — never as real control.
The process: matrix before code
Do not implement RBAC straight into code. The correct flow:
- Map the domains of the system (the "areas": tasks, documents, users, reports, settings...). Medium systems have 8–15 domains.
- Map the real roles of the client's operation (not the ones you imagine). Usually 5–8 roles are enough; more than that smells like roles that should be standalone permissions.
- Build the role × domain matrix in a readable document (table: rows = roles, columns = domains, cells = allowed actions).
- Submit it for approval by the architect/tech lead and, when it makes sense, the client. The matrix is cheap to change; code and migrations are not.
- Only after approval, implement — and if implementing into an existing system, verify the real codebase first (do not implement against an imagined codebase).
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 61 lines · 58 tokens per session scan A 7895a6f4ef98
rbac-design is a skill published in the GitHub repository JoaoEquer/Oficina (2 stars, last pushed 4d ago), licensed MIT. It adds 58 tokens to every session and 736 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
prisma-orm
Use when modeling data or writing type-safe queries with Prisma ORM in TypeScript — schema.prisma, prisma.config.ts, the generated Prisma Client, and Prisma Migrate, including the v6 to v7 upgrade. NOT schema-as-TS with a SQL builder (that is drizzle-orm), NOT ORM-agnostic zero-downtime migration (that is…
db-migration-checker
name: db-migration-checker description: Compares database migration scripts across environments and generates diff reports. version: 1.0.0.
nestjs-database
Implement data access patterns, Scaling, Migrations, and ORM selection in NestJS. Use when implementing TypeORM/Prisma repositories, migrations, or database patterns in NestJS.
pgvector-semantic-search
Use this skill for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search. Trigger when user asks to: Store or search vector embeddings in PostgreSQL Set up semantic search, similarity search, or nearest neighbor search Create HNSW or IVFFlat indexes for vectors…
postgres-hybrid-text-search
Use this skill to implement hybrid search combining BM25 keyword search with semantic vector search using Reciprocal Rank Fusion (RRF). Trigger when user asks to: Combine keyword and semantic search Implement hybrid search or multi-modal retrieval Use BM25/pgtextsearch with pgvector together Implement RRF (Reciprocal…
find-hypertable-candidates
Use this skill to analyze an existing PostgreSQL database and identify which tables should be converted to Timescale/TimescaleDB hypertables. Trigger when user asks to: Analyze database tables for hypertable conversion potential Identify time-series or event tables in an existing schema Evaluate if a table would…