rbac-design

rbac-design is a skill for Claude Code from JoaoEquer/Oficina. It costs 58 tokens per session (736 once invoked), scanned A, original, MIT.

A design process for role-based access control, a way to decide which users can perform which actions on which parts of a system.

In plain words
What is it for?
Use it to design permissions for applications, admin panels, workspaces, or other systems where different users need different access.
Why use it?
It avoids inflexible roles by modeling individual permissions, roles that group them, and users who can receive multiple roles before implementation begins.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the oficina plugin — 17 skills, 6 commands shipped together

Good fit Use it to design permissions for applications, admin panels, workspaces, or other…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/joaoequer/oficina/rbac-design
Install

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.

Any agent
npx skills add JoaoEquer/Oficina --skill rbac-design
Clone the repo
git clone --depth 1 https://github.com/JoaoEquer/Oficina

Made for: Claude Code.

Or install oficina, the plugin that ships this one along with the rest of its 17 skills, 6 commands.

Wrote 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.

agentmods badge for rbac-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/joaoequer/oficina/rbac-design.svg)](https://agentmods.dev/skills/joaoequer/oficina/rbac-design)
Your own site
<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>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 736 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 6d ago against content hash 7895a6f4ef98, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

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.

skills/rbac-design/SKILL.md · 61 lines

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:

  1. Map the domains of the system (the "areas": tasks, documents, users, reports, settings...). Medium systems have 8–15 domains.
  2. 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.
  3. Build the role × domain matrix in a readable document (table: rows = roles, columns = domains, cells = allowed actions).
  4. 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.
  5. Only after approval, implement — and if implementing into an existing system, verify the real codebase first (do not implement against an imagined codebase).

Read the full file on GitHub · 61 lines

Changes

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.

  1. 6d ago First seen · 61 lines · 58 tokens per session scan A 7895a6f4ef98

Subscribe to this mod's changes

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.

Related

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…

ericrisco/rsc-harness · 101 tokens

db-migration-checker

name: db-migration-checker description: Compares database migration scripts across environments and generates diff reports. version: 1.0.0.

zxpmail/ReqForge · 0 tokens

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.

FilippoDeSilva/skills · 40 tokens

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…

timescale/pg-aiguide · 190 tokens

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…

timescale/pg-aiguide · 162 tokens

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…

timescale/pg-aiguide · 184 tokens