rbac-policy-tester — Claude Code skill: what it does, how to install
rbac-policy-tester generates role permission matrices and automated authorization test suites to catch RBAC regressions in CI.
MIT 274 installs ★ 64 updated 2026-01-12
npx skills add patricio0312rev/skills --skill rbac-policy-tester -a claude-codeWhat rbac-policy-tester does
The skill lays out a permission matrix mapping roles to actions like create, read, update, and delete across application resources. Using that matrix, the agent creates TypeScript test suites running API requests with role-specific authentication tokens.
It builds tests for allowed routes expecting HTTP 200 as well as forbidden actions asserting HTTP 403. Because the generated blueprint relies on request(app) and Bearer tokens, setups using attribute-based access control or custom session headers require manual adjustments. The included checklist keeps track of matrix definitions, role coverage, and CI gating.
What it helps with
- generate a role-permission test matrix across resources
- write positive and negative authorization tests in TypeScript
- assert HTTP 403 responses for forbidden actions
- add CI gating to prevent RBAC regressions
Example prompts for the agent
- Generate an RBAC permission matrix and test suite for ADMIN, MANAGER, and GUEST roles
- Write negative authorization tests returning 403 for unauthorized order updates
- Create test coverage for role-based access across users and reports endpoints
How to install rbac-policy-tester
1Skills CLI (Vercel)
npx skills add patricio0312rev/skills --skill rbac-policy-tester -a claude-code2Manually: put the files in place
~/.claude/skills/rbac-policy-tester/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/rbac-policy-tester/
1Skills CLI (Vercel)
npx skills add patricio0312rev/skills --skill rbac-policy-tester -a codex2Manually: put the files in place
.agents/skills/rbac-policy-tester/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add patricio0312rev/skills --skill rbac-policy-tester -a cursor2Manually: put the files in place
.cursor/skills/rbac-policy-tester/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install patricio0312rev/skills security/rbac-policy-tester/SKILL.md2Manually: put the files in place
.github/skills/rbac-policy-tester/SKILL.md1Skills CLI (Vercel)
npx skills add patricio0312rev/skills --skill rbac-policy-tester -a gemini-cli2Platform CLI
gemini skills install https://github.com/patricio0312rev/skills --path security/rbac-policy-testerManually: put the files in place
.devin/skills/rbac-policy-tester/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add patricio0312rev/skills --skill rbac-policy-tester -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about rbac-policy-tester
How do I install rbac-policy-tester in Claude Code?
Run npx skills add patricio0312rev/skills --skill rbac-policy-tester -a claude-code. Alternatively, place the skill file directly at ~/.claude/skills/rbac-policy-tester/SKILL.md.
What does rbac-policy-tester do?
It outlines a matrix of roles and permitted actions, then outputs an automated test suite verifying each endpoint. Permitted requests expect a 200 status, while forbidden operations are checked against a 403 status code.
How does it handle denied permissions?
For each role and resource, the skill determines actions excluded from the matrix and generates tests expecting HTTP 403. It also provides a checklist to verify coverage and CI integration.
Source text
SKILL.md · MIT
---
name: rbac-policy-tester
description: Creates comprehensive permission tests ensuring RBAC doesn't regress with test matrices, CI gating, and authorization coverage. Use for "RBAC testing", "permission tests", "authorization testing", or "access control tests".
---
# RBAC/Policy Tester
Comprehensive testing for role-based access control.
## Permission Test Matrix
```typescript
type Role = 'ADMIN' | 'MANAGER' | 'USER' | 'GUEST';
type Action = 'create' | 'read' | 'update' | 'delete';
type Resource = 'users' | 'orders' | 'reports';
const permissionMatrix: Record<Role, Record<Resource, Action[]>> = {
ADMIN: {
users: ['create', 'read', 'update', 'delete'],
orders: ['create', 'read', 'update', 'delete'],
reports: ['create', 'read', 'update', 'delete'],
},
MANAGER: {
users: ['read', 'update'],
orders: ['create', 'read', 'update'],
reports: ['read', 'update'],
},
USER: {
users: ['read'], // Only own profile
orders: ['create', 'read'], // Only own orders
reports: ['read'],
},
GUEST: {
users: [],
orders: [],
reports: ['read'],
},
};
describe('RBAC Tests', () => {
Object.entries(permissionMatrix).forEach(([role, resources]) => {
describe(\`Role: \${role}\`, () => {
Object.entries(resources).forEach(([resource, actions]) => {
actions.forEach(action => {
it(\`should allow \${action} on \${resource}\`, async () => {
const token = generateToken({ role });
await request(app)
.post(\`/api/\${resource}/\${action}\`)
.set('Authorization', \`Bearer \${token}\`)
.expect(200);
});
});
// Test forbidden actions
const allActions: Action[] = ['create', 'read', 'update', 'delete'];
const forbidden = allActions.filter(a => !actions.includes(a));
forbidden.forEach(action => {
it(\`should deny \${action} on \${resource}\`, async () => {
const token = generateToken({ role });
await request(app)
.post(\`/api/\${resource}/\${action}\`)
.set('Authorization', \`Bearer \${token}\`)
.expect(403);
});
});
});
});
});
});
```
## Output Checklist
- [ ] Permission matrix defined
- [ ] Test suite for all roles
- [ ] Positive and negative tests
- [ ] CI gating enabled
- [ ] Coverage monitoring
ENDFILE
© patricio0312rev · MIT · patricio0312rev/skills